🐛 Fix git fatal error reading /root/.git at gitea startup 🐛

Docker's WORKDIR is /root and the git user has no read permission on
that directory. When gitea starts via gosu git, git inherits /root as
the working directory, calls getcwd(), constructs /root/.git, and
fails with "fatal: error reading '/root/.git'" — crashing gitea.
Setting WORK_DIR=/data/gitea causes the init functions library to cd
to /data/gitea before launching the service, so git never sees /root.
- rootfs/usr/local/etc/docker/init.d/08-gitea.sh: set WORK_DIR=/data/gitea

rootfs/usr/local/etc/docker/init.d/08-gitea.sh
This commit is contained in:
2026-06-05 17:40:04 -04:00
parent 7e6f4f5a84
commit 0ff1923d3e
@@ -145,7 +145,7 @@ RUN_DIR="/run/gitea"
LOG_DIR="/data/logs/gitea"
# - - - - - - - - - - - - - - - - - - - - - - - - -
# Set the working dir
WORK_DIR=""
WORK_DIR="/data/gitea"
# - - - - - - - - - - - - - - - - - - - - - - - - -
# port which service is listening on
SERVICE_PORT="80"