1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-08 19:26:48 +00:00
Commit graph

156 commits

Author SHA1 Message Date
catborise
f94b3cee7a chore: drop references to the local roadmap from code and tests
Comments, docstrings and live test names cited item IDs of a roadmap
that is not part of the repository. They now say what is meant, or
nothing where the sentence stands without them. Test assertions and
behavior are unchanged.
2026-10-04 11:09:25 +03:00
catborise
63b9f86436 build: drop unused dependencies
ldap3, markdown, zipp, qrcode and tzdata are not imported anywhere and
no installed package needs them on Linux with Python 3.10-3.13: LDAP
login uses python-ldap through django-auth-ldap, QR codes come from
django-qr-code (segno), qrcode is only an optional django-otp extra,
tzdata is a Windows-only Django dependency and TIME_ZONE is UTC.
python-engineio stays pinned next to python-socketio, which requires it.

The test suite passes with the five packages uninstalled.
2026-10-04 01:08:11 +03:00
catborise
e94d69a524 feat(accounts): Django's LoginRequiredMiddleware replaces the package
django-login-required-middleware is dropped; Django 5.1+ ships the same
middleware. The login page is already marked login_not_required by
Django; email_otp gets the decorator, which replaces
LOGIN_REQUIRED_IGNORE_VIEW_NAMES. The datasource still requires login.

Existing settings.py files still name the old middleware. A system
check (accounts.E002) stops migrate and the server until MIDDLEWARE
uses Django's middleware, instead of an ImportError at startup; the
README has the steps.

A new matrix test walks every URL anonymously: everything outside a
short allowlist (login pages, the OpenAPI docs) sends the visitor to
the login page, and API views deny with 401/403. It passed with the old
middleware first and passes unchanged now.
2026-10-04 01:08:11 +03:00
catborise
920f318601 build: Django 5.2.17 LTS
Django 4.2 reached end of life on 2026-04-07.

- Django==5.2.17; django-login-required-middleware 0.9.0 keeps working
  (the authorization matrix passes).
- USE_L10N removed from the settings template.
- Log out is a POST form in the navbar; Django 5 removed GET logout.
- pip-audit in CI no longer ignores the Django 4.2.30 advisories.
- README: Django 5.2, backup step and upgrade notes for existing
  settings and GET logout callers.

python -Wd manage.py test shows no Django deprecation warnings. The live
libvirt suite passes on 5.2 and on 4.2 against a RHEL qemu-kvm host.
2026-10-04 01:08:11 +03:00
catborise
dbbf2ce2e8 test(instances): isolate the live libvirt suite on shared hosts
- Runs only when TEST_LIBVIRT_HOST is set, so manage.py test on a
  developer machine no longer creates VMs on the local libvirtd.
- Every VM and volume is named wvc-test-*, and volumes live in a
  temporary wvc-test pool (/var/lib/libvirt/wvc-test) instead of the
  default pool next to real images.
- Cleanup removes only prefixed domains and the test pool's volumes;
  it also clears leftovers of an interrupted run before starting, and
  tolerates domains that turned transient.
- tearDownClass fails if any domain or volume outside the test
  namespace appeared, disappeared or was replaced.
- livetest gains create_volume/define_vm helpers and
  test_live_dataloss.py, whose setUpClass opens the class transaction
  last, so a failed libvirt connection cannot lock the test database
  for later test classes.

The first live tests reproduce two known external-snapshot data losses
and are marked expectedFailure: reverting deletes a disk added after
the snapshot, and deleting the older of two snapshots deletes the
newer one's overlay.
2026-10-04 01:08:11 +03:00
catborise
88ec3c5f6a test(instances): make the live libvirt suite runnable on real hosts
- Pick the test VM by name; .first() could select any VM already on
  the compute, and tearDownClass deletes the chosen VM's disks.
- Delete the test volume when setUpClass fails after creating it.
- test-vm.xml: no hard-coded emulator, machine alias q35 instead of
  pc-q35-5.1, so it defines on RHEL qemu-kvm hosts too.
- Follow current behavior: power actions are POST-only, the create
  form needs add_cdrom/add_input and VNC, cloning needs change
  permission on the source VM.
- README: the tests read TEST_LIBVIRT_HOST/TYPE/LOGIN/PASSWORD;
  WEBVIRTCLOUD_TEST_LIBVIRT_URI never existed.
