mirror of
https://github.com/casjaysdevdocker/gitea
synced 2026-05-24 15:28:44 -04:00
e8021e29e29152849644e0d5d30ec7db2b91a8b1
Runner registration was broken by three compounding bugs:
1. Token generated at script init time (before gitea was ready)
2. gitea CLI missing --work-path/--custom-path flags, writing fatal
log messages to stdout which got captured as the token value
3. Token assignment inside a piped subshell didn't propagate back
to the parent shell, leaving SYS_AUTH_TOKEN empty at runtime
4. INSTALL_LOCK=false in app.ini template caused gitea to start in
install-wizard mode, making generate-runner-token always fail
- rootfs/tmp/etc/gitea/app.ini: set INSTALL_LOCK=true so gitea
auto-initializes the SQLite DB on first run
- rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh:
- defer SYS_AUTH_TOKEN: initialize to empty at global scope,
generate in __run_pre_execute_checks after gitea is confirmed up
- add --work-path/--custom-path to gitea CLI call; filter output
with grep -oE '[A-Za-z0-9]{20,}' to extract only the token
- guard token generation on INSTALL_LOCK=true in app.ini
- read token back from $CONF_DIR/tokens/system after the piped
__run_pre_execute_checks call returns (subshell escape)
Tested: fresh start registers all 5 runners with full 22-label set;
restart skips re-registration and reconnects all 5 daemons cleanly.
rootfs/tmp/etc/gitea/app.ini
rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh
👋 Welcome to gitea 🚀
gitea README
Install my system scripts
sudo bash -c "$(curl -q -LSsf "https://github.com/systemmgr/installer/raw/main/install.sh")"
sudo systemmgr --config && sudo systemmgr install scripts
Automatic install/update
dockermgr update gitea
Install and run container
dockerHome="/var/lib/srv/$USER/docker/casjaysdevdocker/gitea/gitea/latest/rootfs"
mkdir -p "/var/lib/srv/$USER/docker/gitea/rootfs"
git clone "https://github.com/dockermgr/gitea" "$HOME/.local/share/CasjaysDev/dockermgr/gitea"
cp -Rfva "$HOME/.local/share/CasjaysDev/dockermgr/gitea/rootfs/." "$dockerHome/"
docker run -d \
--restart always \
--privileged \
--name casjaysdevdocker-gitea-latest \
--hostname gitea \
-e TZ=${TIMEZONE:-America/New_York} \
-v "$dockerHome/data:/data:z" \
-v "$dockerHome/config:/config:z" \
-p 80:80 \
casjaysdevdocker/gitea:latest
via docker-compose
version: "2"
services:
ProjectName:
image: casjaysdevdocker/gitea
container_name: casjaysdevdocker-gitea
environment:
- TZ=America/New_York
- HOSTNAME=gitea
volumes:
- "/var/lib/srv/$USER/docker/casjaysdevdocker/gitea/gitea/latest/rootfs/data:/data:z"
- "/var/lib/srv/$USER/docker/casjaysdevdocker/gitea/gitea/latest/rootfs/config:/config:z"
ports:
- 80:80
restart: always
Get source files
dockermgr download src casjaysdevdocker/gitea
OR
git clone "https://github.com/casjaysdevdocker/gitea" "$HOME/Projects/github/casjaysdevdocker/gitea"
Build container
cd "$HOME/Projects/github/casjaysdevdocker/gitea"
buildx
Authors
Description
Languages
Shell
95.7%
Dockerfile
4.3%