Commit Graph
31 Commits
Author SHA1 Message Date
jason 3fc96e70e2 🐛 Fix UUOC and missing grep guard in start-runners 🐛
Replaced `echo "$SERVER_ADDRESS" | grep -q '://'` with the native bash
`[[ "$SERVER_ADDRESS" != *"://"* ]]` test, eliminating a useless
subshell/pipe and the missing `--` before the grep pattern that came
with it. Found by the `script-lint` agent while auditing the
act_runner cache-server integration.

- rootfs/usr/local/bin/start-runners: line 24 UUOC fix
- TODO.AI.md: marked the start-runners lint finding fixed; logged a
  new, separate line-length violation on line 36 (`RUNNER_LABELS`
  default is 781 chars) discovered during the same lint pass but not
  yet actioned
2026-08-05 23:22:20 -04:00
jason fc3e148bb2 🐛 Create /config/env directory before services write into it 🐛
gitea / release-gitea (push) Failing after 41s
App-breaking bug found during full runtime verification of the act_runner
cache-server feature: `/config/env` was never explicitly created. It only
came into existence as a side effect of `__create_env_file()` copying
`/usr/local/etc/docker/env/default.sample` into it — but that sample file
does not exist in this image's rootfs, so `__create_env_file()` returns
early without creating the directory. `05-dockerd.sh` and
`zz-act_runner.sh` then failed writing `/config/env/docker.local.sh` and
`/config/env/act_runner.local.sh` directly, logging
`No such file or directory` (non-fatal, but a real bug).

- rootfs/usr/local/bin/entrypoint.sh: added
  `mkdir -p "/config/env" 2>/dev/null || true` alongside the other
  `/config/*` directory creation lines
- TODO.AI.md: logged the fix and the upstream-template-sync follow-up

Verified: full end-to-end run with `--privileged --cap-add CHOWN
--cap-add SYS_TIME --cap-add SYS_ADMIN` (per README) shows no more
"No such file or directory" errors, gitea starts on port 80, dockerd
starts, act_runner cache server logs "Cache server has been started and
is listening on 44015", and both configured runners register
successfully ("Runner registered successfully." x2, RUNNERS_START=2).
`runners-cache.yaml` is generated with real (non-REPLACE_) cache config
values.
2026-08-05 01:52:09 -04:00
jason 6a3a9bde14 🚀 Enable shared act_runner cache-server 🚀
gitea / release-gitea (push) Failing after 48s
Turned on the act_runner Actions cache instead of leaving it disabled.
The standalone `cache-server` process was already being launched
unconditionally by zz-act_runner.sh but had no `external_secret`, so it
was refusing to start (the binary requires a non-empty secret even
though its own `cache.enabled` field is unused). Wired a shared,
randomly generated secret through the existing REPLACE_* templating
pattern so the "gitea" runner, the cache-server, and the extra
runner-N daemons spawned by start-runners all share one cache backend.

- rootfs/tmp/etc/act_runner/default_config.yaml: cache.enabled: true;
  added external_server (pointed at the local cache-server) and
  external_secret placeholders
- rootfs/tmp/etc/act_runner/cache_server.yaml: cache.enabled: true;
  added external_secret placeholder (required for the binary to start)
- rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh: added
  __gen_cache_secret() (mirrors __gen_auth_token's persisted-token
  pattern, stored at $CONF_DIR/tokens/cache_secret); substitutes
  REPLACE_RUNNER_CACHE_SECRET into both the runner config and the
  cache-server config; exports RUNNER_CACHE_HOST/PORT/SECRET for
  start-runners; bumped version stamp
- rootfs/usr/local/bin/start-runners: generates a shared
  runners-cache.yaml from the exported cache env vars and passes
  --config to both `act_runner register` and `act_runner daemon` for
  every runner-N instance, so they use the same external cache server
  instead of an unshared per-process local cache
- TODO.AI.md: logged pre-existing script-lint findings (missing `--`
  before grep queries throughout zz-act_runner.sh, a UUOC in
  start-runners, an unpinned/stale docker.yaml CI workflow, and
  forbidden OCI labels in the Dockerfile) surfaced incidentally by the
  lint pass for this change but out of scope for it
