From f26e6ca762c88363c48747f23f8b726be4ec6e41 Mon Sep 17 00:00:00 2001 From: Don Beckham Date: Tue, 23 Jun 2026 02:35:02 -0500 Subject: [PATCH 1/2] Add a source-repository link to the workspace sidebar Surface a configurable link to the project's source repository in the signed-in workspace sidebar. Controlled by the new SOURCE_URL setting (set empty to hide). Adds a backend test asserting the link renders. --- app/config.py | 2 ++ app/static/css/styles.css | 1 + app/templates/app.html | 5 +++++ tests/backend/test_auth.py | 9 +++++++++ 4 files changed, 17 insertions(+) diff --git a/app/config.py b/app/config.py index ca4cfe2..838b4dd 100644 --- a/app/config.py +++ b/app/config.py @@ -19,6 +19,8 @@ class Settings(BaseSettings): brand_domain: str = "beckham.ai" # Public origin the app is served from (used to build absolute share links). base_url: str = "https://share.beckham.ai" + # Source-repository link surfaced in the signed-in workspace. Set empty to hide. + source_url: str = "https://github.com/dabeckham/beckham-share" # Signs the session cookie. MUST be set to a long random value in prod. secret_key: str = "dev-insecure-change-me" diff --git a/app/static/css/styles.css b/app/static/css/styles.css index 6237b34..019939f 100644 --- a/app/static/css/styles.css +++ b/app/static/css/styles.css @@ -104,6 +104,7 @@ body { .side-link:hover { background: #f1f4f9; color: var(--ink); } .side-link.active { background: #eaf1ff; color: var(--blue); } .usage { margin-top: auto; color: var(--muted); font-size: 13px; padding: 12px; } +.source-link { font-size: 13px; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--line); } .filespane { padding: 28px 32px; } .filespane-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; } diff --git a/app/templates/app.html b/app/templates/app.html index f0d9c61..8af2514 100644 --- a/app/templates/app.html +++ b/app/templates/app.html @@ -13,6 +13,11 @@ All files
Storage used: {{ usage }}
+ {% if settings.source_url %} + + + View source + {% endif %}
diff --git a/tests/backend/test_auth.py b/tests/backend/test_auth.py index b1241d4..0e96e16 100644 --- a/tests/backend/test_auth.py +++ b/tests/backend/test_auth.py @@ -18,6 +18,15 @@ def test_member_reaches_app(client, member): assert client.get("/app").status_code == 200 +def test_member_sees_source_link(client, member): + from app.config import settings + + r = client.get("/app") + assert r.status_code == 200 + assert settings.source_url + assert settings.source_url in r.text + + def test_api_upload_forbidden_for_anonymous(client): r = client.post("/api/files", files={"file": ("x.txt", b"x", "text/plain")}, data={"expiry_hours": "24"}) assert r.status_code == 403 From 8b07a13f7ca12e0d3a649d281aea087b93df96d7 Mon Sep 17 00:00:00 2001 From: Don Beckham Date: Tue, 23 Jun 2026 02:35:27 -0500 Subject: [PATCH 2/2] Document SOURCE_URL in .env.example --- .env.example | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.env.example b/.env.example index 2896475..83e4b94 100644 --- a/.env.example +++ b/.env.example @@ -6,6 +6,9 @@ # the authenticated flow to this host. BASE_URL=https://share.beckham.ai +# Source-repository link shown in the signed-in workspace sidebar. Leave blank to hide. +SOURCE_URL=https://github.com/dabeckham/beckham-share + # Session cookie signing key + database password — random, set by generate-secrets.sh. SECRET_KEY=CHANGE_ME DB_PASSWORD=CHANGE_ME