88 lines
2.1 KiB
Markdown
88 lines
2.1 KiB
Markdown
# Secrets Setup mit Token - Schritt für Schritt
|
|
|
|
## ✅ Du hast bereits ein Token - Perfekt!
|
|
|
|
## Option 1: Automatisches Setup (Empfohlen)
|
|
|
|
Führe einfach dieses Kommando aus (ersetze `<DEIN_TOKEN>` mit deinem Token):
|
|
|
|
```bash
|
|
bash scripts/setup-gitea-secrets-with-token.sh <DEIN_TOKEN>
|
|
```
|
|
|
|
**Beispiel:**
|
|
```bash
|
|
bash scripts/setup-gitea-secrets-with-token.sh ghp_1234567890abcdefghijklmnopqrstuvwxyz
|
|
```
|
|
|
|
Das Script:
|
|
1. ✅ Testet die API-Verbindung
|
|
2. ✅ Setzt automatisch `REGISTRY_USER` = `admin`
|
|
3. ✅ Setzt automatisch `REGISTRY_PASSWORD` = `registry-secure-password-2025`
|
|
4. ✅ Setzt automatisch `SSH_PRIVATE_KEY` = Inhalt von `~/.ssh/production`
|
|
|
|
## Option 2: Manuell über Gitea UI
|
|
|
|
Falls das automatische Setup nicht funktioniert:
|
|
|
|
### Schritt 1: Gehe zu Secrets-Seite
|
|
|
|
```
|
|
https://git.michaelschiemer.de/michael/michaelschiemer/settings/secrets/actions
|
|
```
|
|
|
|
### Schritt 2: Füge jedes Secret einzeln hinzu
|
|
|
|
**REGISTRY_USER:**
|
|
1. Klicke "New Secret"
|
|
2. Name: `REGISTRY_USER`
|
|
3. Value: `admin`
|
|
4. Save
|
|
|
|
**REGISTRY_PASSWORD:**
|
|
1. Klicke "New Secret"
|
|
2. Name: `REGISTRY_PASSWORD`
|
|
3. Value: `registry-secure-password-2025`
|
|
4. Save
|
|
|
|
**SSH_PRIVATE_KEY:**
|
|
1. Klicke "New Secret"
|
|
2. Name: `SSH_PRIVATE_KEY`
|
|
3. Value: Kompletter Inhalt von `~/.ssh/production`
|
|
```bash
|
|
cat ~/.ssh/production
|
|
```
|
|
(Kopiere ALLES, inklusive `-----BEGIN` und `-----END` Zeilen)
|
|
4. Save
|
|
|
|
## Verifizierung
|
|
|
|
Nach dem Setup:
|
|
|
|
1. **Prüfe in Gitea UI:**
|
|
```
|
|
https://git.michaelschiemer.de/michael/michaelschiemer/settings/secrets/actions
|
|
```
|
|
|
|
2. **Sollte zeigen:**
|
|
- ✅ REGISTRY_USER
|
|
- ✅ REGISTRY_PASSWORD
|
|
- ✅ SSH_PRIVATE_KEY
|
|
|
|
Alle drei Secrets sollten "Hidden" als Wert anzeigen.
|
|
|
|
## Troubleshooting
|
|
|
|
### "API-Verbindung fehlgeschlagen"
|
|
- Prüfe Token-Kopierung (keine Leerzeichen)
|
|
- Prüfe Token-Berechtigung: `write:repository` Scope nötig
|
|
- Prüfe Repository-Name: `michael/michaelschiemer`
|
|
|
|
### "HTTP 403 Forbidden"
|
|
- Token hat keine ausreichenden Berechtigungen
|
|
- Generiere neuen Token mit `write:repository` scope
|
|
|
|
### "HTTP 404 Not Found"
|
|
- Repository existiert nicht oder falscher Name
|
|
- Prüfe: `https://git.michaelschiemer.de/michael/michaelschiemer`
|