Restore verified programmer archive with search, provenance and legacy URLs
Build and deploy / deploy (push) Successful in 1m5s
Build and deploy / deploy (push) Successful in 1m5s
This commit is contained in:
1 parent
089b949f4d
commit
681502465a
82 files changed
+8142
-5566
No files matched your search
@@ -1,87 +1,27 @@
|
||||
ProgCode.Ru
|
||||
===========
|
||||
# ProgCode.Ru
|
||||
|
||||
Structure:
|
||||
Restored programmer blog: 14 historical posts (2017–2019), topic/search catalog, JSON formatter, legacy WordPress URLs. This clean checkout at `~/tmp/progcode.ru` uses the existing `huncode/progcode` repository; the dirty `~/tmp/progcode` checkout is untouched.
|
||||
|
||||
- `web/` — Next.js application.
|
||||
- `web/data/articles.json` — article data used by the site.
|
||||
- `web/public/assets/illustrations/` — SVG illustrations and article covers.
|
||||
- `web/public/assets/media/` — raster images used by the site.
|
||||
- `web/scripts/buildDatabase.mjs` — refreshes article data and generated assets from local source files.
|
||||
## Build and preview
|
||||
|
||||
Useful commands:
|
||||
|
||||
```bash
|
||||
cd ~/tmp/progcode/web
|
||||
npm install
|
||||
ADMIN_PORT=3333 npm run admin:posts
|
||||
node scripts/buildDatabase.mjs
|
||||
npm run dev -- --port 3000
|
||||
npm run build
|
||||
```sh
|
||||
npm ci --prefix web --no-audit --fund=false
|
||||
npm run build --prefix web
|
||||
python3 deploy/local-server.py
|
||||
```
|
||||
|
||||
Local posts admin:
|
||||
The preview binds 127.0.0.1 on a random free port and writes `.local-service.json` (PID, port, URL). Stop only that PID. See DEPLOYMENT_REPORT.md for the running instance.
|
||||
|
||||
- run from `web/` with `npm run admin:posts`;
|
||||
- open `http://127.0.0.1:3333`;
|
||||
- it edits posts as Markdown and saves generated `contentHtml` to `web/data/articles.json`;
|
||||
- uploaded files are stored in `web/public/assets/uploads/`;
|
||||
- it lives in `local-admin/`, outside the Next.js app, and `.dockerignore` excludes it from Docker builds.
|
||||
## Archive and editorial policy
|
||||
|
||||
Docker static deploy:
|
||||
`provenance/restoration.json` records URLs, capture times, SHA-256, reuse results, image/missing counts. `provenance/cdx-20261026.json` and control HTML were fetched again on 2026-10-26. The historical corpus was recovered from the owner's existing local archive cache; it is not a claim that all historical site URLs were recovered. Raw captures are data and never executed. No original server code, trackers, comments, downloads or remote embeds are published. Future-dated synthetic editorial corpus is retained in Git history but excluded from publication. New UI/tools and dated safety corrections are explicitly separate from historical text.
|
||||
|
||||
```bash
|
||||
docker build -t progcode:static .
|
||||
docker run --rm -p 8080:8080 progcode:static
|
||||
```
|
||||
Five unique archive images are displayed in five articles; 13 missing inline illustrations are disclosed. Recovered third-party images have source attribution; no ownership of their copyright is asserted. Unused editorial imagery and wallpaper are excluded from publication. The home illustration is original CSS/text.
|
||||
|
||||
Swarm example:
|
||||
## Production
|
||||
|
||||
```bash
|
||||
DOMAIN=progcode.example.com IMAGE=registry.example.com/progcode:static \
|
||||
docker stack deploy -c deploy/stack.example.yml progcode
|
||||
```
|
||||
Existing `.gitea/workflows/deploy.yml` builds on master, pushes `git.pryanik.synology.me/huncode/progcode:<commit>` and deploys only the existing `progcode` stack via configured manager SSH secrets. It fails if the manager is absent. No global Traefik changes are needed. Static runtime listens on 8080 and has an HTTP healthcheck.
|
||||
|
||||
Gitea Actions variables:
|
||||
## Verification and tracking
|
||||
|
||||
- `DOMAIN` — public host routed by Traefik.
|
||||
- `IMAGE` — full image tag to build and deploy, for example `registry.example.com/progcode:latest`.
|
||||
- `IMAGE_REPO` — optional alternative to `IMAGE`; the workflow will tag images as `${IMAGE_REPO}:${short_sha}`.
|
||||
- `REGISTRY` — registry host for `docker login`.
|
||||
- `STACK_NAME` — optional, defaults to `progcode`.
|
||||
- `TRAEFIK_NETWORK` — optional, defaults to `traefik-public`.
|
||||
- `TRAEFIK_ENTRYPOINT` — optional, defaults to `websecure`.
|
||||
- `TRAEFIK_CERTRESOLVER` — optional, defaults to `le`.
|
||||
- The workflow also pushes `${IMAGE_REPO}:latest` automatically.
|
||||
|
||||
Gitea Actions secrets:
|
||||
|
||||
- `REGISTRY_USERNAME`
|
||||
- `REGISTRY_PASSWORD`
|
||||
- `SWARM_MANAGER_HOST`
|
||||
- `SWARM_SSH_USER`
|
||||
- `SWARM_SSH_PORT` — optional, defaults to `22`.
|
||||
|
||||
The workflow follows the same SSH model as `ohuello`: the deploy SSH private key is not stored in Gitea secrets. It must be created on the Gitea runner host and mounted into job containers as `/root/.ssh:ro`, including `known_hosts`.
|
||||
|
||||
Example account or organization variables:
|
||||
|
||||
```text
|
||||
REGISTRY=git.example.com
|
||||
IMAGE_REPO=git.example.com/huncode/progcode
|
||||
DOMAIN=progcode.example.com
|
||||
STACK_NAME=progcode
|
||||
TRAEFIK_NETWORK=traefik-public
|
||||
TRAEFIK_ENTRYPOINT=websecure
|
||||
TRAEFIK_CERTRESOLVER=le
|
||||
```
|
||||
|
||||
Example account or organization secrets:
|
||||
|
||||
```text
|
||||
REGISTRY_USERNAME=<gitea-user-or-token-user>
|
||||
REGISTRY_PASSWORD=<gitea-token>
|
||||
SWARM_MANAGER_HOST=<swarm-manager-origin-ip-or-ssh-host>
|
||||
SWARM_SSH_USER=deploy
|
||||
SWARM_SSH_PORT=22
|
||||
```
|
||||
Run `python3 deploy/smoke.py http://127.0.0.1:<port>` after build/preview; the same script supports public HTTPS. Browser evidence is under `verification/`. Separate project Beads prefix: `webprogcode`; run `bd prime` and `bd list`. No tracker from pupline is used.
|
||||
Reference in new issue
Block a user