diff --git a/.dockerignore b/.dockerignore index 387291a..746447b 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,7 +1,7 @@ # Version control .git .gitignore -.github +.gitea # Dependencies / build output (rebuilt inside the image) node_modules @@ -19,9 +19,9 @@ prisma/dev.db prisma/dev.db-journal prisma/*.db -# Secrets: .env holds file:./dev.db, and .env.local / .env.production hold REAL -# Entra secrets and the RDS password. Baking these into a layer would push them -# to JFrog. All runtime env comes from the k8s Secret instead. +# Secrets: .env holds file:./dev.db, and .env.local / .env.production hold the +# real admin password and the RDS password. Baking these into a layer would push +# them to Harbor. All runtime env comes from the k8s Secret instead. .env .env.* !.env.production.example diff --git a/.env b/.env index e9494fc..d8997bb 100644 --- a/.env +++ b/.env @@ -3,13 +3,12 @@ DATABASE_URL="file:./dev.db" DATABASE_PROVIDER="sqlite" -# SSO secrets are NOT stored here (this file is committed). Dev auth vars live in -# .env.local (gitignored); prod auth vars in .env.production — see .env.production.example. +# Auth secrets are NOT stored here (this file is committed). Dev auth vars live +# in .env.local (gitignored); prod auth vars in .env.production. -# Local break-glass admin login (username/password, in addition to SSO). The -# password is intentionally EMPTY here so local login is DISABLED by default; -# set a real value in the gitignored .env.local (dev) / .env.production (prod). -# Role model: config/users.json maps SSO emails -> "admin" | "user"; unlisted -# SSO emails cannot sign in. The local admin always has the admin role. +# Local admin login (username/password) — the only sign-in path. The password is +# intentionally EMPTY here so login is DISABLED by default; set a real value in +# the gitignored .env.local (dev) / .env.production (prod). The local admin +# always has the admin role. LOCAL_ADMIN_USERNAME="admin" LOCAL_ADMIN_PASSWORD="" diff --git a/.github/workflows/cicd.yaml b/.gitea/workflows/cicd.yaml similarity index 63% rename from .github/workflows/cicd.yaml rename to .gitea/workflows/cicd.yaml index a7193a1..70e1615 100644 --- a/.github/workflows/cicd.yaml +++ b/.gitea/workflows/cicd.yaml @@ -9,10 +9,8 @@ on: jobs: setup: - runs-on: - group: trend-emu-intranet - labels: - - "ubuntu-latest-intranet" + # Gitea Actions: runners are selected by label only (no runner groups). + runs-on: gitea-runner outputs: matrix: ${{ steps.pick.outputs.matrix }} steps: @@ -28,10 +26,7 @@ jobs: build-and-deploy: needs: setup - runs-on: - group: trend-emu-intranet - labels: - - "ubuntu-latest-intranet" + runs-on: gitea-runner strategy: matrix: ${{ fromJSON(needs.setup.outputs.matrix) }} @@ -42,8 +37,12 @@ jobs: cancel-in-progress: true env: - # host/repo, e.g. jfrog.trendmicro.com/ameait-it-cost-dashboard - JFROG_REGISTRY: ${{ secrets.JFROG_REGISTRY }} + # Harbor on the Mac mini host. The runner pod mounts the Docker Desktop + # daemon socket, so from the daemon's point of view the registry is + # reachable as host.docker.internal:8080 (plain HTTP — the daemon must + # list it under "insecure-registries"). Images live in Harbor's + # "library" project. + REGISTRY: host.docker.internal:8080/library DOCKER_BUILDKIT: "1" COMPOSE_DOCKER_CLI_BUILD: "1" @@ -72,80 +71,13 @@ jobs: echo "${{ secrets.KUBE_CONFIG_DATA }}" | base64 -d > "${RUNNER_TEMP}/kubeconfig" chmod 600 "${RUNNER_TEMP}/kubeconfig" - # Temporary debug step: we cannot shell into this self-hosted runner - # directly, so this proves (or disproves) network reachability to the - # k8s API from inside the runner itself, ahead of the image build/push - # so we fail fast instead of waiting ~10 min for the helm timeout. - # Remove once the ACL/connectivity issue is confirmed fixed. - - name: "[DEBUG] Network path to k8s API (6443)" + - name: Login to Harbor run: | - set +e - echo "===== Runner identity / network info =====" - hostname -f 2>/dev/null || hostname - echo "--- Interfaces ---" - ip -brief addr show 2>/dev/null || ifconfig - echo "--- Default route ---" - ip route show 2>/dev/null || route -n - - echo - echo "===== K8s API endpoint (parsed from kubeconfig) =====" - KUBE_HOST=$(grep -m1 'server:' "${KUBECONFIG}" | sed -E 's#.*https?://([^:/]+).*#\1#') - KUBE_PORT=$(grep -m1 'server:' "${KUBECONFIG}" | sed -E 's#.*:([0-9]+)/?.*#\1#') - KUBE_PORT="${KUBE_PORT:-6443}" - echo "Host: ${KUBE_HOST}" - echo "Port: ${KUBE_PORT}" - - echo - echo "===== DNS resolution =====" - getent hosts "${KUBE_HOST}" || nslookup "${KUBE_HOST}" || dig +short "${KUBE_HOST}" - - RESOLVED_IPS=$(getent hosts "${KUBE_HOST}" | awk '{print $1}') - - echo - echo "===== Route to each resolved IP =====" - for ip in ${RESOLVED_IPS}; do - echo "-- ip route get ${ip} --" - ip route get "${ip}" 2>/dev/null || echo "(ip route not available)" - done - - echo - echo "===== TCP connect test per resolved IP (port ${KUBE_PORT}) =====" - for ip in ${RESOLVED_IPS}; do - if timeout 5 bash -c "cat < /dev/null > /dev/tcp/${ip}/${KUBE_PORT}" 2>/dev/null; then - echo "OK ${ip}:${KUBE_PORT} - TCP connect succeeded" - else - echo "FAIL ${ip}:${KUBE_PORT} - TCP connect timed out or refused" - fi - done - - echo - echo "===== TCP connect test via hostname (through NLB, port ${KUBE_PORT}) =====" - if timeout 5 bash -c "cat < /dev/null > /dev/tcp/${KUBE_HOST}/${KUBE_PORT}" 2>/dev/null; then - echo "OK ${KUBE_HOST}:${KUBE_PORT} - TCP connect succeeded" - else - echo "FAIL ${KUBE_HOST}:${KUBE_PORT} - TCP connect timed out or refused" - fi - - echo - echo "===== curl -v (expect HTTP 401/403 = reachable; a hang/timeout = blocked) =====" - curl -v -k --max-time 8 "https://${KUBE_HOST}:${KUBE_PORT}/version" - - echo - echo "===== traceroute (best effort, may be blocked itself) =====" - if command -v traceroute >/dev/null 2>&1; then - traceroute -T -p "${KUBE_PORT}" -w 2 -m 15 "${KUBE_HOST}" || true - else - echo "traceroute not installed on runner, skipping" - fi - set -e - - - name: Login to JFrog - run: | - # JFROG_REGISTRY is host/repo but `docker login` takes only the host. - JFROG_HOST=$(echo "${JFROG_REGISTRY}" | cut -d'/' -f1) - echo "Logging in to ${JFROG_HOST}" - echo "${{ secrets.JFROG_IDENTITY_TOKEN }}" | docker login "${JFROG_HOST}" \ - -u "${{ secrets.JFROG_USERNAME }}" \ + # REGISTRY is host/project but `docker login` takes only the host. + REGISTRY_HOST=$(echo "${REGISTRY}" | cut -d'/' -f1) + echo "Logging in to ${REGISTRY_HOST}" + echo "${{ secrets.HARBOR_PASSWORD }}" | docker login "${REGISTRY_HOST}" \ + -u "${{ secrets.HARBOR_USERNAME }}" \ --password-stdin - name: Determine ref type and release tag @@ -171,8 +103,8 @@ jobs: echo "Ref type: ${{ steps.refinfo.outputs.ref_type }}" echo "Release tag: ${{ steps.refinfo.outputs.release_tag }}" echo "Environment: ${{ matrix.env }}" - echo "Server image: ${JFROG_REGISTRY}/${{ matrix.image_name_server }}" - echo "DB image: ${JFROG_REGISTRY}/${{ matrix.image_name_db }}" + echo "Server image: ${REGISTRY}/${{ matrix.image_name_server }}" + echo "DB image: ${REGISTRY}/${{ matrix.image_name_db }}" docker version helm version kubectl version --client @@ -181,7 +113,7 @@ jobs: run: | REF_TYPE="${{ steps.refinfo.outputs.ref_type }}" RELEASE_TAG="${{ steps.refinfo.outputs.release_tag }}" - IMAGE="${JFROG_REGISTRY}/${{ matrix.image_name_server }}" + IMAGE="${REGISTRY}/${{ matrix.image_name_server }}" BUILD_TAG_ARGS=( -t "${IMAGE}:${{ matrix.latest_tag }}" @@ -209,7 +141,7 @@ jobs: run: | REF_TYPE="${{ steps.refinfo.outputs.ref_type }}" RELEASE_TAG="${{ steps.refinfo.outputs.release_tag }}" - IMAGE="${JFROG_REGISTRY}/${{ matrix.image_name_db }}" + IMAGE="${REGISTRY}/${{ matrix.image_name_db }}" BUILD_TAG_ARGS=( -t "${IMAGE}:${{ matrix.latest_tag }}" @@ -236,12 +168,15 @@ jobs: kubectl create namespace "${{ matrix.namespace }}" \ --dry-run=client -o yaml | kubectl apply -f - - - name: Ensure JFrog pull secret exists + # The kubelet pulls through the same Docker Desktop daemon that built the + # image, so the pull server must match the push host exactly + # (host.docker.internal:8080). + - name: Ensure Harbor pull secret exists run: | - kubectl create secret docker-registry jfrog-registry-creds \ - --docker-server="$(echo "${JFROG_REGISTRY}" | cut -d'/' -f1)" \ - --docker-username="${{ secrets.JFROG_USERNAME }}" \ - --docker-password="${{ secrets.JFROG_IDENTITY_TOKEN }}" \ + kubectl create secret docker-registry harbor-pull-secret \ + --docker-server="$(echo "${REGISTRY}" | cut -d'/' -f1)" \ + --docker-username="${{ secrets.HARBOR_USERNAME }}" \ + --docker-password="${{ secrets.HARBOR_PASSWORD }}" \ --namespace "${{ matrix.namespace }}" \ --dry-run=client -o yaml | kubectl apply -f - @@ -258,16 +193,13 @@ jobs: helm upgrade --install "${{ matrix.release }}" "${{ matrix.chart }}" \ -f "${{ matrix.values_file }}" \ --namespace "${{ matrix.namespace }}" \ - --set server.image.repository="${JFROG_REGISTRY}/${{ matrix.image_name_server }}" \ + --set server.image.repository="${REGISTRY}/${{ matrix.image_name_server }}" \ --set server.image.tag="${{ github.sha }}" \ - --set db.image.repository="${JFROG_REGISTRY}/${{ matrix.image_name_db }}" \ + --set db.image.repository="${REGISTRY}/${{ matrix.image_name_db }}" \ --set db.image.tag="${{ github.sha }}" \ --set-string secrets.authSecret="${{ secrets.AUTH_SECRET_DEV }}" \ --set-string secrets.dbRootPassword="${{ secrets.DB_PASSWORD_DEV }}" \ --set-string secrets.localAdminPassword="${{ secrets.LOCAL_ADMIN_PASSWORD_DEV }}" \ - --set-string secrets.entraClientId="${{ secrets.ENTRA_CLIENT_ID_DEV }}" \ - --set-string secrets.entraClientSecret="${{ secrets.ENTRA_CLIENT_SECRET_DEV }}" \ - --set-string secrets.entraIssuer="${{ secrets.ENTRA_ISSUER_DEV }}" \ --wait --timeout 10m --atomic --debug # ---- PROD DEPLOY (tag push only) ---- @@ -286,16 +218,13 @@ jobs: helm upgrade --install "${{ matrix.release }}" "${{ matrix.chart }}" \ -f "${{ matrix.values_file }}" \ --namespace "${{ matrix.namespace }}" \ - --set server.image.repository="${JFROG_REGISTRY}/${{ matrix.image_name_server }}" \ + --set server.image.repository="${REGISTRY}/${{ matrix.image_name_server }}" \ --set server.image.tag="${TAG}" \ - --set db.image.repository="${JFROG_REGISTRY}/${{ matrix.image_name_db }}" \ + --set db.image.repository="${REGISTRY}/${{ matrix.image_name_db }}" \ --set db.image.tag="${TAG}" \ --set-string secrets.authSecret="${{ secrets.AUTH_SECRET_PROD }}" \ --set-string secrets.dbRootPassword="${{ secrets.DB_PASSWORD_PROD }}" \ --set-string secrets.localAdminPassword="${{ secrets.LOCAL_ADMIN_PASSWORD_PROD }}" \ - --set-string secrets.entraClientId="${{ secrets.ENTRA_CLIENT_ID_PROD }}" \ - --set-string secrets.entraClientSecret="${{ secrets.ENTRA_CLIENT_SECRET_PROD }}" \ - --set-string secrets.entraIssuer="${{ secrets.ENTRA_ISSUER_PROD }}" \ --wait --timeout 10m --atomic --debug # Strictly redundant with immutable image tags: Helm already rolled the @@ -313,7 +242,7 @@ jobs: run: | echo "----- Diagnostics -----" kubectl get deploy,sts,po,svc,ing -n "${{ matrix.namespace }}" -o wide || true - echo "----- PVCs (a Pending PVC = missing gp3 StorageClass; invisible in pod logs) -----" + echo "----- PVCs (a Pending PVC = missing/wrong StorageClass; invisible in pod logs) -----" kubectl get pvc -n "${{ matrix.namespace }}" -o wide || true echo "----- Events -----" kubectl get events -n "${{ matrix.namespace }}" --sort-by=.lastTimestamp || true diff --git a/DEPLOY.md b/DEPLOY.md index 5c4e2d0..cea1004 100644 --- a/DEPLOY.md +++ b/DEPLOY.md @@ -94,38 +94,18 @@ Restart=always ## Authentication & authorization -Sign-in uses Auth.js / NextAuth v5. There are **two** ways in, and access is -**role-based** (`admin` = full access; `user` = read-only dashboard/trend): +Sign-in uses Auth.js / NextAuth v5 with a single sign-in path: -1. **Microsoft Entra ID SSO** — allowed only if the user's email is in the - allowlist (see below). Unlisted emails cannot enter the app (fail closed). -2. **Local username/password** (break-glass admin) — a form on `/login`, - controlled by `LOCAL_ADMIN_USERNAME` / `LOCAL_ADMIN_PASSWORD`. This account is - always `admin` and bypasses the allowlist, so you can always get in to fix a - broken/empty `config/users.json`. +- **Local username/password** — a form on `/login`, controlled by + `LOCAL_ADMIN_USERNAME` / `LOCAL_ADMIN_PASSWORD`. This account always has the + `admin` role. An empty `LOCAL_ADMIN_PASSWORD` disables login entirely (fail + closed). Middleware redirects any unauthenticated request to `/login` and enforces roles -**server-side**: normal users are redirected away from admin pages +**server-side**: non-admin users are redirected away from admin pages (`/cost-registration`, `/cost-item-creation`, `/year-creation`) and any write API call (non-`GET` `/api/*`) returns **403**. Read APIs (`GET /api/*`) stay open to -any signed-in user. The sidebar "Admin" group is also hidden for normal users. - -### Role allowlist — `config/users.json` - -Committed (NOT secret), hand-edited map of **email → role**: - -```json -{ - "Sunny_Ho@trendmicro.com": "admin", - "tom_chien@trendmicro.com": "user" -} -``` - -- Emails are matched **case-insensitively**. -- An email that is absent (or an unreadable/invalid file) ⇒ SSO sign-in denied. -- The role is baked into the session JWT at sign-in, so after editing this file - users must **re-login** (or restart the app) for changes to apply: - `pm2 restart it_cost_dashboard`. +any signed-in user. The sidebar "Admin" group is also hidden for non-admins. ### Required env vars (`.env.production`) @@ -133,32 +113,22 @@ Next.js does **not** load `.env.local` in production, so these must live in `.env.production` on the EC2 host: ```env -AUTH_MICROSOFT_ENTRA_ID_ID="" -AUTH_MICROSOFT_ENTRA_ID_SECRET="" -AUTH_MICROSOFT_ENTRA_ID_ISSUER="https://login.microsoftonline.com//v2.0" AUTH_SECRET="<32-byte random string, e.g. `npx auth secret`>" AUTH_URL="https://" # or set AUTH_TRUST_HOST=true behind a TLS proxy/ALB -# Local break-glass admin. Non-empty password ENABLES the /login form; empty disables it. +# Local admin login. Non-empty password ENABLES the /login form; empty disables it. LOCAL_ADMIN_USERNAME="admin" LOCAL_ADMIN_PASSWORD="" ``` -After changing `config/users.json` or the auth env vars, rebuild and restart: +After changing the auth env vars, rebuild and restart: ```bash rm -rf .next && npm run build:prod && pm2 restart it_cost_dashboard --update-env ``` -In the Entra app registration, add the prod **redirect URI**: - -``` -https:///api/auth/callback/microsoft-entra-id -``` - -(Dev uses `http://localhost:3000/api/auth/callback/microsoft-entra-id`, configured -in the gitignored `.env.local`.) The `AUTH_*` vars are read at both build and -runtime, so they must be present before `npm run build:prod` and at `pm2` start. +The `AUTH_*` vars are read at both build and runtime, so they must be present +before `npm run build:prod` and at `pm2` start. ## Notes diff --git a/Dockerfile b/Dockerfile index 652e555..1023030 100644 --- a/Dockerfile +++ b/Dockerfile @@ -66,12 +66,10 @@ RUN groupadd --system --gid 1001 nodejs \ # .next/standalone ships its own traced node_modules — do NOT copy the # builder's. .next/static is NOT part of standalone and must come separately or -# every CSS/JS chunk 404s. config/ is read at runtime by lookupRole() -# (src/lib/authz.ts) via process.cwd() once SSO is re-enabled. +# every CSS/JS chunk 404s. # NOTE: this repo has no public/ directory; adding a COPY for it would fail. COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static -COPY --from=builder --chown=nextjs:nodejs /app/config ./config USER nextjs diff --git a/config/users.json b/config/users.json deleted file mode 100644 index 2380bce..0000000 --- a/config/users.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "Sunny_Ho@trendmicro.com": "admin", - "tom_chien@trendmicro.com": "user" -} diff --git a/helm/templates/server-secret.yaml b/helm/templates/server-secret.yaml index d57d4ef..f6416a6 100644 --- a/helm/templates/server-secret.yaml +++ b/helm/templates/server-secret.yaml @@ -11,20 +11,15 @@ stringData: # URL-reserved characters (@ : / # ? % + & and space) — keep it [A-Za-z0-9-]. DATABASE_URL: "mysql://root:{{ required "secrets.dbRootPassword is required" .Values.secrets.dbRootPassword }}@{{ include "it-cost-dashboard.dbServiceName" . }}:{{ .Values.db.port }}/{{ .Values.db.database }}" - # Auth.js JWT signing key. Required at runtime even with SSO commented out. + # Auth.js JWT signing key. AUTH_SECRET: {{ required "secrets.authSecret is required" .Values.secrets.authSecret | quote }} AUTH_TRUST_HOST: "true" - # Break-glass local login. Empty disables it entirely (src/auth.ts fails closed). - LOCAL_ADMIN_PASSWORD: {{ .Values.secrets.localAdminPassword | default "" | quote }} + # Local admin login. Empty disables login entirely (src/auth.ts fails + # closed); required loudly here since it is now the only sign-in path. + LOCAL_ADMIN_PASSWORD: {{ required "secrets.localAdminPassword is required" .Values.secrets.localAdminPassword | quote }} - # Microsoft Entra ID SSO. Required: a deploy fails loudly rather than shipping - # a build whose sign-in button 500s. - AUTH_MICROSOFT_ENTRA_ID_ID: {{ required "secrets.entraClientId is required" .Values.secrets.entraClientId | quote }} - AUTH_MICROSOFT_ENTRA_ID_SECRET: {{ required "secrets.entraClientSecret is required" .Values.secrets.entraClientSecret | quote }} - AUTH_MICROSOFT_ENTRA_ID_ISSUER: {{ required "secrets.entraIssuer is required" .Values.secrets.entraIssuer | quote }} - # Derived from the ingress host so the OAuth callback URL always matches what - # is registered in Entra. AUTH_TRUST_HOST alone would leave Auth.js depending - # on X-Forwarded-Proto; if that is ever wrong it builds an http:// callback and - # Entra rejects it with AADSTS50011 (http is invalid for non-localhost). - AUTH_URL: {{ printf "https://%s" (required "ingress.host is required" .Values.ingress.host) | quote }} + # Derived from the ingress host so Auth.js builds correct absolute redirect + # URLs regardless of X-Forwarded-Proto. Local Docker Desktop ingress has no + # TLS, so the scheme is http (override ingress.scheme if TLS is added later). + AUTH_URL: {{ printf "%s://%s" (.Values.ingress.scheme | default "http") (required "ingress.host is required" .Values.ingress.host) | quote }} diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index 6fd2abb..666acfe 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -4,7 +4,7 @@ replicaCount: 1 server: image: - repository: jfrog.trendmicro.com/ameait-it-cost-dashboard/it-cost-dashboard-server-dev + repository: host.docker.internal:8080/library/it-cost-dashboard-server-dev resources: requests: cpu: 100m @@ -15,10 +15,10 @@ server: db: image: - repository: jfrog.trendmicro.com/ameait-it-cost-dashboard/it-cost-dashboard-db-dev + repository: host.docker.internal:8080/library/it-cost-dashboard-db-dev storage: size: 5Gi - storageClassName: gp3 + storageClassName: hostpath resources: requests: cpu: 100m @@ -30,5 +30,6 @@ db: ingress: enabled: true className: nginx - # TODO: point this at a hostname resolving to the ingress-nginx external IP. - host: it-cost-dashboard-dev.trendmicro.com + # Local ingress hostname — map it to the Mac mini's IP (192.168.0.31) in + # /etc/hosts or local DNS. + host: it-cost-dashboard-dev.local diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index 4db4e94..af95ef7 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -4,7 +4,7 @@ replicaCount: 2 server: image: - repository: jfrog.trendmicro.com/ameait-it-cost-dashboard/it-cost-dashboard-server-prod + repository: host.docker.internal:8080/library/it-cost-dashboard-server-prod resources: requests: cpu: 250m @@ -15,10 +15,10 @@ server: db: image: - repository: jfrog.trendmicro.com/ameait-it-cost-dashboard/it-cost-dashboard-db-prod + repository: host.docker.internal:8080/library/it-cost-dashboard-db-prod storage: size: 20Gi - storageClassName: gp3 + storageClassName: hostpath resources: requests: cpu: 250m @@ -30,5 +30,6 @@ db: ingress: enabled: true className: nginx - # TODO: point this at a hostname resolving to the ingress-nginx external IP. - host: it-cost-dashboard-prod.trendmicro.com + # Local ingress hostname — map it to the Mac mini's IP (192.168.0.31) in + # /etc/hosts or local DNS. + host: it-cost-dashboard-prod.local diff --git a/helm/values.yaml b/helm/values.yaml index 6897857..01e893a 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -29,7 +29,8 @@ db: database: it_cost_dashboard storage: size: 5Gi - storageClassName: gp3 + # Docker Desktop's built-in StorageClass. + storageClassName: hostpath resources: requests: cpu: 100m @@ -44,23 +45,19 @@ ingress: host: "" # required per-env secrets: - authSecret: "" # from GitHub secret AUTH_SECRET_ + authSecret: "" # from Gitea secret AUTH_SECRET_ # MySQL root password. MUST be [A-Za-z0-9-] only — it is interpolated into # DATABASE_URL and Helm has no URL-encode function. - dbRootPassword: "" # from GitHub secret DB_ROOT_PASSWORD_ - # Optional; empty disables local login entirely (src/auth.ts fails closed). + dbRootPassword: "" # from Gitea secret DB_ROOT_PASSWORD_ + # Local admin login password. Empty disables login entirely (src/auth.ts + # fails closed), so this is effectively required now that it is the only + # sign-in path. localAdminPassword: "" - # Microsoft Entra ID SSO. Supplied per-env by the CI workflow from GitHub - # secrets; server-secret.yaml marks them required, so a deploy fails loudly - # rather than shipping a build whose sign-in button 500s. - entraClientId: "" - entraClientSecret: "" - entraIssuer: "" -# Pre-created manually, once per namespace (see the deploy notes). Not templated: -# the kubelet needs it independently of Helm. +# Created/refreshed by the CI workflow in each namespace ("Ensure Harbor pull +# secret exists" step). Not templated: the kubelet needs it independently of Helm. imagePullSecrets: - - name: jfrog-registry-creds + - name: harbor-pull-secret nodeSelector: {} tolerations: [] diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx index be388e2..e6e522a 100644 --- a/src/app/login/page.tsx +++ b/src/app/login/page.tsx @@ -7,19 +7,11 @@ function errorMessage(code: string | undefined): string | null { switch (code) { case "CredentialsSignin": return "Invalid username or password"; - case "AccessDenied": - return "Your account is not authorized — contact the administrator"; default: return code ? "Sign-in failed — please try again" : null; } } -// Server action: kick off the Microsoft SSO flow. -async function microsoftLogin() { - "use server"; - await signIn("microsoft-entra-id", { redirectTo: "/" }); -} - // Server action: local username/password login. async function credentialsLogin(formData: FormData) { "use server"; @@ -63,21 +55,6 @@ export default async function LoginPage({ )} -
- -
- -
- - OR - -
-