Compare commits
32
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
801d2e695c | ||
|
|
bdd1157cd9 | ||
|
|
b95303143b | ||
|
|
5369a26836 | ||
|
|
68a76b78ea | ||
|
|
4345d6a8cb | ||
|
|
cf0fffc2d2 | ||
|
|
67f3aaa02d | ||
|
|
476557dcc3 | ||
|
|
a2664c6369 | ||
|
|
c685e69281 | ||
|
|
0d15b2c1ad | ||
|
|
6da6ee52d8 | ||
|
|
dd2467f7e6 | ||
|
|
ac91aa844b | ||
|
|
89917a9489 | ||
|
|
480adba0be | ||
|
|
87ba04fc9c | ||
|
|
06af751888 | ||
|
|
5a208a29c3 | ||
|
|
133b0116a1 | ||
|
|
d4ca0cf615 | ||
|
|
bf772a82af | ||
|
|
66e0a494af | ||
|
|
bebf781f41 | ||
|
|
6c1a6f47a8 | ||
|
|
d3e7d46dea | ||
|
|
bcd5e4fd44 | ||
|
|
536059b1d3 | ||
|
|
4dc76d3c8f | ||
|
|
c88faea471 | ||
|
|
55fff7e8d1 |
+7
-7
@@ -1,11 +1,11 @@
|
||||
# CI-14 — CODEOWNERS bor i .gitea/, aldrig i .github/ (SEC-25).
|
||||
# Granskning krävs särskilt för kontrakt, deploy och migrationer.
|
||||
|
||||
* @sax3l
|
||||
/contracts/ @sax3l
|
||||
/deploy/ @sax3l
|
||||
/.gitea/ @sax3l
|
||||
/siax.repo.json @sax3l
|
||||
/siax.config.json @sax3l
|
||||
* @admin
|
||||
/contracts/ @admin
|
||||
/deploy/ @admin
|
||||
/.gitea/ @admin
|
||||
/siax.repo.json @admin
|
||||
/siax.config.json @admin
|
||||
# TODO: lägg till migrationskatalogen när den finns, t.ex.
|
||||
# /packages/db/migrations/ @sax3l
|
||||
# /packages/db/migrations/ @admin
|
||||
|
||||
+20
-11
@@ -1,18 +1,23 @@
|
||||
name: CI (SIAX Cloud)
|
||||
on: [push, pull_request, workflow_dispatch]
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
# CI-02 concurrency (N6): en ny commit på samma PR/gren avbryter den inaktuella körningen.
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
|
||||
group: ${{ gitea.workflow }}-${{ gitea.ref }}
|
||||
cancel-in-progress: true
|
||||
jobs:
|
||||
quality:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
||||
with:
|
||||
node-version: "22"
|
||||
- uses: pnpm/action-setup@v4
|
||||
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
|
||||
with:
|
||||
version: 9.15.9
|
||||
- name: Install
|
||||
@@ -29,20 +34,24 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
- name: Install Trivy
|
||||
run: curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin
|
||||
run: |
|
||||
# Pinned + checksum-verified instead of `curl ... | sh` (Semgrep gha-curl-pipe-shell)
|
||||
curl -sSfL -o /tmp/trivy.tar.gz "https://github.com/aquasecurity/trivy/releases/download/v0.76.2/trivy_0.76.2_Linux-64bit.tar.gz"
|
||||
echo "bc0fc726e017b8927a62b2d3531d7a84ee01769daf5c99ed866dced54089fdbf /tmp/trivy.tar.gz" | sha256sum -c -
|
||||
tar -xzf /tmp/trivy.tar.gz -C /usr/local/bin trivy
|
||||
- name: Scan
|
||||
run: trivy fs --scanners vuln,secret --severity HIGH,CRITICAL --exit-code 0 .
|
||||
contracts:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
||||
with:
|
||||
node-version: "22"
|
||||
- uses: pnpm/action-setup@v4
|
||||
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
|
||||
with:
|
||||
version: 9.15.9
|
||||
- name: Install
|
||||
@@ -60,7 +69,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: SonarQube analysis (self-hosted sonar.siax.io)
|
||||
|
||||
@@ -2,12 +2,17 @@ name: Component conformance
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ gitea.workflow }}-${{ gitea.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
conformance:
|
||||
name: Component conformance (blocking)
|
||||
|
||||
@@ -2,9 +2,13 @@ name: Masterplan Lock
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 4 * * *"
|
||||
# ci-concurrency-exempt: tar masterplan-låset; avbrott kan lämna låset satt (N6 §4)
|
||||
concurrency:
|
||||
group: ${{ gitea.workflow }}
|
||||
cancel-in-progress: false
|
||||
jobs:
|
||||
lock:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
- run: echo "masterplan lock placeholder"
|
||||
|
||||
@@ -26,6 +26,7 @@ on:
|
||||
pull_request: {}
|
||||
schedule:
|
||||
- cron: "17 2 * * *"
|
||||
workflow_dispatch: {}
|
||||
permissions: { contents: read }
|
||||
concurrency:
|
||||
group: security-${{ github.ref }}
|
||||
@@ -34,6 +35,8 @@ concurrency:
|
||||
jobs:
|
||||
scan:
|
||||
runs-on: ubuntu-latest
|
||||
# Övre gräns: ett scannerjobb får aldrig äta en delad runner-värd.
|
||||
timeout-minutes: 60
|
||||
steps:
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
with: { fetch-depth: 0 }
|
||||
@@ -61,38 +64,103 @@ jobs:
|
||||
- name: gitleaks secret scan
|
||||
run: |
|
||||
set +e
|
||||
docker run --rm -v "$SCAN_VOLUME:/repo" -w /repo \
|
||||
zricethezav/gitleaks:v8.30.1 detect --no-git --source /repo --no-banner --exit-code 1 > /tmp/scan.log 2>&1
|
||||
docker run --rm --cpus 2 --memory 4g -v "$SCAN_VOLUME:/repo" -w /repo \
|
||||
zricethezav/gitleaks:v8.30.1 detect --no-git --source /repo --no-banner --redact --exit-code 1 > /tmp/scan.log 2>&1
|
||||
rc=$?
|
||||
set -e
|
||||
tail -n 120 /tmp/scan.log
|
||||
if [ $rc -eq 0 ]; then echo "gitleaks secret scan ren"; exit 0; fi
|
||||
if [ $rc -eq 1 ]; then echo "::error::gitleaks secret scan hittade fynd"; exit 1; fi
|
||||
echo "::warning::gitleaks secret scan kunde inte köras (rc=$rc) - verktygsfel, inte fynd"; exit 0
|
||||
echo "::error::gitleaks secret scan kunde inte koras (rc=$rc) - scannerfel, inte fynd; grinden far inte bli tyst gron"; exit 1
|
||||
|
||||
# Historiken scannas informativt. Gamla hemligheter i tidigare commits
|
||||
# kraver historikomskrivning och blockerar darfor inte bygget.
|
||||
- name: gitleaks history informational
|
||||
continue-on-error: true
|
||||
# gitleaks over just de commits som PR:en eller pushen inför. Blockerar på
|
||||
# hemligheter som introduceras i intervallet, även om de raderas senare i
|
||||
# samma PR (de finns kvar i historiken efter merge). Git-läget med
|
||||
# --log-opts skannar bara tillagda rader, så en PR som RADERAR en gammal
|
||||
# hemlighet fälls inte, och .gitleaks.toml/.gitleaksignore i repot gäller.
|
||||
# Fullhistoriken körs bara nattligt/manuellt (nästa steg): en full
|
||||
# `git log -p --all` per PR tog timmar och sänkte runner-värden
|
||||
# (server10, 2026-11-11).
|
||||
- name: gitleaks commit range
|
||||
if: github.event_name == 'pull_request' || github.event_name == 'push'
|
||||
timeout-minutes: 15
|
||||
env:
|
||||
EVENT_NAME: ${{ github.event_name }}
|
||||
BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
||||
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
||||
BEFORE_SHA: ${{ github.event.before }}
|
||||
run: |
|
||||
docker run --rm -v "$SCAN_VOLUME:/repo" -w /repo \
|
||||
set -eu
|
||||
test -d .git || { echo "::error::ingen .git i $PWD"; exit 1; }
|
||||
head="${PR_HEAD_SHA:-$GITHUB_SHA}"
|
||||
base=""
|
||||
if [ "$EVENT_NAME" = "pull_request" ] && [ -n "${BASE_SHA:-}" ]; then
|
||||
base=$(git merge-base "$BASE_SHA" "$head" 2>/dev/null || echo "$BASE_SHA")
|
||||
elif [ -n "${BEFORE_SHA:-}" ] && [ "$BEFORE_SHA" != "0000000000000000000000000000000000000000" ] \
|
||||
&& git cat-file -e "${BEFORE_SHA}^{commit}" 2>/dev/null; then
|
||||
base="$BEFORE_SHA"
|
||||
fi
|
||||
MAX=500
|
||||
if [ -n "$base" ]; then
|
||||
count=$(git rev-list --count "$base..$head")
|
||||
echo "intervall $base..$head: $count commits"
|
||||
if [ "$count" -eq 0 ]; then echo "inga nya commits i intervallet"; exit 0; fi
|
||||
if [ "$count" -gt "$MAX" ]; then
|
||||
echo "::warning::intervallet har $count commits; skannar de $MAX senaste. Resten täcks av den nattliga fullhistorikskanningen."
|
||||
fi
|
||||
logopts="-n $MAX $base..$head"
|
||||
else
|
||||
echo "::notice::inget jämförbart föregående läge (ny gren eller omskriven historik); skannar head-commiten. Fullhistoriken täcks nattligt."
|
||||
logopts="-n 1 $head"
|
||||
fi
|
||||
name="siax-gitleaks-range-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}"
|
||||
set +e
|
||||
timeout --signal=TERM 12m docker run --rm --name "$name" --cpus 2 --memory 4g \
|
||||
-v "$SCAN_VOLUME:/repo" -w /repo \
|
||||
-e GIT_CONFIG_COUNT=1 -e GIT_CONFIG_KEY_0=safe.directory -e GIT_CONFIG_VALUE_0='*' \
|
||||
zricethezav/gitleaks:v8.30.1 detect --source /repo --log-opts="$logopts" \
|
||||
--no-banner --redact --exit-code 1 > /tmp/scan.log 2>&1
|
||||
rc=$?
|
||||
set -e
|
||||
docker kill "$name" >/dev/null 2>&1 || true
|
||||
tail -n 120 /tmp/scan.log
|
||||
if [ $rc -eq 0 ]; then echo "gitleaks commit range ren"; exit 0; fi
|
||||
if [ $rc -eq 1 ]; then echo "::error::gitleaks commit range hittade fynd i införda commits"; exit 1; fi
|
||||
if [ $rc -eq 124 ]; then echo "::error::gitleaks commit range nådde tidsgränsen - intervallet är EJ skannat"; exit 1; fi
|
||||
echo "::error::gitleaks commit range kunde inte koras (rc=$rc) - scannerfel, inte fynd; grinden far inte bli tyst gron"; exit 1
|
||||
|
||||
# Hela historiken scannas informativt, bara nattligt eller manuellt och
|
||||
# med tidsbudget. Gamla hemligheter i tidigare commits kräver
|
||||
# historikomskrivning och blockerar därför inte bygget.
|
||||
- name: gitleaks history informational
|
||||
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
|
||||
timeout-minutes: 45
|
||||
continue-on-error: true # ci2-allow-swallowed-failure: historik-gitleaks informativt per kanonisk security.yml
|
||||
run: |
|
||||
name="siax-gitleaks-history-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}"
|
||||
rc=0
|
||||
timeout --signal=TERM 40m docker run --rm --name "$name" --cpus 2 --memory 6g \
|
||||
-v "$SCAN_VOLUME:/repo" -w /repo \
|
||||
-e GIT_CONFIG_COUNT=1 -e GIT_CONFIG_KEY_0=safe.directory \
|
||||
-e GIT_CONFIG_VALUE_0='*' \
|
||||
zricethezav/gitleaks:v8.30.1 detect --source /repo --no-banner --exit-code 1 \
|
||||
|| echo "::notice::historiska traffar loggas informativt"
|
||||
zricethezav/gitleaks:v8.30.1 detect --source /repo --no-banner --redact --exit-code 1 || rc=$?
|
||||
docker kill "$name" >/dev/null 2>&1 || true
|
||||
if [ "$rc" -eq 124 ]; then echo "::warning::fullhistorikskanningen nådde tidsbudgeten (40 min) - historiken är EJ fullständigt skannad"; fi
|
||||
if [ "$rc" -ne 0 ]; then echo "::notice::historiska träffar eller avbrott loggas informativt (rc=$rc)"; fi
|
||||
|
||||
|
||||
# Trivy filsystem, blockerar pa HIGH och CRITICAL sarbarheter och hemligheter (SUP-*)
|
||||
- name: Trivy filesystem scan
|
||||
run: |
|
||||
set +e
|
||||
docker run --rm -v "$SCAN_VOLUME:/repo" -w /repo \
|
||||
docker run --rm --cpus 2 --memory 4g -v "$SCAN_VOLUME:/repo" -w /repo \
|
||||
aquasec/trivy:0.76.2 fs --scanners vuln,secret --severity HIGH,CRITICAL --exit-code 1 --no-progress /repo > /tmp/scan.log 2>&1
|
||||
rc=$?
|
||||
set -e
|
||||
tail -n 120 /tmp/scan.log
|
||||
if [ $rc -eq 0 ]; then echo "Trivy filesystem scan ren"; exit 0; fi
|
||||
if [ $rc -eq 1 ]; then echo "::error::Trivy filesystem scan hittade fynd"; exit 1; fi
|
||||
echo "::warning::Trivy filesystem scan kunde inte köras (rc=$rc) - verktygsfel, inte fynd"; exit 0
|
||||
echo "::error::Trivy filesystem scan kunde inte koras (rc=$rc) - scannerfel, inte fynd; grinden far inte bli tyst gron"; exit 1
|
||||
|
||||
# Dockerfile- och IaC-misconfig är informativt: DS-0002 (root-USER)
|
||||
# kräver ändrade runtime-användare och hanteras per repo, inte i grinden.
|
||||
@@ -117,28 +185,29 @@ jobs:
|
||||
cfg=""
|
||||
if [ -f "/repo/osv-scanner.toml" ]; then cfg="--config=/repo/osv-scanner.toml"; fi
|
||||
set +e
|
||||
docker run --rm -v "$SCAN_VOLUME:/repo" -w /repo \
|
||||
docker run --rm --cpus 2 --memory 4g -v "$SCAN_VOLUME:/repo" -w /repo \
|
||||
ghcr.io/google/osv-scanner:v2.7.1 scan source --recursive $cfg /repo > /tmp/scan.log 2>&1
|
||||
rc=$?
|
||||
set -e
|
||||
tail -n 120 /tmp/scan.log
|
||||
if [ $rc -eq 0 ]; then echo "OSV ren"; exit 0; fi
|
||||
if [ $rc -eq 1 ]; then echo "::error::OSV Scanner hittade fynd"; exit 1; fi
|
||||
echo "::warning::OSV Scanner kunde inte koras (rc=$rc) - verktygsfel, inte fynd"; exit 0
|
||||
echo "::error::OSV Scanner kunde inte koras (rc=$rc) - scannerfel, inte fynd; grinden far inte bli tyst gron"; exit 1
|
||||
|
||||
# Statisk kodanalys, felallvarlighet bryter bygget. Semgrep kraver koden pa /src
|
||||
- name: Semgrep code scan
|
||||
run: |
|
||||
set +e
|
||||
docker run --rm -v "$SCAN_VOLUME:/src" -w /src \
|
||||
docker run --rm --cpus 2 --memory 4g -v "$SCAN_VOLUME:/src" -w /src \
|
||||
semgrep/semgrep:1.183.0 semgrep scan --config=p/ci --error --quiet > /tmp/scan.log 2>&1
|
||||
rc=$?
|
||||
set -e
|
||||
tail -n 120 /tmp/scan.log
|
||||
if [ $rc -eq 0 ]; then echo "Semgrep code scan ren"; exit 0; fi
|
||||
if [ $rc -eq 1 ]; then echo "::error::Semgrep code scan hittade fynd"; exit 1; fi
|
||||
echo "::warning::Semgrep code scan kunde inte köras (rc=$rc) - verktygsfel, inte fynd"; exit 0
|
||||
echo "::error::Semgrep code scan kunde inte koras (rc=$rc) - scannerfel, inte fynd; grinden far inte bli tyst gron"; exit 1
|
||||
- name: Remove scan volume
|
||||
if: always()
|
||||
run: |
|
||||
for c in $(docker ps -q --filter "name=siax-gitleaks-.*-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}"); do docker kill "$c" >/dev/null 2>&1 || true; done
|
||||
docker volume rm -f "${SCAN_VOLUME:-none}" >/dev/null 2>&1 || true
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
@siax:registry=https://git.siax.io/api/packages/siax/npm/
|
||||
//git.siax.io/api/packages/siax/npm/:_authToken=${NODE_AUTH_TOKEN}
|
||||
# @siax/* resolves from SIAX's local Gitea npm registry, canonical owner "admin" (host git.siax.app, anonymous read).
|
||||
# No _authToken line on purpose: an unset or stale ${NODE_AUTH_TOKEN} makes npm send an empty Bearer and Gitea answers 401 even for public reads.
|
||||
# Publishing sets its own auth in the CI user config, never here. Do not use npm.siax.io (402) or /api/packages/siax/ (owner does not exist, 404).
|
||||
# External builds (Vercel etc.) use https://registry.siax.dev via design.siax.dev/docs/consume.md.
|
||||
@siax:registry=https://git.siax.app/api/packages/admin/npm/
|
||||
engine-strict=true
|
||||
fund=false
|
||||
# Supply-chain: wait 7 days before resolving newly published versions (Semgrep p/ci; npm 11.10+).
|
||||
min-release-age=7
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"exemptions": []
|
||||
}
|
||||
@@ -14,16 +14,16 @@
|
||||
"@siax/c0py-config": "workspace:*",
|
||||
"@siax/c0py-core": "workspace:*",
|
||||
"@siax/c0py-types": "workspace:*",
|
||||
"fastify": "^5.12.0",
|
||||
"fastify": "^5.12.6",
|
||||
"pg": "^8.23.0",
|
||||
"playwright-core": "^1.63.0",
|
||||
"zod": "^3.24.0"
|
||||
"zod": "^4.6.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^24.0.0",
|
||||
"@types/pg": "^8.23.1",
|
||||
"tsx": "^4.21.0",
|
||||
"typescript": "^5.7.2",
|
||||
"vitest": "^3.0.0"
|
||||
"vitest": "^4.1.12"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
"test": "vitest run"
|
||||
},
|
||||
"dependencies": {
|
||||
"next": "^15.0.0",
|
||||
"next": "15.5.28",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0"
|
||||
},
|
||||
@@ -20,6 +20,6 @@
|
||||
"@types/react": "^19.0.0",
|
||||
"@types/react-dom": "^19.0.0",
|
||||
"typescript": "^5.7.2",
|
||||
"vitest": "^3.0.0"
|
||||
"vitest": "^4.1.12"
|
||||
}
|
||||
}
|
||||
|
||||
+4
-1
@@ -32,7 +32,10 @@
|
||||
"postcss@<8.5.18": "8.5.28",
|
||||
"next": "15.5.28",
|
||||
"sharp": "0.35.5",
|
||||
"source-map-js": "1.2.2"
|
||||
"source-map-js": "1.2.2",
|
||||
"next@<15.5.29": "15.5.29",
|
||||
"tinypool": "2.1.2",
|
||||
"@typescript-eslint/typescript-estree>minimatch": "11.0.8"
|
||||
}
|
||||
},
|
||||
"packageManager": "[email protected]"
|
||||
|
||||
@@ -14,6 +14,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.7.2",
|
||||
"vitest": "^3.0.0"
|
||||
"vitest": "^4.1.12"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
"test": "vitest run"
|
||||
},
|
||||
"dependencies": {
|
||||
"zod": "^3.24.0"
|
||||
"zod": "^4.6.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.7.2",
|
||||
"vitest": "^3.0.0"
|
||||
"vitest": "^4.1.12"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
import { describe, it, expect } from "vitest";
|
||||
import { envSchema } from "../src/index.js";
|
||||
|
||||
const required = {
|
||||
ZITADEL_ISSUER: "https://id-customers.siax.io",
|
||||
ZITADEL_AUDIENCE: "c0py-api.siax.io",
|
||||
DATABASE_URL: "postgresql://localhost:5432/c0py",
|
||||
};
|
||||
|
||||
// Regressionstest för zod 3 -> 4 (OSV GHSA-mrhx-c7xc-m3w5): beteendet hos envSchema ska vara oförändrat.
|
||||
describe("envSchema (zod 4)", () => {
|
||||
it("fyller i standardvärden och coerce:ar numeriska strängar", () => {
|
||||
const env = envSchema.parse({ ...required });
|
||||
expect(env.PORT).toBe(3000);
|
||||
expect(env.NODE_ENV).toBe("development");
|
||||
expect(env.CRAWL_TIMEOUT_MS).toBe(30000);
|
||||
expect(env.MAX_REGISTRY_PAGES).toBe(1000);
|
||||
expect(env.CAPTURE_WORKER).toBe("on");
|
||||
expect(env.CL0UD_REQUIRED).toBe("false");
|
||||
expect(env.CL0UD_PROBE_INTERVAL_MS).toBe(300000);
|
||||
expect(envSchema.parse({ ...required, PORT: "8080" }).PORT).toBe(8080);
|
||||
});
|
||||
|
||||
it("kräver issuer, audience och databas-URL", () => {
|
||||
const result = envSchema.safeParse({});
|
||||
expect(result.success).toBe(false);
|
||||
if (!result.success) {
|
||||
const paths = result.error.issues.map((i) => i.path.join("."));
|
||||
expect(paths).toEqual(
|
||||
expect.arrayContaining(["ZITADEL_ISSUER", "ZITADEL_AUDIENCE", "DATABASE_URL"]),
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
it("avvisar ogiltig URL och okänt enum-värde", () => {
|
||||
expect(envSchema.safeParse({ ...required, ZITADEL_ISSUER: "inte-en-url" }).success).toBe(false);
|
||||
expect(envSchema.safeParse({ ...required, CL0UD_BASE_URL: "nope" }).success).toBe(false);
|
||||
expect(envSchema.safeParse({ ...required, NODE_ENV: "staging" }).success).toBe(false);
|
||||
expect(envSchema.safeParse({ ...required, CAPTURE_WORKER: "maybe" }).success).toBe(false);
|
||||
});
|
||||
});
|
||||
@@ -11,6 +11,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.7.2",
|
||||
"vitest": "^3.0.0"
|
||||
"vitest": "^4.1.12"
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+197
-258
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,8 @@
|
||||
packages:
|
||||
- 'apps/*'
|
||||
- 'packages/*'
|
||||
|
||||
# Supply-chain hardening (Semgrep p/ci blocking rules): 7 days wait, no downgrade of trust, no exotic sub-dependencies
|
||||
minimumReleaseAge: 10080
|
||||
trustPolicy: no-downgrade
|
||||
blockExoticSubdeps: true
|
||||
|
||||
+35
-1
@@ -1 +1,35 @@
|
||||
{"$schema": "https://github.com/renovatebot/renovate-config/blob/master/renovate-schema.json", "extends": ["config:recommended"], "packageRules": [{"matchPackagePatterns": ["^@siax/"], "rangeStrategy": "bump"}, {"matchPackagePatterns": ["typescript"], "rangeStrategy": "bump"}, {"matchPackagePatterns": ["node"], "rangeStrategy": "update"}], "vulnerabilityReport": {"enabled": true}, "schedule": ["before 3am on Saturday"]}
|
||||
{
|
||||
"$schema": "https://github.com/renovatebot/renovate-config/blob/master/renovate-schema.json",
|
||||
"extends": [
|
||||
"config:recommended"
|
||||
],
|
||||
"packageRules": [
|
||||
{
|
||||
"matchPackagePatterns": [
|
||||
"^@siax/"
|
||||
],
|
||||
"rangeStrategy": "bump",
|
||||
"minimumReleaseAge": "7 days"
|
||||
},
|
||||
{
|
||||
"matchPackagePatterns": [
|
||||
"typescript"
|
||||
],
|
||||
"rangeStrategy": "bump",
|
||||
"minimumReleaseAge": "7 days"
|
||||
},
|
||||
{
|
||||
"matchPackagePatterns": [
|
||||
"node"
|
||||
],
|
||||
"rangeStrategy": "update",
|
||||
"minimumReleaseAge": "7 days"
|
||||
}
|
||||
],
|
||||
"vulnerabilityReport": {
|
||||
"enabled": true
|
||||
},
|
||||
"schedule": [
|
||||
"before 3am on Saturday"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"id": "server6-db.qhucpjjpv3mx9jupqkbyf5uh",
|
||||
"repo": "c0py",
|
||||
"frequency": "daily",
|
||||
"retention": "3m",
|
||||
"target": "storage-box",
|
||||
"encrypted": true,
|
||||
"lastRunAt": "2026-11-23T00:42:41Z"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"id": "server6-db.qhucpjjpv3mx9jupqkbyf5uh-20261118",
|
||||
"repo": "c0py",
|
||||
"backupId": "server6-db.qhucpjjpv3mx9jupqkbyf5uh",
|
||||
"performedAt": "2026-11-18T11:02:47Z",
|
||||
"performedBy": "siax-backup-restoretest.service",
|
||||
"result": "pass",
|
||||
"notes": "Nod server6, jobb db.qhucpjjpv3mx9jupqkbyf5uh: veckovist återställningstest (temporär container utan nätverk, radräkning). Tidsstämpel ur nodens tillstånd (restore_last_success)."
|
||||
}
|
||||
Reference in New Issue
Block a user