1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-11 12:46:49 +00:00
Commit graph

2243 commits

Author SHA1 Message Date
catborise
b95f2a28d7 fix(instances): the VM page's DRBD state does not rewrite the VM's record
With VM DRBD Status on, the VM page saved the whole record it had read
after waiting up to its ssh timeout for the host. A migration or delete
that finished meanwhile was undone: the record moved back to the old
compute, or came back without its owners. Only the DRBD state is written.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 13:19:39 +03:00
catborise
12e33f7964 fix(computes): a compute is not edited while a job on it is admitted
A job resolves its compute's connection when it runs. Changing the
compute's hostname meanwhile sent the job to another host, where a VM
with the same UUID (a copy) could be deleted or changed instead. An edit
now holds the compute as a delete does, and is refused while a job or VM
operation on it is admitted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 13:19:39 +03:00
catborise
a2f4d3fe06 fix(instances): an open VM page follows its VM's removal on the host
A VM undefined outside the panel (virsh, virt-manager) while its page was
open made the state and statistics polls answer 500 every 5 seconds, each
an error in the panel's log, and the page stayed as it was. A page read of
an object the host no longer has is now 404, and the VM page reloads on a
404 of its state: it then goes to the VM list with "no longer on its host",
or shows that the VM is not found.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 13:19:39 +03:00
catborise
373760f2c5 fix(instances): a VM name of any length libvirt takes is kept
libvirt names a VM by its <name>.xml file, so a name can have up to 251
bytes. The panel's VM, removed-VM and log records held 120 characters:
on PostgreSQL one longer name made the host's sync fail and the VM list
answer with an error. They now hold 255.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 13:11:22 +03:00
catborise
e83bdcbd44 fix: worker warnings and CPU windows do not depend on a wall clock
The job panel warned "Worker unavailable" when the worker's last
heartbeat was more than 60 s older than the browser's clock: a browser
set two minutes ahead warned about a worker that had just beaten, and
one behind hid a worker that had stopped. The server now says whether
the worker is gone (worker_gone in the job panel's answer), by the same
rule as the Jobs page.

A host's CPU graph measured its averaging window with time.time(): a
clock set back between two polls gave a negative window. It now uses
time.monotonic(), as a VM's usage already does; a sample from before
the server restarted is measured over a second again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 12:21:36 +03:00
catborise
25e49c2aa2 fix: backups and snapshots keep their order when the clock goes back
Backup retention kept the last --keep backups by name, and a name is the
panel's local time. Where the clock goes back an hour in autumn
(TIME_ZONE=Europe/Berlin), a backup at 02:10 CET forty minutes after one
at 02:50 CEST sorted first, and --keep 1 deleted the new one. Retention
now keeps the newest by when they were made (the directory's mtime);
the names stay as they were.

Snapshot times from libvirt (epoch seconds) became naive local times,
which the snapshot list sorts newest first: in the same hour the older
snapshot came first. They are now aware UTC times; the page still shows
them in the panel's time zone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 12:21:36 +03:00
catborise
0d20d07b29 fix(ui): host and VM charts give their points the panel's time
A host's charts and their "Updated at" line took their times from
timezone.now(), which is UTC, while a VM's charts took time.strftime(),
the panel's time zone. With TIME_ZONE=Europe/Istanbul the same moment
read 09:00 on the host page and 12:00 on the VM page. Both now give the
panel's time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 11:57:43 +03:00
catborise
a8f7c8aeaa fix(logs): the VM page's Logs tab shows times as the Logs page does
The Logs tab of a VM's Stats showed each row's time in UTC, formatted by
the process locale ("11/10/26 08:43:08" whatever the page's language),
while the Logs page shows the same row in the panel's time zone
("2026-11-10 11:43:08" with TIME_ZONE=Europe/Istanbul). The tab now
shows the panel's time in the Logs page's format, and its Date heading
names the zone as the Logs page's does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 11:52:54 +03:00
catborise
ae3496ac50 fix(console): a VNC session ends when its host drops off the network
novncd connects to a VM's VNC server directly when it listens on a
reachable address, with no timeout once connected: a console may stay
quiet for long. When the network to the host dropped without a word,
nothing noticed it; the browser kept a frozen console and novncd its
proxy process until the user closed the tab or the kernel gave up after
many minutes.

The socket now has TCP keepalive (30 s idle, then 3 probes 10 s apart)
and TCP_USER_TIMEOUT (60 s for data left unanswered). Measured against
compute1 with the port's packets dropped: quiet and busy sockets both
ended after 61 s; a socket without these options still waited after
200 s. SSH-tunnelled consoles already have SSH's keepalive.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 11:12:21 +03:00
catborise
139e43e4c4 fix(instances): the VM page says when its host stops answering
The VM page polls the VM's state every 5 s and reloads when it changes.
When the host stopped answering, the poll failed and nothing changed on
the page: it kept showing the last state, figures and actions as if they
were current. A notice now says that the page could not be refreshed and
may be out of date while the poll fails (a host that does not answer, a
session that ended); it goes away with the next answer. Checked on
compute1 in headless Chromium with its libvirt port dropped and restored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 11:12:21 +03:00
catborise
6cdda6d4f3 fix(instances): the VM list survives a host that stops answering mid-request
The VM list reads each reachable host's CPUs and memory while it renders,
after it has found the host reachable. When the network to a host
dropped during that request, libvirt's keepalive closed the connection
in between, and the read raised: the whole list became the 500 error
page after about 40 s. Only the next load showed the host as down.

The host's CPU, memory and memory-use reads now give None for a host
that stopped answering; the list leaves its numbers out and the New VM
dialog does not offer it. Checked on compute1 with its libvirt port
dropped mid-request: the list answers 200.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 11:12:08 +03:00
catborise
b70bab2144 fix(vrtManager): reconnect after a host's storage or network daemon restarts
On a host with libvirt's modular daemons, a restart of virtstoraged or
virtnetworkd (a package update, for one) left the panel's connection to
virtproxyd open and alive, but every later storage or network call on it
failed with "internal error: client socket is closed". Nothing replaced
it: the storage and network pages showed the error and the VM page gave
500 until the panel was restarted, and a clone running then waited in
recovery for up to an hour, holding its VM.

libvirt reports that error as an RPC internal error and does not say on
which connection, so the error handler now has the process retire its
open connections at the next get_connection: each opens again when next
asked. A retired connection stays with the threads that use them, its
close callback unregistered so that it closes once they are done; a
connection that failed or is opening keeps its retry delay. On compute1 the
pages answered again from the second request on, and the clone's job
failed at its first recovery check, 30 s later, freeing its VM.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 11:12:08 +03:00
catborise
aefe551450 feat(ui): the owner and VM lists of the ownership forms are searchable
The VM page's Add owner and a user's Add VM page listed every user and
every VM in a plain drop-down: with 800 users and 300 VMs one was found
by scrolling. They now have a search box (Tom Select, already used by the
create form), through searchable_select.js for a select with
data-searchable.

The box loses focus once an item is chosen: focused, it is a line taller,
and on a phone the tap on Save shrank it and moved the button away from
under the finger, so the first tap did nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 09:21:25 +03:00
catborise
0368d94f27 fix(ui): the Logs and Jobs page links fit a phone screen
The page links of Logs and Jobs showed eleven pages around the current
one: with many pages the bar was 674 px wide on a 375 px screen and the
page scrolled sideways. They now show five and wrap when even those do
not fit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 09:05:01 +03:00
catborise
b91a9d6f28 fix(instances): a long VM name wraps on its page
The VM page's heading did not wrap a name without spaces: a 185-character
name made the page 2,600 px wide, even on a 1440 px screen, and pushed the
state badge off it. The heading now breaks the name and the badges wrap
below it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 09:04:19 +03:00
catborise
8c87fe8d32 fix(admin): a block deletes the user's API tokens
A blocked user's tokens were refused while the block lasted, but an
unblock brought them back: blocking a taken-over account and opening it
again gave its tokens back to whoever had made them. Blocking, from the
user list or by unticking Active on the edit form, now deletes them, as
an administrator's password reset does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 08:10:56 +03:00
catborise
135839bd66 feat(accounts): an administrator can reset a user's OTP
A user's OTP secret could not be changed: "Lost OTP?" and the admin's
"Email OTP QR code" both send the same secret again, so a stolen phone
kept making valid codes. The user's profile page now has "Reset OTP",
which deletes the user's TOTP device; they sign in with the password
alone until a new QR code is mailed, which has a new secret.

The mailed link now names the device, not the user: a link mailed before
a reset shows nothing, not the next device's secret. A new signing salt
refuses the links that named a user, whose id may be another user's device.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 08:10:48 +03:00
catborise
fa0f7f79ac fix(accounts): a failed OTP mail leaves the user without OTP
The admin's "Email OTP QR code" made the user's TOTP device and then sent
the mail. When the SMTP server refused it, the page said so, but the
device stayed: the user's next login asked for a code from a QR code they
never got. The device and the mail now share one transaction.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-10 07:58:46 +03:00
catborise
cb4fd4185b test(operations): the stuck-host cancel test waits for both hosts' hooks
The worker starts the cancel hooks of the two hosts in no set order. The
test waited only for the healthy host's hook and then counted the stuck
host's, which on a slow runner had not started yet (seen on Python 3.14
in CI): it now waits for both before it counts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 16:44:25 +03:00
catborise
e6155c855a fix(instances): a late cancel leaves a later job's migration or disk move alone
A cancel that comes before libvirt began a migration or disk move waits
for it. When the job ended meanwhile and another job of the VM started
its own migration or copy within the hook's second of sleep, the hook
took that for its own and aborted it. The hook now asks whether its job
is still active right before it aborts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 16:34:20 +03:00
catborise
c49ee24aae fix(operations): a cancel during recovery cannot hold up its job for good
After a worker restart, recovery watches a migration or disk move that
libvirt still runs and sends a cancel asked meanwhile to the job's hook.
It ran inline in the inspection. The hook waits until libvirt's job runs
or the panel's job ends; when libvirt finished just after the inspection
saw it run, only the next inspection could record the end, so the job
stayed cancelling for good and held its host's control slot. The hook
now runs in a thread of its own, and the next inspection ends the job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 16:34:20 +03:00
catborise
8197e645f9 fix(instances): a VM delete waits at most 60 s for another host's disk check
Deleting a VM with its disks first asks the other computes whether they
use its files. A host that is connected but does not answer (a hung NFS
mount under a pool) held the delete job for good, and with it a slot of
the worker: a few such deletes could fill the pool and stop the jobs of
healthy hosts. The check now waits USED_CHECK_WAIT, as the disk move and
migration checks do; a host that does not answer in time stops the
delete before anything changes, naming the host. Until it answers the
earlier check, a retried delete is refused at once instead of asking it
again, so the calls waiting on it do not pile up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 16:34:06 +03:00
catborise
f6c7f8c85e fix(i18n): chart series and the preset announcement in the page's language
The VM and host charts named their series in English (Usage, Usage (RSS),
Read, Write, Inbound, Outbound) and the new-VM form announced an applied
preset as "...new N GiB disk" in English on Turkish and Chinese pages.
The texts now come from the templates: the stats tab and host overview
give the series names (disk and NIC series reuse In, Out, Read, Write of
the readings line), and each preset button carries its own announcement.
"Usage" has the context "chart": zh translated it for secrets as "used by".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 14:41:48 +03:00
catborise
03dcb14e45 fix(storages): an ISO chunk answered with an HTML page is not counted as stored
When the host did not answer, the storage page redirected the chunk's
POST to the pools page; the upload took that HTML as a stored chunk, and
on the last one closed as finished without an error. The chunk request
now expects JSON, so such an answer shows the upload error and the
upload can be resumed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 14:41:48 +03:00
catborise
7625b327c4 fix(instances): the VM page waits to reload while it is in use
A power state change reloaded the VM page at once, losing what the user
was typing in a form or a dialog left open (only an unsaved XML edit was
kept). It now waits while pageInUse(), as the VM list's poll does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 14:41:43 +03:00
catborise
600c8d8566 fix(operations): the job panel shows the outcome when its resource is gone
An owner who deleted their VM stayed on its page with "Delete VM queued"
and a Cancel button for good: the delete takes the user's ownership, so
the resource's job list answers 404, and outcomes were asked for only
after a list answered. A 403 or 404 list now counts as an empty one, so
each job is asked for by its id: while it runs (a delete goes on with the
disks after the VM's record is gone) it stays shown with its Cancel
button, and once it ends its page (the VM list) opens.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 14:41:39 +03:00
catborise
f18287d3b8 fix(instances): the delete page names the host only where hosts are shown
The confirmation page put "on <host>" in its heading for every owner who
may delete the VM, while the VM list and page show the host only to
superusers and users with view_instances.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 13:54:28 +03:00
catborise
0cee65805d fix(instances): a template's console settings cannot be changed by a POST
A template's page has no console settings form (it is cloned, not run),
but update_console still took a direct POST from a staff owner with
is_change and is_vnc, or from a superuser. can_manage_console now refuses
every template, so the page and the view use one rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 13:53:51 +03:00
catborise
d34b1eb2bf fix(accounts): the mailed OTP link keeps its token out of the access logs
The link to the OTP QR code carried its signed token in the path, so
gunicorn's access log (docker logs, the journal) and nginx's held it:
anyone reading them within the hour could open the code and take the
TOTP secret. The token is now the URL's fragment, which no request
carries; the page posts it (otp_qr.js) and the answer shows the code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 12:00:55 +03:00
catborise
9323d61743 fix(backup): the backup holds the secret key in use
The backup copied data/secret_key, which does not exist when SECRET_KEY
comes from the environment (Docker then makes none) and can differ from
the key in use: a restored panel signed everyone out and could not read
what it had signed. The backup now writes settings.SECRET_KEY.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 12:00:55 +03:00
catborise
d0b08db654 fix(docker): the settings.py kept next to the compose file stays out of the image
The README has Docker users keep their own settings.py next to the compose
file and mount it. .dockerignore left out only webvirtcloud/settings.py,
so the next docker compose build copied that file, with its LDAP password
or SECRET_KEY, into an image layer. It is now ignored by Docker and git,
and CI plants it among the files that must not reach the image.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 12:00:55 +03:00
catborise
7b405e0c6e docs(readme): environment variables go to /etc/default/webvirtcloud, not settings.py
The README offered "edit webvirtcloud/settings.py" as a place for the
environment variables, but settings.py reads them from the environment:
WEBVIRTCLOUD_HTTPS = 1 written there changes nothing. It now says so and
names the setting to change instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 12:00:55 +03:00
catborise
bba4f7908e fix(install): migrate runs with /etc/default/webvirtcloud loaded
The services read their environment from /etc/default/webvirtcloud, but
a re-run of the installer and the README's update and rollback steps ran
manage.py migrate without it: with WEBVIRTCLOUD_DB_HOST set there, the
migrations went to the fallback sqlite file and PostgreSQL kept the old
schema. All three now load the file first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 12:00:55 +03:00
catborise
0c028ef107 fix(settings): OTP mail is sent from the SMTP account, or DEFAULT_FROM_EMAIL
send_mail got no sender, so the OTP mail went out from Django's default
webmaster@localhost, which relays that take mail only from their account
refuse. DEFAULT_FROM_EMAIL is now read from the environment, defaulting to
EMAIL_HOST_USER.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 12:00:55 +03:00
catborise
7d873d431e fix(settings): TZ sets the panel time zone in Docker
Docker builds settings.py from the template, whose TIME_ZONE was fixed to
UTC: TZ in docker-compose moved the container's clock and its backup time
but not the panel's dates, and Django then reset the process's TZ to UTC.
TIME_ZONE is now TZ, or UTC; the installer still writes the server's
zone into settings.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 12:00:55 +03:00
catborise
fc96bd2261 fix(settings): a relative WEBVIRTCLOUD_LOG_FILE is from the panel directory
WEBVIRTCLOUD_LOG_FILE=panel.log made os.makedirs("") raise while the
settings loaded: the panel did not start. A relative path is now taken
from the panel's directory, like the default data/webvirtcloud.log.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 12:00:55 +03:00
catborise
28fc394b9e fix(settings): a network in ALLOWED_HOSTS stops the start
Django matches the request's host with each ALLOWED_HOSTS entry as a name:
192.0.2.0/24 was accepted and matched nothing, so requests to the
addresses in it got 400 with no sign why. Such an entry now raises
ImproperlyConfigured, naming it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 12:00:55 +03:00
catborise
9a00239a86 fix(settings): an on/off variable is 1 or 0; another value stops the start
WEBVIRTCLOUD_DEBUG, WEBVIRTCLOUD_HTTPS, WEBVIRTCLOUD_SERIAL_CONSOLE and
EMAIL_USE_TLS compared their value with "1": EMAIL_USE_TLS=true turned
STARTTLS off, and WEBVIRTCLOUD_HTTPS=true left the cookies insecure,
without a word. env_flag takes 1 or 0 (unset is the default, empty is 0
as before) and raises
ImproperlyConfigured, naming the variable, on anything else.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 12:00:55 +03:00
catborise
2a3c05020f test(connection): host-request tests give the fake open 1 s, not 0.2 s
CONNECT_TIMEOUT bounds both the wait for a host's request slot, which
these tests time out on purpose, and the wait for the open's thread,
which they expect to finish. 0.2 s was missed once on a CI runner
("h did not answer within 0.2 s" in test_an_ended_request_lets_the_next_one_in).
The four refusal tests now wait 1 s each.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 10:22:41 +03:00
catborise
23ce5de31e feat(settings): WEBVIRTCLOUD_DEBUG=1 turns on Django's debug mode
DEBUG was fixed to False in the template, and Docker builds settings.py
from it in each container: debug mode could only be had by editing the
file inside a running container. It is now read from the environment like
the other options; off unless the variable is 1.

The toolbar's URLs follow settings-dev, which installs the toolbar, not
DEBUG: with the dev packages present, DEBUG alone imported them without
the app and every URL lookup failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 09:48:34 +03:00
catborise
47d2a34403 chore(static): nginx alone serves the static files; WhiteNoise is removed
nginx answers /static/ from staticfiles/ before a request reaches gunicorn,
so WhiteNoise never served a file in an installed panel. It only answered
under runserver with DEBUG off, from staticfiles/ as the last collectstatic
left it: a stale copy without the themes broke the page. The dev server
serves the sources itself with DEBUG on, or with --insecure, which the
README now says.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 08:16:30 +03:00
catborise
a7f620d3c9 test(connection): the thread tests wait for the opens they started
ConnectionThreadsTestCase, like BoundedOpenTestCase, released its blocked
opens when a test ended without waiting for them, so an open could still
end during the next test. Its cleanup joins the threads the test started.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 22:38:07 +03:00
catborise
9f323d709e test: no test connects to a real host
Tests of eight files patched a host's status but not what the page also read, its
connection, connection_error or proxy, and so connected for real: over
ssh to 10.0.0.9 or over TCP to unroutable addresses (5 to 10 s each until
the connect timeout), and to the machine's own libvirt (qemu:///system).
A failed host is not tried again for a while, so only the first such test
of a process connected, and which one depended on the order. They now
patch the connection itself, or what the page reads, and use RFC 5737
addresses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 22:22:16 +03:00
catborise
0d225edda4 test(connection): a test waits for the opens it started
BoundedOpenTestCase released its blocked opens when a test ended but did
not wait for them: an open that ended during the next test logged
"h: connected" into that test's assertLogs, and the log test failed in
two of three runs of the vrtManager tests in reverse order. The cleanup
now joins the threads the test started.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 22:12:55 +03:00
catborise
f09a1b67f5 test(accounts): validate_ssh_key is tested in one place
test_ssh_keys repeated test_utils' cases of a key with and without a
comment and of an invalid key; test_utils keeps them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 21:20:06 +03:00
catborise
6dab3b210c test(migrate): the worker refuses a migration whose user may no longer migrate
The worker checks again, before it migrates, that the job's user is
still an active superuser; no test removed either while the job was
queued, so the check could go unnoticed, as it is tested for clones and
new VMs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 21:20:06 +03:00
catborise
9a4a201dac test(backup): the backup has the database's last change
The test checked only that the copy had a table, and it copied the test
run's own database file, which a run of this module alone does not
create. Each test now backs up a database of its own whose last change
is still only in its WAL file, and checks that the copy has it: a copy of
the main file alone would lose it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 21:20:06 +03:00
catborise
91f8d83bc1 test(installer): check that the settings are copied from the template
The test checked only wvc_ensure_settings' exit status and then wrote
the settings file itself: a function that copied nothing passed. It now
checks the file's contents after the copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 21:20:06 +03:00
catborise
2ee3e5ddad test(quota): the concurrent resize test checks what happened to each request
The test asserted only that one resize ran: a request that failed for any
other reason in its thread, unseen, passed it as well. It now collects
each request's messages, or its exception, and asserts that one resized
and the other was refused by the user's quota lock or by the quota.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 21:20:06 +03:00
catborise
3ead5fadd7 test(connection): a close during the lookup returns the connection it checked
The test fired the close callback at the 1st, 2nd or 3rd isAlive call of
a lookup, but a lookup calls isAlive once: two of its three cases closed
nothing. It also took a libvirtError for a result, as it only asserted
that the result was not None. It now runs the one interleaving there is
and asserts that the lookup returns the connection it checked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 20:51:02 +03:00