Author SHA1 Message Date
Jochen MehlichandClaude Sonnet 5.5 ce87fea7a6 .env.example für create-deploy-user.py, .env ignorieren
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-24 10:59:40 +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
5 changed files with 101 additions and 1 deletions

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
# Beispiel für create-deploy-user.py – kopieren nach .env (wird nicht eingecheckt):
# cp .env.example .env && chmod 600 .env
# Laden und ausführen:
# set -a; source .env; set +a
# ./create-deploy-user.py --project-path owner/repo
# Das Skript liest nur die Umgebungsvariablen; fehlen sie, wird interaktiv gefragt.
# authentik-API-Token (authentik → Benutzer-Einstellungen → Tokens und App-Passwörter)
AUTHENTIK_TOKEN=
# Gitea-Access-Token mit Scope write:repository
# (https://git.share-fix.de/user/settings/applications)
GITEA_TOKEN=
+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
+1
View File
@@ -2,3 +2,4 @@ __pycache__/
*.pyc *.pyc
.claude/ .claude/
.codegraph/ .codegraph/
.env
+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 AuthorizedKeysCommand /usr/bin/sss_ssh_authorizedkeys %u
AuthorizedKeysCommandUser nobody AuthorizedKeysCommandUser nobody
EOF 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 ───────────────────────────────────────────────────────── # ── docker-deploy.sh ─────────────────────────────────────────────────────────
log "🔧 $DEPLOY_CONF schreiben" log "🔧 $DEPLOY_CONF schreiben"