initial COM2 system snapshot

This commit is contained in:
gitea
2026-03-06 15:22:40 +00:00
commit 9c0fa49baf
4377 changed files with 273033 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
#!/usr/bin/env bash
set -euo pipefail
CADDY_CONTAINER="hx-caddy-caddy-1"
APP_REF_CONTAINER="hxki-grafana"
echo "==> Ermittle Docker-Netzwerk des HX-KI-Stacks über ${APP_REF_CONTAINER} ..."
NETS=$(docker inspect -f '{{range $name, $_ := .NetworkSettings.Networks}}{{println $name}}{{end}}' "$APP_REF_CONTAINER")
if [ -z "$NETS" ]; then
echo "FEHLER: Kein Netzwerk für $APP_REF_CONTAINER gefunden."
exit 1
fi
NET=$(echo "$NETS" | head -n1)
echo "==> Verwende Netzwerk: $NET"
echo "==> Hänge Caddy-Container $CADDY_CONTAINER an Netzwerk $NET ..."
docker network connect "$NET" "$CADDY_CONTAINER" 2>/dev/null || echo " (evtl. schon verbunden, ignoriere Fehler)"
echo "==> Caddy neu starten ..."
docker restart "$CADDY_CONTAINER"
echo "=================================================="
echo "FERTIG."
echo "Versuche jetzt im Browser (evtl. einmal neu laden / Inkognito):"
echo " https://grafana.hx-ki.com"
echo " https://git.hx-ki.com"
echo " https://sync.hx-ki.com"
echo " https://mautic.hx-ki.com"
echo "=================================================="

View File

@@ -0,0 +1,62 @@
#!/usr/bin/env bash
set -euo pipefail
CADDYFILE="/opt/hx-caddy/Caddyfile"
echo "==> Prüfe, ob Caddyfile existiert ..."
if [ ! -f "$CADDYFILE" ]; then
echo "FEHLER: $CADDYFILE nicht gefunden."
exit 1
fi
BACKUP="/opt/hx-caddy/Caddyfile.bak.$(date +%Y%m%d%H%M%S)"
echo "==> Backup der Caddyfile nach: $BACKUP"
cp "$CADDYFILE" "$BACKUP"
add_block () {
local host="$1"
local block="$2"
if grep -q "^[[:space:]]*${host}[[:space:]]*{" "$CADDYFILE"; then
echo "==> Block für ${host} existiert schon überspringe."
else
echo "==> Füge Block für ${host} hinzu ..."
printf "\n%s\n\n" "$block" >> "$CADDYFILE"
fi
}
# Grafana
add_block "grafana.hx-ki.com" \
"grafana.hx-ki.com {
reverse_proxy hxki-grafana:3000
}"
# Gitea (git.hx-ki.com)
add_block "git.hx-ki.com" \
"git.hx-ki.com {
reverse_proxy hxki-gitea:3000
}"
# Syncthing (sync.hx-ki.com)
add_block "sync.hx-ki.com" \
"sync.hx-ki.com {
reverse_proxy hxki-syncthing:8384
}"
# Mautic
add_block "mautic.hx-ki.com" \
"mautic.hx-ki.com {
reverse_proxy hxki-mautic:80
}"
echo "==> Starte Caddy neu ..."
docker restart hx-caddy-caddy-1
echo "=================================================="
echo "FERTIG."
echo "Folgende URLs sollten jetzt funktionieren (wenn DNS auf 49.12.97.28 zeigt):"
echo " https://grafana.hx-ki.com"
echo " https://git.hx-ki.com"
echo " https://sync.hx-ki.com"
echo " https://mautic.hx-ki.com"
echo "=================================================="

View File

@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -euo pipefail
echo "==> Stoppe Falkenstein-Services (Caddy zuerst, dann HX-KI) ..."
cd /opt/hx-caddy
docker compose down
cd /opt/hx-ki/docker
docker compose down
echo "==> Alle Falkenstein-Services sind gestoppt."

View File

@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -euo pipefail
echo "==> Starte Falkenstein-Services (HX-KI + Caddy) ..."
cd /opt/hx-ki/docker
docker compose up -d
cd /opt/hx-caddy
docker compose up -d
echo "==> Alle definierten Services sind hochgefahren."
docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"

View File

@@ -0,0 +1,37 @@
#!/bin/bash
set -e
echo "==> HX-KI OPENWEBUI INSTALLER FERRARI MODE"
# 1) Basisverzeichnisse
mkdir -p /opt/hx-ki/openwebui
mkdir -p /opt/hx-ki/docker
# 2) Docker-Compose-Datei NUR für OpenWebUI anlegen
cat >/opt/hx-ki/docker/docker-openwebui.yml <<'EOF'
services:
hxki-openwebui:
image: ghcr.io/open-webui/open-webui:main
container_name: hxki-openwebui
ports:
- "3002:3000"
volumes:
- /opt/hx-ki/openwebui:/data
environment:
- WEBUI_AUTH=False
restart: unless-stopped
networks:
- hxki-internal
networks:
hxki-internal:
external: true
EOF
# 3) OpenWebUI starten
cd /opt/hx-ki/docker
docker compose -f docker-openwebui.yml up -d
echo "==> OpenWebUI läuft jetzt auf Port 3002."
echo " URL: http://<FALKENSTEIN-IP>:3002"
echo "==> Keine anderen Container wurden verändert."

