Commit Graph
20 Commits
Author SHA1 Message Date
jason 5b995c205b 🐛 Fix database dir excluded from permission fixup, causing restart loop 🐛
Root cause: the `git` service user's UID is assigned dynamically (random,
non-persistent across container recreations), and __fix_permissions
re-chowns APPLICATION_DIRS on every startup to whatever UID `git`
currently has. However DATABASE_DIR / DATABASE_BASE_DIR (e.g.
/data/db/sqlite for the sqlite backend) live under /data/db, outside
APPLICATION_DIRS ($ETC_DIR $CONF_DIR $DATA_DIR $LOG_DIR $TMP_DIR
$RUN_DIR $VAR_DIR, where DATA_DIR is /data/opengist, not /data). So
whenever the on-disk DB ownership didn't already match the current
`git` UID, it was never corrected, and opengist failed every start
with "attempt to write a readonly database (8)", causing the
container to exit and get restarted indefinitely.

Reproduced against a live instance (git.casjay.work,
casjaysdevdocker/opengist:latest): confirmed via container logs and
`id git` vs `ls -la /data/db/sqlite` that the sqlite file's owning UID
did not match the current `git` UID, and manually chowning it fixed
that boot but the mismatch could recur on any future UID reassignment.
Reproduced locally by pre-seeding a volume with the DB owned by an
arbitrary UID (9999) and confirming, pre-fix, __fix_permissions never
touched it; post-fix, the container's first boot re-chowns it to the
newly assigned `git` UID and opengist starts cleanly.

- rootfs/usr/local/etc/docker/init.d/00-opengist.sh: after the
  database-type case block resolves DATABASE_DIR/DATABASE_BASE_DIR,
  append both to ADD_APPLICATION_DIRS so __fix_permissions picks them
  up on every startup, regardless of database backend
2026-08-03 10:47:06 -04:00
jason b016f1db1d 🐛 Fix container restart loop from set -e propagation 🐛
Build and Push / build (push) Failing after 1s
opengist / release-opengist (push) Failing after 53s
Root cause: many functions in functions/entrypoint.sh ended with a bare,
unguarded `[ "$DEBUGGER" = "on" ] && echo/printf/__service_banner ...`
statement as their last executed line. With DEBUGGER unset (the default
runtime case), the `[ ]` test is false, so the function's implicit
return value is nonzero. Several of these functions (most critically
__symlink, called bare from __setup_mta) are invoked as unguarded
statements from other functions, and the whole entrypoint runs under
`set -eo pipefail`, so the nonzero return aborted the entire script
chain immediately after startup — explaining why the container only
printed the first log line and exited 1, and why it only worked with
DEBUGGER=on (which makes the echo run and return 0, masking the bug).

Verified via two clean docker buildx build + run cycles: before the
fix, `docker inspect` showed the container crash-looping (exit 1,
~3.9s uptime); after, `RestartCount=0 Status=running Health=healthy`
with opengist fully started, DEBUGGER unset.

- rootfs/usr/local/etc/docker/functions/entrypoint.sh: append `|| true`
  to all 26 bare `[ "$DEBUGGER" = "on" ] && ...` statements so their
  result never propagates as the enclosing function's return value
- TODO.AI.md: log 20 pre-existing script-lint findings on the same
  file (missing `--` on grep, missing `local` on a few function-local
  vars, missing VERSION= line) found incidentally while diagnosing
  this bug; deferred as unrelated cleanup, not part of this fix
2026-08-03 09:41:46 -04:00
jason 5a588e7075 🗃️ Update codebase 🗃️
opengist / release-opengist (push) Failing after 2m12s
Build and Push / build (push) Failing after 29m24s
rootfs/usr/local/etc/docker/functions/entrypoint.sh
2026-08-02 20:43:58 -04:00
jason 3b463a4bba 🗃️ Update codebase 🗃️
Build and Push / build (push) Failing after 2s
opengist / release-opengist (push) Failing after 2s
rootfs/usr/local/etc/docker/functions/entrypoint.sh
2026-06-26 23:51:32 -04:00
jason 575cbfdd2c 🐛 Fix __create_service_env to write .local.sh to disk 🐛
The .local.sh block defined stub functions in memory but never
wrote the file to disk, so __file_exists_with_content always
failed and __create_service_env returned non-zero on every run.
Fix: use a heredoc to write the stub functions into .local.sh.
- rootfs/usr/local/etc/docker/init.d/00-opengist.sh: write .local.sh
via heredoc in __create_service_env; bump version to 202606261600-git

