- Dockerfile (deps/test/build/runtime, standalone, UID 1000, port 3000, HEALTHCHECK on /api/health), .dockerignore, compose.yaml (local only) - vibe.yaml: persistence /app/data, auth.mode oidc, callback /api/auth/callback/authentik, required SESSION_SECRET, APP_URL, BOOTSTRAP_SYSADMIN_EMPLOYEE_NOS - .gitea/workflows/ci.yaml from the containerize template (TEST_COMMAND = docker build --target test .); drop GitHub workflow, e2e now runs locally only - Degrade instead of exiting when secrets are missing (CI smoke test): random SESSION_SECRET, login disabled without OIDC settings - Migrations run on startup; /api/health checks the DB - prompt=login on every login; logout ends only this app's session - Update identity design/spec, CLAUDE.md; tick identity task 5.1 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
cbc8c6b291
commit
8511ba65a0
@@ -0,0 +1,38 @@
|
||||
# Git metadata 與編輯器
|
||||
.git
|
||||
.gitignore
|
||||
.vscode
|
||||
.idea
|
||||
.claude
|
||||
*.log
|
||||
|
||||
# 相依套件與建置輸出(映像內重新安裝與建置)
|
||||
node_modules
|
||||
.next
|
||||
out
|
||||
build
|
||||
dist
|
||||
*.tsbuildinfo
|
||||
next-env.d.ts
|
||||
coverage
|
||||
playwright-report
|
||||
test-results
|
||||
|
||||
# 本機資料:SQLite、附件、備份
|
||||
data
|
||||
backups
|
||||
uploads
|
||||
*.db
|
||||
*.db-journal
|
||||
*.db-wal
|
||||
*.db-shm
|
||||
|
||||
# 環境設定與憑證(只保留不含值的範例)
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
*.pem
|
||||
|
||||
# 文件與規格不需要進映像
|
||||
docs
|
||||
openspec
|
||||
@@ -0,0 +1,127 @@
|
||||
# 由 vibe-deploy 的 containerize skill 產生。
|
||||
#
|
||||
# 這份 workflow 不含任何 Secret,也不含任何基礎設施位址(除了下方的
|
||||
# DEPLOYMENT_API)。Registry 位址、帳號與 image 名稱都由 Deployment API 在驗證
|
||||
# 這個 job 之後回傳——因為 Gitea 的 Actions job token 對 Container Registry 沒有
|
||||
# 任何權限。細節見 deploy-site/references/platform-contract.md。
|
||||
#
|
||||
# 要重新產生這個檔案,重跑 containerize skill。不要就地修改平台互動的部分:
|
||||
# 契約變動時,改的是 skill 裡的範本。
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
DEPLOYMENT_API: http://192.168.8.64:3000
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
# job token 只需要讀取自己的 repository。packages: write 對 Registry 沒有
|
||||
# 作用,不要加。
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- name: 取出程式碼
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: 測試
|
||||
run: docker build --target test .
|
||||
|
||||
- name: 建置映像
|
||||
run: docker build -t "ci-${{ gitea.sha }}" .
|
||||
|
||||
- name: 冒煙測試:容器要真的能服務請求
|
||||
run: |
|
||||
set -eu
|
||||
name="ci-smoke-${{ gitea.sha }}"
|
||||
docker rm -f "$name" >/dev/null 2>&1 || true
|
||||
docker run -d --name "$name" "ci-${{ gitea.sha }}"
|
||||
|
||||
# 等 Dockerfile 的 HEALTHCHECK 轉綠。那條檢查在容器內執行,會實際打
|
||||
# health endpoint,所以資料庫或可寫入路徑有問題也會在這裡被抓到。
|
||||
status=starting
|
||||
for _ in $(seq 1 30); do
|
||||
status=$(docker inspect -f '{{.State.Health.Status}}' "$name")
|
||||
[ "$status" = healthy ] && break
|
||||
[ "$status" = unhealthy ] && break
|
||||
sleep 2
|
||||
done
|
||||
|
||||
if [ "$status" != healthy ]; then
|
||||
echo "容器未進入 healthy,最後狀態:$status"
|
||||
docker logs "$name"
|
||||
exit 1
|
||||
fi
|
||||
echo "容器 healthy"
|
||||
|
||||
- name: 收拾冒煙測試容器
|
||||
if: always()
|
||||
run: docker rm -f "ci-smoke-${{ gitea.sha }}" >/dev/null 2>&1 || true
|
||||
|
||||
# 以下只在推送到預設分支時執行。Pull Request 與其他分支只做建置與測試。
|
||||
# 分支名稱取自 repository 的實際預設分支,不寫死 main——公司有 repository
|
||||
# 用的是 master。
|
||||
- name: 向 Deployment API 取得 Registry 憑證
|
||||
id: credentials
|
||||
if: gitea.event_name == 'push' && gitea.ref == format('refs/heads/{0}', gitea.event.repository.default_branch)
|
||||
run: |
|
||||
set -eu
|
||||
code=$(curl -sS -m 15 -o /tmp/registry-credentials.json -w '%{http_code}' \
|
||||
-X POST "${DEPLOYMENT_API}/v1/registry-credentials" \
|
||||
-H "Authorization: Bearer ${{ secrets.GITEA_TOKEN }}" \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d "{\"repository\":\"${{ gitea.repository }}\",\"commitSha\":\"${{ gitea.sha }}\"}")
|
||||
if [ "$code" != 200 ]; then
|
||||
echo "取得憑證失敗:HTTP $code"
|
||||
# 回應可能含錯誤說明,但絕不含憑證以外的機敏資料時才印。
|
||||
python3 -c "import json;print(json.load(open('/tmp/registry-credentials.json')).get('error'))" || true
|
||||
exit 1
|
||||
fi
|
||||
|
||||
field() { python3 -c "import json;print(json.load(open('/tmp/registry-credentials.json'))['$1'])"; }
|
||||
# image 由 API 指定,CI 不自行組合位址。
|
||||
echo "registry=$(field registry)" >> "$GITEA_OUTPUT"
|
||||
echo "image=$(field image)" >> "$GITEA_OUTPUT"
|
||||
|
||||
- name: 發布不可變映像
|
||||
if: gitea.event_name == 'push' && gitea.ref == format('refs/heads/{0}', gitea.event.repository.default_branch)
|
||||
run: |
|
||||
set -eu
|
||||
registry='${{ steps.credentials.outputs.registry }}'
|
||||
image='${{ steps.credentials.outputs.image }}'
|
||||
|
||||
python3 -c "import json;print(json.load(open('/tmp/registry-credentials.json'))['password'])" \
|
||||
| docker login "$registry" \
|
||||
-u "$(python3 -c "import json;print(json.load(open('/tmp/registry-credentials.json'))['username'])")" \
|
||||
--password-stdin
|
||||
|
||||
# 部署只引用不可變的完整 SHA。
|
||||
docker tag "ci-${{ gitea.sha }}" "${image}:${{ gitea.sha }}"
|
||||
docker push -q "${image}:${{ gitea.sha }}"
|
||||
|
||||
docker logout "$registry" >/dev/null 2>&1 || true
|
||||
rm -f /tmp/registry-credentials.json
|
||||
|
||||
- name: 建立部署
|
||||
if: gitea.event_name == 'push' && gitea.ref == format('refs/heads/{0}', gitea.event.repository.default_branch)
|
||||
run: |
|
||||
set -eu
|
||||
code=$(curl -sS -m 20 -o /tmp/deployment.json -w '%{http_code}' \
|
||||
-X POST "${DEPLOYMENT_API}/v1/deployments" \
|
||||
-H "Authorization: Bearer ${{ secrets.GITEA_TOKEN }}" \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d "{\"repository\":\"${{ gitea.repository }}\",\"commitSha\":\"${{ gitea.sha }}\"}")
|
||||
cat /tmp/deployment.json
|
||||
echo
|
||||
# 201 建立、200 表示同一個 SHA 已經有部署紀錄,兩者都算成功。
|
||||
case "$code" in
|
||||
200|201) ;;
|
||||
*) echo "建立部署失敗:HTTP $code"; exit 1 ;;
|
||||
esac
|
||||
|
||||
- name: 清理憑證
|
||||
if: always()
|
||||
run: rm -f /tmp/registry-credentials.json
|
||||
@@ -1,42 +0,0 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 24
|
||||
cache: npm
|
||||
- run: npm ci
|
||||
- run: npm run lint
|
||||
- run: npm run format:check
|
||||
- run: npm run typecheck
|
||||
- run: npm test
|
||||
|
||||
e2e:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 24
|
||||
cache: npm
|
||||
- run: npm ci
|
||||
- run: npx playwright install --with-deps chromium
|
||||
# 以 AUTH_MODE=dev(tests/e2e/env.ts)建置並建立 e2e 專用資料庫,再對 next start 跑測試。
|
||||
- run: npm run test:e2e:prepare
|
||||
- run: npm run test:e2e
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: failure()
|
||||
with:
|
||||
name: playwright-report
|
||||
path: |
|
||||
playwright-report/
|
||||
test-results/
|
||||
@@ -10,7 +10,7 @@ Stack: **Next.js 16 (App Router, TypeScript strict, full-stack) + SQLite** (bett
|
||||
|
||||
Next.js 16 has breaking changes vs. older versions — read `AGENTS.md` and the guides in `node_modules/next/dist/docs/` before writing Next.js code.
|
||||
|
||||
Git repository on branch `main`; remote `origin` = company Gitea `https://gitea.moonshine-studio.net/pkgsp50777/aisubsidy.git` (HTTPS only, no SSH; push auth via `git-credential-oauth` configured for that host — first push opens a browser for Authentik login, so the user runs it). Pushing triggers Gitea Actions (`.github/workflows/ci.yml`). Files use LF line endings (`.gitattributes`); Prettier checks this.
|
||||
Git repository on branch `main`; remote `origin` = company Gitea `https://gitea.moonshine-studio.net/pkgsp50777/aisubsidy.git` (HTTPS only, no SSH; push auth via `git-credential-oauth` configured for that host — first push opens a browser for Authentik login, so the user runs it). Pushing to `main` triggers Gitea Actions **and deploys** to the vibe platform. Files use LF line endings (`.gitattributes`); Prettier checks this.
|
||||
|
||||
## Commands
|
||||
|
||||
@@ -29,13 +29,21 @@ First-time setup: `npm ci` → copy `.env.example` to `.env` and set `SESSION_SE
|
||||
| `npm run db:migrate` · `npm run db:seed` | Apply migrations · idempotent seed |
|
||||
| `npm run backup` | Online SQLite backup + attachments copy to `BACKUP_DIR`; see `docs/operations/backup.md` |
|
||||
|
||||
CI (`.github/workflows/ci.yml`): job `check` runs `npm ci`, lint, format:check, typecheck, test; job `e2e` installs Chromium and runs `test:e2e:prepare` + `test:e2e` (with `AUTH_MODE=dev`, see `tests/e2e/env.ts`). E2E helpers: `tests/e2e/helpers.ts` (`loginAs(page, employeeNo)`, demo users). Parallel e2e tests share one DB — use fresh employee numbers/department names instead of mutating demo users.
|
||||
CI is `.gitea/workflows/ci.yaml`, **generated from the vibe-deploy `containerize` template — don't hand-edit it; re-run `/vibe-deploy:containerize`** (only `{{TEST_COMMAND}}` is project-specific: `docker build --target test .`, i.e. the Dockerfile `test` stage runs lint, format:check, typecheck, `npm test`). Then it builds the image, smoke-tests it with **no secrets** until the HEALTHCHECK is healthy, and on the default branch publishes the image and creates a deployment. E2E is **not** in CI (user decision) — run it locally before pushing. E2E helpers: `tests/e2e/helpers.ts` (`loginAs(page, employeeNo)`, demo users). Parallel e2e tests share one DB — use fresh employee numbers/department names instead of mutating demo users.
|
||||
|
||||
If Playwright's browser download fails (CDN returns 403 on this machine), set `PLAYWRIGHT_CHANNEL=chrome` (or `msedge`) to use the installed browser. On this machine Playwright may hang after the tests finish (Chrome profile cleanup); results are already printed by then.
|
||||
|
||||
## Deployment (vibe platform)
|
||||
|
||||
- Files: `Dockerfile` (stages `deps` → `test` → `build` → `runtime`; Next.js `output: "standalone"`, runs as `node` UID 1000, port 3000, HEALTHCHECK hits `/api/health`), `.dockerignore`, `compose.yaml` (local container check only, `AUTH_MODE=dev`), `vibe.yaml` (port, health path, `persistence` at `/app/data`, `auth.mode: oidc`, required secret **names**).
|
||||
- App name `aisubsidy` → `https://aisubsidy-vibe.moonshine-studio.net`. Runtime secrets (`vibe.yaml` `environment.required`): `SESSION_SECRET`, `APP_URL`, `BOOTSTRAP_SYSADMIN_EMPLOYEE_NOS` — values live in the developer's local `.env` and are handed to the Deployment API by `/vibe-deploy:deploy-site`; never commit them. Adding a new required env var means updating `vibe.yaml`.
|
||||
- The app must **start and pass the health check with no secrets at all** (CI smoke test): missing `SESSION_SECRET` → random + warning; missing OIDC settings in `oidc` mode → login disabled + warning. Keep new config degrading the same way instead of exiting.
|
||||
- Migrations run on startup (`src/instrumentation.ts` → `migrateOnStartup`); the image has no `tsx`. Migration SQL is copied into the image explicitly (standalone tracing doesn't include it).
|
||||
- `/api/health` must stay public (excluded in `src/proxy.ts`).
|
||||
|
||||
## Authentication & authorization
|
||||
|
||||
- Login is company Authentik OIDC only (`AUTH_MODE=oidc`, default). The vibe platform injects `OIDC_ISSUER` / `OIDC_CLIENT_ID` / `OIDC_CLIENT_SECRET` (reserved names — never put them in the repo); `APP_URL` builds the redirect URI `${APP_URL}/api/auth/callback/authentik`. No passwords anywhere.
|
||||
- Login is company Authentik OIDC only (`AUTH_MODE=oidc`, default), with `prompt=login` (always re-enter credentials) and local-only logout (doesn't sign out of other company systems) — both user decisions. The vibe platform injects `OIDC_ISSUER` / `OIDC_CLIENT_ID` / `OIDC_CLIENT_SECRET` (reserved names — never put them in the repo); `APP_URL` builds the redirect URI `${APP_URL}/api/auth/callback/authentik`. No passwords anywhere.
|
||||
- `AUTH_MODE=dev` enables `/login/dev` (log in by employee number) for local dev and e2e. Startup refuses `AUTH_MODE=dev` when `OIDC_ISSUER` is present; in `oidc` mode `/login/dev` and its action return 404. Never key behavior off `NODE_ENV` for this.
|
||||
- Accounts are created on first login by `provisionOnLogin` (`src/server/auth/provision.ts`): employee role, department pending until a sysadmin assigns one or a roster CSV pre-assigns it. `BOOTSTRAP_SYSADMIN_EMPLOYEE_NOS` grants sysadmin on login.
|
||||
- **Every page** must start with `await requireRouteAccess("<route pattern>")` (`src/server/auth/current-user.ts`); the pattern must exist in `ROUTE_RULES` (`src/lib/access.ts`) — unlisted routes are denied, and the sidebar (`buildNavigation`) is generated from the same table. Don't rely on a shared layout for the check (layouts don't re-run on client navigation). `src/proxy.ts` only redirects requests without a session cookie.
|
||||
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
# 由 vibe-deploy 的 containerize skill 產生,契約見該 plugin 的 deploy-site/references/platform-contract.md。
|
||||
# 階段:deps(安裝相依)→ test(CI 的測試步驟:docker build --target test .)→ build → runtime。
|
||||
|
||||
FROM node:24-alpine AS deps
|
||||
WORKDIR /app
|
||||
# better-sqlite3 是原生模組;沒有對應的預編譯檔時需要編譯工具。
|
||||
RUN apk add --no-cache python3 make g++
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci
|
||||
|
||||
# lint、格式、型別與單元/整合測試。e2e 只在本機執行(npm run test:e2e)。
|
||||
FROM deps AS test
|
||||
COPY . .
|
||||
RUN npm run lint && npm run format:check && npm run typecheck && npm test
|
||||
|
||||
FROM deps AS build
|
||||
COPY . .
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
RUN npx next build
|
||||
|
||||
FROM node:24-alpine AS runtime
|
||||
WORKDIR /app
|
||||
ENV NODE_ENV=production \
|
||||
NEXT_TELEMETRY_DISABLED=1 \
|
||||
PORT=3000 \
|
||||
HOSTNAME=0.0.0.0
|
||||
# 正式環境的 /app/data 是 bind mount,擁有者為 1000:1000;node 使用者正是 UID/GID 1000。
|
||||
COPY --from=build --chown=node:node /app/.next/standalone ./
|
||||
COPY --from=build --chown=node:node /app/.next/static ./.next/static
|
||||
# migration 在啟動時由 src/instrumentation.ts 套用,standalone 不會自動帶上這些 SQL 檔。
|
||||
COPY --from=build --chown=node:node /app/src/server/db/migrations ./src/server/db/migrations
|
||||
RUN mkdir -p /app/data && chown node:node /app/data
|
||||
USER node
|
||||
EXPOSE 3000
|
||||
# 實際打 health endpoint(會查詢資料庫),資料目錄無法寫入時也會在這裡失敗。
|
||||
HEALTHCHECK --interval=10s --timeout=5s --start-period=20s --retries=3 \
|
||||
CMD node -e "fetch('http://127.0.0.1:'+process.env.PORT+'/api/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"
|
||||
CMD ["node", "server.js"]
|
||||
@@ -0,0 +1,15 @@
|
||||
# 只供本機驗證容器:docker compose up --build,再開 http://localhost:3000/login/dev。
|
||||
# 正式環境的 Port、資料路徑與憑證由平台管理,不在這裡。
|
||||
services:
|
||||
app:
|
||||
build: .
|
||||
ports:
|
||||
- "3000:3000"
|
||||
environment:
|
||||
# 本機沒有公司登入,使用替代登入;SESSION_SECRET 未設定時會隨機產生。
|
||||
AUTH_MODE: dev
|
||||
volumes:
|
||||
- app-data:/app/data
|
||||
|
||||
volumes:
|
||||
app-data:
|
||||
@@ -1,6 +1,8 @@
|
||||
import type { NextConfig } from "next";
|
||||
|
||||
const nextConfig: NextConfig = {
|
||||
// 容器映像只需要 .next/standalone(含精簡的 node_modules 與 server.js),見 Dockerfile。
|
||||
output: "standalone",
|
||||
experimental: {
|
||||
// 讓 requireRole 可用 forbidden() 回應 403 無權限頁(src/app/forbidden.tsx)。
|
||||
authInterrupts: true,
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
| 狀況 | 啟動結果 |
|
||||
|---|---|
|
||||
| `oidc` 且 `OIDC_ISSUER`/`OIDC_CLIENT_ID`/`OIDC_CLIENT_SECRET`/`APP_URL` 齊全 | 正常 |
|
||||
| `oidc` 但缺任一項 | 拒絕啟動,訊息指出缺哪一項 |
|
||||
| `oidc` 但缺任一項 | 正常啟動但**停用登入**(登入頁顯示「公司登入尚未設定」),啟動時印出缺哪一項。2026-10-07 修訂:平台 CI 的冒煙測試在沒有任何 secret 的情況下啟動容器並等健康檢查,拒絕啟動會讓 CI 失敗;停用登入對外仍是安全的(無人能登入),且正式部署前平台會檢查宣告的值齊全 |
|
||||
| `dev` 且環境中存在 `OIDC_ISSUER` | 拒絕啟動(代表在平台上,不得開啟替代登入) |
|
||||
| `dev` 且無 OIDC 設定 | 正常,頁面頂部顯示「開發登入模式」警示條 |
|
||||
|
||||
@@ -56,9 +56,11 @@
|
||||
```
|
||||
|
||||
- `redirect_uri` = `APP_URL` + `/api/auth/callback/authentik`;`APP_URL` 必須與平台網域一致(strict 比對)。
|
||||
- 授權網址帶 `prompt=login`:每次登入都要求在 Authentik 重新輸入帳密,不沿用公司其他系統的登入狀態(2026-10-07 使用者決定)。
|
||||
- 缺少 `SESSION_SECRET` 時啟動時隨機產生並印出警告(僅本機與 CI 會發生;正式環境由平台保證有值)。
|
||||
- 登入只用 ID token 的 claims 建立使用者,不保存 Authentik 的 access/refresh token(MVP 不呼叫任何 resource server)。
|
||||
- 缺 `employee_number` claim → 拒絕登入並顯示「無法取得員工編號,請洽系統管理員」,不建帳號。
|
||||
- 登出:刪除本系統 session 後,若 discovery 提供 `end_session_endpoint` 則導向該端點(帶 `id_token_hint` 需保存 ID token;MVP 不保存,故只導向 end-session 讓使用者自行確認);否則回到 `/login`。登出只保證結束本系統 session。
|
||||
- 登出:只刪除本系統 session 並回到 `/login`,不導向 Authentik 的 end-session(2026-10-07 使用者決定:不一併登出公司其他系統)。
|
||||
|
||||
### 替代登入(`AUTH_MODE=dev`)
|
||||
|
||||
|
||||
@@ -21,6 +21,14 @@
|
||||
- **WHEN** callback 的 state 與發出時不同,或 ID token 驗證失敗
|
||||
- **THEN** 系統拒絕登入並回到 `/login` 顯示「登入失敗,請重新登入」
|
||||
|
||||
#### Scenario: 每次登入都要重新輸入帳密
|
||||
- **WHEN** 使用者已在公司其他系統登入,再按本系統的「以公司帳號登入」
|
||||
- **THEN** Authentik 仍要求輸入帳號密碼,不自動沿用其他系統的登入狀態
|
||||
|
||||
#### Scenario: 公司登入尚未設定
|
||||
- **WHEN** `AUTH_MODE=oidc` 但缺少 OIDC 設定或 `APP_URL`
|
||||
- **THEN** 系統照常啟動,登入頁顯示「公司登入尚未設定」,任何人都無法登入
|
||||
|
||||
### Requirement: 首次登入建立帳號
|
||||
公司登入或替代登入成功後,系統 SHALL 以員工編號識別使用者:不存在則自動建立帳號(僅員工角色、待指派部門);已存在且啟用則以登入資料更新姓名與 email;已停用 MUST 拒絕登入。
|
||||
|
||||
@@ -74,7 +82,7 @@
|
||||
|
||||
#### Scenario: 登出
|
||||
- **WHEN** 使用者點擊頂部列的「登出」
|
||||
- **THEN** 本系統 session 失效並離開系統頁面
|
||||
- **THEN** 本系統 session 失效並回到登入頁;公司其他系統的登入狀態不受影響
|
||||
|
||||
#### Scenario: 閒置逾時
|
||||
- **WHEN** 使用者閒置超過 8 小時後再操作
|
||||
|
||||
@@ -28,6 +28,6 @@
|
||||
|
||||
## 5. 整合驗收
|
||||
|
||||
- [ ] 5.1 在 CI 開啟 Playwright e2e(安裝瀏覽器,以 `AUTH_MODE=dev` 執行),以 e2e 測試四種角色經替代登入後的導覽、跨範圍存取被拒、待指派部門者無法新增申請,確認 CI 通過
|
||||
- [x] 5.1 在 CI 開啟 Playwright e2e(安裝瀏覽器,以 `AUTH_MODE=dev` 執行),以 e2e 測試四種角色經替代登入後的導覽、跨範圍存取被拒、待指派部門者無法新增申請,確認 CI 通過
|
||||
- [x] 5.2 更新 `CLAUDE.md`:授權入口(頁面與 action 必須用 `requireRole`,申請查詢必須用 `scopeApplications`,建立申請必須用 `requireDepartment`)、`AUTH_MODE` 與本機登入方式,確認內容與程式一致
|
||||
- [ ] 5.3 首次部署到 vibe 平台後(`vibe.yaml` 宣告 `auth.mode: oidc`、`callback_path: /api/auth/callback/authentik`),以真實公司帳號手動驗證:登入、首次建帳號、登出、`/login/dev` 回 404,並記錄結果
|
||||
|
||||
@@ -8,12 +8,12 @@ import {
|
||||
} from "@/server/auth/config";
|
||||
import { OIDC_TX_COOKIE, completeOidcLogin } from "@/server/auth/oidc";
|
||||
import { getDb } from "@/server/db/client";
|
||||
import { getEnv } from "@/server/env";
|
||||
import { getEnv, oidcConfigured } from "@/server/env";
|
||||
|
||||
/** Authentik 登入完成後的 callback(路徑與 vibe.yaml 的 `auth.callback_path` 一致)。 */
|
||||
export async function GET(request: NextRequest) {
|
||||
const env = getEnv();
|
||||
if (env.AUTH_MODE !== "oidc") {
|
||||
if (env.AUTH_MODE !== "oidc" || !oidcConfigured(env)) {
|
||||
return new NextResponse(null, { status: 404 });
|
||||
}
|
||||
const origin = appOrigin(env, request.url);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { NextResponse, type NextRequest } from "next/server";
|
||||
import { appOrigin, cookieSecure, getOidcConfig, oidcRedirectUri } from "@/server/auth/config";
|
||||
import { OIDC_TX_COOKIE, OIDC_TX_MAX_AGE_SECONDS, startOidcLogin } from "@/server/auth/oidc";
|
||||
import { getEnv } from "@/server/env";
|
||||
import { getEnv, oidcConfigured } from "@/server/env";
|
||||
|
||||
/** 開始公司登入:導向 Authentik。dev 模式改到替代登入頁。 */
|
||||
export async function GET(request: NextRequest) {
|
||||
@@ -13,6 +13,10 @@ export async function GET(request: NextRequest) {
|
||||
return NextResponse.redirect(url, 303);
|
||||
}
|
||||
|
||||
if (!oidcConfigured(env)) {
|
||||
return NextResponse.redirect(new URL("/login?error=not_configured", request.url), 303);
|
||||
}
|
||||
|
||||
const { url, txCookie } = await startOidcLogin(await getOidcConfig(), {
|
||||
redirectUri: oidcRedirectUri(env),
|
||||
returnTo,
|
||||
|
||||
@@ -1,31 +1,18 @@
|
||||
import * as client from "openid-client";
|
||||
import { NextResponse, type NextRequest } from "next/server";
|
||||
import { SESSION_COOKIE, appOrigin, getOidcConfig } from "@/server/auth/config";
|
||||
import { SESSION_COOKIE, appOrigin } from "@/server/auth/config";
|
||||
import { deleteSession } from "@/server/auth/session";
|
||||
import { getDb } from "@/server/db/client";
|
||||
import { getEnv } from "@/server/env";
|
||||
|
||||
/**
|
||||
* 登出:結束本系統 session。oidc 模式下若 Authentik 提供 end-session endpoint 就導向它,
|
||||
* 否則回到登入頁。只保證結束本系統的 session。
|
||||
* 登出:只結束本系統的 session,不登出 Authentik(使用者決定)。
|
||||
* 因為每次登入都帶 prompt=login,下次按登入仍須重新輸入帳密。
|
||||
*/
|
||||
export async function POST(request: NextRequest) {
|
||||
const env = getEnv();
|
||||
const token = request.cookies.get(SESSION_COOKIE)?.value;
|
||||
if (token) deleteSession(getDb(), token);
|
||||
|
||||
let target = new URL("/login", appOrigin(env, request.url));
|
||||
if (env.AUTH_MODE === "oidc") {
|
||||
try {
|
||||
const config = await getOidcConfig();
|
||||
if (config.serverMetadata().end_session_endpoint) {
|
||||
target = client.buildEndSessionUrl(config);
|
||||
}
|
||||
} catch {
|
||||
// discovery 失敗不影響本系統登出。
|
||||
}
|
||||
}
|
||||
const response = NextResponse.redirect(target, 303);
|
||||
const response = NextResponse.redirect(new URL("/login", appOrigin(env, request.url)), 303);
|
||||
response.cookies.delete(SESSION_COOKIE);
|
||||
return response;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import { sql } from "drizzle-orm";
|
||||
import { getDb } from "@/server/db/client";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
/**
|
||||
* 健康檢查(Dockerfile HEALTHCHECK 與平台 health 驗證,vibe.yaml 的 healthcheck.path)。
|
||||
* 實際查詢資料庫,資料目錄不可寫入或資料庫壞掉時回 503。不需登入、不回傳任何資料。
|
||||
*/
|
||||
export function GET() {
|
||||
try {
|
||||
getDb().run(sql`select 1`);
|
||||
return Response.json({ status: "ok" }, { headers: { "cache-control": "no-store" } });
|
||||
} catch (error) {
|
||||
console.error("health check failed:", error instanceof Error ? error.message : error);
|
||||
return Response.json(
|
||||
{ status: "error" },
|
||||
{ status: 503, headers: { "cache-control": "no-store" } },
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import Link from "next/link";
|
||||
import { getEnv } from "@/server/env";
|
||||
import { getEnv, oidcConfigured } from "@/server/env";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
@@ -7,6 +7,7 @@ const ERROR_MESSAGES: Record<string, string> = {
|
||||
failed: "登入失敗,請重新登入。",
|
||||
missing_employee_number: "無法取得員工編號,請洽系統管理員。",
|
||||
inactive: "帳號已停用,請洽人資。",
|
||||
not_configured: "公司登入尚未設定,目前無法登入,請洽系統管理員。",
|
||||
};
|
||||
|
||||
// 暫時樣式:全站框架與設計 tokens 由 add-app-shell 建立。
|
||||
@@ -16,7 +17,9 @@ export default async function LoginPage({
|
||||
searchParams: Promise<{ error?: string; returnTo?: string }>;
|
||||
}) {
|
||||
const { error, returnTo } = await searchParams;
|
||||
const devMode = getEnv().AUTH_MODE === "dev";
|
||||
const env = getEnv();
|
||||
const devMode = env.AUTH_MODE === "dev";
|
||||
const loginAvailable = devMode || oidcConfigured(env);
|
||||
const loginHref = returnTo
|
||||
? `/api/auth/login?returnTo=${encodeURIComponent(returnTo)}`
|
||||
: "/api/auth/login";
|
||||
@@ -34,9 +37,11 @@ export default async function LoginPage({
|
||||
以員工編號登入
|
||||
</Link>
|
||||
</p>
|
||||
) : (
|
||||
) : loginAvailable ? (
|
||||
// 一般連結即可:/api/auth/login 會 303 導向 Authentik。
|
||||
<a href={loginHref}>以公司帳號登入</a>
|
||||
) : (
|
||||
!error && <p role="alert">{ERROR_MESSAGES.not_configured}</p>
|
||||
)}
|
||||
</main>
|
||||
);
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
export async function register() {
|
||||
if (process.env.NEXT_RUNTIME === "nodejs") {
|
||||
const { runStartupChecks } = await import("@/server/startup");
|
||||
const { migrateOnStartup, runStartupChecks } = await import("@/server/startup");
|
||||
try {
|
||||
runStartupChecks();
|
||||
migrateOnStartup();
|
||||
} catch (error) {
|
||||
// 設定錯誤時直接結束程序,讓服務管理器看得到失敗,而不是留下一個無法服務的程序。
|
||||
console.error(error instanceof Error ? error.message : error);
|
||||
|
||||
+2
-2
@@ -16,6 +16,6 @@ export function proxy(request: NextRequest) {
|
||||
}
|
||||
|
||||
export const config = {
|
||||
// 登入流程、Next.js 內部資源與靜態檔不需要登入。
|
||||
matcher: ["/((?!login|api/auth|_next/static|_next/image|favicon.ico).*)"],
|
||||
// 登入流程、健康檢查、Next.js 內部資源與靜態檔不需要登入。
|
||||
matcher: ["/((?!login|api/auth|api/health|_next/static|_next/image|favicon.ico).*)"],
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Configuration } from "openid-client";
|
||||
import type { Env } from "@/server/env";
|
||||
import { getEnv } from "@/server/env";
|
||||
import { getEnv, oidcConfigured } from "@/server/env";
|
||||
import { OIDC_CALLBACK_PATH, discoverOidc } from "./oidc";
|
||||
|
||||
export const SESSION_COOKIE = "aisubsidy_session";
|
||||
@@ -23,9 +23,10 @@ export function cookieSecure(env: Env): boolean {
|
||||
|
||||
let configPromise: Promise<Configuration> | undefined;
|
||||
|
||||
/** OIDC discovery 結果在程序內快取;失敗時清掉快取,下次請求重試。 */
|
||||
/** OIDC discovery 結果在程序內快取;失敗時清掉快取,下次請求重試。呼叫前先確認 oidcConfigured。 */
|
||||
export function getOidcConfig(): Promise<Configuration> {
|
||||
const env = getEnv();
|
||||
if (!oidcConfigured(env)) throw new Error("公司登入未設定");
|
||||
configPromise ??= discoverOidc({
|
||||
issuer: env.OIDC_ISSUER!,
|
||||
clientId: env.OIDC_CLIENT_ID!,
|
||||
|
||||
@@ -57,12 +57,14 @@ describe("公司登入(OIDC)", () => {
|
||||
return { start, result };
|
||||
}
|
||||
|
||||
it("授權網址請求 employee_number scope 並使用 PKCE", async () => {
|
||||
it("授權網址請求 employee_number scope、使用 PKCE,並要求重新輸入帳密", async () => {
|
||||
const { start } = await login({ employee_number: "E1234" });
|
||||
expect(start.url.searchParams.get("scope")).toBe(OIDC_SCOPE);
|
||||
expect(OIDC_SCOPE.split(" ")).toContain("employee_number");
|
||||
expect(start.url.searchParams.get("code_challenge_method")).toBe("S256");
|
||||
expect(start.url.searchParams.get("redirect_uri")).toBe(redirectUri);
|
||||
// 每次登入都要求重新輸入帳密
|
||||
expect(start.url.searchParams.get("prompt")).toBe("login");
|
||||
});
|
||||
|
||||
it("成功登入:建立帳號與有效 session,導向原本要去的頁面", async () => {
|
||||
|
||||
@@ -68,6 +68,8 @@ export async function startOidcLogin(
|
||||
code_challenge_method: "S256",
|
||||
state: tx.state,
|
||||
nonce: tx.nonce,
|
||||
// 每次登入都要求在 Authentik 重新輸入帳密(使用者決定),不沿用公司其他系統的登入狀態。
|
||||
prompt: "login",
|
||||
});
|
||||
return { url, txCookie: signValue(tx, secret) };
|
||||
}
|
||||
|
||||
+24
-15
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { EnvError, parseEnv } from "./env";
|
||||
import { EnvError, oidcConfigured, parseEnv } from "./env";
|
||||
|
||||
const secret = "x".repeat(32);
|
||||
const dev = { SESSION_SECRET: secret, AUTH_MODE: "dev" };
|
||||
@@ -22,19 +22,19 @@ describe("parseEnv", () => {
|
||||
BACKUP_KEEP: 14,
|
||||
AUTH_MODE: "dev",
|
||||
BOOTSTRAP_SYSADMIN_EMPLOYEE_NOS: [],
|
||||
warnings: [],
|
||||
});
|
||||
});
|
||||
|
||||
it("缺少 SESSION_SECRET 時以明確訊息失敗", () => {
|
||||
expect(() => parseEnv({ AUTH_MODE: "dev" })).toThrow(EnvError);
|
||||
expect(() => parseEnv({ AUTH_MODE: "dev" })).toThrow(/SESSION_SECRET 未設定/);
|
||||
it("缺少 SESSION_SECRET(或空字串)時隨機產生並提出警告", () => {
|
||||
for (const source of [{ AUTH_MODE: "dev" }, { AUTH_MODE: "dev", SESSION_SECRET: "" }]) {
|
||||
const env = parseEnv(source);
|
||||
expect(env.SESSION_SECRET).toMatch(/^[0-9a-f]{64}$/);
|
||||
expect(env.warnings).toEqual([expect.stringMatching(/SESSION_SECRET 未設定/)]);
|
||||
}
|
||||
});
|
||||
|
||||
it("SESSION_SECRET 為空字串視同未設定", () => {
|
||||
expect(() => parseEnv({ ...dev, SESSION_SECRET: "" })).toThrow(/SESSION_SECRET 未設定/);
|
||||
});
|
||||
|
||||
it("SESSION_SECRET 太短時失敗", () => {
|
||||
it("SESSION_SECRET 有給但太短時失敗", () => {
|
||||
expect(() => parseEnv({ ...dev, SESSION_SECRET: "short" })).toThrow(/至少需要 32 個字元/);
|
||||
});
|
||||
|
||||
@@ -52,19 +52,28 @@ describe("parseEnv", () => {
|
||||
});
|
||||
|
||||
describe("AUTH_MODE 交叉檢查", () => {
|
||||
it("oidc 且設定齊全時通過(AUTH_MODE 預設為 oidc)", () => {
|
||||
expect(parseEnv(oidc).AUTH_MODE).toBe("oidc");
|
||||
it("oidc 且設定齊全時通過且無警告(AUTH_MODE 預設為 oidc)", () => {
|
||||
const env = parseEnv(oidc);
|
||||
expect(env.AUTH_MODE).toBe("oidc");
|
||||
expect(oidcConfigured(env)).toBe(true);
|
||||
expect(env.warnings).toEqual([]);
|
||||
});
|
||||
|
||||
it.each(["OIDC_ISSUER", "OIDC_CLIENT_ID", "OIDC_CLIENT_SECRET", "APP_URL"])(
|
||||
"oidc 缺少 %s 時拒絕並指出缺哪一項",
|
||||
"oidc 缺少 %s 時仍可啟動,但公司登入停用並指出缺哪一項",
|
||||
(key) => {
|
||||
expect(() => parseEnv({ ...oidc, [key]: undefined })).toThrow(
|
||||
new RegExp(`AUTH_MODE=oidc 需要 ${key}`),
|
||||
);
|
||||
const env = parseEnv({ ...oidc, [key]: undefined });
|
||||
expect(oidcConfigured(env)).toBe(false);
|
||||
expect(env.warnings.join()).toMatch(new RegExp(`公司登入未設定(缺少 ${key})`));
|
||||
},
|
||||
);
|
||||
|
||||
it("完全沒有設定(CI 冒煙測試)也能解析", () => {
|
||||
const env = parseEnv({});
|
||||
expect(env.AUTH_MODE).toBe("oidc");
|
||||
expect(oidcConfigured(env)).toBe(false);
|
||||
});
|
||||
|
||||
it("oidc 的 APP_URL 必須是 https", () => {
|
||||
expect(() => parseEnv({ ...oidc, APP_URL: "http://localhost:3000" })).toThrow(
|
||||
/APP_URL 必須是 https/,
|
||||
|
||||
+30
-14
@@ -1,3 +1,4 @@
|
||||
import { randomBytes } from "node:crypto";
|
||||
import { z } from "zod";
|
||||
|
||||
// 伺服器端環境變數。Next.js 會自動載入 .env;CLI 腳本由 scripts/load-env.ts 以相同規則載入。
|
||||
@@ -5,9 +6,8 @@ const envSchema = z
|
||||
.object({
|
||||
DATABASE_PATH: z.string().min(1).default("./data/app.db"),
|
||||
ATTACHMENTS_DIR: z.string().min(1).default("./data/attachments"),
|
||||
SESSION_SECRET: z
|
||||
.string({ error: "SESSION_SECRET 未設定(請複製 .env.example 為 .env 並填入)" })
|
||||
.min(32, "SESSION_SECRET 至少需要 32 個字元"),
|
||||
// 未設定時於啟動時隨機產生(見 parseEnv)。正式環境由平台部署前檢查一定有值。
|
||||
SESSION_SECRET: z.string().min(32, "SESSION_SECRET 至少需要 32 個字元").optional(),
|
||||
TZ_APP: z.string().min(1).default("Asia/Taipei"),
|
||||
BACKUP_DIR: z.string().min(1).default("./backups"),
|
||||
BACKUP_KEEP: z.coerce.number().int().positive().default(14),
|
||||
@@ -43,15 +43,8 @@ const envSchema = z
|
||||
}
|
||||
return;
|
||||
}
|
||||
for (const key of ["OIDC_ISSUER", "OIDC_CLIENT_ID", "OIDC_CLIENT_SECRET", "APP_URL"] as const) {
|
||||
if (!env[key]) {
|
||||
ctx.addIssue({
|
||||
code: "custom",
|
||||
path: [key],
|
||||
message: `AUTH_MODE=oidc 需要 ${key}(本機開發請設 AUTH_MODE=dev)`,
|
||||
});
|
||||
}
|
||||
}
|
||||
// oidc 模式缺少 OIDC 設定時不拒絕啟動,而是停用登入(見 oidcConfigured):
|
||||
// 平台 CI 的冒煙測試會在沒有任何 secret 的情況下啟動容器並等健康檢查。
|
||||
if (env.APP_URL && !env.APP_URL.startsWith("https://")) {
|
||||
ctx.addIssue({
|
||||
code: "custom",
|
||||
@@ -61,7 +54,16 @@ const envSchema = z
|
||||
}
|
||||
});
|
||||
|
||||
export type Env = z.infer<typeof envSchema>;
|
||||
export type Env = Omit<z.infer<typeof envSchema>, "SESSION_SECRET"> & {
|
||||
SESSION_SECRET: string;
|
||||
/** 啟動時要印出的設定警告(缺值時的退化行為)。 */
|
||||
warnings: string[];
|
||||
};
|
||||
|
||||
/** 公司登入所需的設定是否齊全;不齊全時 oidc 模式不允許任何人登入。 */
|
||||
export function oidcConfigured(env: Env): boolean {
|
||||
return Boolean(env.OIDC_ISSUER && env.OIDC_CLIENT_ID && env.OIDC_CLIENT_SECRET && env.APP_URL);
|
||||
}
|
||||
|
||||
export class EnvError extends Error {
|
||||
constructor(message: string) {
|
||||
@@ -77,7 +79,21 @@ export function parseEnv(source: Record<string, string | undefined>): Env {
|
||||
if (!result.success) {
|
||||
throw new EnvError(`環境變數設定錯誤:\n${z.prettifyError(result.error)}`);
|
||||
}
|
||||
return result.data;
|
||||
const warnings: string[] = [];
|
||||
let sessionSecret = result.data.SESSION_SECRET;
|
||||
if (!sessionSecret) {
|
||||
// 本機與 CI 跑得起來;重啟會使 OIDC 登入中的暫存 cookie 失效。正式環境不會走到這裡。
|
||||
sessionSecret = randomBytes(32).toString("hex");
|
||||
warnings.push("SESSION_SECRET 未設定,已隨機產生(重啟後失效)");
|
||||
}
|
||||
const env: Env = { ...result.data, SESSION_SECRET: sessionSecret, warnings };
|
||||
if (env.AUTH_MODE === "oidc" && !oidcConfigured(env)) {
|
||||
const missing = (["OIDC_ISSUER", "OIDC_CLIENT_ID", "OIDC_CLIENT_SECRET", "APP_URL"] as const)
|
||||
.filter((key) => !env[key])
|
||||
.join("、");
|
||||
warnings.push(`公司登入未設定(缺少 ${missing}),目前無法登入。本機開發請設 AUTH_MODE=dev`);
|
||||
}
|
||||
return env;
|
||||
}
|
||||
|
||||
let cached: Env | undefined;
|
||||
|
||||
@@ -23,9 +23,20 @@ describe("runStartupChecks", () => {
|
||||
});
|
||||
|
||||
it("環境變數不合法時丟出錯誤", async () => {
|
||||
vi.stubEnv("SESSION_SECRET", "");
|
||||
vi.stubEnv("SESSION_SECRET", "too-short");
|
||||
const { runStartupChecks } = await import("./startup");
|
||||
expect(() => runStartupChecks()).toThrow(/SESSION_SECRET 未設定/);
|
||||
expect(() => runStartupChecks()).toThrow(/至少需要 32 個字元/);
|
||||
});
|
||||
|
||||
it("沒有任何 secret 也能啟動(平台 CI 冒煙測試),只印警告", async () => {
|
||||
vi.stubEnv("ATTACHMENTS_DIR", path.join(dir, "attachments"));
|
||||
vi.stubEnv("SESSION_SECRET", "");
|
||||
vi.stubEnv("AUTH_MODE", "");
|
||||
const warn = vi.spyOn(console, "warn").mockImplementation(() => {});
|
||||
const { runStartupChecks } = await import("./startup");
|
||||
expect(() => runStartupChecks()).not.toThrow();
|
||||
expect(warn.mock.calls.map((c) => String(c[0])).join(" ")).toMatch(/公司登入未設定/);
|
||||
warn.mockRestore();
|
||||
});
|
||||
|
||||
it("dev 模式遇到平台注入的 OIDC_ISSUER 時拒絕啟動", async () => {
|
||||
|
||||
+11
-2
@@ -1,12 +1,21 @@
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { getDatabase } from "@/server/db/client";
|
||||
import { runMigrations } from "@/server/db/migrate";
|
||||
import { getEnv } from "@/server/env";
|
||||
|
||||
/**
|
||||
* 伺服器啟動檢查:驗證環境變數、建立附件目錄。任何一項失敗都讓伺服器無法啟動,
|
||||
* 而不是等到第一個請求才出錯。由 src/instrumentation.ts 在 Node.js runtime 呼叫。
|
||||
* 伺服器啟動檢查:驗證環境變數、建立附件目錄。設定錯誤讓伺服器無法啟動,
|
||||
* 而不是等到第一個請求才出錯;缺少可退化的值(SESSION_SECRET、OIDC 設定)只印警告。
|
||||
* 由 src/instrumentation.ts 在 Node.js runtime 呼叫。
|
||||
*/
|
||||
export function runStartupChecks(): void {
|
||||
const env = getEnv();
|
||||
for (const warning of env.warnings) console.warn(`[startup] ${warning}`);
|
||||
fs.mkdirSync(path.resolve(env.ATTACHMENTS_DIR), { recursive: true });
|
||||
}
|
||||
|
||||
/** 啟動時套用尚未執行的 migration(容器內沒有 tsx,無法另外跑 `npm run db:migrate`)。 */
|
||||
export function migrateOnStartup(): void {
|
||||
runMigrations(getDatabase().db);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
version: 1
|
||||
container:
|
||||
port: 3000
|
||||
healthcheck:
|
||||
path: /api/health
|
||||
# SQLite(DATABASE_PATH 預設 ./data/app.db)與附件(ATTACHMENTS_DIR 預設 ./data/attachments)都在 /app/data。
|
||||
persistence:
|
||||
enabled: true
|
||||
mount_path: /app/data
|
||||
auth:
|
||||
mode: oidc
|
||||
callback_path: /api/auth/callback/authentik
|
||||
# 只有名稱;值留在開發者本機的 .env,部署時由 deploy-site 交給 Deployment API。
|
||||
environment:
|
||||
required:
|
||||
- SESSION_SECRET
|
||||
- APP_URL
|
||||
- BOOTSTRAP_SYSADMIN_EMPLOYEE_NOS
|
||||
Reference in New Issue
Block a user