- Go 61.1%
- templ 12.8%
- JavaScript 11.5%
- Python 11.3%
- CSS 2.6%
- Other 0.7%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .claude | ||
| .forgejo/workflows | ||
| .supplychain | ||
| cmd | ||
| config | ||
| docs | ||
| internal | ||
| k8s | ||
| scripts | ||
| third_party | ||
| tools/gosu | ||
| .air.toml | ||
| .dockerignore | ||
| .env.example | ||
| .gitignore | ||
| .gitleaks.toml | ||
| .mcp.json | ||
| AGENTS.md | ||
| CLAUDE.md | ||
| codewire.yaml | ||
| docker-compose.yml | ||
| Dockerfile | ||
| Dockerfile.browser | ||
| Dockerfile.dev | ||
| Dockerfile.postgres | ||
| go.mod | ||
| go.sum | ||
| Makefile | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| sqlc.yaml | ||
| tailwind.config.js | ||
| WIP.md | ||
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 pointinternal/app/— router, middleware, static assetsinternal/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.