rootfs/usr/local/etc/docker/init.d/00-opengist.sh
2026-06-26 21:04:36 -04:00
jason bc212ec85c 🗃️ Updated 🗃️
Dockerfile
.env.scripts
.gitattributes
.gitea/workflows/build.yml
.gitignore
README.md
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/opengist/config.yaml
rootfs/usr/local/bin/entrypoint.sh
rootfs/usr/local/etc/docker/functions/entrypoint.sh
rootfs/usr/local/etc/docker/init.d/00-opengist.sh
rootfs/usr/local/etc/resolv.conf
2026-06-12 05:39:45 -04:00
jason 0a8cc3019b ♻️ Migrate opengist to /config/ source-of-truth architecture ♻️
Migrate opengist Docker image to the new build-time config architecture.
- rootfs/root/docker/setup/03-files.sh: rewrite to canonical form with /tmp/bin, /tmp/var, /tmp/etc, /tmp/usr handlers; remove template-files copy block
- rootfs/usr/local/etc/docker/functions/entrypoint.sh: update to latest template with __init_service_conf, __find_php_ini, __find_php_bin helpers
- rootfs/usr/local/etc/docker/init.d/*.sh: fix $(basename) UUOC → ${var##*/}; move inline comments above code lines; remove commented-out dead code
- rootfs/usr/local/share/template-files/: delete entire directory; config files now deployed via /tmp/etc/ at build time

rootfs/root/docker/setup/03-files.sh
rootfs/usr/local/etc/docker/functions/entrypoint.sh
rootfs/usr/local/etc/docker/init.d/00-opengist.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
rootfs/usr/local/share/template-files/config/.gitkeep
rootfs/usr/local/share/template-files/data/.gitkeep
rootfs/usr/local/share/template-files/defaults/.gitkeep
2026-06-04 14:47:16 -04:00
jason e9de36a20b 🗃️ Updated the functions file 🗃️
rootfs/usr/local/etc/docker/functions/entrypoint.sh
2026-05-24 12:27:21 -04:00
jason d4764c5f7a 🗃️ 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/00-opengist.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:12:36 -04:00
jason b3f234d69e 🗃️ Update codebase 🗃️
rootfs/usr/local/bin/entrypoint.sh
rootfs/usr/local/etc/docker/init.d/00-opengist.sh
2026-02-02 11:14:08 -05:00
jason fb32ddf69c 🗃️ Update codebase 🗃️
rootfs/usr/local/bin/entrypoint.sh
rootfs/usr/local/etc/docker/functions/entrypoint.sh
2025-11-30 16:25:53 -05:00
jason 8ca45bd693 🔄 Updated entrypoint.sh script in docker functions directory 🔄
rootfs/usr/local/etc/docker/functions/entrypoint.sh
2025-11-30 16:05:13 -05:00
jason 9d28639a1f 🗃️ Update codebase 🗃️
rootfs/usr/local/etc/docker/init.d/00-opengist.sh
2025-11-29 15:03:05 -05:00
jason 3d43b8a912 🗃️ Fixed the entrypoint scripts 🗃️
rootfs/usr/local/bin/entrypoint.sh
rootfs/usr/local/etc/docker/functions/entrypoint.sh
2025-11-29 12:37:07 -05:00
jason d454bd1983 🗃️ Updated Dockerfile* and .env.scripts* 🗃️
rootfs/usr/local/bin/entrypoint.sh
rootfs/usr/local/etc/docker/functions/entrypoint.sh
2025-11-29 11:04:42 -05:00
jason 92a70efe12 🗃️ Update codebase 🗃️
rootfs/usr/local/etc/docker/functions/entrypoint.sh
2025-11-29 09:15:08 -05:00
jason 35b17f6ce1 🔧 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/00-opengist.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:22:47 -05:00
jason a912f0e336 🗃️ Committing everything that changed 🗃️
rootfs/usr/local/etc/docker/functions/entrypoint.sh
rootfs/usr/local/etc/docker/init.d/00-opengist.sh
2025-09-20 06:39:39 -04:00
jason e893bbf09d 🗃️ Committing everything that changed 🗃️
rootfs/usr/local/etc/docker/functions/
2025-09-20 05:27:53 -04:00
jason 591e8cb540 🦈🏠🐜 Initial Commit 🐜🦈🏠 2025-09-16 23:50:20 -04:00