From f4a889660f024b8a5e3250bd5e9cdf89cc1200cf Mon Sep 17 00:00:00 2001 From: Peter van Arkel Date: Sun, 22 Nov 2026 23:46:37 +0100 Subject: [PATCH] Adopt the Coulobre ribbon logo --- README.md | 2 ++ deploy/panel_installer/web.py | 25 +++++++++++++++---- pyproject.toml | 1 + .../hosting/static/hosting/coulobre-mark.svg | 16 ++++++++++++ src/coulobre/hosting/static/hosting/panel.css | 18 ++++++++++--- .../templates/hosting/authentication.html | 3 +-- .../hosting/templates/hosting/base.html | 4 +-- .../hosting/templates/hosting/brand.html | 2 ++ .../hosting/templates/hosting/login.html | 3 +-- 9 files changed, 60 insertions(+), 14 deletions(-) create mode 100644 src/coulobre/hosting/static/hosting/coulobre-mark.svg create mode 100644 src/coulobre/hosting/templates/hosting/brand.html diff --git a/README.md b/README.md index 250a3e2..44571f3 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Coulobre Panel + + Coulobre Panel is an open-source web hosting control panel for hosting providers and resellers. The project is in early development. diff --git a/deploy/panel_installer/web.py b/deploy/panel_installer/web.py index aef6f0b..01078a4 100644 --- a/deploy/panel_installer/web.py +++ b/deploy/panel_installer/web.py @@ -11,10 +11,11 @@ from urllib.parse import parse_qs from .cli import comma_separated, number from .config import REMOTE_MODES, InstallError, parse_plan, port -from .engine import Installer +from .engine import SOURCE, Installer COOKIE = "coulobre_installer" MAX_FORM = 16384 +BRAND_MARK = SOURCE / "src/coulobre/hosting/static/hosting/coulobre-mark.svg" FORM = """

Full-service setup is recommended for a public single server. The panel, websites, databases, DNS and mail run locally. Adjust the settings below @@ -44,7 +45,10 @@ for a different deployment.

""" -STYLE = """body{font:1rem system-ui,sans-serif;max-width:46rem;margin:auto; +STYLE = """:root{color-scheme:light} +h1{display:flex;align-items:center;gap:.65rem} +h1 img{width:1.9rem;height:1.9rem;flex:none} +body{font:1rem system-ui,sans-serif;max-width:46rem;margin:auto; padding:1rem;color:#14372e} fieldset{margin:1rem 0;border:1px solid #a9beb2; border-radius:.4rem;padding:1rem} label{display:block;margin-bottom:.75rem} input,select{display:block;box-sizing:border-box;width:100%;padding:.45rem; @@ -223,8 +227,10 @@ class WizardHandler(BaseHTTPRequestHandler): head = '' if refresh else "" html = f""" + {head}Install Coulobre Panel -

Install Coulobre Panel

{body}
+

Install Coulobre Panel

+{body}
""".encode() self.send_response(status) self.send_header("Cache-Control", "no-store") @@ -234,7 +240,7 @@ class WizardHandler(BaseHTTPRequestHandler): self.send_header("Referrer-Policy", "no-referrer") self.send_header( "Content-Security-Policy", - "default-src 'none'; style-src 'unsafe-inline'; " + "default-src 'none'; style-src 'unsafe-inline'; img-src 'self'; " "form-action 'self'; frame-ancestors 'none'; base-uri 'none'", ) if cookie: @@ -254,12 +260,21 @@ class WizardHandler(BaseHTTPRequestHandler): return self.headers.get("Host") == self.server.authority def do_GET(self): - if not self.host_allowed() or self.path != "/": + if not self.host_allowed() or self.path not in {"/", "/favicon.svg"}: self.page( "

Use the installer address shown in the terminal.

", status=403, ) return + if self.path == "/favicon.svg": + svg = BRAND_MARK.read_bytes() + self.send_response(200) + self.send_header("Content-Type", "image/svg+xml") + self.send_header("Content-Length", str(len(svg))) + self.send_header("X-Content-Type-Options", "nosniff") + self.end_headers() + self.wfile.write(svg) + return state = self.server.wizard if not self.authorized(): self.page( diff --git a/pyproject.toml b/pyproject.toml index 97dacff..b2aa735 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,6 +42,7 @@ server = ["gunicorn>=27.0.1,<28"] "coulobre.hosting" = [ "static/hosting/*.js", "static/hosting/*.css", + "static/hosting/*.svg", "templates/*.html", "templates/hosting/*.conf", "templates/hosting/*.html", diff --git a/src/coulobre/hosting/static/hosting/coulobre-mark.svg b/src/coulobre/hosting/static/hosting/coulobre-mark.svg new file mode 100644 index 0000000..16ade11 --- /dev/null +++ b/src/coulobre/hosting/static/hosting/coulobre-mark.svg @@ -0,0 +1,16 @@ + + + + + + diff --git a/src/coulobre/hosting/static/hosting/panel.css b/src/coulobre/hosting/static/hosting/panel.css index 8008682..d20974b 100644 --- a/src/coulobre/hosting/static/hosting/panel.css +++ b/src/coulobre/hosting/static/hosting/panel.css @@ -168,9 +168,21 @@ button, input, select, textarea { place-items: center; border-radius: 0.55rem; background: var(--brand-bg); - color: var(--brand-ink); - font-size: 1.12rem; - font-weight: 800; +} + +.brand-mark::before { + content: ""; + width: 66%; + height: 66%; + background: var(--brand-ink); + mask: url("coulobre-mark.svg") center / contain no-repeat; +} + +@media (forced-colors: active) { + .brand-mark::before { + forced-color-adjust: none; + background: CanvasText; + } } .brand-product { diff --git a/src/coulobre/hosting/templates/hosting/authentication.html b/src/coulobre/hosting/templates/hosting/authentication.html index 06c1ffc..95ea74f 100644 --- a/src/coulobre/hosting/templates/hosting/authentication.html +++ b/src/coulobre/hosting/templates/hosting/authentication.html @@ -4,8 +4,7 @@