The UI registration token is not a hex string — create-runner-file --secret expects a hex secret. Use the register subcommand with --token instead, which accepts the token from the Forgejo UI directly. https://claude.ai/code/session_01FKCW3FDjNFj6jve4niMFXH
23 lines
867 B
Bash
Executable file
23 lines
867 B
Bash
Executable file
#!/bin/sh
|
|
# runner-entrypoint.sh — register the Forgejo runner on first start, then run the daemon.
|
|
#
|
|
# On first run (no /data/.runner file) it calls create-runner-file to register
|
|
# with the Forgejo instance using FORGEJO_RUNNER_TOKEN. On subsequent starts it
|
|
# goes straight to the daemon.
|
|
set -e
|
|
|
|
CONFIG=/data/.runner
|
|
|
|
if [ ! -f "$CONFIG" ]; then
|
|
echo "[runner] No registration found — registering with Forgejo…"
|
|
forgejo-runner register \
|
|
--instance "${FORGEJO_INSTANCE_URL}" \
|
|
--token "${FORGEJO_RUNNER_TOKEN}" \
|
|
--name "${FORGEJO_RUNNER_NAME:-hiy-runner}" \
|
|
--labels "ubuntu-latest:docker://node:20-bookworm,ubuntu-22.04:docker://node:20-bookworm" \
|
|
--no-interactive
|
|
echo "[runner] Registration complete."
|
|
fi
|
|
|
|
echo "[runner] Starting daemon…"
|
|
exec forgejo-runner daemon --config "$CONFIG"
|