4 Commits
v1 ... master

Author SHA1 Message Date
Deeman
bb70a5372b docs: replace GitLab CI/CD section with Gitea pull-based deployment
All checks were successful
CI / test (push) Successful in 48s
CI / tag (push) Successful in 3s
Remove outdated SSH-push model referencing GitLab variables. Document
the actual pull-based flow: Gitea Actions → tag → supervisor polls.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-28 01:58:11 +01:00
Deeman
bc28d93662 fix: remove duplicate age key in .sops.yaml
All checks were successful
CI / test (push) Successful in 47s
CI / tag (push) Successful in 3s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-27 18:30:31 +01:00
Deeman
81ce1d277a update key
Some checks failed
CI / test (push) Has been cancelled
CI / tag (push) Has been cancelled
2026-02-27 18:26:14 +01:00
Deeman
2012894eeb chore: migrate from GitLab to self-hosted Gitea
Some checks failed
CI / test (push) Has been cancelled
CI / tag (push) Has been cancelled
Update bootstrap_supervisor.sh and setup_server.sh to use
git.padelnomics.io:2222 instead of gitlab.com.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-27 18:23:20 +01:00
3 changed files with 19 additions and 17 deletions

View File

@@ -396,18 +396,19 @@ docker compose logs -f app # tail logs
## CI/CD ## CI/CD
Go to GitLab → padelnomics → Settings → CI/CD → Variables and add: Pull-based deployment via Gitea Actions — no SSH keys or deploy credentials in CI.
| Variable | Value | Notes | 1. Push to master → Gitea Actions runs tests (`.gitea/workflows/ci.yaml`)
|----------|-------|-------| 2. On success, CI creates tag `v<run_number>` using the built-in `github.token`
| SSH_PRIVATE_KEY | Your ed25519 private key | Mask it, type "Variable" | 3. On-server supervisor polls for new tags every 60s and deploys automatically
| DEPLOY_HOST | Your Hetzner server IP | e.g. 1.2.3.4 |
| DEPLOY_USER | SSH username on the server | e.g. deploy or root |
| SSH_KNOWN_HOSTS | Server host key | Run `ssh-keyscan $YOUR_SERVER_IP` |
Server-side one-time setup: **Server-side one-time setup:**
1. Add the matching public key to `~/.ssh/authorized_keys` for the deploy user ```bash
2. Clone the repo to `/opt/padelnomics` bash infra/setup_server.sh # creates padelnomics_service user, keys, dirs
3. Create `.env` from `padelnomics/.env.example` with production values ssh root@<server> 'bash -s' < infra/bootstrap_supervisor.sh
4. `chmod +x deploy.sh && ./deploy.sh` for the first deploy ```
5. Point reverse proxy to port 5000
1. `setup_server.sh` generates an ed25519 SSH deploy key — add the printed public key to Gitea:
`git.padelnomics.io → padelnomics → Settings → Deploy Keys → Add key (read-only)`
2. Add the printed age public key to `.sops.yaml`, re-encrypt, commit + push
3. Run `bootstrap_supervisor.sh` — clones from `git.padelnomics.io:2222`, decrypts secrets, starts systemd supervisor

View File

@@ -15,7 +15,7 @@ set -euo pipefail
SERVICE_USER="padelnomics_service" SERVICE_USER="padelnomics_service"
REPO_DIR="/opt/padelnomics" REPO_DIR="/opt/padelnomics"
GITLAB_PROJECT="deemanone/padelnomics" GITEA_REPO="ssh://git@git.padelnomics.io:2222/deemanone/padelnomics.git"
UV="/home/${SERVICE_USER}/.local/bin/uv" UV="/home/${SERVICE_USER}/.local/bin/uv"
[ "$(id -u)" = "0" ] || { echo "ERROR: Run as root"; exit 1; } [ "$(id -u)" = "0" ] || { echo "ERROR: Run as root"; exit 1; }
@@ -35,7 +35,7 @@ if [ -d "${REPO_DIR}/.git" ]; then
sudo -u "${SERVICE_USER}" git -C "${REPO_DIR}" fetch --tags --prune-tags origin sudo -u "${SERVICE_USER}" git -C "${REPO_DIR}" fetch --tags --prune-tags origin
else else
sudo -u "${SERVICE_USER}" git clone \ sudo -u "${SERVICE_USER}" git clone \
"git@gitlab.com:${GITLAB_PROJECT}.git" "${REPO_DIR}" "${GITEA_REPO}" "${REPO_DIR}"
fi fi
LATEST_TAG=$(sudo -u "${SERVICE_USER}" \ LATEST_TAG=$(sudo -u "${SERVICE_USER}" \

View File

@@ -75,7 +75,8 @@ fi
if [ ! -f "${SSH_DIR}/config" ]; then if [ ! -f "${SSH_DIR}/config" ]; then
cat > "${SSH_DIR}/config" <<EOF cat > "${SSH_DIR}/config" <<EOF
Host gitlab.com Host git.padelnomics.io
Port 2222
IdentityFile ${DEPLOY_KEY} IdentityFile ${DEPLOY_KEY}
IdentitiesOnly yes IdentitiesOnly yes
EOF EOF
@@ -83,7 +84,7 @@ EOF
chmod 600 "${SSH_DIR}/config" chmod 600 "${SSH_DIR}/config"
fi fi
ssh-keyscan -H gitlab.com >> "${SSH_DIR}/known_hosts" 2>/dev/null ssh-keyscan -H -p 2222 git.padelnomics.io >> "${SSH_DIR}/known_hosts" 2>/dev/null
sort -u "${SSH_DIR}/known_hosts" -o "${SSH_DIR}/known_hosts" sort -u "${SSH_DIR}/known_hosts" -o "${SSH_DIR}/known_hosts"
chown "${SERVICE_USER}:${SERVICE_USER}" "${SSH_DIR}/known_hosts" chown "${SERVICE_USER}:${SERVICE_USER}" "${SSH_DIR}/known_hosts"
chmod 644 "${SSH_DIR}/known_hosts" chmod 644 "${SSH_DIR}/known_hosts"