View File

@@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -euo pipefail
echo "==> [1/3] Stoppe das gesamte ORCHESTER (HX-KI Dienste) ..."
cd /opt/hx-ki/docker
docker compose down
echo "==> [2/3] Stoppe DIRIGENT (Caddy) ..."
cd /opt/hx-caddy
docker compose down
echo "======================================================"
echo "HX-KI FALKENSTEIN ORCHESTER = AUS"
echo "Alle Dienste sauber beendet."
echo "======================================================"

View File

@@ -0,0 +1,27 @@
#!/usr/bin/env bash
set -euo pipefail
echo "==> STARTE HX-KI ORCHESTER AUF FALKENSTEIN (OHNE hxki-web) ..."
echo "==> [1/3] Starte HX-KI-Services ..."
cd /opt/hx-ki/docker
docker compose up -d \
hxki-grafana \
hxki-n8n \
hxki-mautic \
hxki-gitea \
hxki-syncthing \
hxki-postgres \
hxki-mariadb
echo "==> [2/3] Starte DIRIGENT (Caddy) ..."
cd /opt/hx-caddy
docker compose up -d
echo "==> [3/3] Verbinde DIRIGENT mit Netzwerk 'hxki-internal' (falls nötig) ..."
docker network connect hxki-internal hx-caddy-caddy-1 2>/dev/null || echo " (Caddy ist bereits verbunden oder Netz fehlt)"
echo "======================================================"
echo "HX-KI FALKENSTEIN ORCHESTER = AKTIV"
docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}'
echo "======================================================"

View File

@@ -0,0 +1,106 @@
#!/bin/bash
set -euo pipefail
# ================================
# HX-KI CADDY INSTALL (FALKENSTEIN)
# ================================
# Macht:
# - /opt/hx-caddy anlegen
# - docker-compose.yml + Caddyfile schreiben
# - Caddy per Docker starten
# - n8n.hx-ki.com -> Nürnberg:5678 routen
# Bricht lieber ab, wenn Ports 80/443 schon belegt sind.
NBG_IP="46.224.17.53" # Nürnberg (Gehirn)
N8N_DOMAIN="n8n.hx-ki.com" # Offizielle n8n-Subdomain
CADDY_DIR="/opt/hx-caddy"
echo "==> Prüfe, ob Docker installiert ist ..."
if ! command -v docker >/dev/null 2>&1; then
echo "Docker ist nicht installiert. Abbruch."
exit 1
fi
echo "==> Finde docker compose / docker-compose ..."
if docker compose version >/dev/null 2>&1; then
DC="docker compose"
elif command -v docker-compose >/dev/null 2>&1; then
DC="docker-compose"
else
echo "Weder 'docker compose' noch 'docker-compose' gefunden. Abbruch."
exit 1
fi
echo "==> Prüfe, ob Ports 80/443 bereits belegt sind ..."
if ss -tulpn 2>/dev/null | grep -qE ':(80|443)\s'; then
echo "ACHTUNG: Ports 80 oder 443 sind bereits in Benutzung."
echo "Ich mache NICHTS, um nichts zu zerschießen."
echo
ss -tulpn 2>/dev/null | grep -E ':(80|443)\s' || true
echo
echo "Bitte zuerst klären, welcher Dienst 80/443 nutzt (z.B. Mailcow/nginx),"
echo "und dann entscheiden, ob Caddy davor/danach stehen soll."
exit 1
fi
echo "==> Erstelle Verzeichnis: $CADDY_DIR ..."
mkdir -p "$CADDY_DIR"
cd "$CADDY_DIR"
echo "==> Backup vorhandener Dateien (falls vorhanden) ..."
for f in docker-compose.yml Caddyfile; do
if [ -f "$f" ]; then
cp "$f" "${f}.bak.$(date +%F-%H%M%S)"
echo " Backup von $f -> ${f}.bak.$(date +%F-%H%M%S)"
fi
done
echo "==> Schreibe docker-compose.yml für Caddy ..."
cat > docker-compose.yml <<EOF
services:
caddy:
image: caddy:2
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
- caddy_config:/config
volumes:
caddy_data:
caddy_config:
EOF
echo "==> Schreibe Caddyfile (n8n-Proxy) ..."
cat > Caddyfile <<EOF
{
# Optional: E-Mail für Let's Encrypt
email admin@hx-ki.com
}
${N8N_DOMAIN} {
reverse_proxy ${NBG_IP}:5678
}
EOF
echo "==> Starte Caddy über Docker ..."
$DC up -d
echo "==> Laufende Caddy-Container:"
docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}' | grep caddy || true
echo
echo "=================================================="
echo "Caddy läuft jetzt (sofern keine Fehler gemeldet wurden)."
echo
echo "Wenn DNS korrekt gesetzt ist, solltest du n8n erreichen unter:"
echo " https://${N8N_DOMAIN}"
echo
echo "WICHTIG:"
echo "- Nürnberg (46.224.17.53:5678) liefert weiterhin deinen alten n8n-Workflow."
echo "- Wir haben NICHTS auf Nürnberg/Helsinki verändert."
echo "- Das hier ist nur der Türsteher auf Falkenstein."
echo "=================================================="

