No description
  • Go 61.1%
  • templ 12.8%
  • JavaScript 11.5%
  • Python 11.3%
  • CSS 2.6%
  • Other 0.7%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Noel Jackson 4efa69ed92
All checks were successful
Supply-chain scan / Supply-chain scan (push) Successful in 15s
Deploy / verify (push) Successful in 56s
Merge pull request 'Deploy Photostack 5f7dea47bc' (#40) from deploy/photostack-5f7dea47bcd62800e907211d11ed26ef7ef3d834 into main
Reviewed-on: ⁨#40⁩
2026-12-02 15:33:35 +00:00
.claude chore: add project verify skill 2026-07-13 18:26:56 +02:00
.forgejo/workflows ci: select the plan's runner labels (noel/infra#2151 step 5) 2026-11-02 15:39:35 +00:00
.supplychain Patch Go toolchains and dependency supply chain 2026-10-23 13:01:33 +02:00
cmd feat(auth): add value-blind password reset command 2026-11-29 13:31:33 +01:00
config Record validated public configuration from opaque secret handoff 2026-10-17 17:50:06 +02:00
docs Migrate Photostack delivery helpers to OpenBao 2026-10-17 16:16:40 +02:00
internal Store Photostack album photo uploads in R2 2026-12-02 16:18:48 +01:00
k8s Deploy Photostack 5f7dea47bc 2026-12-02 15:27:59 +00:00
scripts Use a fresh public cache key for every deployment probe 2026-10-23 15:17:40 +02:00
third_party feat: add high-quality HLS video delivery 2026-07-24 21:04:55 +02:00
tools/gosu Patch Go toolchains and dependency supply chain 2026-10-23 13:01:33 +02:00
.air.toml feat: pages, descriptions, direct video uploads, gallery layout overhaul 2026-05-10 11:22:01 +00:00
.dockerignore Patch Go toolchains and dependency supply chain 2026-10-23 13:01:33 +02:00
.env.example feat: add video support via CF Stream, fix test DB wipe and login flow 2026-04-13 09:41:10 +00:00
.gitignore Patch Go toolchains and dependency supply chain 2026-10-23 13:01:33 +02:00
.gitleaks.toml Migrate Photostack delivery helpers to OpenBao 2026-10-17 16:16:40 +02:00
.mcp.json fix: route login/signup links through /auth/login for proper OIDC flow 2026-04-12 17:01:50 +00:00
AGENTS.md Migrate Photostack delivery helpers to OpenBao 2026-10-17 16:16:40 +02:00
CLAUDE.md docs: never add Co-Authored-By trailer 2026-05-10 14:10:51 +00:00
codewire.yaml feat: CF processing state + dashboard spinner + dimension fix 2026-05-10 14:03:34 +00:00
docker-compose.yml Patch Go toolchains and dependency supply chain 2026-10-23 13:01:33 +02:00
Dockerfile Store Photostack album photo uploads in R2 2026-12-02 16:18:48 +01:00
Dockerfile.browser Patch Go toolchains and dependency supply chain 2026-10-23 13:01:33 +02:00
Dockerfile.dev Store Photostack album photo uploads in R2 2026-12-02 16:18:48 +01:00
Dockerfile.postgres Use admitted Docker Hub origins for pinned build inputs 2026-10-23 13:11:29 +02:00
go.mod deps: update Hugo to its patched 0.170.0 release 2026-12-02 16:21:23 +01:00
go.sum deps: update Hugo to its patched 0.170.0 release 2026-12-02 16:21:23 +01:00
Makefile Patch Go toolchains and dependency supply chain 2026-10-23 13:01:33 +02:00
package-lock.json Patch Go toolchains and dependency supply chain 2026-10-23 13:01:33 +02:00
package.json Patch Go toolchains and dependency supply chain 2026-10-23 13:01:33 +02:00
README.md Verify the served Photostack revision after deployment pin merges 2026-10-23 15:09:14 +02:00
sqlc.yaml feat(db): add sqlc queries and generate target 2026-04-12 10:30:43 +00:00
tailwind.config.js feat(app): add tailwind pipeline and embedded static assets 2026-04-12 09:26:17 +00:00
WIP.md feat: gallery carousel layout with dimension-aware video containers 2026-04-13 18:11:48 +00:00

Photostack

Multi-tenant photo album hosting. Sign in, upload, share.

Dev quickstart

Development, generation, and tests run in Docker Compose; the app and its toolchain are not run directly on the host. The host helper uses Python 3 and the installed Infrastructure CLI session (infra-auth) to read the exact local OpenBao profile. Complete scripts/infra-auth login in the infrastructure repo once per workstation session; the helper never starts login implicitly.

make up       # foreground app + postgres + Tailwind
make up-d     # same stack, detached
make test     # complete test suite in Compose
make security # strict read-only Supplychain source audit (installed on the host)
make generate # templ + sqlc + Tailwind in Compose
make r2-configure # merge required HLS CORS into R2
make secrets-check # validate the local OpenBao profile without displaying values
make secrets-refresh # fetch current local values and recreate the app
make status   # approved service and health fields only

Visit http://localhost:8080.

Go and container inputs are pinned to reviewed releases. Go's tool directives lock templ, sqlc, Air, and their dependencies in go.mod/go.sum. Tailwind v3 and browser dependencies are locked with integrity hashes in package-lock.json; Chrome has a pinned SHA-256 checksum. Copied assets are verified against signed npm tarballs through .supplychain/vendor-artifacts.json.

The PostgreSQL 16 image rebuilds its gosu privilege helper with the same patched Go toolchain; its dependencies are locked separately in tools/gosu.

Development and production use Alpine and its maintained FFmpeg branch. Builds need HTTPS access to dl-cdn.alpinelinux.org and registry.npmjs.org in addition to Docker Hub, Go, and GitHub build inputs. OS advisories without distribution fixes remain visible in the image audit.

The source policy has two expiring exceptions without upstream fixes: unused OpenPGP packages in x/crypto (GO-2026-5932), and Tailwind's development-only braces parser (GHSA-vfj7-8cjw-p6xm), which handles trusted repository inputs. Builds and tests enforce these scopes with scripts/check-advisory-scope. All other source advisories remain blocking.

Main builds publish an immutable image and open a deployment PR. After its required validation and merge, Flux reconciles the pin. The separate Deploy workflow waits for photostack.org to return the application's origin marker and the pinned source revision. Redirects, another application's response, and an older release fail deployment verification. The check reads no credentials and receives no Kubernetes identity; successful publication alone is not a successful deployment. X-Photostack-Revision identifies the running source commit without exposing runtime configuration.

make up and make up-d build without credentials, fetch the local application profile internally, confirm revocation of their OpenBao token, and pass the selected variables only to the Compose child. They never generate dotenv files, mount secret files, export values to the parent shell, or print provider/runtime output. Docker retains container environments; application code and Docker administrators are trusted. Never inspect a live environment or render Compose configuration with credentials. make logs does not stream raw runtime logs.

Public settings live in config/local.json and config/prod.json. The private migration helper creates those files using only a validated public-field schema. It never writes credential fields there. Database credentials remain owned by Compose locally and CNPG in production.

Infisical handoff

Only the one-time handoff uses the existing human Infisical CLI login. Never run an export/list command directly: the CLI can display values. Use:

./scripts/secrets-migrate inventory local # field names only
./scripts/secrets-migrate inventory prod
./scripts/secrets-migrate transfer local
./scripts/secrets-migrate transfer prod
./scripts/secrets-migrate audit local
./scripts/secrets-migrate audit prod

The helper reads only project photostack (fixed project ID), environment local or prod, path /, without recursive imports or personal overrides. Unknown fields stop transfer. Existing references are resolved privately during transfer, matching application injection. Credential values remain inside the helper and TLS requests; they never pass through tool output, shell arguments, dotenv files, or a temporary export.

Runtime documents are apps/photostack/<environment>/runtime and apps/photostack/<environment>/cloudflare-saas. The R2 administrative pair has its separate operational document at platform/infra/cloudflare/noel-sh/r2/photostack-cors and is never injected into ordinary development. The public bucket/account settings select the command's target; provider permissions still need independent scope verification. The retired MUX_TOKEN_ID / MUX_TOKEN_SECRET pair is preserved separately at apps/photostack/<environment>/legacy-mux for rollback. Neither local development nor the production application receives it.

All destinations are checked before writing. Writes use KV v2 CAS=0, then exact private equality readback. Equal existing documents permit verification/resume; different documents stop without overwrite. Source changes stop further work. The source remains intact until production cutover and rollback acceptance. SESSION_SECRET is preserved because it also feeds Photostack's OIDC key.

Run make test-helpers for synthetic boundary tests. The opt-in PHOTOSTACK_DOCKER_TESTS=1 make test-helpers also proves real Compose delivery and service isolation using public test markers, never live credentials.

Delivery

Forgejo PR validation builds without runtime or publishing credentials. An exact main-push OIDC role can read only platform/ci/photostack/harbor-publisher, publish an immutable Harbor image, and propose its digest through the job's repository token. The proposal updates only k8s/deployment.yaml on a new deployment branch, then opens a PR through the API. A create-only Git lease rejects existing branches. Its token reaches the private API client and Git push child's environment; no token-bearing URL, argument or credential file is created. The installed Forgejo build's REST branch endpoint and AGit hook cannot handle its Actions identity, so the helper uses ordinary Git receive and only the PR API for writes. Required PR validation gates its merge; Flux owns the Kubernetes deployment. Forgejo suppresses new workflows from its automatic job token. An owner must request validation for a generated digest PR by closing and reopening it with fj pr close NUMBER followed by fj pr reopen NUMBER, then merge only after the required check passes. Owner-authored updates also trigger validation. Merges containing only Kubernetes manifests or documentation do not publish another image. Infrastructure gates runtime and workload activation on the private transfer, access audits, projection equality proof and immutable image acceptance.

Layout

  • cmd/photostack/ — binary entry point
  • internal/app/ — router, middleware, static assets
  • internal/marketing/ — public marketing pages (server-side Templ)

See docs/plans/2026-04-01-photostack-design.md for the full design.

Video delivery also requires the R2 HLS configuration.