Author SHA1 Message Date
Jochen MehlichandClaude Sonnet 5.5 76b8a9417e create-deploy-user.py: Standard-authentik-URL auf auth.share-fix.de
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-24 11:08:09 +02:00
Jochen MehlichandClaude Sonnet 5.5 75c0b8ca88 create-deploy-user.py: mit uv ausführbar (Shebang + Inline-Abhängigkeiten)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-24 11:03:24 +02:00
Jochen MehlichandClaude Sonnet 5.5 beba2d7ef1 Beispiel-Deploy-Workflow für Dienst-Repos
lint / python (push) Has been cancelled
lint / shell (push) Has been cancelled
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-24 10:55:40 +02:00
Jochen MehlichandClaude Sonnet 5.5 03e83d68b8 Gitea-Workflow: Lint für Shell- und Python-Skripte
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-24 10:54:29 +02:00
jochen ed18e0a908 Update setup-sshd-ldap.sh 2026-10-24 08:16:32 +00:00
Jochen MehlichandClaude Sonnet 5.5 612b4f7250 Doku und Skripte: authentik-LDAP-Outpost mit sshd (SSSD), Self-only-Check in docker-deploy.sh
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-24 10:15:01 +02:00
Jochen MehlichandClaude Sonnet 5.5 7085909165 Remove committed pyc, add .gitignore
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-24 10:10:03 +02:00
Jochen MehlichandClaude Sonnet 5.5 658d975ac9 Docker-Gruppe server_<SERVER>_docker_compose (Default H1), Deploy-Verzeichnis 'deployment', Repo-Link in authentik notes
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-24 10:05:52 +02:00
Jochen MehlichandClaude Sonnet 5.5 c2add5e660 Add create-deploy-user.py: Gitea statt GitLab, nur Deploy-User, --server und Docker-Gruppe
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-24 10:02:30 +02:00
Jochen MehlichandClaude Sonnet 5.5 9122259f55 docker-deploy.sh: --no-cache wieder Standard, --cache als Opt-out
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-24 09:58:06 +02:00
Jochen MehlichandClaude Sonnet 5.5 5cb8c6b67a Optimiere docker-deploy.sh: Validierung, Lock, Symlink-Schutz, --no-cache optional
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-24 09:57:16 +02:00
4 changed files with 96 additions and 3 deletions

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
name: lint
on:
push:
branches: [main]
pull_request:
jobs:
shell:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: bash -n
run: for f in *.sh; do bash -n "$f"; done
- name: shellcheck
run: |
sudo apt-get update -qq && sudo apt-get install -y -qq shellcheck
shellcheck --severity=warning *.sh
python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Syntax-Check
run: python -m py_compile create-deploy-user.py
- name: ruff
run: pip install -q ruff && ruff check create-deploy-user.py
+9 -2
View File
@@ -1,4 +1,11 @@
#!/usr/bin/env python3
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.13"
# dependencies = [
# "authentik-client>=2026.8.5",
# "requests>=2.34.2",
# ]
# ///
"""Legt in authentik einen Deploy-User für ein Gitea-Repository an und hinterlegt
die Zugangsdaten als Gitea-Actions-Secrets/-Variablen."""
@@ -13,7 +20,7 @@ import authentik_client
import requests
from authentik_client.rest import ApiException
DEFAULT_AUTHENTIK_URL = "https://auth.systems.cogsys.wiai.uni-bamberg.de/api/v3"
DEFAULT_AUTHENTIK_URL = "https://auth.share-fix.de/api/v3"
DEFAULT_GITEA_URL = "https://git.share-fix.de"
DEFAULT_SERVER = "H1"
HOME_DIR_BASE = "/home"
+56
View File
@@ -0,0 +1,56 @@
# Beispiel: .gitea/workflows/deploy.yml im Repo eines Dienstes
#
# Voraussetzungen (Setup mit create-deploy-user.py --project-path owner/repo):
# Variable deploy_user – Deploy-User (wird vom Skript gesetzt)
# Secret deploy_pass – Passwort/App-Token des Users (wird vom Skript gesetzt)
# Variable deploy_host – Hostname/IP des Zielservers (manuell setzen)
#
# Das Repo enthält docker-compose.yml (und optional docker-compose.override.yml)
# im Wurzelverzeichnis; sie landen in ~/deployment auf dem Server.
name: deploy
on:
push:
branches: [main]
workflow_dispatch:
# Nie zwei Deploys gleichzeitig für denselben Dienst
concurrency:
group: deploy-${{ gitea.repository }}
cancel-in-progress: false
env:
DEPLOY_USER: ${{ vars.deploy_user }}
DEPLOY_HOST: ${{ vars.deploy_host }}
SSHPASS: ${{ secrets.deploy_pass }}
SSH_OPTS: -o StrictHostKeyChecking=accept-new -o PubkeyAuthentication=no
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Compose-Datei validieren
run: docker compose -f docker-compose.yml config --quiet
- name: Tools installieren
run: sudo apt-get update -qq && sudo apt-get install -y -qq sshpass rsync
- name: Dateien nach ~/deployment synchronisieren
run: |
sshpass -e rsync -az --delete \
--exclude '.git' --exclude '.gitea' --exclude '.env' \
-e "ssh $SSH_OPTS" \
./ "$DEPLOY_USER@$DEPLOY_HOST:deployment/"
- name: Deploy (pull → build → up)
run: |
sshpass -e ssh $SSH_OPTS "$DEPLOY_USER@$DEPLOY_HOST" \
"sudo /usr/local/bin/docker-deploy.sh $DEPLOY_USER deploy"
- name: Logs bei Fehler
if: failure()
run: |
sshpass -e ssh $SSH_OPTS "$DEPLOY_USER@$DEPLOY_HOST" \
"sudo /usr/local/bin/docker-deploy.sh $DEPLOY_USER logs" || true
+1 -1
View File
@@ -161,7 +161,7 @@ PasswordAuthentication yes
AuthorizedKeysCommand /usr/bin/sss_ssh_authorizedkeys %u
AuthorizedKeysCommandUser nobody
EOF
sshd -t || die "sshd-Konfiguration ungültig – Drop-in $SSHD_DROPIN prüfen"
sshd -t || die "sshd-Konfiguration ungültig - Drop-in $SSHD_DROPIN prüfen"
# ── docker-deploy.sh ─────────────────────────────────────────────────────────
log "🔧 $DEPLOY_CONF schreiben"