1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-02 17:06:09 +00:00
Commit graph

22 commits

Author SHA1 Message Date
catborise
eeae606d08 feat(migration): encrypt migrations over TLS between hosts that have it
QEMU sends a migrating VM's memory and copied disks in the clear. A
compute gets "Encrypt migrations (TLS)" (edit page, Advanced; API
field migration_tls); a migration between two hosts that both have it
passes VIR_MIGRATE_TLS whenever data moves (not for a shut-off VM's
definition alone), and the log says TLS. The hosts need QEMU's
certificates in /etc/pki/qemu; a host without them refuses before
anything moves. Tried on two AlmaLinux 10 hosts: the TLS stream starts
with a TLS record, the plain one with QEMU's QEVM header.
2026-11-19 15:45:32 +03:00
catborise
f6b1ee8985 fix(tags): sixth audit: the tag box tells its rule, trims a paste; clear keeps the focus
- A name typed or pasted into the tag box that cannot be a tag shows the
  rule (letters a-z, digits, dots, dashes, underscores; at most 12
  characters) instead of nothing; the spaces a paste brings are dropped;
  "constructor" is no longer taken for a tag there is.
- "Clear the filters" hides with the message it is in: the search box takes
  the focus.
2026-11-19 10:03:50 +03:00
catborise
bc1894e4d8 fix(tags): at most 12 characters; "…" does not move the columns
- A new or renamed tag has at most 12 characters (computes.models.TAG_LENGTH,
  a validator: the column keeps 32, so names made before the limit stay
  usable until renamed and the migration changes no SQL); the tag box
  offers no longer name.
- The tags "…" shows in a table's cell go below the others within the
  cell's width as it is, so the list's columns no longer move.
2026-11-19 09:34:07 +03:00
catborise
65b8110464 fix(tags): fourth audit: stale tag forms, rename after delete, stale filter
- A tags form carries the names it showed (show_hidden_initial): sent back
  unchanged, the VM's or host's tags are left as they are, so a form shown
  before a tag was renamed or deleted does not bring the old name back.
- A rename whose tag is deleted while it waits answers 404, not 500.
- A removed VM kept only for a deleted tag leaves the Removed VMs page.
- A kept tag filter the list no longer offers is forgotten, so a name made
  again later is not chosen by itself.
2026-11-19 07:53:14 +03:00
catborise
6cdaa2affd fix(tags): third audit: host form and tag delete, hosts list badges
- A host's form saves the host and its tags in one transaction under the
  ownership lock: a tag the Tags page deletes meanwhile is made again,
  instead of a 500 after the host's other changes were saved.
- The hosts list shows three tags and "…" for the others, as the VM list.
- "…" shows the other tags on any page, the tag filter or not.
2026-11-18 23:50:43 +03:00
catborise
149530f8df feat: tags for VMs and hosts
One list of tag names (lower case letters, digits, dot, dash, underscore;
up to 32) given to VMs and hosts. A superuser sets a VM's tags on its
Options tab and a host's on its form; Tom Select suggests the tags there
are and makes a new one typed. The VM list, the VM page and the hosts list
show them as badges, to everyone who sees the VM or host.

A VM's tags stay with it: an out-of-band move adds them to those on the
new host's record, and a VM that leaves its host keeps them on the Removed
VMs page (a VM with only tags too) and gets them back when it returns.
Setting them is audited and held against the VM's move.
2026-11-18 20:20:52 +03:00
catborise
eb3bc69754 fix(computes): the compute forms save their own kind, a password as typed, and say when the host is not reached
The kind of a compute came from a hidden form field: posted as another
number it was saved, and the edit page of that compute failed. Each form
now saves its own kind. Passwords lost their leading and trailing spaces
on the forms and the API, so a SASL password with one never worked. A
host name whose last label is all digits, such as an IPv4 address with a
trailing dot, was taken and libvirt could not resolve it. A host saved with
a wrong password or not answering was saved silently; the page now says
why the panel cannot connect to it.
2026-11-12 09:19:15 +03:00
catborise
d5697c5d2c feat(computes): the host form names its connection and folds the advanced fields
The host form said "Add Compute" or "Edit Compute" whatever the
connection, set its labels in a narrow column, and on an edit showed an
empty password box as if the password were gone; the migration address
and the gstfsd key sat among the basics with their long help, Cancel
went back in the browser history and Save was green.

