Initiales Karate-Wiki Setup (Docker, LocalSettings, KarateMedia Video-Extension)
This commit is contained in:
commit
53aec82f7d
17 files changed
+763
No files matched your search
@@ -0,0 +1,36 @@
|
||||
# ============================================================================
|
||||
# Rein lesendes Sync-Skript (Windows PowerShell)
|
||||
# Holt einen aktuellen Datenbank-Abzug (mysqldump) und das Vereins-Logo
|
||||
# vom Strato-Produktivserver nach C:\dev\Karatewiki\backups\
|
||||
# ============================================================================
|
||||
param(
|
||||
[switch]$IncludeSampleVideos
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
$SshKey = "$env:USERPROFILE\.ssh\strato_fewo"
|
||||
$SshTarget = "stu100093250@51539426.ssh.w1.strato.hosting"
|
||||
$WikiDir = "Karate_Wiki_135"
|
||||
|
||||
$BackupDir = Join-Path $PSScriptRoot "..\backups\db-init"
|
||||
New-Item -ItemType Directory -Force -Path $BackupDir | Out-Null
|
||||
|
||||
Write-Host "1. Erstelle rein lesenden Datenbank-Dump von Strato nach backups\db-init\01-karatewiki.sql ..." -ForegroundColor Cyan
|
||||
$RemoteDumpCmd = @'
|
||||
/opt/RZphp84/bin/php-cli -r '
|
||||
$c = file_get_contents("Karate_Wiki_135/LocalSettings.php");
|
||||
preg_match("/wgDBpassword\s*=\s*\"([^\"]+)\"/", $c, $m);
|
||||
$cmd = sprintf("mysqldump --single-transaction --no-tablespaces -h rdbms.strato.de -u dbu1061679 -p%s dbs1754262", escapeshellarg($m[1]));
|
||||
passthru($cmd);
|
||||
'
|
||||
'@
|
||||
|
||||
ssh -i $SshKey -o BatchMode=yes $SshTarget $RemoteDumpCmd > (Join-Path $BackupDir "01-karatewiki.sql")
|
||||
Write-Host " Datenbank-Dump erfolgreich gespeichert!" -ForegroundColor Green
|
||||
|
||||
if ($IncludeSampleVideos) {
|
||||
$ImagesDir = Join-Path $PSScriptRoot "..\data\images"
|
||||
New-Item -ItemType Directory -Force -Path $ImagesDir | Out-Null
|
||||
Write-Host "2. Kopiere images/ Verzeichnis (oder Beispiel-Videos) ..." -ForegroundColor Cyan
|
||||
scp -i $SshKey -r "${SshTarget}:${WikiDir}/images/.htaccess" $ImagesDir
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
# ============================================================================
|
||||
# Rein lesendes Sync-Skript (Linux / Docker-Host)
|
||||
# Spiegelt Datenbank und (optional) den 8.3 GB images/-Ordner per rsync von Strato
|
||||
# ============================================================================
|
||||
set -euo pipefail
|
||||
|
||||
SSH_KEY="${STRATO_SSH_KEY:-$HOME/.ssh/strato_fewo}"
|
||||
SSH_TARGET="stu100093250@51539426.ssh.w1.strato.hosting"
|
||||
WIKI_DIR="Karate_Wiki_135"
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
|
||||
mkdir -p "$ROOT_DIR/backups/db-init" "$ROOT_DIR/data/images"
|
||||
|
||||
echo "[1/2] Ziehe aktuellen Datenbank-Dump (rein lesend) von Strato..."
|
||||
ssh -i "$SSH_KEY" -o BatchMode=yes "$SSH_TARGET" \
|
||||
'/opt/RZphp84/bin/php-cli -r '\''$c=file_get_contents("Karate_Wiki_135/LocalSettings.php");preg_match("/wgDBpassword\s*=\s*\"([^\"]+)\"/",$c,$m);passthru(sprintf("mysqldump --single-transaction --no-tablespaces -h rdbms.strato.de -u dbu1061679 -p%s dbs1754262",escapeshellarg($m[1])));'\''' \
|
||||
> "$ROOT_DIR/backups/db-init/01-karatewiki.sql"
|
||||
|
||||
echo "[2/2] Synchronisiere images/ Verzeichnis inkrementell per rsync (rein lesend auf Quelle)..."
|
||||
if [[ "${SYNC_IMAGES:-false}" == "true" ]]; then
|
||||
rsync -avz --e "ssh -i $SSH_KEY" "${SSH_TARGET}:${WIKI_DIR}/images/" "$ROOT_DIR/data/images/"
|
||||
else
|
||||
echo " (Uebersprungen. Starte mit SYNC_IMAGES=true ./scripts/sync-from-strato.sh um alle 8.3 GB Videos zu spiegeln)"
|
||||
fi
|
||||
|
||||
echo "Fertig!"
|
||||
Reference in new issue
Block a user