forgejo db issues; eod checkin

This commit is contained in:
Mark Randall Havens 2025-05-25 01:27:32 -05:00
parent d2d01d7f63
commit 7c11e6163c
21 changed files with 1529 additions and 43 deletions

23
scripts/forgejo-entrypoint.sh Executable file
View file

@ -0,0 +1,23 @@
#!/bin/sh
# Fix ownership (ignore failure in rootless mode)
chown -R 1000:1000 /var/lib/gitea || echo "Warning: chown failed, likely due to rootless mode."
APP_INI="/var/lib/gitea/custom/conf/app.ini"
# Delay until config is saved by frontend, then patch it (if it exists)
fix_config() {
if [ -f "$APP_INI" ]; then
echo "Patching ROOT_URL to /forgejo subpath..."
sed -i 's|^ROOT_URL *=.*|ROOT_URL = http://localhost:8080/forgejo/|' "$APP_INI"
fi
}
# Background config fixer that waits for web setup to complete
(
echo "Waiting to patch app.ini..."
sleep 10
fix_config
) &
exec /usr/bin/dumb-init -- /usr/local/bin/forgejo "$@"