feat: add Gitea registry authentication support

- Add gitea_registry, gitea_user, gitea_token to config.json parsing
- Pass Gitea credentials to setup.sh via --gitea-* arguments
- Add docker login for Gitea registry in setup.sh
- Supports both Docker Hub and Gitea registries simultaneously

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Matt 2025-12-08 21:20:27 +01:00
parent 6f4bee8128
commit c09546f916
2 changed files with 34 additions and 0 deletions

View File

@ -31,6 +31,11 @@ DOCKER_USER=""
DOCKER_TOKEN="" DOCKER_TOKEN=""
DOCKER_REGISTRY="" DOCKER_REGISTRY=""
# Gitea registry authentication (for private images from code.letsbe.solutions)
GITEA_REGISTRY=""
GITEA_USER=""
GITEA_TOKEN=""
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case $1 in case $1 in
--tools) --tools)
@ -61,6 +66,18 @@ while [[ $# -gt 0 ]]; do
DOCKER_REGISTRY="$2" DOCKER_REGISTRY="$2"
shift 2 shift 2
;; ;;
--gitea-registry)
GITEA_REGISTRY="$2"
shift 2
;;
--gitea-user)
GITEA_USER="$2"
shift 2
;;
--gitea-token)
GITEA_TOKEN="$2"
shift 2
;;
--help|-h) --help|-h)
echo "Usage: $0 [--tools \"tool1,tool2,...\"|\"all\"] [--domain DOMAIN] [--skip-ssl] [--root-ssl]" echo "Usage: $0 [--tools \"tool1,tool2,...\"|\"all\"] [--domain DOMAIN] [--skip-ssl] [--root-ssl]"
echo "" echo ""
@ -129,6 +146,12 @@ if [[ -n "$DOCKER_USER" && -n "$DOCKER_TOKEN" ]]; then
fi fi
fi fi
# Gitea registry login (for private images from code.letsbe.solutions)
if [[ -n "$GITEA_REGISTRY" && -n "$GITEA_USER" && -n "$GITEA_TOKEN" ]]; then
echo "Logging into Gitea registry: $GITEA_REGISTRY..."
echo "$GITEA_TOKEN" | docker login -u "$GITEA_USER" --password-stdin "$GITEA_REGISTRY"
fi
# ============================================================================= # =============================================================================
# DISABLE CONFLICTING SERVICES # DISABLE CONFLICTING SERVICES
# ============================================================================= # =============================================================================

View File

@ -62,6 +62,11 @@ DOCKER_USER=""
DOCKER_TOKEN="" DOCKER_TOKEN=""
DOCKER_REGISTRY="" DOCKER_REGISTRY=""
# Gitea registry authentication (for private images)
GITEA_REGISTRY=""
GITEA_USER=""
GITEA_TOKEN=""
# ============================================================================= # =============================================================================
# HELPER FUNCTIONS # HELPER FUNCTIONS
# ============================================================================= # =============================================================================
@ -139,6 +144,9 @@ parse_json() {
DOCKER_USER=$(echo "$json" | jq -r '.docker_user // empty') DOCKER_USER=$(echo "$json" | jq -r '.docker_user // empty')
DOCKER_TOKEN=$(echo "$json" | jq -r '.docker_token // empty') DOCKER_TOKEN=$(echo "$json" | jq -r '.docker_token // empty')
DOCKER_REGISTRY=$(echo "$json" | jq -r '.docker_registry // empty') DOCKER_REGISTRY=$(echo "$json" | jq -r '.docker_registry // empty')
GITEA_REGISTRY=$(echo "$json" | jq -r '.gitea_registry // empty')
GITEA_USER=$(echo "$json" | jq -r '.gitea_user // empty')
GITEA_TOKEN=$(echo "$json" | jq -r '.gitea_token // empty')
# Registration token (can also be set via environment variable) # Registration token (can also be set via environment variable)
local json_token=$(echo "$json" | jq -r '.registration_token // empty') local json_token=$(echo "$json" | jq -r '.registration_token // empty')
@ -381,6 +389,9 @@ if [[ "$ACTION" == "setup" ]]; then
[[ -n "$DOCKER_USER" ]] && SETUP_ARGS="$SETUP_ARGS --docker-user $(printf '%q' "$DOCKER_USER")" [[ -n "$DOCKER_USER" ]] && SETUP_ARGS="$SETUP_ARGS --docker-user $(printf '%q' "$DOCKER_USER")"
[[ -n "$DOCKER_TOKEN" ]] && SETUP_ARGS="$SETUP_ARGS --docker-token $(printf '%q' "$DOCKER_TOKEN")" [[ -n "$DOCKER_TOKEN" ]] && SETUP_ARGS="$SETUP_ARGS --docker-token $(printf '%q' "$DOCKER_TOKEN")"
[[ -n "$DOCKER_REGISTRY" ]] && SETUP_ARGS="$SETUP_ARGS --docker-registry $(printf '%q' "$DOCKER_REGISTRY")" [[ -n "$DOCKER_REGISTRY" ]] && SETUP_ARGS="$SETUP_ARGS --docker-registry $(printf '%q' "$DOCKER_REGISTRY")"
[[ -n "$GITEA_REGISTRY" ]] && SETUP_ARGS="$SETUP_ARGS --gitea-registry $(printf '%q' "$GITEA_REGISTRY")"
[[ -n "$GITEA_USER" ]] && SETUP_ARGS="$SETUP_ARGS --gitea-user $(printf '%q' "$GITEA_USER")"
[[ -n "$GITEA_TOKEN" ]] && SETUP_ARGS="$SETUP_ARGS --gitea-token $(printf '%q' "$GITEA_TOKEN")"
# Run setup.sh directly in foreground (connection stays alive with PermitRootLogin yes) # Run setup.sh directly in foreground (connection stays alive with PermitRootLogin yes)
echo "Running setup.sh (this may take 10-15 minutes)..." echo "Running setup.sh (this may take 10-15 minutes)..."