2026-10-04 01:08:11 +03:00
catborise
964b58778d ci: test Python 3.13, check migrations, schema, deploy and audit
- Matrix 3.10-3.13; pip cache keyed on the requirements.
- New steps: makemigrations --check, spectacular --validate
  --fail-on-warn, check --deploy --fail-level ERROR, pip-audit of the
  installed environment (the Django 4.2.30 advisories are ignored until
  the Django 5.2 upgrade), and a Docker image build.
- The separate vrtManager unittest run is dropped; manage.py test
  already runs those tests.
- CodeQL also runs on pull requests to master.
- Docker installs into a plain venv instead of using the distro's
  python3-lxml and python3-libvirt; lxml>=6.1, since the distro's
  lxml 5.2.1 has CVE-2026-41066.
- dev requirements add ruff and pip-audit.
2026-10-04 01:08:11 +03:00
catborise
a6364f5d9b fix(gstfsd): append SSH keys, IPv6 loopback bind, server-side timeout
- Add the public key to authorized_keys instead of replacing the file.
- Use AF_INET6 when GSTFSD_BIND_HOST is an IPv6 address (binding ::1
  crashed with the AF_INET server).
- Close idle client connections after 30 s.

Tests run the real daemon against a small fake guestfs module over a
socket; this also exercises the earlier sendall() fix.
2026-10-03 00:02:01 +03:00
catborise
e4aa4f2372 conf(gstfsd): show how to allow a remote bind in supervisor and systemd
gstfsd only listens on loopback unless GSTFSD_BIND_HOST and
GSTFSD_ALLOW_REMOTE=1 are set; add commented environment lines for both
service definitions. gstfsd.conf now ends with a newline, which matters
because dev/libvirt-bootstrap.sh appends it to /etc/supervisor.conf.
2026-10-02 23:10:04 +03:00
catborise
7286ba079d fix(gstfsd): random password salt, timeouts, loopback-only daemon
- Hash the root password with a random SHA-512 salt instead of the fixed
  "$6$kgPoiREy".
- Talk to gstfsd through one helper with a 120 s socket timeout; an
  unreachable daemon or a bad reply is an error message, not a 500.
- gstfsd refuses to listen on a non-loopback address unless
  GSTFSD_ALLOW_REMOTE=1: it is an unauthenticated root service.
- gstfsd: encode replies (sendall(str) raised TypeError on Python 3, so
  the success path never worked) and use octal chmod modes.
- README: what gstfsd does and how to allow it on a remote compute.
2026-10-02 22:52:09 +03:00
catborise
4252ad9280 fix(console): keep socketiod behind nginx and off by default there too
- Comment out the nginx /socket.io/ location: a firewall on 6081 does not
  protect a console that nginx proxies on 80/443.
- Default SOCKETIO_HOST to 127.0.0.1.
- README: short enable steps and the changes existing installs need.
- test_socketiod_disabled writes its settings module to a temporary
  directory instead of the source tree.
2026-10-02 22:27:39 +03:00
catborise
1547e58e55 fix(console): disable the unauthenticated serial console by default
socketiod does not validate the console token, keeps a single global PTY
and broadcasts its output to every connected client, so anyone who can
reach port 6081 can read and write a serial console that someone opened.
It is also broken for legitimate users, since console/views.py now writes
signed tokens that socketiod cannot parse.

Until it is rewritten, turn the serial console off by default:

- Add SERIAL_CONSOLE_ENABLED = False to the settings template; installs
  whose settings.py lacks it are treated as disabled.
- The console view shows an error instead of the xterm page for pty
  consoles while the setting is off.
- socketiod refuses to start unless SERIAL_CONSOLE_ENABLED is True.
- Supervisor: autostart=false for socketiod; drop -d (debug) from the
  supervisor and systemd definitions; fix the systemd unit description;
  conf/systemd/install.sh no longer suggests enabling socketiod.
- README: stop opening port 6081 and document how to enable the serial
  console on a trusted network.
