Commit graph

6 commits

Author SHA1 Message Date
4119711850 containerfile: stop copying .env.example, it's excluded from the build context
.containerignore excludes .env.* (to keep secrets out of the build), which
also matches .env.example, so COPY --from=build /src/.env.example failed:
that file was never actually present under /src in the build stage. Drop
it -- ReadEnvGroups now falls back to an empty list instead of crashing
when neither .env nor .env.example is present, and deploy hosts already
provide their own via a mounted .env.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-14 19:04:08 +01:00
4cbd4c0c9e admin: fix env editor crash and ship .env.example into the image
Some checks failed
CI / Go tests (push) Has been cancelled
CI / Admin web build (push) Has been cancelled
CI / Grammy store bot (push) Has been cancelled
CI / Docker main topology smoke (push) Has been cancelled
ReadEnvGroups returned (nil, nil) when .env.example wasn't found, and that
nil slice marshaled to JSON null instead of []. The admin UI's env editor
unconditionally calls .reduce()/.map() on the response, so it crashed on
load with "Cannot read properties of null" -- and .env.example was never
copied into the container image in the first place, so this was always the
production code path, not an edge case.

Fixed the nil-slice response and added .env.example to the image so the
editor actually has a template of available settings to show. The real
current values still require the deploy host to mount its actual .env file
into the owpengram-admin container at /app/.env (procctl.Manager.Root is
just os.Getwd(), i.e. the container's /app workdir) -- that's a systemd
Quadlet unit change on the deploy host, not something this commit can fix on
its own.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-14 17:02:02 +01:00
3ae27c435d container: build and ship cmd/createuser in the server image
Mirrors the telesrv-admin pattern - a static build stage compile, copied
into the final alpine image as /app/createuser - so the tool is
available wherever the server image runs, not just from a local go run.
2026-09-14 12:05:28 +01:00
4f7d619955 build: stamp git metadata into the container image
.containerignore excludes .git, so go build's automatic VCS stamping produced
nothing and telesrv logged git_commit/git_branch/git_tree_state/build_time as
"unknown" on startup.

- Containerfile: accept GIT_COMMIT/GIT_BRANCH/GIT_TREE_STATE/BUILD_TIME build
  args and pass them to the gramsrv build via -ldflags -X.
- build.sh: wrapper that fills those args from the current checkout and runs
  podman build.
2026-09-14 11:58:47 +01:00
db3fbe6015 Containerfile: copy sticker-seed data into the image 2026-09-14 11:53:43 +01:00
196f90f9b1 Add Containerfile and .containerignore 2026-09-14 11:52:52 +01:00