Now the heading names the host and the connection type, with the line
the add menu uses for it; a Connection card holds the name, the address,
the login and the password in two columns (SASL login and password for
TCP and TLS, SSH user for SSH) and the description the hosts list
shows; the migration address and the gstfsd key fold under Advanced,
whose summary says what is set, open when one has a value or an error.
A stored password or key says so in its box. Cancel returns to the
hosts list and Save is the primary action.
2026-10-31 18:10:05 +03:00
catborise
d7b600dea7 fix(gstfsd): only the panel, with the host's key, can change a VM's disk
gstfsd, the root service on each compute that rewrites a shut-off VM's
/etc/shadow and authorized_keys, did what any client on its port asked.
Now it needs GSTFSD_KEY (64 hexadecimal characters, in the unit's
/etc/default/webvirt-gstfsd) and does not start without it. Each
connection gets a new challenge; the panel signs its request for it
with HMAC-SHA256 and gstfsd checks the signature before any change, so
a request recorded on one connection is refused on another. gstfsd
signs its reply for the same challenge and the panel's nonce, and the
panel accepts only that reply.

Each compute has a gstfsd key, the host's GSTFSD_KEY: the compute forms
and the API take it and never show it, and an empty value on an edit
keeps it. The bootstrap script makes the key file once, readable by
root only; the README shows how to make it and where the panel takes
it. The traffic is still not encrypted: a remote panel's port stays
open to the panel's address only.
2026-10-31 01:53:43 +03:00
catborise
5a523befbd feat(computes): a compute names the address migrations reach it on
Migration is client-driven: libvirt sends the VM's memory to the
destination's own host name unless a migration URI is given, and the
app never gave one. Where the hosts cannot resolve each other's names
(or the names point at a management network) every migration failed
with "Unable to resolve address '<host name>' service '49152'".

A compute now has an optional migration address (an IP address or a
host name, no scheme or port), editable in the compute form and the
API. A VM migrating to that compute is sent to tcp://<address>
(bracketed for IPv6). Empty, the default for existing computes, keeps
the previous behavior. The compute's host name is not reused, because
for SSH computes it can be an ssh_config alias.

The migration log entry names the address when one is set.
2026-10-06 15:05:40 +03:00
catborise
1ce7dbf18e fix(computes): editing a compute keeps its password unless a new one is given
The TCP and TLS compute forms never show the stored password, so the
field is empty on every edit. Saving the form without typing the
password again replaced it with nothing, and the next connection to the
host failed to authenticate.

An empty password field on an edit now keeps the stored password; a
new value replaces it.
2026-10-06 13:58:55 +03:00
catborise
217e106c8b format python code with black 2022-11-02 08:54:35 +03:00
Real-Gecko
01043ba8a8 Templates cleanup 2020-10-15 20:18:45 +06:00
Real-Gecko
1b3fd9d05e replaced ugettext_lazy with gettext_lazy 2020-10-14 18:27:57 +06:00
catborise
6a8d713ae6 hide compute login password for tcp/tls connections 2020-07-23 13:49:29 +03:00
Real-Gecko
d3c59acb3f More tests for computes 2020-06-16 11:04:09 +06:00
Real-Gecko
7103c52380 Reworked some computes forms and views 2020-05-29 19:25:36 +06:00
catborise
4d40de1b55 Python3 & Django 2.2 Migration - Fix & Updates 2020-03-16 16:59:45 +03:00
T. Tran
08e694db4d Increase some max_length 2019-11-09 00:07:02 +07:00
catborise
eb621ef2c6 broken compute details info is fixed. 2018-07-31 10:15:59 +03:00
andrem
b6350e134e add details for local socket 2016-03-18 15:21:44 -03:00
Retspen
573a09fd4d Added full function with compute 2015-03-06 13:59:27 +02:00