2026-08-03 11:57:10 -04:00
jason c9593bd0b6 🐛 Fix entrypoint hang and lost-interpreter bugs 🐛
gitea / release-gitea (push) Failing after 1m50s
- rootfs/usr/local/bin/entrypoint.sh:
  1. The "start all services" gate
     (`if [ "$START_SERVICES" = "yes" ] || [ -z "$1" ]`) always evaluated
     true on a first-run container regardless of $1, because
     START_SERVICES is force-set to "yes" whenever no PID file exists yet.
     Any command passed to `docker run` — `exec ...`, `sh -c ...`,
     `shell`, or an arbitrary program — was swallowed into the
     service-start+monitor branch before reaching the `case "$1"`
     statement that already handles those subcommands, hanging the
     container as a daemon instead of running the given command. Changed
     the condition to `if [ -z "$1" ]` so the daemon branch only fires
     when no command was given at all.
  2. The `*/bin/sh | */bin/bash | bash | sh | shell)` case branch
     unconditionally shifted $1 before `__exec_command "$@"` (a bare
     `exec "$@"`). For `docker run image sh -c 'cmd'` this turned the
     exec into `exec -c cmd` (command not found, exit 127) instead of
     `exec sh -c 'cmd'`. Split the branch: real interpreter names
     (*/bin/sh, */bin/bash, bash, sh) now pass through unshifted; the
     "shell" keyword (not a real interpreter) gets its own branch that
     shifts and prepends "sh" to any remaining args, or falls back to a
     bare `__exec_command` (exec bash -l) when none remain.
  Verified `bash -n` passes. Found and fixed upstream in
  dockersrc/go, confirmed identical in this repo's generated
  entrypoint.sh, and mechanically applied here with the same patch.
2026-07-27 23:19:25 -04:00
jason ee93310f88 🐛 Fix duplicate 2>/dev/null in entrypoint.sh /etc/hosts line 🐛
gitea / release-gitea (push) Failing after 13m48s
The grep -vF line that appends /usr/local/etc/hosts entries had a
duplicate 2>/dev/null redirect after the append operator, which is
a no-op but clutters the script. Synced from template.
- rootfs/usr/local/bin/entrypoint.sh: remove duplicate 2>/dev/null
from grep -vF /etc/hosts append line; bump version to 202606261500-git

rootfs/usr/local/bin/entrypoint.sh
2026-06-26 18:44:20 -04:00
jason 36854be70b 🐛 Update entrypoint.sh and functions library from current template 🐛
Stale copies called __initialize_default_templates, __initialize_config_dir,
and __initialize_data_dir which are not in the old functions library,
causing container startup failures. Replaced with current template
versions (202606041210-git) which no longer call those missing functions.
- rootfs/usr/local/bin/entrypoint.sh: update to current template
- rootfs/usr/local/etc/docker/functions/entrypoint.sh: update to current template

.claude/settings.local.json
Dockerfile
.env.scripts
rootfs/usr/local/bin/entrypoint.sh
2026-06-05 18:24:48 -04:00
jason 056270d60c 🐛 Update entrypoint.sh and functions library from current template 🐛
The gitea repo had stale copies of both files. The old entrypoint.sh
called __initialize_default_templates, __initialize_config_dir, and
__initialize_data_dir which don't exist in the old functions library,
causing container startup failures.
Replace both with the current template versions (202606041210-git).
The new entrypoint.sh no longer calls those missing functions.
Set CONTAINER_NAME=gitea and description to match the service.
- rootfs/usr/local/bin/entrypoint.sh: update to 202606041210-git template
- rootfs/usr/local/etc/docker/functions/entrypoint.sh: update to current template

.claude/settings.local.json
rootfs/usr/local/bin/entrypoint.sh
rootfs/usr/local/etc/docker/functions/entrypoint.sh
2026-06-05 18:06:48 -04:00
jason 0abc43bffc 🐛 Fix act_runner registration order 🐛
Runners were launched in parallel subshells with only a 2-second gap
between them. act_runner register is a network call; if Gitea was
still warming up any registration could race past an earlier one,
causing Gitea to assign IDs out of sequence (1,3,2,5,4 instead of
1,2,3,4,5).
Split into two phases: register all runners sequentially first so IDs
are assigned in the correct order, then launch all daemons in parallel
once every runner is confirmed registered.
- rootfs/usr/local/bin/start-runners: split __start_runner into
__register_runner (sequential, phase 1) and __start_runner_daemon
(parallel, phase 2); remove the sleep 2 workaround

