From 11cceb4c30d4e16c490ca84dae7527aba29e5522 Mon Sep 17 00:00:00 2001 From: randogoth Date: Sun, 26 Oct 2025 22:21:50 +0200 Subject: [PATCH] web feature --- README.md | 2 +- scripts/dos-httpd | 62 +++++++++++++++++++++++++++------------ scripts/start-services.sh | 11 +++++-- 3 files changed, 53 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 197d3b6..220bace 100644 --- a/README.md +++ b/README.md @@ -126,7 +126,7 @@ You can override which binary is used for the Linux side by setting `DOS_LINUX_S | `DOS_SSH_PORT` | `2222` | Host port forwarded to container port 22. | | `DOS_TELNET_PORT` | `2323` | Host port forwarded to container port 23. | | `DOS_HTTP_PORT` | `8080` | Host port forwarded to the web console. | -| `DOS_HTTP_FONT_PATH` | `/usr/local/share/dos-httpd/WebPlus_IBM_VGA_8x16.woff` | Override the font served to the web console. | +| `DOS_HTTP_CRT` | `1` | Toggle the CRT styling applied to the web console (`0` to disable). | | `ENABLE_TELNET` | `1` | Toggle BusyBox telnetd. | | `ENABLE_HTTP_CONSOLE` | `1` | Launch the built-in web terminal. | | `TELNET_PORT` | `23` | Port inside the container where telnetd listens. | diff --git a/scripts/dos-httpd b/scripts/dos-httpd index d3f70cd..fc884d1 100644 --- a/scripts/dos-httpd +++ b/scripts/dos-httpd @@ -28,6 +28,18 @@ from aiohttp import web, WSMsgType LOG = logging.getLogger("dos_httpd") + +def _env_bool(name: str, default: bool) -> bool: + value = os.environ.get(name) + if value is None: + return default + value = value.strip().lower() + if value in {"1", "true", "yes", "on"}: + return True + if value in {"0", "false", "no", "off"}: + return False + return default + HTML_PAGE = """ @@ -76,7 +88,7 @@ HTML_PAGE = """ overflow: hidden; } .crt-display { - filter: saturate(1.1) contrast(1.12) brightness(0.85); + filter: saturate(1.05) contrast(1.08) brightness(0.95); --crt-line-step: 1; } .crt-display::before { @@ -87,15 +99,15 @@ HTML_PAGE = """ background-image: repeating-linear-gradient( to bottom, - rgba(255, 255, 255, 0.1) 0px, - rgba(255, 255, 255, 0.1) calc(var(--crt-line-step) * 1px), + rgba(255, 255, 255, 0.06) 0px, + rgba(255, 255, 255, 0.06) calc(var(--crt-line-step) * 1px), rgba(0, 0, 0, 0) calc(var(--crt-line-step) * 1px), rgba(0, 0, 0, 0) calc(var(--crt-line-step) * 2px) ), repeating-linear-gradient( to right, - rgba(255, 255, 255, 0.04) 0px, - rgba(255, 255, 255, 0.04) calc(var(--crt-line-step) * 1px), + rgba(255, 255, 255, 0.025) 0px, + rgba(255, 255, 255, 0.025) calc(var(--crt-line-step) * 1px), rgba(0, 0, 0, 0) calc(var(--crt-line-step) * 1px), rgba(0, 0, 0, 0) calc(var(--crt-line-step) * 2px) ); @@ -152,6 +164,7 @@ HTML_PAGE = """