Files
homebrewery-oidc/scripts/git-e2e-gitea.sh
dev-bot BotandClaude Sonnet 5.5 448c67912f
CI / App (npm ci + Build, ESLint, Stylelint, Jest) (push) Successful in 3m25s
CI / Storage (mongo) (push) Successful in 1m24s
CI / Storage (postgres) (push) Successful in 1m13s
Image / Image bauen und pushen (push) Successful in 1m3s
feat(git): Git-Backend über HTTPS + PAT (ADR 0003, FLW-86) (#19)
Repositories gitConnections/brewGitLinks (Mongo/PG), Krypto, SSRF-Policy mit net.BlockList, git-Client ohne Arbeitskopie, Sync/Konflikte, /api/git/*, Client (Verbindungen, Git-Status, Konfliktdialog), Autosave 60 s für Git-Brews (F6), Tests und Doku.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Dev (Paperclip) <dev-bot@noreply.git.morlana.online>
2026-11-25 21:16:42 +00:00

23 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env bash
# Startet eine Wegwerf-Gitea-Instanz (Docker, SQLite), legt Benutzer, Token und Repo an und führt
# scripts/git-e2e.mjs dagegen aus. Container wird am Ende gestoppt. Nur Dev-Zugangsdaten.
set -euo pipefail
cd "$(dirname "$0")/.."
NAME=hb-e2e-gitea
PORT=${GITEA_E2E_PORT:-3300}
IMAGE=${GITEA_IMAGE:-gitea/gitea:1.24}
PASS="e2e-$(openssl rand -hex 8)"
cleanup() { docker rm -f "$NAME" >/dev/null 2>&1 || true; }
trap cleanup EXIT
cleanup
docker run -d --name "$NAME" --memory 400m -p "127.0.0.1:${PORT}:3000" \
-e GITEA__database__DB_TYPE=sqlite3 -e GITEA__security__INSTALL_LOCK=true \
-e GITEA__server__ROOT_URL="http://127.0.0.1:${PORT}/" -e GITEA__service__DISABLE_REGISTRATION=true "$IMAGE" >/dev/null
for _ in $(seq 1 60); do curl -fs "http://127.0.0.1:${PORT}/api/healthz" >/dev/null && break; sleep 2; done
docker exec -u git "$NAME" gitea admin user create --admin --username tester --password "$PASS" --email tester@example.test --must-change-password=false >/dev/null
TOKEN=$(curl -fs -u "tester:$PASS" -H 'Content-Type: application/json' -X POST "http://127.0.0.1:${PORT}/api/v1/users/tester/tokens" \
-d '{"name":"e2e","scopes":["write:repository","write:user"]}' | sed -n 's/.*"sha1":"\([^"]*\)".*/\1/p')
curl -fs -u "tester:$PASS" -H 'Content-Type: application/json' -X POST "http://127.0.0.1:${PORT}/api/v1/user/repos" -d '{"name":"hb-e2e"}' >/dev/null
GIT_E2E_URL="http://127.0.0.1:${PORT}/tester/hb-e2e.git" GIT_E2E_USER=tester GIT_E2E_TOKEN="$TOKEN" \
GIT_E2E_ALLOW_HTTP=true GIT_E2E_ALLOW_PRIVATE=true node scripts/git-e2e.mjs