From 9186a2a7f38b6178cbbd06c41a44991c4a9fc089 Mon Sep 17 00:00:00 2001 From: dingo Date: Fri, 27 Feb 2026 09:47:16 -0500 Subject: [PATCH] Hide sidebar until authenticated; wire Admin seed credentials - MainLayout.razor: wrap shell in so the sidebar and nav are only rendered when the user is logged in. Unauthenticated pages (login) render @Body directly, giving the login card its full viewport without the nav overlay. - deployment-admin.yaml: inject Admin__Email / Admin__Password from sor-app-secrets so the startup seed picks up production credentials. - sor-app-secrets.yaml.template: add Admin__Email / Admin__Password placeholder entries with instructions. - secrets/README.md: document the two new seed-account keys. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude Co-Authored-By: Happy --- .../Components/Layout/MainLayout.razor | 21 ++++++++++++------- deploy/k8s/deployment-admin.yaml | 12 +++++++++++ deploy/secrets/README.md | 16 +++++++------- deploy/secrets/sor-app-secrets.yaml.template | 5 +++++ 4 files changed, 40 insertions(+), 14 deletions(-) diff --git a/Server/src/SOR.Admin/Components/Layout/MainLayout.razor b/Server/src/SOR.Admin/Components/Layout/MainLayout.razor index 2bc161b..453df6c 100644 --- a/Server/src/SOR.Admin/Components/Layout/MainLayout.razor +++ b/Server/src/SOR.Admin/Components/Layout/MainLayout.razor @@ -1,10 +1,17 @@ @inherits LayoutComponentBase -
- -
-
- @Body + + +
+ +
+
+ @Body +
+
-
-
+ + + @Body + +
diff --git a/deploy/k8s/deployment-admin.yaml b/deploy/k8s/deployment-admin.yaml index ab44c4b..d921b99 100644 --- a/deploy/k8s/deployment-admin.yaml +++ b/deploy/k8s/deployment-admin.yaml @@ -64,6 +64,18 @@ spec: name: sor-app-secrets key: Cdn__BucketName + # Initial SuperAdmin seed — created on first startup if the email doesn't exist yet. + - name: Admin__Email + valueFrom: + secretKeyRef: + name: sor-app-secrets + key: Admin__Email + - name: Admin__Password + valueFrom: + secretKeyRef: + name: sor-app-secrets + key: Admin__Password + # ASP.NET Core Data Protection — persists Blazor auth cookies across restarts. # TODO: generate a strong random value and store in sor-app-secrets. - name: DataProtection__ApplicationName diff --git a/deploy/secrets/README.md b/deploy/secrets/README.md index 113a16d..0a4e20a 100644 --- a/deploy/secrets/README.md +++ b/deploy/secrets/README.md @@ -35,14 +35,16 @@ In your Gitea repository → Settings → Secrets, add: | Secret Name | Key | Used By | Notes | |--------------------|----------------------------|-----------------|-------------------------------------------------| -| sor-app-secrets | ConnectionStrings__Default | host + admin | Postgres connection string | -| sor-app-secrets | Cdn__PublicBaseUrl | host + admin | e.g. https://cdn.aeternalisgames.com | +| sor-app-secrets | ConnectionStrings__Default | host + admin | Postgres connection string | +| sor-app-secrets | Admin__Email | admin only | Seed SuperAdmin email (default: admin@sor.local) | +| sor-app-secrets | Admin__Password | admin only | Seed SuperAdmin password (12+ chars required) | +| sor-app-secrets | Cdn__PublicBaseUrl | host + admin | e.g. https://cdn.aeternalisgames.com | | sor-app-secrets | Cdn__EndpointUrl | host + admin | Ceph RadosGW endpoint, e.g. http://172.10.1.60:7480 | -| sor-app-secrets | Cdn__AccessKey | host + admin | S3 access key ID | -| sor-app-secrets | Cdn__SecretKey | host + admin | S3 secret access key | -| sor-app-secrets | Cdn__BucketName | host + admin | S3 bucket name, e.g. sor-assets | -| redis-credentials | connection-string | host only | **Already exists** in stone-server ns | -| harbor-credentials | .dockerconfigjson | both pods | Harbor image pull secret | +| sor-app-secrets | Cdn__AccessKey | host + admin | S3 access key ID | +| sor-app-secrets | Cdn__SecretKey | host + admin | S3 secret access key | +| sor-app-secrets | Cdn__BucketName | host + admin | S3 bucket name, e.g. sor-assets | +| redis-credentials | connection-string | host only | **Already exists** in stone-server ns | +| harbor-credentials | .dockerconfigjson | both pods | Harbor image pull secret | --- diff --git a/deploy/secrets/sor-app-secrets.yaml.template b/deploy/secrets/sor-app-secrets.yaml.template index 4f3fb39..0722082 100644 --- a/deploy/secrets/sor-app-secrets.yaml.template +++ b/deploy/secrets/sor-app-secrets.yaml.template @@ -9,6 +9,11 @@ stringData: # Format: Host=HOST;Port=5432;Database=SOR;Username=USER;Password=PASSWORD; ConnectionStrings__Default: "Host=172.10.1.127;Port=5432;Database=SOR;Username=SOR-DBA;Password=CHANGEME" + # Admin portal seed account — created on first startup if no account with this email exists. + # Password must meet ASP.NET Identity rules: 12+ chars, uppercase, digit, non-alphanumeric. + Admin__Email: "admin@sor.local" + Admin__Password: "CHANGEME_strong_password!" + # CDN (Ceph RadosGW S3-compatible). # PublicBaseUrl: the public-facing URL prefix returned to clients for asset links. # EndpointUrl: internal S3 endpoint (e.g. http://172.10.1.60:7480).