2026-10-02 17:22:20 +03:00
catborise
1227674d8f feat(security): implement P0 critical security fixes for API, console, and access control
- Computes API: mark password as write_only in ComputeSerializer, restrict ComputeViewSet and architectures to IsAdminUser.
- Instances API: enforce user ownership tenant isolation in InstanceViewSet.list, restrict MigrateViewSet and CreateInstanceViewSet to IsAdminUser, require IsAdminUser for mutating FlavorViewSet.
- Storage, Network, and Interface APIs: restrict StorageViewSet, VolumeViewSet, NetworkViewSet, InterfaceViewSet to IsAdminUser.
- AppSettings & NWFilters: protect appsettings and nwfilter views with @superuser_only (403 Forbidden for non-superusers).
- noVNC Console: sign tokens with TimestampSigner (salt='console.novnc', max_age=600), verify signature and user authorization in novncd with backward-compatible fallback for debug/test mode.
- Accounts: avoid hardcoded default admin password; generate cryptographically secure random password unless ADMIN_PASSWORD is set (preserve 'admin' in test runner).
- gstfsd daemon: bind to 127.0.0.1 by default instead of 0.0.0.0.
- Tests: added comprehensive test coverage for API security, token expiration/rejection, and view permissions (132 tests passing).
2026-09-27 10:50:09 +03:00
catborise
33550e5e3a chore(deps): update production and development requirements for Django 4.2 LTS
- Upgraded Django to 4.2.30 (latest Django 4.x LTS release)
- Upgraded production dependencies in conf/requirements.txt:
  * django_bootstrap5 to 26.2 (latest supporting Django 4.2)
  * django-otp to 1.7.3
  * django-auth-ldap to 5.3.0
  * djangorestframework to 3.17.2 (latest supporting Django 4.2)
  * drf-nested-routers to 0.95.3
  * drf-spectacular[sidecar] to 0.30.0
  * eventlet to 0.41.2
  * gunicorn to 26.2.0
  * markdown to 3.10 (supporting Python 3.10+)
  * paramiko to 5.0.0
  * python-engineio to 4.14.0
  * python-socketio to 5.17.0
  * whitenoise to 6.12.0
  * zipp to 4.1.0
- Upgraded development dependencies in dev/requirements.txt:
  * coverage to 7.16.1
  * django-debug-toolbar to 6.3.0 (latest supporting Django 4.2)
  * pycodestyle to 2.15.0
  * pyflakes to 4.0.0
  * pylint to 4.0.9
  * black to 26.5.1
