115
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,115 @@
|
||||
name: Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- develop
|
||||
|
||||
env:
|
||||
BASE_DIRS: "src public api partials tools"
|
||||
CONFIG_BASE_DIR: "config"
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: private-server
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install lftp
|
||||
shell: sh
|
||||
run: |
|
||||
if command -v lftp >/dev/null 2>&1; then
|
||||
echo "✅ lftp bereits installiert"
|
||||
elif command -v apk >/dev/null 2>&1; then
|
||||
apk add --no-cache lftp ca-certificates
|
||||
elif command -v apt-get >/dev/null 2>&1; then
|
||||
apt-get update
|
||||
apt-get install -y lftp ca-certificates
|
||||
else
|
||||
echo "❌ Kein unterstützter Paketmanager gefunden"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Set environment
|
||||
run: |
|
||||
if [ "${{ gitea.ref_name }}" = "main" ]; then
|
||||
echo "TARGET_PATH=${{ vars.FTP_PATH_PROD }}" >> "$GITHUB_ENV"
|
||||
echo "CONFIG_ENV_DIR=config/prod" >> "$GITHUB_ENV"
|
||||
elif [ "${{ gitea.ref_name }}" = "develop" ]; then
|
||||
echo "TARGET_PATH=${{ vars.FTP_PATH_STAGING }}" >> "$GITHUB_ENV"
|
||||
echo "CONFIG_ENV_DIR=config/staging" >> "$GITHUB_ENV"
|
||||
else
|
||||
echo "Unsupported branch"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Debug workspace
|
||||
run: |
|
||||
echo "📂 CI Workspace:"
|
||||
pwd
|
||||
ls -la
|
||||
|
||||
- name: Deploy via FTPS
|
||||
run: |
|
||||
set -e
|
||||
|
||||
echo "🚀 Deploy to ${TARGET_PATH}"
|
||||
|
||||
VALID_DIRS=""
|
||||
|
||||
for d in $BASE_DIRS; do
|
||||
if [ -d "$d" ]; then
|
||||
VALID_DIRS="$VALID_DIRS $d"
|
||||
else
|
||||
echo "⚠️ Überspringe fehlendes Verzeichnis: $d"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z "$VALID_DIRS" ]; then
|
||||
echo "❌ Kein deploybares Verzeichnis gefunden."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for d in $VALID_DIRS; do
|
||||
echo "🔁 ${d}/ → ${TARGET_PATH}${d}/"
|
||||
lftp -u "${{ secrets.FTP_USER }}","${{ secrets.FTP_PASSWORD }}" "${{ vars.FTP_HOST }}" -e "
|
||||
set ftp:ssl-force true;
|
||||
set ftp:passive-mode true;
|
||||
set ftp:ssl-protect-data true;
|
||||
set ssl:verify-certificate no;
|
||||
mirror -R --delete --exclude .gitkeep ${d}/ ${TARGET_PATH}${d}/;
|
||||
bye
|
||||
" || exit 1
|
||||
done
|
||||
|
||||
if [ -d "$CONFIG_BASE_DIR" ] && [ -d "$CONFIG_ENV_DIR" ]; then
|
||||
echo "🧩 Baue gemischtes Config-Verzeichnis"
|
||||
|
||||
rm -rf .ci_config_deploy
|
||||
mkdir -p .ci_config_deploy
|
||||
|
||||
for f in ${CONFIG_BASE_DIR}/*.php; do
|
||||
[ -f "$f" ] && cp "$f" .ci_config_deploy/
|
||||
done
|
||||
|
||||
cp -R ${CONFIG_ENV_DIR}/. .ci_config_deploy/
|
||||
|
||||
echo "🔁 config → ${TARGET_PATH}${CONFIG_BASE_DIR}/"
|
||||
|
||||
lftp -u "${{ secrets.FTP_USER }}","${{ secrets.FTP_PASSWORD }}" "${{ vars.FTP_HOST }}" -e "
|
||||
set ftp:ssl-force true;
|
||||
set ftp:passive-mode true;
|
||||
set ftp:ssl-protect-data true;
|
||||
set ssl:verify-certificate no;
|
||||
lcd .ci_config_deploy;
|
||||
mirror -R --delete --exclude .gitkeep ./ ${TARGET_PATH}${CONFIG_BASE_DIR}/;
|
||||
bye
|
||||
" || exit 1
|
||||
else
|
||||
echo "⚠️ Config-Deploy übersprungen: ${CONFIG_BASE_DIR} oder ${CONFIG_ENV_DIR} fehlt"
|
||||
fi
|
||||
|
||||
echo "✅ Deploy abgeschlossen"
|
||||
0
.gitlab-ci.yml
Normal file → Executable file
73
.projektstructure.txt
Executable file
@@ -0,0 +1,73 @@
|
||||
Anweisung: Projektstruktur (Basis-Template) wie in „papa-kind-treff“
|
||||
|
||||
Ziel
|
||||
- Erstelle ein neues Projekt bzw. aktualisiere das aktuelle mit exakt der gleichen Grundstruktur wie in „papa-kind-treff“.
|
||||
- Fokus auf Hauptordner und deren Zweck; keine projektspezifischen Sonderordner (z. B. Community) anlegen.
|
||||
- Inhalte können minimal sein, aber alle Pfade müssen existieren.
|
||||
- In Ordnern, die noch keine Dateien beinhalten, muss eine leere Datei mit dem Namen .gitkeep erstellt werden.
|
||||
- Bestehende Dateien nicht überschreiben; wenn nötig, Inhalte behutsam an die neue Logik anpassen.
|
||||
|
||||
Verzeichnisstruktur (Pflichtordner)
|
||||
- api/
|
||||
- config/
|
||||
- debug/
|
||||
- partials/
|
||||
- public/
|
||||
- src/
|
||||
- tools/
|
||||
- README.md
|
||||
- schema.sql
|
||||
- .gitlab-ci.yml
|
||||
|
||||
Details je Ordner
|
||||
|
||||
config/
|
||||
- Enthält alle Konfigurationen.
|
||||
- Muss Subordner für Umgebungen haben: z. B. prod/ und staging/.
|
||||
- In den Umgebungsordnern liegen Basis-Konfigurationen (z. B. db.php, settings.php, emailtemplates.php, domaindata.php).
|
||||
- Hinweis: Die Umgebungs-Subordner werden beim Deployment in den root-Config kopiert; daher ist hier keine weitere Unterscheidung nötig.
|
||||
- Falls Dateien fehlen, lege sie mit minimalem Basisinhalt an (z. B. PHP-Array/Kommentar), ohne vorhandene Inhalte zu überschreiben.
|
||||
|
||||
api/
|
||||
- Schnittstellen/Endpunkte.
|
||||
- Kann zunächst leer bleiben; dann .gitkeep anlegen.
|
||||
|
||||
debug/
|
||||
- Debug-Hilfen, Logs oder Debug-Skripte.
|
||||
- Wenn leer: .gitkeep.
|
||||
|
||||
partials/
|
||||
- Nur die Unterscheidung in:
|
||||
- landing/
|
||||
- structure/
|
||||
- landing/: Platz für seitenbezogene Teilausschnitte.
|
||||
- structure/: Layout-Grundbausteine (z. B. layout_start.php, layout_end.php, nav.php, matomo.php) als Beispieldaten.
|
||||
|
||||
public/
|
||||
- Webroot.
|
||||
- Muss assets/ enthalten mit Unterordnern: bilder/, fonts/, js/, css/ (Dateien optional).
|
||||
- Muss index.php enthalten mit Basis-Logic (z. B. Entry-Point/Router/Bootstrap).
|
||||
|
||||
src/
|
||||
- Backend/Business-Logik und Kernklassen.
|
||||
- Enthält App- oder Domain-Code (z. B. Auth, Database, Mailer, Config, Request, Assets usw.).
|
||||
- Lege eine kurze Beschreibung an, wofür src gedacht ist (Kommentar oder README im Ordner).
|
||||
|
||||
tools/
|
||||
- Entwicklungs-/Wartungs-Tools, Skripte oder Utilities.
|
||||
- Inhaltlich analog zu src gedacht, aber für interne Werkzeuge.
|
||||
|
||||
Datei-Inhalte (minimal, aber vorhanden)
|
||||
- .gitkeep: leer.
|
||||
- README.md, schema.sql, .gitlab-ci.yml: leer oder mit kurzem Platzhaltertext.
|
||||
- PHP-Dateien: leer oder mit kurzem Kommentar, z. B. "<?php // TODO".
|
||||
- .htaccess (falls genutzt): leer oder minimaler Platzhalter.
|
||||
|
||||
Zusätzliche Regeln
|
||||
- Keine projektspezifischen Sonderordner anlegen.
|
||||
- Pfade und Dateinamen exakt, Groß-/Kleinschreibung beachten.
|
||||
- Struktur ist wichtiger als Inhalt.
|
||||
|
||||
Ausgabeformat
|
||||
- Erzeuge die Ordner und Dateien exakt wie oben.
|
||||
- Liefere optional eine kurze Zusammenfassung der angelegten/angepassten Struktur.
|
||||
0
api/.gitkeep
Normal file → Executable file
0
config/.gitkeep
Normal file → Executable file
0
config/community.php
Normal file → Executable file
0
config/config.php
Normal file → Executable file
0
config/fileload.php
Normal file → Executable file
0
config/prod/.gitkeep
Normal file → Executable file
0
config/prod/db.php
Normal file → Executable file
0
config/prod/domaindata.php
Normal file → Executable file
0
config/prod/emailtemplates.php
Normal file → Executable file
0
config/prod/settings.php
Normal file → Executable file
0
config/staging/.gitkeep
Normal file → Executable file
0
config/staging/db.php
Normal file → Executable file
0
config/staging/domaindata.php
Normal file → Executable file
0
config/staging/emailtemplates.php
Normal file → Executable file
0
config/staging/settings.php
Normal file → Executable file
0
debug/.gitkeep
Normal file → Executable file
0
partials/.gitkeep
Normal file → Executable file
0
partials/landing/account/dashboard.php
Normal file → Executable file
0
partials/landing/account/login.php
Normal file → Executable file
0
partials/landing/account/register.php
Normal file → Executable file
0
partials/landing/account/verify.php
Normal file → Executable file
0
partials/landing/community/index.php
Normal file → Executable file
0
partials/landing/community/thread.php
Normal file → Executable file
0
partials/landing/main/home.php
Normal file → Executable file
0
partials/landing/search/search.php
Normal file → Executable file
0
partials/structure/layout_end.php
Normal file → Executable file
0
partials/structure/layout_start.php
Normal file → Executable file
0
partials/structure/matomo.php
Normal file → Executable file
0
partials/structure/nav.php
Normal file → Executable file
0
public/.gitkeep
Normal file → Executable file
0
public/.htaccess
Normal file → Executable file
0
public/assets/bilder/404.jpg
Normal file → Executable file
|
Before Width: | Height: | Size: 144 KiB After Width: | Height: | Size: 144 KiB |
0
public/assets/bilder/404portrait.jpg
Normal file → Executable file
|
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 69 KiB |
0
public/assets/bilder/email/banner_emailconfirm.jpg
Normal file → Executable file
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 KiB |
0
public/assets/bilder/email/banner_passwordreset.jpg
Normal file → Executable file
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB |
0
public/assets/bilder/email/banner_welcome.jpg
Normal file → Executable file
|
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 58 KiB |
0
public/assets/bilder/email/logo_mail.png
Normal file → Executable file
|
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 94 KiB |
0
public/assets/bilder/logo_female.png
Normal file → Executable file
|
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 94 KiB |
0
public/assets/bilder/logo_male.png
Normal file → Executable file
|
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 92 KiB |
0
public/assets/bilder/welcome.jpg
Normal file → Executable file
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 85 KiB |