mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-02 08:56:07 +00:00
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.
This commit is contained in:
parent
04f39d469c
commit
aead17dc32
4 changed files with 3 additions and 5 deletions
|
|
@ -895,7 +895,7 @@ Run every step as your normal user, not with `sudo`: if `manage.py` ever runs as
|
||||||
python manage.py run_worker --settings=webvirtcloud.settings-dev
|
python manage.py run_worker --settings=webvirtcloud.settings-dev
|
||||||
```
|
```
|
||||||
|
|
||||||
Open `http://127.0.0.1:8000`. The browser consoles connect to `/novncd/` and `/socket.io/` on the panel's own address, which the dev server does not proxy: try them in the Docker image, or behind nginx with `conf/nginx/webvirtcloud.conf`.
|
Open `http://127.0.0.1:8000`. The dev server serves the static files from `static/` while `DEBUG` is on; to try the panel with `DEBUG = False`, add `--insecure` (development only: in production nginx serves `staticfiles/`, which `collectstatic` fills). The browser consoles connect to `/novncd/` and `/socket.io/` on the panel's own address, which the dev server does not proxy: try them in the Docker image, or behind nginx with `conf/nginx/webvirtcloud.conf`.
|
||||||
|
|
||||||
### Keyboard layouts
|
### Keyboard layouts
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,5 @@ python-engineio==4.15.1
|
||||||
python-socketio==5.18.1
|
python-socketio==5.18.1
|
||||||
segno==1.6.6
|
segno==1.6.6
|
||||||
websockify==0.13.0
|
websockify==0.13.0
|
||||||
whitenoise==6.12.0
|
|
||||||
# the root password's SHA-512 crypt hash (the stdlib crypt is gone in Python 3.13)
|
# the root password's SHA-512 crypt hash (the stdlib crypt is gone in Python 3.13)
|
||||||
libpass==1.9.4
|
libpass==1.9.4
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ WebVirtCloud is a web panel for libvirt hosts. libvirt is the source of truth: t
|
||||||
| API | Django REST Framework, `drf-nested-routers`, `drf-spectacular` (OpenAPI 3.0), API tokens (`django-rest-knox`) |
|
| API | Django REST Framework, `drf-nested-routers`, `drf-spectacular` (OpenAPI 3.0), API tokens (`django-rest-knox`) |
|
||||||
| Frontend | Django templates, Bootstrap 5, Bootstrap Icons, vendored jQuery, Chart.js, noVNC, xterm.js |
|
| Frontend | Django templates, Bootstrap 5, Bootstrap Icons, vendored jQuery, Chart.js, noVNC, xterm.js |
|
||||||
| Security | `django-otp` (TOTP), `django-axes` (lockout), optional `django-auth-ldap`; CSP `script-src 'self'` |
|
| Security | `django-otp` (TOTP), `django-axes` (lockout), optional `django-auth-ldap`; CSP `script-src 'self'` |
|
||||||
| Serving | nginx in front of gunicorn (gthread workers) and WhiteNoise |
|
| Serving | nginx in front of gunicorn (gthread workers); nginx serves the static files |
|
||||||
| Processes | systemd units on hosts, supervisord in the Docker image |
|
| Processes | systemd units on hosts, supervisord in the Docker image |
|
||||||
|
|
||||||
## Processes
|
## Processes
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,6 @@ MIDDLEWARE = [
|
||||||
"webvirtcloud.middleware.RequestIdMiddleware",
|
"webvirtcloud.middleware.RequestIdMiddleware",
|
||||||
"webvirtcloud.middleware.AccessDeniedMiddleware",
|
"webvirtcloud.middleware.AccessDeniedMiddleware",
|
||||||
"django.middleware.security.SecurityMiddleware",
|
"django.middleware.security.SecurityMiddleware",
|
||||||
"whitenoise.middleware.WhiteNoiseMiddleware",
|
|
||||||
"django.contrib.sessions.middleware.SessionMiddleware",
|
"django.contrib.sessions.middleware.SessionMiddleware",
|
||||||
"django.middleware.locale.LocaleMiddleware",
|
"django.middleware.locale.LocaleMiddleware",
|
||||||
"django.middleware.common.CommonMiddleware",
|
"django.middleware.common.CommonMiddleware",
|
||||||
|
|
@ -230,7 +229,7 @@ USE_TZ = True
|
||||||
STATIC_URL = "/static/"
|
STATIC_URL = "/static/"
|
||||||
|
|
||||||
# Source assets live in static/; collectstatic gathers them with the apps'
|
# Source assets live in static/; collectstatic gathers them with the apps'
|
||||||
# assets into staticfiles/ (gitignored), which WhiteNoise and nginx serve.
|
# assets into staticfiles/ (gitignored), which nginx serves.
|
||||||
STATICFILES_DIRS = [BASE_DIR / "static"]
|
STATICFILES_DIRS = [BASE_DIR / "static"]
|
||||||
STATIC_ROOT = BASE_DIR / "staticfiles"
|
STATIC_ROOT = BASE_DIR / "staticfiles"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue