Eigene Skills vom MacBook (9 Skills)
This commit is contained in:
@@ -0,0 +1,131 @@
|
||||
---
|
||||
name: strato-server-tasks
|
||||
description: Execute post-breach tasklist on Strato server haslach2025.
|
||||
version: 0.1.0
|
||||
author: Hermes
|
||||
platforms: [macos]
|
||||
metadata:
|
||||
hermes:
|
||||
tags:
|
||||
- Strato
|
||||
- Server
|
||||
- Tasklist
|
||||
- Devops
|
||||
---
|
||||
# strato-server-tasks
|
||||
|
||||
Execute a defined post-breach tasklist on the Strato server (haslach2025/mindboost infrastructure) via SSH. This skill assumes the passphrase-protected SSH key at `~/Documents/Zertifikate/haslach_privat` is already loaded into `ssh-agent`.
|
||||
|
||||
## When to Use
|
||||
- User provides a task list for the Strato server (haslach2025) and requests execution
|
||||
- Tasks involve Docker containers, Traefik, Nextcloud, invoiceninja, Laravel, or PHP version management
|
||||
- SSH key `haslach_privat` is loaded and server `85.215.56.185` is accessible
|
||||
|
||||
## Prerequisites
|
||||
- ssh-agent running with `haslach_privat` key loaded (passphrase provided by user)
|
||||
- Server `85.215.56.185` reachable as `root@85.215.56.185`
|
||||
- Docker and docker-compose installed on the server
|
||||
- Access to `/opt/containers/` directory tree on the server
|
||||
- Traefik dynamic config at `/var/log/traefik/dynamic_conf.yml` and backup at `/var/log/traefik/dynamic_conf.yml.bak-20261022`
|
||||
|
||||
## How to Run
|
||||
Invoke through the `terminal` tool. Each task is executed as a separate SSH command sequence. Example workflow:
|
||||
|
||||
```bash
|
||||
# Task 1: Nextcloud
|
||||
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@85.215.56.185 <<'EOF'
|
||||
cd /opt/containers/nextcloud_mindboost
|
||||
docker compose up -d nextcloud-app-mindboost
|
||||
# Wait 1-2 min for self-update from 32.0.6 to 32.0.15
|
||||
EOF
|
||||
|
||||
# Task 2: invoiceninja
|
||||
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@85.215.56.185 <<'EOF'
|
||||
cd "$(docker inspect invoiceninja-in-app-1 --format '{{index .Config.Labels "com.docker.compose.project.working_dir"}}')"
|
||||
docker compose pull && docker compose up -d
|
||||
EOF
|
||||
|
||||
# Task 3: Laravel-Backend (build in Jenkins first with CLEAN_BUILD=true)
|
||||
# Then on server:
|
||||
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@85.215.56.185 <<'EOF'
|
||||
cd /opt/containers/Repositories && docker compose pull && docker compose up -d
|
||||
cd /opt/containers/Repositories/staging
|
||||
# Update image tag from sha256-9aeddeb… to sha256-5049884533f12b82d28eae03a5f8647182d0f56a
|
||||
sed -i 's/sha256-9aeddeb.*/sha256-5049884533f12b82d28eae03a5f8647182d0f56a/' docker-compose.yml
|
||||
docker compose pull && docker compose up -d
|
||||
EOF
|
||||
|
||||
# Task 4: lichterei-web
|
||||
# Build in Jenkins first (pushes :0.0.1 tag)
|
||||
# Then on server:
|
||||
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@85.215.56.185 <<'EOF'
|
||||
cd /opt/containers/lichtereiweb
|
||||
# Update docker-compose.yml :latest to :0.0.1 (sed replacement)
|
||||
sed -i 's/:latest/:0.0.1/' docker-compose.yml
|
||||
docker compose pull && docker compose up -d
|
||||
EOF
|
||||
|
||||
# Task 5: Traefik 2.10 → v2.11.60
|
||||
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@85.215.56.185 <<'EOF'
|
||||
cd /opt/containers/traefik-crowdsec-stack
|
||||
export SERVICES_TRAEFIK_IMAGE_VERSION=v2.11.60
|
||||
docker compose up -d traefik
|
||||
docker rm traefik-update-helper; rm docker-compose.yml.bak-20261022
|
||||
EOF
|
||||
|
||||
# Task 6: Kontrolle - PHP version check
|
||||
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@85.215.56.185 <<'EOF'
|
||||
docker exec <container> php -v
|
||||
# Expected: 8.2.35 / 8.3.36 bzw. Ubuntu-Paket 8.3.6-0ubuntu0.24.04.13
|
||||
EOF
|
||||
|
||||
# Task 7: Cleanup dynamic_conf.yml
|
||||
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@85.215.56.185 <<'EOF'
|
||||
# Remove php2shell-* routers and body-limit-* middlewares from /dynamic_conf.yml
|
||||
# Backup already exists at /var/log/traefik/dynamic_conf.yml.bak-20261022
|
||||
grep -v 'php2shell-' /var/log/traefik/dynamic_conf.yml > /tmp/dynamic_conf.yml.tmp
|
||||
grep -v 'body-limit-' /tmp/dynamic_conf.yml.tmp > /var/log/traefik/dynamic_conf.yml
|
||||
rm /tmp/dynamic_conf.yml.tmp
|
||||
EOF
|
||||
```
|
||||
|
||||
## Quick Reference
|
||||
- `ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@85.215.56.185` — connect to Strato server
|
||||
- Docker compose commands: `cd <dir> && docker compose up -d <service>`
|
||||
- `sed -i 's/old/new/' file` — replace image tags in docker-compose.yml
|
||||
- `grep -v 'pattern' file` — remove lines from config
|
||||
|
||||
## Procedure
|
||||
1. Verify ssh-agent is running with the `haslach_privat` key loaded
|
||||
2. Execute Task 1: Nextcloud self-update (cd /opt/containers/nextcloud_mindboost && docker compose up -d nextcloud-app-mindboost)
|
||||
3. Execute Task 2: invoiceninja update (cd working_dir && docker compose pull && docker compose up -d)
|
||||
4. Execute Task 3: Laravel-Backend — build in Jenkins with CLEAN_BUILD=true, then on server: cd /opt/containers/Repositories && docker compose up -d, update image tag via sed, docker compose up -d
|
||||
5. Execute Task 4: lichterei-web — ensure Jenkins pushed :0.0.1 tag, then on server: cd /opt/containers/lichtereiweb, sed :latest to :0.0.1, docker compose pull && up -d
|
||||
6. Execute Task 5: Traefik upgrade — cd /opt/containers/traefik-crowdsec-stack, set SERVICES_TRAEFIK_IMAGE_VERSION=v2.11.60 in .env, docker compose up -d traefik, rm traefik-update-helper, rm docker-compose.yml.bak-20261022
|
||||
7. Execute Task 6: PHP version check — docker exec <container> php -v (expect 8.2.35 / 8.3.36 / 8.3.6-0ubuntu0.24.04.13)
|
||||
8. Execute Task 7: Cleanup — remove php2shell-* and body-limit-* entries from /var/log/traefik/dynamic_conf.yml (backup at .bak-20261022 already exists)
|
||||
|
||||
## Pitfalls
|
||||
- Wrong SSH passphrase — key won't load, all commands fail
|
||||
- Docker compose file syntax errors — validate before running
|
||||
- Image tag mismatches — ensure correct SHA or tag values
|
||||
- Traefik dynamic_conf.yml — incorrect removal of routers/middlewares breaks routing
|
||||
- Jenkins pipeline must produce correct tags (:0.0.1 for lichterei-web, sha256-... for Laravel)
|
||||
- Nextcloud self-update takes 1-2 minutes; do not interrupt
|
||||
|
||||
## Verification
|
||||
```bash
|
||||
# Check PHP version on any container
|
||||
docker exec <container> php -v
|
||||
|
||||
# Verify running containers
|
||||
docker ps
|
||||
|
||||
# Test Traefik routing
|
||||
curl -s http://localhost/ # should route correctly after cleanup
|
||||
|
||||
# Confirm task completion — user specifies next steps
|
||||
```
|
||||
This should return expected PHP version and confirm all 7 tasks completed successfully.
|
||||
|
||||
---\n*Skill captures the complete post-breach tasklist for Strato server haslach2025/mindboost infrastructure. Tasks cover Nextcloud, invoiceninja, Laravel-Backend, lichterei-web, Traefik upgrade, PHP version control, and Traefik dynamic config cleanup. All commands framed for SSH execution via the `terminal` tool with the pre-loaded haslach_privat key.*", "name": "strato-server-tasks"}
|
||||
Reference in New Issue
Block a user