Usa GITEA_TOKEN secret per autenticazione Container Registry
Build Docker Image for Raspberry Pi / build-and-push (push) Failing after 34s
Build Docker Image for Raspberry Pi / build-and-push (push) Failing after 34s
- Modificato docker-build.yml e docker-cleanup.yml - Il token automatico github.token non ha permessi sufficienti - Aggiunta guida SETUP_GITEA_TOKEN.md per configurazione
This commit is contained in:
@@ -51,7 +51,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
registry: gitea.home-nas-ds.org
|
registry: gitea.home-nas-ds.org
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ github.token }}
|
password: ${{ secrets.GITEA_TOKEN }}
|
||||||
|
|
||||||
- name: Build and push Docker image
|
- name: Build and push Docker image
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v4
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
registry: gitea.home-nas-ds.org
|
registry: gitea.home-nas-ds.org
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ github.token }}
|
password: ${{ secrets.GITEA_TOKEN }}
|
||||||
|
|
||||||
- name: Cleanup old development images
|
- name: Cleanup old development images
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -0,0 +1,58 @@
|
|||||||
|
# Setup Token Gitea per Container Registry
|
||||||
|
|
||||||
|
## Passaggi per creare il token:
|
||||||
|
|
||||||
|
1. **Vai su Gitea:**
|
||||||
|
- Apri https://gitea.home-nas-ds.org
|
||||||
|
- Login con il tuo account
|
||||||
|
|
||||||
|
2. **Crea un Access Token:**
|
||||||
|
- Clicca sull'avatar in alto a destra → **Settings**
|
||||||
|
- Vai su **Applications** nel menu laterale
|
||||||
|
- Scorri fino alla sezione **Generate New Token**
|
||||||
|
|
||||||
|
3. **Configura il token:**
|
||||||
|
- **Token Name:** `github-actions-registry` (o un nome a tua scelta)
|
||||||
|
- **Select Permissions:**
|
||||||
|
- ✓ `write:package` (per push su Container Registry)
|
||||||
|
- ✓ `read:package` (per pull da Container Registry)
|
||||||
|
- Clicca su **Generate Token**
|
||||||
|
|
||||||
|
4. **Copia il token:**
|
||||||
|
- ⚠️ **IMPORTANTE:** Copia il token generato immediatamente, non sarà più visibile!
|
||||||
|
- Esempio: `f8a3b2c1d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9`
|
||||||
|
|
||||||
|
5. **Aggiungi il token come Secret nel repository:**
|
||||||
|
- Vai al repository: https://gitea.home-nas-ds.org/Alessio/docker-voltronic-homeassistant
|
||||||
|
- Clicca su **Settings** (icona ingranaggio)
|
||||||
|
- Nel menu laterale: **Secrets** → **Actions**
|
||||||
|
- Clicca su **Add Secret**
|
||||||
|
- **Name:** `GITEA_TOKEN`
|
||||||
|
- **Value:** [incolla il token copiato]
|
||||||
|
- Clicca su **Add Secret**
|
||||||
|
|
||||||
|
6. **Verifica:**
|
||||||
|
- Torna alla pagina Actions
|
||||||
|
- Riavvia il workflow fallito oppure fai un nuovo push
|
||||||
|
- Il workflow dovrebbe ora autenticarsi correttamente
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
Se l'errore persiste:
|
||||||
|
|
||||||
|
1. **Verifica che il Container Registry sia abilitato:**
|
||||||
|
```bash
|
||||||
|
# Controlla se il registry risponde
|
||||||
|
curl https://gitea.home-nas-ds.org/v2/
|
||||||
|
```
|
||||||
|
Dovrebbe rispondere con `{"errors":[{"code":"UNAUTHORIZED",...}]}`
|
||||||
|
|
||||||
|
2. **Test login manuale con il token:**
|
||||||
|
```bash
|
||||||
|
echo "TUO_TOKEN" | docker login gitea.home-nas-ds.org -u Alessio --password-stdin
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Verifica configurazione Gitea:**
|
||||||
|
- Vai su Site Administration → Configuration
|
||||||
|
- Cerca la sezione "Packages"
|
||||||
|
- Assicurati che `ENABLED` sia `true`
|
||||||
Reference in New Issue
Block a user