2026-09-27 00:22:38 +03:00
catborise
e980aca2ff feat(console): remove deprecated SPICE support in favor of noVNC
- Remove obsolete spice-html5 static assets and SPICE console templates
- Restrict default console types to VNC with migration 0012
- Filter out SPICE in VM creation form and backend capabilities
- Return friendly deprecation notice if legacy VM is opened with SPICE
- Clean up docs, architecture references, and libvirt-bootstrap scripts
2026-09-26 22:43:40 +03:00
catborise
d9112b797f fix(console): fix novncd startup in container and prevent double slashes in websocket url 2026-09-25 23:11:52 +03:00
catborise
7435d66492 fix(security): resolve reviewer findings on secret key baking, host symlinks, and injection safety
- Prevent baking SECRET_KEY into Docker image during collectstatic
- Persist runtime SECRET_KEY in data/secret_key volume or read from environment
- Remove sed-based injection of CSRF_TRUSTED_ORIGINS in favor of native os.getenv
- Avoid overwriting system python3 symlink on SUSE; auto-detect python 3.10+ binaries
- Make /etc/hosts entry in installer idempotent
- Add security notice regarding compute node VNC/SPICE port firewall isolation
2026-09-25 22:06:16 +03:00
catborise
b1a843e846 feat(docker): modernize Dockerfile, add runit init script, and provide docker-compose setup
- Add python3-libvirt to apt and configure --system-site-packages for zero-compilation build
- Introduce 10_webvirtcloud_init.sh to handle container startup, migrations, and SQLite persistence
- Exclude host settings.py in .dockerignore for clean builds from settings.py.template
- Add docker-compose.yml with persistent data and SSH volume mounts
- Document Docker Compose deployment in README.md
2026-09-25 21:58:19 +03:00
catborise
f5e5ff2759 fix(install): refine openSUSE Leap dependencies and streamline installer execution
- Add Python 3.11 package detection and alternatives configuration for openSUSE/SLES
- Relax libvirt-python and lxml minimum versions in requirements to match distro-provided packages
- Gracefully handle missing hostname command in minimal/containerized SUSE environments
- Prevent redundant git clone if workspace already exists in target path
2026-09-25 20:44:52 +03:00
catborise
88288f965d feat(install): add openSUSE and SLES 15 distribution support and compute bootstrap 2026-09-25 20:03:02 +03:00
catborise
933e7b378a fix(security): resolve CSRF 403 on DEBUG=False and improve reverse proxy headers
- Add local ports and env var fallback for CSRF_TRUSTED_ORIGINS in settings.py.template
- Configure SECURE_PROXY_SSL_HEADER for reverse proxy / HTTPS environments
- Update Nginx proxy headers to use $http_host and $scheme to prevent port mismatch
2026-09-25 10:28:49 +03:00
catborise
7a9b3c9e13 feat(dev): improve Rocky Linux and RHEL compatibility for local development
- Relax libvirt-python and lxml version pins to allow precompiled distro packages
- Add PEP 508 environment marker to crypt-r (python_version >= 3.13) to avoid unnecessary C compilation on Python 3.12
- Add stdlib crypt fallback when crypt_r is not available in instances/views.py
- Make LDAP imports and configuration optional in settings.py.template
- Add --system-site-packages and missing packages in webvirtcloud.sh for RHEL/CentOS
- Update README with working Rocky Linux / RHEL / Fedora installation and local dev setup
2026-09-25 09:45:54 +03:00
catborise
67364e2a05 feat(api): migrate API documentation from drf-yasg to drf-spectacular
- Replace abandoned drf-yasg with drf-spectacular and drf-spectacular-sidecar
- Configure OpenAPI 3.0 schema generation and offline sidecar assets in settings
- Update schema, Swagger UI, and ReDoc routes in webvirtcloud/urls.py
- Add backwards-compatible AutoSchema fallback for existing settings installations
- Remove 130 obsolete legacy drf-yasg static assets
- Update upgrade instructions in README.md and project documentation
2026-09-25 08:08:36 +03:00
catborise
dc6327c554 fix(vrtManager): modernize rwlock for Python 3.12 compatibility and add tests 2026-09-24 21:49:52 +03:00
hudeng
326579a6ea feat: Add ISO file upload progress support. 2025-07-17 17:11:30 +08:00
catborise
b909a81f51 update requirements 2025-07-01 15:06:29 +03:00
catborise
099769d305
Merge pull request #666 from liangsuilong/master
crypt-r replaces crypt stdlib, support python-3.13
2025-05-02 10:10:40 +03:00
catborise
120f406b48
Merge pull request #667 from catborise/master
update requirements
2025-05-02 10:10:18 +03:00
catborise
34f08fc555 update requirements 2025-05-02 10:06:09 +03:00
Liang Suilong
8bca7db917 crypt-r replaces crypt stdlib, support python-3.13 2025-03-30 10:33:51 +08:00
catborise
fb108f9ac9
Merge pull request #662 from catborise/master
update requirements
2025-03-11 10:43:14 +03:00
catborise
1a800b4535 update requirements 2025-03-11 10:38:38 +03:00
catborise
b892af989b
Merge pull request #657 from catborise/master
update requirements
2024-10-15 16:38:48 +03:00
catborise
b55552f05a update requirements 2024-10-15 16:37:21 +03:00
catborise
3d53f45f27
Merge pull request #656 from catborise/master
update requirements
2024-08-27 10:46:55 +03:00
catborise
24f751774b update requirements 2024-08-27 10:45:51 +03:00
catborise
218ec5dd78
Merge pull request #653 from catborise/master
update requirements
2024-07-23 14:54:43 +03:00
catborise
cb7b690a10 update requirements 2024-07-23 14:53:41 +03:00
catborise
b76b6e382e
Merge pull request #649 from catborise/master
update req
2024-06-24 09:34:25 +03:00
catborise
072a922c15 update requirements 2024-06-24 09:32:41 +03:00
Your Name
950e668631 Silly Mistake fixed 2024-05-28 11:33:40 +02:00
Your Name
46029d533c Ubuntu Service files 2024-05-28 11:22:20 +02:00
catborise
fc60819ff1 update requirements 2024-04-29 12:13:04 +03:00
catborise
6144760456 update requirements 2024-02-13 14:28:13 +03:00
catborise
bfe7da1ccc add tzdata package and reorder package names 2024-01-17 10:20:06 +03:00
catborise
f0cd0bc04f update requirements 2024-01-17 09:28:01 +03:00
catborise
296081d1e3
Merge branch 'master' into master 2023-11-10 16:35:51 +03:00
catborise
e324a19401 add white noise for static_root/staticfiles_dir problem for debug/non-debug running mode 2023-11-10 16:29:48 +03:00
catborise
2ff0abf8c5
Merge pull request #619 from catborise/master
update requirements
2023-10-30 15:59:51 +03:00
catborise
7171a70f75 update requirements 2023-10-30 15:56:54 +03:00