Skip to content

Commit 35c978f

Browse files
committed
refactor: remove bundled demo surface
1 parent e49feb5 commit 35c978f

19 files changed

Lines changed: 375 additions & 1409 deletions

File tree

.github/workflows/docker-image.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ on:
1616
- "package.json"
1717
- "package-lock.json"
1818
- "postcss.config.js"
19-
- "demo-server.mjs"
2019
- "serve.mjs"
2120
- "tsconfig.json"
2221
- "vite.config.mts"
@@ -33,7 +32,6 @@ on:
3332
- "package.json"
3433
- "package-lock.json"
3534
- "postcss.config.js"
36-
- "demo-server.mjs"
3735
- "serve.mjs"
3836
- "tsconfig.json"
3937
- "vite.config.mts"

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ ENV LOCKSTEP_REGISTRATION_ENABLED=true
2222
RUN mkdir -p /data && chown -R node:node /data /app
2323

2424
COPY --from=build --chown=node:node /app/node_modules ./node_modules
25-
COPY --from=build --chown=node:node /app/package.json /app/serve.mjs /app/demo-server.mjs /app/personal-security-checklist.yml ./
25+
COPY --from=build --chown=node:node /app/package.json /app/serve.mjs /app/personal-security-checklist.yml ./
2626
COPY --from=build --chown=node:node /app/dist ./dist
2727
COPY --from=build --chown=node:node /app/server ./server
2828

2929
USER node
30-
EXPOSE 4174 4175
30+
EXPOSE 4174
3131

3232
CMD ["node", "serve.mjs"]

README.md

Lines changed: 1 addition & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -35,61 +35,6 @@ Use `PORT` to run on a custom port:
3535
PORT=4174 npm run serve
3636
```
3737

38-
## Demo
39-
40-
Run the isolated demo with production build output:
41-
42-
```bash
43-
npm run demo
44-
```
45-
46-
Then open `http://127.0.0.1:4175` and sign in with `demo` / `demo`. The demo starts with a populated security profile and checklist progress and keeps changes only in memory. All mutable demo data is restored to its original seed every day at `00:00 Europe/Istanbul`; a process restart also restores it. Existing demo sessions are invalidated at the daily boundary, and open pages reload to the sign-in screen so stale browser data cannot be written back. The demo does not write to `PSC_SETTINGS_FILE` or enable account registration.
47-
48-
Use `LOCKSTEP_DEMO_PORT` (or `DEMO_PORT`) to change the demo port. The demo binds to `127.0.0.1` by default; set `LOCKSTEP_DEMO_HOST` when it must listen on another interface. Set `LOCKSTEP_DEMO_RESET_TIMEZONE` to another valid IANA time zone when the daily boundary should not use `Europe/Istanbul`. Public demo deployments should replace the default credentials with a password of at least six characters:
49-
50-
```bash
51-
LOCKSTEP_DEMO_PORT=4180 \
52-
LOCKSTEP_DEMO_USER=preview \
53-
LOCKSTEP_DEMO_PASSWORD='replace-this-password' \
54-
npm run demo
55-
```
56-
57-
Run the build-backed HTTP smoke test with:
58-
59-
```bash
60-
npm run demo:smoke
61-
```
62-
63-
The Docker image includes the demo server and exposes port `4175`. Override the normal image command to launch it:
64-
65-
```bash
66-
docker run --rm \
67-
-p 127.0.0.1:4175:4175 \
68-
-e LOCKSTEP_DEMO_HOST=0.0.0.0 \
69-
ghcr.io/caglaryalcin/lockstep:v1.0.0 \
70-
node demo-server.mjs
71-
```
72-
73-
The normal `npm run serve` and Docker `CMD` paths remain production mode on port `4174`.
74-
75-
### External Kubernetes demo pod
76-
77-
The same image can run as a dedicated `lockstep-demo` pod, independently from the production deployment. Create its credentials as a Secret, then apply the included single-replica Deployment and Service:
78-
79-
```bash
80-
kubectl create secret generic lockstep-demo-credentials \
81-
--from-literal=username=preview \
82-
--from-literal=password='replace-this-password'
83-
84-
kubectl apply -f deploy/kubernetes/lockstep-demo.yaml
85-
kubectl rollout status deployment/lockstep-demo
86-
kubectl port-forward service/lockstep-demo 4175:80
87-
```
88-
89-
Open `http://127.0.0.1:4175` after the port-forward starts. Point an HTTPS Ingress at the `lockstep-demo` Service when the demo should be public; the ingress must preserve `X-Forwarded-Proto` so the demo session cookie is marked secure.
90-
91-
The manifest runs `node demo-server.mjs`, binds the pod to `0.0.0.0:4175`, and probes `/healthz` and `/readyz`. It intentionally uses `replicas: 1` with the `Recreate` strategy because both demo state and sessions are process-local. Do not attach a PVC or scale this deployment horizontally; use a shared store first if multi-replica demo service is ever required.
92-
9338
## Docker
9439

9540
Run directly from the published image:
@@ -189,8 +134,7 @@ After changing checklist content, rebuild the app so the updated checklist is in
189134

190135
```bash
191136
npm run build
192-
npm run demo
193-
npm run demo:smoke
137+
npm run smoke
194138
npm run serve
195139
npm run lint
196140
```

demo-server.mjs

Lines changed: 0 additions & 86 deletions
This file was deleted.

deploy/kubernetes/lockstep-demo.yaml

Lines changed: 0 additions & 109 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@
88
"build.client": "vite build",
99
"build.server": "vite build -c adapters/node-server/vite.config.mts",
1010
"build.types": "tsc --incremental --noEmit",
11-
"demo": "npm run build && node demo-server.mjs",
12-
"demo:smoke": "npm run build && node scripts/ci-smoke-demo.mjs",
1311
"fmt": "prettier --write .",
1412
"fmt.check": "prettier --check .",
1513
"lint": "eslint \"src/**/*.ts*\"",
1614
"serve": "node serve.mjs",
15+
"smoke": "npm run build && node scripts/ci-smoke-production.mjs",
1716
"qwik": "qwik"
1817
},
1918
"devDependencies": {

0 commit comments

Comments
 (0)