rootfs/usr/local/bin/start-runners
2026-05-24 21:37:50 -04:00
jason 7668154e67 🐛 Fix silent download failure and cosmetic naming bugs 🐛
Fixes three bugs discovered during live container testing.
The critical bug was a bash post-increment no-op: `exitCode=$((exitCode++))`
assigns the *old* value back to the variable, so exitCode stays 0 even
when a download fails. This caused the Docker build to succeed silently
when the gitea binary download failed, publishing a broken image to Docker Hub.
- rootfs/root/docker/setup/05-custom.sh: change exitCode=$((exitCode++)) to
exitCode=$((exitCode + 1)) in both the gitea and act_runner failure handlers
- rootfs/usr/local/bin/entrypoint.sh: change CONTAINER_NAME and description
from "archlinux" (copied template default) to "gitea"
- rootfs/usr/local/etc/docker/init.d/08-gitea.sh: remove leading space from
[ -d " /config/ssh" ] path test so the directory existence check is correct

.claude/
rootfs/root/docker/setup/05-custom.sh
rootfs/usr/local/bin/entrypoint.sh
rootfs/usr/local/etc/docker/init.d/08-gitea.sh
2026-05-24 19:58:15 -04:00
jason e599f1edc8 🐛 Fix start-runners: wrong --config arg kept all runners permanently offline 🐛
The daemon was called with --config pointing at the .runner registration
state file (JSON), not a YAML config. act_runner rejected it immediately
on every start, so all runners were always offline and never reconnected.
Also fix log truncation and stale fallback labels.
- rootfs/usr/local/bin/start-runners: remove --config from act_runner
daemon invocation (act_runner finds .runner in CWD automatically after
cd "$runner_dir"); fix __log to append (>>) instead of truncate (>);
update fallback RUNNER_LABELS to match the full label set defined in
zz-act_runner.sh

rootfs/usr/local/bin/start-runners
2026-05-24 12:32:25 -04:00
jason 4d51cc0e7c 🔧 Sync template framework updates and fix app.ini config 🔧
Bring all init scripts and support files up to the latest docker
template framework, and fully configure gitea's app.ini for a
performant, open, reverse-proxy-aware deployment.
- rootfs/tmp/etc/gitea/app.ini: add missing sections ([server],
[cache], [queue], [git], [git.timeout], [api], [webhook],
[indexer], [session], [oauth2], [metrics], [repository.release]);
raise MAX_RESPONSE_ITEMS=500; set PROTOCOL=http, HTTP_ADDR=0.0.0.0,
USE_PROXY_PROTOCOL=false; INSTALL_LOCK=false; tune DB/session/security
- rootfs/usr/local/bin/entrypoint.sh: direct template sync — new trap
style, SSL_CA fix, ENTRYPOINT_PID_FILE path, mapfile, __netstat call
- rootfs/usr/local/etc/docker/functions/entrypoint.sh: direct template
sync — add __log_debug/info/warn/error; improve __netstat, __mkdir,
__rm, __grep_test (639 changed lines)
- rootfs/usr/local/etc/docker/init.d/00-server01.sh: new generic
template/example init.d service script
- rootfs/usr/local/etc/docker/init.d/05-dockerd.sh: framework update —
__trap_err_handler ERR handler, SIGPWR split, enabled-check expanded,
debug if/else, env loop guard, $(<...) PID read, __check_service guard,
__run_start_script rewrite (printf %q, md5sum hash, bash launcher),
errorCode=${PIPESTATUS[0]}, remove unconditional SERVICE_EXIT_CODE=0,
fix __post_execute fire-and-forget
- rootfs/usr/local/etc/docker/init.d/08-gitea.sh: same framework updates
as 05-dockerd.sh, service-specific content preserved
- rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh: same framework
updates; service-specific __post_execute daemon/cache-server logic kept
- rootfs/root/docker/setup/00-init.sh: version stamp sync
- rootfs/root/docker/setup/01-system.sh: version stamp sync
- rootfs/root/docker/setup/02-packages.sh: version stamp sync
- rootfs/root/docker/setup/03-files.sh: header-only patch, gitea-specific
body preserved
- rootfs/root/docker/setup/04-users.sh: version stamp sync
- rootfs/root/docker/setup/05-custom.sh: header-only patch, gitea/act_runner
binary download logic preserved
- rootfs/root/docker/setup/06-post.sh: version stamp sync
- rootfs/root/docker/setup/07-cleanup.sh: version stamp sync
- rootfs/usr/local/share/template-files/config/env/default.sample:
ENTRYPOINT_PID_FILE path → /run/init.d/entrypoint.pid
- rootfs/usr/local/share/template-files/config/env/examples/zz-entrypoint.sh:
ENTRYPOINT_PID_FILE path → /run/init.d/entrypoint.pid

