mirror of
https://github.com/hanzoai/forge.git
synced 2026-10-30 15:00:39 +00:00
The binary rename to gitd was already done in the Makefile, the Go source (delegateHookName), and the docker wrapper. Two leaks were left in the parts a user or operator actually sees. /app/gitd/gitd -> /app/git/gitd The directory is the product and the binary is the daemon; the old path stuttered. Changed in Dockerfile, Dockerfile.rootless, and both wrapper scripts, which is every place the path is written. In-image only, so no migration: nothing under a volume moves. "AUTO GENERATED BY GITEA" -> "AUTO GENERATED BY HANZO GIT" This string is not a source comment. It is written into the hook scripts of every repository on disk, so it was the most widely deployed gitea mention we had — one copy per repo, visible to anyone who opened a hook. Seven occurrences. Existing hooks keep the old text until they are regenerated. That regeneration is already wired safely: SyncRepositoryHooks re-runs over every repository on the first boot after setting.AppPath moves, before the web listener opens, and legacyDelegateHookNames removes the delegates the old name left behind. The comment in modules/gitrepo/hooks.go spells out why renaming the delegate is only safe in a release that also moves AppPath — that invariant is untouched here. NOT changed, deliberately: /data/gitea (root image) and /var/lib/gitea, /etc/gitea (rootless). Those are volume paths, not image paths. Renaming them relocates live data and needs a migration step, which is its own change with its own rollback. They are the last gitea leak and they are a data move, not a rename.
40 lines
818 B
Bash
40 lines
818 B
Bash
#!/bin/bash
|
|
|
|
##############################################################
|
|
# This script sets defaults for gitd to run in the container #
|
|
##############################################################
|
|
|
|
# Installed as gitd in /usr/local/bin; the real binary lives in /app/git. See
|
|
# the rootful copy for why `exec -a "$0"` and this path are load-bearing.
|
|
GITD="/app/git/gitd"
|
|
WORK_DIR="/var/lib/gitea"
|
|
APP_INI="/etc/gitea/app.ini"
|
|
|
|
APP_INI_SET=""
|
|
for i in "$@"; do
|
|
case "$i" in
|
|
"-c")
|
|
APP_INI_SET=1
|
|
;;
|
|
"-c="*)
|
|
APP_INI_SET=1
|
|
;;
|
|
"--config")
|
|
APP_INI_SET=1
|
|
;;
|
|
"--config="*)
|
|
APP_INI_SET=1
|
|
;;
|
|
*)
|
|
;;
|
|
esac
|
|
done
|
|
|
|
if [ -z "$APP_INI_SET" ]; then
|
|
CONF_ARG=("-c" "${GIT_APP_INI:-$APP_INI}")
|
|
fi
|
|
|
|
|
|
# Provide docker defaults
|
|
GIT_WORK_DIR="${GIT_WORK_DIR:-$WORK_DIR}" exec -a "$0" "$GITD" "${CONF_ARG[@]}" "$@"
|