docs: add live ftp deploy
This commit is contained in:
@@ -1,42 +1,82 @@
|
|||||||
# Deployment
|
# Deployment
|
||||||
|
|
||||||
Dieses Repository ist fuer Auto-Deployment von `main` auf die Synology-Testumgebung vorbereitet.
|
Dieses Repository enthaelt eine statische Website direkt im Repo-Root. Es gibt aktuell keinen Build-Schritt und keinen `dist`- oder `build`-Ordner.
|
||||||
|
|
||||||
## Ziel
|
## Live-Deployment
|
||||||
|
|
||||||
- Repo-Pfad auf Synology: `/volume2/webssd/fabiennefoehn`
|
- Protokoll: `FTP`
|
||||||
- Webroot auf Synology: `/volume2/webssd/fabiennefoehn`
|
- Host: `194.230.87.205`
|
||||||
- Branch: `main`
|
- Port: `21`
|
||||||
- Repo-Owner: `admin_hz2`
|
- Zielverzeichnis auf dem Server: `/httpdocs/`
|
||||||
- Webserver-User: `http`
|
- Webroot: `httpdocs`
|
||||||
|
|
||||||
## Dateien
|
Die Live-Website wird nicht als komplettes Repository deployed, sondern als statische Dateimenge.
|
||||||
|
|
||||||
- `deploy-staging.sh`: wird serverseitig per Webhook ausgefuehrt
|
## Was hochgeladen wird
|
||||||
- `deploy.php`: Gitea-Webhook-Endpunkt im Webroot
|
|
||||||
|
|
||||||
## Gitea Webhook
|
Diese Dateien und Ordner werden nach `httpdocs/` hochgeladen:
|
||||||
|
|
||||||
- URL: `https://fabienne.imhochrain.ch/deploy.php`
|
- `index.html`
|
||||||
- Content Type: `application/json`
|
- `styles.css`
|
||||||
- Secret: in DSM/Apache als `GITEA_WEBHOOK_SECRET` setzen
|
- `script.js`
|
||||||
- Event: `Push Events`
|
- `lupe.svg`
|
||||||
- Branch-Filter: `main`
|
- `media/` komplett
|
||||||
|
|
||||||
## Synology sudoers
|
## Was nicht hochgeladen wird
|
||||||
|
|
||||||
Datei in `/etc/sudoers.d/fabiennefoehn`:
|
Diese Dateien und Ordner bleiben lokal im Repository:
|
||||||
|
|
||||||
```sudoers
|
- `.git/`
|
||||||
http ALL=(admin_hz2) NOPASSWD: /bin/bash /volume2/webssd/fabiennefoehn/deploy-staging.sh
|
- `.gitignore`
|
||||||
|
- `AGENTS.md`
|
||||||
|
- `README.md`
|
||||||
|
- `DEPLOYMENT.md`
|
||||||
|
- `deploy.php`
|
||||||
|
- `deploy-staging.sh`
|
||||||
|
- `scripts/`
|
||||||
|
- sonstige lokale Hilfs- oder Repo-Dateien
|
||||||
|
|
||||||
|
## Manueller Upload
|
||||||
|
|
||||||
|
Der Upload kann direkt per `curl` ueber FTP erfolgen. Beispiel fuer einzelne Root-Dateien:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl --user 'USER:PASS' -T index.html ftp://HOST:21/httpdocs/index.html
|
||||||
|
curl --user 'USER:PASS' -T styles.css ftp://HOST:21/httpdocs/styles.css
|
||||||
|
curl --user 'USER:PASS' -T script.js ftp://HOST:21/httpdocs/script.js
|
||||||
|
curl --user 'USER:PASS' -T lupe.svg ftp://HOST:21/httpdocs/lupe.svg
|
||||||
```
|
```
|
||||||
|
|
||||||
## Apache / Web Station
|
Beispiel fuer den Ordner `media/`:
|
||||||
|
|
||||||
Der Webserver muss die Umgebungsvariable setzen:
|
```bash
|
||||||
|
find media -type f ! -name '.DS_Store' | while IFS= read -r f; do
|
||||||
```apache
|
curl --user 'USER:PASS' --ftp-create-dirs -T "$f" "ftp://HOST:21/httpdocs/$f"
|
||||||
SetEnv GITEA_WEBHOOK_SECRET "nsR7MKmnsHeKpuMUj6baP8CVsjAvo5GmRrPwaTbtswswNiyN7gPu8Wfq1IJn"
|
done
|
||||||
```
|
```
|
||||||
|
|
||||||
Danach Webserver neu laden.
|
## Verifikation
|
||||||
|
|
||||||
|
Nach dem Upload sollte mindestens geprueft werden, ob diese Dateien remote vorhanden sind:
|
||||||
|
|
||||||
|
- `httpdocs/index.html`
|
||||||
|
- `httpdocs/styles.css`
|
||||||
|
- `httpdocs/script.js`
|
||||||
|
- `httpdocs/lupe.svg`
|
||||||
|
- `httpdocs/media/*`
|
||||||
|
|
||||||
|
Optional kann die Dateiliste per FTP geprueft werden:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl --disable-epsv --user 'USER:PASS' --list-only ftp://HOST:21/httpdocs/
|
||||||
|
curl --disable-epsv --user 'USER:PASS' --list-only ftp://HOST:21/httpdocs/media/
|
||||||
|
```
|
||||||
|
|
||||||
|
## Hinweis zum Alt-Setup
|
||||||
|
|
||||||
|
Im Repository liegen noch Dateien fuer ein frueheres Synology-/Webhook-Setup:
|
||||||
|
|
||||||
|
- `deploy.php`
|
||||||
|
- `deploy-staging.sh`
|
||||||
|
|
||||||
|
Dieses Setup ist fuer den aktuellen Live-Upload nicht noetig. Massgeblich ist derzeit der manuelle FTP-Upload nach `httpdocs/`.
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
# fabiennefoehn
|
# fabiennefoehn
|
||||||
|
|
||||||
Projekt-Repository fuer die Entwicklung der Test-Website auf der Synology und den spaeteren Live-Upload.
|
Projekt-Repository fuer die Entwicklung der Test-Website auf der Synology und den spaeteren Live-Upload.
|
||||||
|
|
||||||
|
Die Website liegt als statische Seite direkt im Repo-Root. Details zum aktuellen Live-Deployment per FTP nach `httpdocs/` stehen in `DEPLOYMENT.md`.
|
||||||
|
|||||||
Reference in New Issue
Block a user