rootfs/root/docker/setup/00-init.sh
rootfs/root/docker/setup/01-system.sh
rootfs/root/docker/setup/02-packages.sh
rootfs/root/docker/setup/03-files.sh
rootfs/root/docker/setup/04-users.sh
rootfs/root/docker/setup/05-custom.sh
rootfs/root/docker/setup/06-post.sh
rootfs/root/docker/setup/07-cleanup.sh
rootfs/tmp/etc/gitea/app.ini
rootfs/usr/local/bin/entrypoint.sh
rootfs/usr/local/etc/docker/functions/entrypoint.sh
rootfs/usr/local/etc/docker/init.d/00-server01.sh
rootfs/usr/local/etc/docker/init.d/05-dockerd.sh
rootfs/usr/local/etc/docker/init.d/08-gitea.sh
rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh
rootfs/usr/local/share/template-files/config/env/default.sample
rootfs/usr/local/share/template-files/config/env/examples/zz-entrypoint.sh
2026-05-24 12:19:59 -04:00
jason 4fc5a83354 🗃️ Removed the .claude/settings.local.json 🗃️
Dockerfile
.env.scripts
.gitattributes
.gitea/workflows/docker.yaml
.gitignore
LICENSE.md
README.md
rootfs/usr/local/bin/entrypoint.sh
rootfs/usr/local/bin/pkmgr
2026-05-12 20:06:34 -04:00
jason 8f8cb303f9 🗃️ rootfs: shield internal entrypoint PID files from /run/*.pid sweeps 🗃️
Update the embedded entrypoint copies in rootfs/ to match the
upstream template change. Internal state files renamed to dotfiles
so they're not matched by `/run/*.pid` cleanup globs:
- /run/init.d/entrypoint.pid -> /run/.entrypoint.pid
- /run/no_exit.pid -> /run/.no_exit.pid
- /run/backup.pid -> /run/.backup.pid
- /run/__start_init_scripts.pid -> /run/.start_init_scripts.pid
Per-service PIDs in /run/init.d/ are unchanged.

rootfs/usr/local/bin/entrypoint.sh
rootfs/usr/local/etc/docker/functions/entrypoint.sh
rootfs/usr/local/etc/docker/init.d/05-dockerd.sh
rootfs/usr/local/etc/docker/init.d/08-gitea.sh
rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh
rootfs/usr/local/share/template-files/config/env/default.sample
rootfs/usr/local/share/template-files/config/env/examples/zz-entrypoint.sh
2026-05-05 19:11:44 -04:00
jason 3c8cdd11fe 🗃️ Update codebase 🗃️
rootfs/usr/local/bin/entrypoint.sh
rootfs/usr/local/etc/docker/functions/entrypoint.sh
2025-11-30 16:25:31 -05:00
jason 63d18bb750 🔧 Update configuration files 🔧
.claude/
Dockerfile
.env.scripts
rootfs/tmp/etc/docker/daemon.json
rootfs/usr/local/bin/entrypoint.sh
rootfs/usr/local/etc/docker/init.d/05-dockerd.sh
2025-11-29 15:48:20 -05:00
jason a79ffa1f6a 🗃️ Update codebase 🗃️
README.md
rootfs/tmp/etc/gitea/app.ini
rootfs/usr/local/bin/entrypoint.sh
rootfs/usr/local/etc/docker/init.d/05-dockerd.sh
rootfs/usr/local/etc/docker/init.d/08-gitea.sh
2025-11-29 13:12:37 -05:00
jason 58363fea97 🗃️ Update codebase 🗃️
rootfs/usr/local/bin/start-runners
2025-11-29 12:52:00 -05:00
jason 5d367f60cf 🗃️ Update codebase 🗃️
rootfs/usr/local/bin/start-runners
rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh
2025-11-29 12:50:30 -05:00
jason 141582499f 🗃️ Fixed the entrypoint scripts 🗃️
rootfs/usr/local/bin/entrypoint.sh
rootfs/usr/local/etc/docker/functions/entrypoint.sh
2025-11-29 12:36:45 -05:00
jason 9c35d61ac0 ...🗃️ Fixed rootfs/usr/local/bin/entrypoint.sh and rootfs/usr/local/etc...
rootfs/usr/local/bin/entrypoint.sh
rootfs/usr/local/etc/docker/functions/entrypoint.sh
2025-11-29 12:24:51 -05:00
jason 7d7a4f732a 🗃️ Update codebase 🗃️
rootfs/root/docker/setup/05-custom.sh
rootfs/usr/local/bin/entrypoint.sh
rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh
2025-11-29 10:27:30 -05:00
jason 6380077e3a 🗃️ Update codebase 🗃️
Dockerfile
rootfs/usr/local/bin/entrypoint.sh
2025-11-29 09:04:35 -05:00
jason 032fdadf8f 🗃️ Update codebase 🗃️
rootfs/usr/local/bin/entrypoint.sh
2025-11-29 08:27:50 -05:00
jason b6c12d04c4 🔧 Update configuration files 🔧
Dockerfile
.env.scripts
rootfs/root/docker/setup/00-init.sh
rootfs/root/docker/setup/01-system.sh
rootfs/root/docker/setup/02-packages.sh
rootfs/root/docker/setup/03-files.sh
rootfs/root/docker/setup/04-users.sh
rootfs/root/docker/setup/05-custom.sh
rootfs/root/docker/setup/06-post.sh
rootfs/root/docker/setup/07-cleanup.sh
rootfs/usr/local/bin/entrypoint.sh
rootfs/usr/local/bin/pkmgr
rootfs/usr/local/etc/docker/functions/entrypoint.sh
rootfs/usr/local/etc/docker/init.d/05-dockerd.sh
rootfs/usr/local/etc/docker/init.d/08-gitea.sh
rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh
rootfs/usr/local/share/template-files/config/env/default.sample
rootfs/usr/local/share/template-files/config/env/examples/00-directory.sh
rootfs/usr/local/share/template-files/config/env/examples/addresses.sh
rootfs/usr/local/share/template-files/config/env/examples/certbot.sh
rootfs/usr/local/share/template-files/config/env/examples/couchdb.sh
rootfs/usr/local/share/template-files/config/env/examples/dockerd.sh
rootfs/usr/local/share/template-files/config/env/examples/global.sh
rootfs/usr/local/share/template-files/config/env/examples/healthcheck.sh
rootfs/usr/local/share/template-files/config/env/examples/mariadb.sh
rootfs/usr/local/share/template-files/config/env/examples/mongodb.sh
rootfs/usr/local/share/template-files/config/env/examples/networking.sh
rootfs/usr/local/share/template-files/config/env/examples/other.sh
rootfs/usr/local/share/template-files/config/env/examples/php.sh
rootfs/usr/local/share/template-files/config/env/examples/postgres.sh
rootfs/usr/local/share/template-files/config/env/examples/redis.sh
rootfs/usr/local/share/template-files/config/env/examples/services.sh
rootfs/usr/local/share/template-files/config/env/examples/ssl.sh
rootfs/usr/local/share/template-files/config/env/examples/supabase.sh
rootfs/usr/local/share/template-files/config/env/examples/webservers.sh
rootfs/usr/local/share/template-files/config/env/examples/zz-entrypoint.sh
2025-11-29 08:04:55 -05:00
jason ecdb087651 🗃️ Committing everything that changed 🗃️
rootfs/usr/local/bin/start-runners
2025-09-17 20:44:50 -04:00
jason d931aff2d1 🗃️ Committing everything that changed 🗃️
rootfs/usr/local/bin/start-runners
rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh
2025-09-17 20:03:26 -04:00
jason 225c9a4438 🗃️ Committing everything that changed 🗃️
rootfs/usr/local/bin/start-runners
rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh
2025-09-17 19:10:47 -04:00
jason ac86c62c64 🗃️ Committing everything that changed 🗃️
rootfs/root/docker/setup/06-post.sh
rootfs/usr/local/bin/start-runners
rootfs/usr/local/etc/docker/init.d/05-dockerd.sh
rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh
2025-09-17 18:55:06 -04:00
jason 3b5f98ff37 🗃️ Committing everything that changed 🗃️
rootfs/usr/local/bin/start-runners
2025-09-17 18:23:42 -04:00
jason d0af1c5f6d 🗃️ Committing everything that changed 🗃️
rootfs/usr/local/bin/start-runners
rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh
2025-09-17 17:40:44 -04:00
jason fbe18132f8 🦈🏠🐜 Initial Commit 🐜🦈🏠 2025-09-16 23:50:36 -04:00