View File

@@ -0,0 +1,134 @@
#!/bin/bash
set -e
echo "============================================"
echo " MAUTIC INSTALLER FERRARI EDITION "
echo "============================================"
###############################################
# 1) Update System
###############################################
apt update && apt upgrade -y
###############################################
# 2) Install Required Packages
###############################################
apt install -y software-properties-common gnupg2 unzip curl supervisor
###############################################
# 3) Install PHP 8.2 + Extensions
###############################################
add-apt-repository ppa:ondrej/php -y
apt update
apt install -y \
php8.2 php8.2-cli php8.2-fpm php8.2-common \
php8.2-mysql php8.2-xml php8.2-zip php8.2-mbstring php8.2-curl \
php8.2-intl php8.2-gd php8.2-imap php8.2-bcmath php8.2-opcache
###############################################
# 4) MariaDB installieren
###############################################
apt install -y mariadb-server mariadb-client
###############################################
# 5) MariaDB initial konfigurieren
###############################################
mysql -e "CREATE DATABASE mautic CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
mysql -e "CREATE USER 'mautic'@'localhost' IDENTIFIED BY 'Mautic123!';"
mysql -e "GRANT ALL PRIVILEGES ON mautic.* TO 'mautic'@'localhost';"
mysql -e "FLUSH PRIVILEGES;"
###############################################
# 6) Nginx installieren
###############################################
apt install -y nginx
###############################################
# 7) Mautic herunterladen
###############################################
cd /var/www
curl -L https://github.com/mautic/mautic/releases/latest/download/mautic.zip -o mautic.zip
unzip mautic.zip -d mautic
rm mautic.zip
###############################################
# 8) Berechtigungen setzen
###############################################
chown -R www-data:www-data /var/www/mautic
chmod -R 755 /var/www/mautic
###############################################
# 9) Nginx Virtual Host anlegen
###############################################
cat <<'EOF' >/etc/nginx/sites-available/mautic.conf
server {
listen 80;
server_name _;
root /var/www/mautic;
index index.php;
location / {
try_files $uri /index.php?$args;
}
location ~ \.php$ {
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* \.(jpg|jpeg|png|gif|css|js|ico)$ {
expires max;
log_not_found off;
}
}
EOF
ln -sf /etc/nginx/sites-available/mautic.conf /etc/nginx/sites-enabled/mautic.conf
rm -f /etc/nginx/sites-enabled/default
nginx -t && systemctl restart nginx
###############################################
# 10) Supervisor Mautic Queue Worker
###############################################
cat <<'EOF' >/etc/supervisor/conf.d/mautic-worker.conf
[program:mautic-worker]
command=/usr/bin/php /var/www/mautic/bin/console mautic:messages:consume
autostart=true
autorestart=true
user=www-data
redirect_stderr=true
stdout_logfile=/var/log/supervisor/mautic-worker.log
EOF
supervisorctl reread
supervisorctl update
###############################################
# 11) PHP Tuning
###############################################
sed -i "s/memory_limit = .*/memory_limit = 1024M/" /etc/php/8.2/fpm/php.ini
sed -i "s/upload_max_filesize = .*/upload_max_filesize = 64M/" /etc/php/8.2/fpm/php.ini
sed -i "s/post_max_size = .*/post_max_size = 64M/" /etc/php/8.2/fpm/php.ini
systemctl restart php8.2-fpm
###############################################
# 12) CRONJOBS hinzufügen
###############################################
cat <<'EOF' >/etc/cron.d/mautic
* * * * * www-data php /var/www/mautic/bin/console mautic:segments:update > /dev/null 2>&1
* * * * * www-data php /var/www/mautic/bin/console mautic:campaigns:trigger > /dev/null 2>&1
*/5 * * * * www-data php /var/www/mautic/bin/console mautic:emails:send > /dev/null 2>&1
EOF
###############################################
# READY
###############################################
echo ""
echo "============================================"
echo " MAUTIC INSTALLATION FERTIG FERRARI STYLE"
echo " URL: http://<dein-server>:80"
echo "============================================"