Gitea theme: capital theta (circle+H) logo + homepage senza badge

- Logo/favicon ridisegnati come theta maiuscola: cerchio (anello)
  con 'H' centrata, clearance verificata (non tocca l'anello); ring
  ispessito per la favicon; centratura ottica verificata.
- Rimosso il badge 'Self-hosted Git' dal hero della homepage (era
  esteticamente di troppo) - CSS e markup.
- Aggiornati generate_theta.py, README, home.tmpl; caricati sul VPS in
  staging (md5 locali == remoti); tarball ricostruito.
- Salvataggio iniziale dell'intero admin pack in git.
This commit is contained in:
2026-09-01 16:54:15 +02:00
commit f5c763be7b
23 changed files with 1430 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
# Segreti — MAI commitare
vps_ssh.env
risultati.txt
+92
View File
@@ -0,0 +1,92 @@
# STATO SESSIONE — Gitea + Cloudflare (1 set 2026)
File di memorizzazione del lavoro fatto, per riprendere dopo un cambio di
ambito. Aggiornato: 2026-09-01.
---
## 1. Obiettivo della sessione
Deploy di **Gitea** sul VPS OVH (145.239.94.49, Debian 12) come `https://git.zomas.net`
per tracciare il progetto Tacticus e aprirlo (in futuro) a contributi esterni.
Backup automatico incluso. Tutto completato e verificato.
---
## 2. Stato finale (TUTTO FUNZIONANTE)
| Componente | Stato |
|---|---|
| Gitea 1.27.3 | attivo (systemd, `/etc/gitea/app.ini`), DB sqlite `/var/lib/gitea/data/gitea.db` |
| Web | `https://git.zomas.net` → Apache → `127.0.0.1:3000` (200 esterno) |
| SSH git | server **built-in** Gitea su `0.0.0.0:2222` (host key ed25519/rsa/ecdsa) |
| SSH cliente | questo PC → `[email protected]:2222` (IP origine 145.239.94.49, chiave `~/.ssh/id_ed25519`) |
| Repo | `zomas/tacticus` **privato**, `main`, con README + `bot/.env.example` |
| Mailer | `smtp+starttls` → smtp.gmail.com:587, App Password, test email **ok** |
| 2FA | attiva (richiesta globale) + `TWO_FACTOR_AUTH=enforced` |
| Backup | `/var/backups/gitea/gitea-dump-*.zip` (gitea dump, cron giornaliero 02:30, retention 14gg) |
| Cloudflare | proxy arancio su git/zomas.net/zomas.org, SSL Full (strict), Universal SSL, CAA a posto |
### Warning Gitea: TUTTI RISOLTI
- `https://(null)/` → colpa di `RequestHeader set Host %{HTTP_HOST}e` in Apache
(Host vuoto). Rimosso, basta `ProxyPreserveHost On`.
- Deprecazioni `[mailer].MAILER_TYPE/HOST/IS_TLS_ENABLED/SKIP_VERIFY`
opzioni moderne (`PROTOCOL=smtp+starttls`, `SMTP_ADDR`, `SMTP_PORT`).
Log: "NESSUNA deprecazione residua".
---
## 3. Errori incontrati e soluzioni (utile se si ripete)
1. **`(null)` nel warning** → `RequestHeader set Host %{HTTP_HOST}e` sovrascrive Host
con vuoto (variabile senza valore). Fix: riga rimossa.
2. **Server SSH non partiva** → Gitea default `START_SSH_SERVER=false` (usa OpenSSH
esterno). Config: `START_SSH_SERVER=true` + `SSH_LISTEN_HOST=0.0.0.0`.
Con built-in, l'utente SSH è il **RUN_USER di Gitea = `gitea`** (NON `git`,
NON zomas): remote = `[email protected]:zomas/tacticus.git`.
3. **`git@` "Permission denied"** → normale: il client SSH deve usare `gitea@`.
Config in `~/.ssh/config`: `Host git.zomas.net → HostName 145.239.94.49,
Port 2222, User gitea`.
4. **Cloudflare non passa TCP 2222** → il record proxied serve solo 80/443;
per SSH si punta all'IP origine via `HostName 145.239.94.49`.
5. **SSH rifiuto public key "invalid \r"** → il `.pub` finiva con CRLF; STRIPPARE `\r`
prima di POST all'API `POST /api/v1/user/keys`.
6. **Backup "permission denied"**`gitea dump` gira come utente `gitea`, che non
può scrivere in `/var/backups/gitea` (root). Fix: dump in `/tmp`, poi `mv` da root.
7. **Sole IPv6 da questo PC**`git.zomas.net` risolve solo IPv6 (anycast CF);
per curl ok, per ssh serve IP IPv4 esplicito.
---
## 4. Credenziali / segreti (NON committare)
- `/home/zomas/vps-admin/vps_ssh.env``VPS_*`, `TOKEN_CLOUDFLARE`, `GITEA_TOKEN`
- `bot/.env` — chiavi API Tacticus + token bot Telegram (niente nel repo)
- Il repo `tacticus.git` NON contiene segreti (verificato: `.env`, `vps_ssh.env`,
`risultati.txt`, script setup esclusi da `.gitignore`).
---
## 5. Comandi utili
```bash
# SSH git (da questo PC)
git -C /home/zomas/tacticus remote -v # [email protected]:zomas/tacticus.git
git -C /home/zomas/tacticus push # aggiorna il remote
# Backup manuale (da root sul VPS)
/usr/local/sbin/backup_gitea.sh
ls -lh /var/backups/gitea/ # retention 14 giorni
# Stato servizi
systemctl status gitea apache2 cron # VPS
ss -tlnp | grep -E ':(2222|3000)\b'
```
---
## 6. PROSSIMI PASSI (cambio di ambito dell'utente)
- (Opzionale) Download automatico dei backup VPS sul PC locale (ora solo sul VPS).
- (Opzionale) Girare il repo `tacticus` da privato a pubblico + aprire contributi.
- (Opzionale) `daily.py --fresh` (proposta rimasta aperta dal 31 ago, mai richiesta).
+30
View File
@@ -0,0 +1,30 @@
#!/bin/bash
# Backup automatico Gitea via `gitea dump` (db sqlite + repos + config in un unico zip).
# Retention: 14 giorni (modificare KEEP_DAYS).
set -euo pipefail
BACKUP_DIR=/var/backups/gitea
KEEP_DAYS=14
STAMP=$(date +%Y%m%d-%H%M%S)
TMP_ARC="/tmp/gitea-dump-$STAMP.zip"
ARC="$BACKUP_DIR/gitea-dump-$STAMP.zip"
mkdir -p "$BACKUP_DIR"
# Esegue il dump come utente 'gitea' (stesso user del servizio).
# Il file va in /tmp (scrivibile da gitea), poi lo spostiamo come root.
su -s /bin/bash gitea -c \
"/usr/local/bin/gitea dump --config /etc/gitea/app.ini --file '$TMP_ARC' --type zip" \
>/tmp/gitea-dump.log 2>&1
if [ ! -s "$TMP_ARC" ]; then
echo "ERRORE: dump non creato" >>/tmp/gitea-dump.log
exit 1
fi
mv "$TMP_ARC" "$ARC"
# Pulisce i dump piu' vecchi di KEEP_DAYS
find "$BACKUP_DIR" -name 'gitea-dump-*.zip' -mtime +"$KEEP_DAYS" -delete
echo "OK: $ARC ($(du -h "$ARC" | cut -f1))"
+2
View File
@@ -0,0 +1,2 @@
# Verifica integrita' del dump (lo script e' gia' in /tmp)
su -s /bin/bash gitea -c "python3 /tmp/check_dump.py" 2>/dev/null || su -s /bin/bash gitea -c "python3 /tmp/check_dump.py"
+26
View File
@@ -0,0 +1,26 @@
# FIX: attiva il server SSH BUILT-IN di Gitea (default: esterno -> le chiavi finivano in authorized_keys senza nessun sshd su 2222)
# Dal cheat sheet: START_SSH_SERVER=false di default => Gitea delega a OpenSSH esterno.
# 1) Backup
cp /etc/gitea/app.ini /etc/gitea/app.ini.bak.$(date +%Y%m%d%H%M%S)
# 2) Imposta START_SSH_SERVER = true nella sezione [server]
sed -i 's/^DISABLE_SSH = false/DISABLE_SSH = false\nSTART_SSH_SERVER = true/' /etc/gitea/app.ini
# controllo: se non ci fosse la riga DISABLE_SSH esatta, aggiunge comunque
grep -q '^START_SSH_SERVER = true' /etc/gitea/app.ini || sed -i '/^\[server\]/a START_SSH_SERVER = true' /etc/gitea/app.ini
# 3) Mostra la sezione [server]
sed -n '/^\[server\]/,/^\[/p' /etc/gitea/app.ini
# 4) Riavvio
systemctl restart gitea
sleep 6
# 5) Verifica: 2222 deve essere in ascolto E devono essere generate le host key
echo "--- listener ---"
ss -tlnp | grep -E ':(2222|3000)\b'
echo "--- host key ---"
ls -la /var/lib/gitea/data/ssh/ 2>/dev/null || echo "ATTENZIONE: nessuna host key creata"
echo "--- log avvio ssh ---"
journalctl -u gitea --since "-1 min" --no-pager | grep -iE 'ssh|listen' | tail -8
+18
View File
@@ -0,0 +1,18 @@
# Fix SSH di Gitea: forza il listener built-in su tutte le interfacce
# (di default Gitea deriva SSH_LISTEN_HOST da SSH_DOMAIN = IP Cloudflare -> bind fallisce)
# 1) Backup
cp /etc/gitea/app.ini /etc/gitea/app.ini.bak.$(date +%Y%m%d%H%M%S)
# 2) Aggiunge SSH_LISTEN_HOST = 0.0.0.0 dopo SSH_PORT nella sezione [server]
sed -i 's/^SSH_PORT = 2222/SSH_PORT = 2222\nSSH_LISTEN_HOST = 0.0.0.0/' /etc/gitea/app.ini
# 3) Riavvio
systemctl restart gitea
sleep 5
# 4) Verifica: il listener ora deve esserci
ss -tlnp | grep -E ':(2222)\b' && echo "OK: 2222 in ascolto" || echo "ERRORE: 2222 assente"
# 5) Verifica log avvio (liste meno, mostra le righe rilevanti)
journalctl -u gitea --since "-1 min" --no-pager | grep -iE 'ssh|listen|bind|error|warn' | tail -10
+26
View File
@@ -0,0 +1,26 @@
# Correzione deprecazioni residue in [mailer] (Gitea moderno)
# Sostituisce: HOST, IS_TLS_ENABLED, SKIP_VERIFY -> SMTP_ADDR+SMTP_PORT, PROTOCOL, FORCE_TRUST_SERVER_CERT
# 1) Backup e riscrittura della sezione [mailer] con opzioni moderne
cp /etc/gitea/app.ini /etc/gitea/app.ini.bak.$(date +%Y%m%d%H%M%S)
# 2) Sostituisce le righe obsolete (lasciando PASSWD, FROM, USER, ENABLED intatti)
sed -i \
-e 's|^HOST = .*|SMTP_ADDR = smtp.gmail.com\nSMTP_PORT = 587|' \
-e 's|^IS_TLS_ENABLED = .*||' \
-e 's|^SKIP_VERIFY = .*||' \
/etc/gitea/app.ini
# 3) Garantisce PROTOCOL corretto per il 587 (starttls esplicito)
sed -i 's|^PROTOCOL = smtp$|PROTOCOL = smtp+starttls|' /etc/gitea/app.ini
# 4) Controlla il risultato (senza esporre PASSWD)
awk '/^\[mailer\]/{p=1} p{print} /^\[/ && !/\[mailer\]/{p=0}' /etc/gitea/app.ini | sed 's/^PASSWD.*/PASSWD = ***/'
# 5) Riavvia Gitea
systemctl restart gitea
sleep 3
systemctl status gitea --no-pager | head -6
# 6) Verifica che NON compaiano piu deprecazioni mailer all'avvio
journalctl -u gitea --since "-1 min" --no-pager | grep -i deprecat || echo "NESSUNA deprecazione residua"
+12
View File
@@ -0,0 +1,12 @@
# Correzione warning Gitea/Cloudflare
# 1) Rimuove "RequestHeader set Host" (causa Host=null nel warning giallo)
sed -i '/RequestHeader set Host/d' /etc/apache2/sites-available/git.zomas.net-ssl.conf
apache2ctl configtest && systemctl reload apache2
# 2) Corregge opzione deprecata MAILER_TYPE -> PROTOCOL
sed -i 's/^MAILER_TYPE = smtp/PROTOCOL = smtp/' /etc/gitea/app.ini
grep -nE '^MAILER_TYPE|^PROTOCOL' /etc/gitea/app.ini
systemctl restart gitea
# 3) Legge le altre deprecazioni dai log (per completare)
journalctl -u gitea --no-pager | grep -i -E "deprecat|\[config\]" | tail -30
Binary file not shown.
+95
View File
@@ -0,0 +1,95 @@
# Gitea theme pack — git.zomas.net
Homepage moderna + favicon/logo personalizzati per l'istanza Gitea.
## Contenuto
```
custom/
templates/home.tmpl # homepage pubblica ridisegnata
public/assets/img/logo.svg # logo (navbar + hero)
public/assets/img/logo.png
public/assets/img/favicon.svg # icona tab browser (SVG)
public/assets/img/favicon.png # favicon fallback (PNG)
public/assets/img/apple-touch-icon.png
install_gitea_theme.sh # installer — da eseguire come ROOT sul VPS
rollback_gitea_theme.sh # ripristino stato iniziale — da eseguire come ROOT
gitea_theme.sh # script UNICO: install o rollback (consigliato)
generate_theta.py # rigenera logo/favicon con theta greca (opzionale, serve PIL)
```
La homepage pubblica (la landing page che si vede su git.zomas.net
senza login) è ora un hero con gradiente, titolo, tagline e 4
feature card. Usa solo CSS inline + variabili tematiche di Gitea, quindi
rispetta automaticamente tema chiaro/scuro.
Il logo è una THETA MAIUSCOLA (Θ): un cerchio (anello) con una "H"
centrata. La H non tocca i bordi dell'anello (clearance verificata),
in bianco su quadrato arrotondato con gradiente viola→azzurro.
Niente badge "Self-hosted Git" sopra il logo (era esteticamente di
troppo) — il hero parte direttamente dal logo.
## Requisiti / limitazione
Installare questi file richiede **accesso root** (o appartenenza al
gruppo `gitea`) sul VPS: la cartella `/var/lib/gitea/custom` non è
scrivibile dall'utente SSH `deb_zomas_connection`. L'installer va quindi
lanciato da chi ha root.
I file sono già stati caricati sul VPS in staging (dall'utente
`deb_zomas_connection`) in `/var/tmp/gitea-theme/` — pronto per essere
installato da root.
## Applicazione (root sul VPS) — script UNICO
I file sono già sul VPS. Da root, uno script solo gestisce tutto:
```bash
cd /var/tmp/gitea-theme/gitea-theme-pack
bash gitea_theme.sh install # applica homepage moderna + favicon
bash gitea_theme.sh rollback # torna allo stato iniziale (se non piace)
```
Lo script `gitea_theme.sh` è l'unico che serve:
- `install` salva il backup delle eventuali personalizzazioni in
`/var/lib/gitea/custom/.backup-*`, copia i file, imposta i permessi
`gitea:gitea`, scrive lo stato in `$CUSTOM_DIR/.gitea-theme-state`,
riavvia Gitea e verifica gli asset.
- `rollback` rimuove homepage+favicon custom, ripristina la precedente
personalizzazione dal backup (se esiste), riavvia Gitea.
(Permangono anche `install_gitea_theme.sh` e `rollback_gitea_theme.sh`
come equivalenti separati, per chi preferisce un comando per azione.)
3. Sul browser apri https://git.zomas.net premendo **Ctrl+Shift+R**
(hard reload) per bypassare la cache.
## Ripristino
Se la modifica non piace, da root sul VPS:
```bash
cd /var/tmp/gitea-theme/gitea-theme-pack
bash gitea_theme.sh rollback
```
Lo script rimuove homepage + favicon custom, ripristina l'eventuale
personalizzazione precedente dal backup (se esiste), riavvia Gitea e
verifica. In alternativa il ripristino manuale è:
```bash
rm -rf /var/lib/gitea/custom/templates/home.tmpl /var/lib/gitea/custom/public/assets/img
systemctl restart gitea
```
La vecchia homepage è comunque salvata anche su questo PC in
`/home/zomas/vps-admin/homepage-backup/homepage_original_20260901-152245.html`.
## Note
- Gitea 1.27.3. Homepage di riferimento: stock `templates/home.tmpl`.
- Le icone octicon usate (`git-branch`, `shield-check`, `telescope`,
`sign-in`, `repo`, `code`, `rocket`) e le chiavi locale
(`dashboard`, `explore_title`, `sign_in`, `home_title`) sono verificate
esistenti nel sorgente Gitea 1.27.3.
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

@@ -0,0 +1,8 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64">
<defs><linearGradient id="zg" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#7c3aed"/><stop offset="1" stop-color="#0ea5e9"/></linearGradient></defs>
<rect x="2.56" y="2.56" width="58.88" height="58.88" rx="14.08" fill="url(#zg)"/>
<path fill-rule="evenodd" fill="#fff" d="M 5.76 32.00 A 26.24 26.24 0 1 0 58.24 32.00 A 26.24 26.24 0 1 0 5.76 32.00 ZM 8.96 32.00 A 23.04 23.04 0 1 0 55.04 32.00 A 23.04 23.04 0 1 0 8.96 32.00 Z"/>
<rect x="21.12" y="15.36" width="3.20" height="33.28" fill="#fff"/>
<rect x="39.68" y="15.36" width="3.20" height="33.28" fill="#fff"/>
<rect x="21.12" y="30.66" width="21.76" height="2.69" fill="#fff"/>
</svg>

After

Width:  |  Height:  |  Size: 749 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

@@ -0,0 +1,8 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64">
<defs><linearGradient id="zg" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#7c3aed"/><stop offset="1" stop-color="#0ea5e9"/></linearGradient></defs>
<rect x="2.56" y="2.56" width="58.88" height="58.88" rx="14.08" fill="url(#zg)"/>
<path fill-rule="evenodd" fill="#fff" d="M 5.76 32.00 A 26.24 26.24 0 1 0 58.24 32.00 A 26.24 26.24 0 1 0 5.76 32.00 ZM 8.96 32.00 A 23.04 23.04 0 1 0 55.04 32.00 A 23.04 23.04 0 1 0 8.96 32.00 Z"/>
<rect x="21.12" y="15.36" width="3.20" height="33.28" fill="#fff"/>
<rect x="39.68" y="15.36" width="3.20" height="33.28" fill="#fff"/>
<rect x="21.12" y="30.66" width="21.76" height="2.69" fill="#fff"/>
</svg>

After

Width:  |  Height:  |  Size: 749 B

+143
View File
@@ -0,0 +1,143 @@
{{template "base/head" .}}
<style>
.zm-hero {
position: relative;
overflow: hidden;
padding: 3.5rem 1.5rem 4rem;
text-align: center;
}
.zm-hero::before {
content: "";
position: absolute;
inset: 0;
background:
radial-gradient(60rem 30rem at 20% 0%, rgba(124, 58, 237, 0.18), transparent 60%),
radial-gradient(50rem 26rem at 85% 10%, rgba(14, 165, 233, 0.18), transparent 60%);
pointer-events: none;
}
.zm-hero-logo {
margin: 1.5rem auto 1rem;
width: 120px;
height: 120px;
filter: drop-shadow(0 12px 24px rgba(80, 70, 229, 0.25));
}
.zm-hero h1 {
font-size: clamp(2rem, 5vw, 3.4rem);
font-weight: 800;
line-height: 1.1;
margin: 0 0 0.6rem;
letter-spacing: -0.02em;
}
.zm-hero p.lead {
max-width: 46rem;
margin: 0 auto 2rem;
font-size: 1.15rem;
line-height: 1.6;
opacity: 0.85;
}
.zm-ctas {
display: flex;
flex-wrap: wrap;
gap: 0.6rem;
justify-content: center;
}
.zm-ctas .ui.button {
padding: 0.7rem 1.4rem;
font-weight: 600;
border-radius: 0.55rem;
}
.zm-features {
max-width: 66rem;
margin: 2.5rem auto 1rem;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
gap: 1rem;
padding: 0 1.5rem;
}
.zm-feature {
border-radius: 0.9rem;
padding: 1.3rem 1.3rem 1.4rem;
background: var(--color-box-header, #f0f0f0);
border: 1px solid var(--color-secondary, rgba(0, 0, 0, 0.1));
text-align: left;
transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.zm-feature:hover {
transform: translateY(-3px);
box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}
.zm-feature .zm-ico {
display: inline-flex;
align-items: center;
justify-content: center;
width: 2.4rem;
height: 2.4rem;
border-radius: 0.6rem;
margin-bottom: 0.8rem;
color: #fff;
background: linear-gradient(135deg, #7c3aed, #0ea5e9);
}
.zm-feature h3 {
margin: 0 0 0.35rem;
font-size: 1.05rem;
}
.zm-feature p {
margin: 0;
font-size: 0.92rem;
line-height: 1.55;
opacity: 0.82;
}
@media (prefers-color-scheme: dark) {
.zm-feature { background: var(--color-box-header, #1a1a1a); }
}
</style>
<div role="main" aria-label="{{if .IsSigned}}{{ctx.Locale.Tr "dashboard"}}{{else}}{{ctx.Locale.Tr "home_title"}}{{end}}" class="page-content home">
<div class="zm-hero">
<img class="zm-hero-logo" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{AppName}}" width="120" height="120">
<h1>{{AppName}}</h1>
<p class="lead">
Il tuo spazio Git personale, veloce e affidabile.
Gestisci repository, collabora e tieni tutto sotto controllo, con un unico account.
</p>
<div class="zm-ctas">
{{if .IsSigned}}
<a class="ui primary button" href="{{AppSubUrl}}/">
{{svg "octicon-rocket" 16}}&nbsp;{{ctx.Locale.Tr "dashboard"}}
</a>
<a class="ui secondary button" href="{{AppSubUrl}}/explore/repos">
{{svg "octicon-telescope" 16}}&nbsp;{{ctx.Locale.Tr "explore_title"}}
</a>
{{else}}
<a class="ui primary button" href="{{AppSubUrl}}/user/login">
{{svg "octicon-sign-in" 16}}&nbsp;{{ctx.Locale.Tr "sign_in"}}
</a>
<a class="ui secondary button" href="{{AppSubUrl}}/explore/repos">
{{svg "octicon-telescope" 16}}&nbsp;{{ctx.Locale.Tr "explore_title"}}
</a>
{{end}}
</div>
</div>
<div class="zm-features">
<div class="zm-feature">
<div class="zm-ico">{{svg "octicon-rocket" 22}}</div>
<h3>Veloce e leggero</h3>
<p>Prestazioni elevate anche su risorse ridotte. Il tuo codice, sempre a portata di mano.</p>
</div>
<div class="zm-feature">
<div class="zm-ico">{{svg "octicon-shield-check" 22}}</div>
<h3>Sicuro e privato</h3>
<p>Accessi protetti e controllo completo sui tuoi repository, dalla creazione alla condivisione.</p>
</div>
<div class="zm-feature">
<div class="zm-ico">{{svg "octicon-git-branch" 22}}</div>
<h3>Versioning semplice</h3>
<p>Branches, pull request e collaborazione fluida, progettati per chi scrive codice ogni giorno.</p>
</div>
<div class="zm-feature">
<div class="zm-ico">{{svg "octicon-code" 22}}</div>
<h3>Open source</h3>
<p>Costruito con tecnologie aperte e libere. Nessun blocco, tutta la flessibilità di cui hai bisogno.</p>
</div>
</div>
</div>
{{template "base/footer" .}}
+139
View File
@@ -0,0 +1,139 @@
#!/usr/bin/env python3
# Logo/favicon Gitea: THETA MAIUSCOLA = cerchio (anello) con una "H" al centro.
# La H non tocca l'anello (clearance sicura). Niente coda.
# Emette sia gli SVG (logo/favicon) che i PNG (logo/favicon/apple-touch-icon)
# partendo dalla STESSA geometria, così SVG e PNG combaciano.
import os
from PIL import Image, ImageDraw
OUT = "custom/public/assets/img"
# --- geometria normalizzata (frazioni del lato quadrato) ---
INSET = 0.04 # bordo del riquadro arrotondato
RAD = 0.22 # raggio angoli del riquadro
CX, CY = 0.5, 0.5 # centro (simmetrico, nessuna coda)
RO = 0.41 # raggio esterno anello
RING = 0.05 # spessore anello -> raggio interno RI = RO - RING
# H centrale
HH = 0.26 # mezza altezza della H (stelo da CY-HH a CY+HH)
SPAC = 0.145 # distanza orizzontale dal centro agli steli
STEM = 0.05 # spessore steli
CROSS = 0.042 # spessore barra orizzontale
C1, C2 = (124, 58, 237), (14, 165, 233) # viola -> azzurro
RI = RO - RING
def lerp(a, b, t):
return int(a + (b - a) * t)
def grad_color(t):
return (lerp(C1[0], C2[0], t), lerp(C1[1], C2[1], t), lerp(C1[2], C2[2], t))
def theta_geo(size):
cx, cy = CX * size, CY * size
ro, ri = RO * size, RI * size
stem = STEM * size
cross = CROSS * size
# steli: centro x = cx ± SPAC
left_x0 = (CX - SPAC - STEM / 2) * size
left_x1 = (CX - SPAC + STEM / 2) * size
right_x0 = (CX + SPAC - STEM / 2) * size
right_x1 = (CX + SPAC + STEM / 2) * size
st_y0, st_y1 = (CY - HH) * size, (CY + HH) * size
# barra: attraversa tutta la larghezza della H, centrata su CY
cb_y0, cb_y1 = CY * size - cross / 2, CY * size + cross / 2
return dict(cx=cx, cy=cy, ro=ro, ri=ri,
left_x0=left_x0, left_x1=left_x1,
right_x0=right_x0, right_x1=right_x1,
st_y0=st_y0, st_y1=st_y1,
cb_x0=left_x0, cb_x1=right_x1, cb_y0=cb_y0, cb_y1=cb_y1,
stem=stem, cross=cross)
def circle_path(r, cx, cy, size):
lx, rx = cx - r, cx + r
return (f"M {lx:.2f} {cy:.2f} A {r:.2f} {r:.2f} 0 1 0 {rx:.2f} {cy:.2f} "
f"A {r:.2f} {r:.2f} 0 1 0 {lx:.2f} {cy:.2f} Z")
def svg_theta(size):
g = theta_geo(size)
inset, rad = INSET * size, RAD * size
w = size
def e(x):
return f"{x:.2f}"
outer = circle_path(g["ro"], g["cx"], g["cy"], size)
inner = circle_path(g["ri"], g["cx"], g["cy"], size)
lines = []
lines.append(f'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 {size} {size}" width="{size}" height="{size}">')
lines.append(' <defs><linearGradient id="zg" x1="0" y1="0" x2="0" y2="1">'
'<stop offset="0" stop-color="#7c3aed"/><stop offset="1" stop-color="#0ea5e9"/></linearGradient></defs>')
lines.append(f' <rect x="{e(inset)}" y="{e(inset)}" width="{e(w-2*inset)}" height="{e(w-2*inset)}" rx="{e(rad)}" fill="url(#zg)"/>')
# anello (theta maiuscola = cerchio)
lines.append(f' <path fill-rule="evenodd" fill="#fff" d="{outer}{inner}"/>')
# H centrale (steli + barra)
lines.append(f' <rect x="{e(g["left_x0"])}" y="{e(g["st_y0"])}" width="{e(g["left_x1"]-g["left_x0"])}" height="{e(g["st_y1"]-g["st_y0"])}" fill="#fff"/>')
lines.append(f' <rect x="{e(g["right_x0"])}" y="{e(g["st_y0"])}" width="{e(g["right_x1"]-g["right_x0"])}" height="{e(g["st_y1"]-g["st_y0"])}" fill="#fff"/>')
lines.append(f' <rect x="{e(g["cb_x0"])}" y="{e(g["cb_y0"])}" width="{e(g["cb_x1"]-g["cb_x0"])}" height="{e(g["cb_y1"]-g["cb_y0"])}" fill="#fff"/>')
lines.append('</svg>')
return "\n".join(lines) + "\n"
def draw_theta_png(size, apple=False):
g = theta_geo(size)
img = Image.new("RGBA", (size, size), (0, 0, 0, 0))
inset, rad = INSET * size, RAD * size
# sfondo: riquadro arrotondato con gradiente verticale
sq = Image.new("L", (size, size), 0)
ImageDraw.Draw(sq).rounded_rectangle(
[inset, inset, size - inset, size - inset], radius=rad, fill=255)
grad = Image.new("RGBA", (size, size), (0, 0, 0, 0))
gd = ImageDraw.Draw(grad)
for i in range(size * 2):
t = i / (size * 2 - 1)
gd.line([(i, 0), (i, size)], fill=grad_color(t))
grad.putalpha(sq)
img.alpha_composite(grad)
# theta+H come maschera bianca
mask = Image.new("L", (size, size), 0)
md = ImageDraw.Draw(mask)
md.ellipse([g["cx"] - g["ro"], g["cy"] - g["ro"],
g["cx"] + g["ro"], g["cy"] + g["ro"]], fill=255)
md.ellipse([g["cx"] - g["ri"], g["cy"] - g["ri"],
g["cx"] + g["ri"], g["cy"] + g["ri"]], fill=0)
md.rectangle([g["left_x0"], g["st_y0"], g["left_x1"], g["st_y1"]], fill=255)
md.rectangle([g["right_x0"], g["st_y0"], g["right_x1"], g["st_y1"]], fill=255)
md.rectangle([g["cb_x0"], g["cb_y0"], g["cb_x1"], g["cb_y1"]], fill=255)
white = Image.new("RGBA", (size, size), (255, 255, 255, 255))
white.putalpha(mask)
img.alpha_composite(white)
if apple:
base = Image.new("RGBA", img.size, (255, 255, 255, 255))
base.alpha_composite(img)
return base.convert("RGB")
return img
def make_assets():
os.makedirs(OUT, exist_ok=True)
open(f"{OUT}/logo.svg", "w").write(svg_theta(64))
open(f"{OUT}/favicon.svg", "w").write(svg_theta(64))
draw_theta_png(220).save(f"{OUT}/logo.png")
draw_theta_png(64).save(f"{OUT}/favicon.png")
draw_theta_png(180, apple=True).save(f"{OUT}/apple-touch-icon.png")
print("theta (capital: circle + H) assets written to", OUT)
if __name__ == "__main__":
make_assets()
+133
View File
@@ -0,0 +1,133 @@
#!/bin/bash
# Gitea theme manager — installa o ripristina homepage + favicon custom.
# DA ESEGUIRE COME ROOT SUL VPS (o con sudo).
#
# Uso:
# bash gitea_theme.sh install # applica la homepage moderna + favicon
# bash gitea_theme.sh rollback # torna allo stato iniziale
# bash gitea_theme.sh # come "install"
set -euo pipefail
CUSTOM_DIR="${CUSTOM_DIR:-/var/lib/gitea/custom}"
SRC_DIR="$(cd "$(dirname "$0")" && pwd)/custom"
STATE_FILE="$CUSTOM_DIR/.gitea-theme-state"
MODE="${1:-install}"
case "$MODE" in
install|rollback) : ;;
*) echo "Uso: $0 [install|rollback]"; exit 2 ;;
esac
if [ "$(id -u)" != "0" ]; then
echo "ERRORE: devi eseguire questo script come root (o sudo)."
exit 1
fi
# ---------------------------------------------------------------- verifica
echo "==> Modalità: $MODE"
echo "==> Custom dir: $CUSTOM_DIR"
# ---------------------------------------------------------------- install
install_theme() {
STAMP="$(date +%Y%m%d-%H%M%S)"
BACKUP_DIR="${CUSTOM_DIR}/.backup-${STAMP}"
if [ ! -d "$SRC_DIR" ]; then
echo "ERRORE: cartella sorgente '$SRC_DIR' non trovata (script in cartella sbagliata?)."
exit 1
fi
# 1) Backup delle eventuali personalizzazioni esistenti
HAD_PREV=no
if [ -e "$CUSTOM_DIR/templates/home.tmpl" ] || [ -e "$CUSTOM_DIR/public/assets/img" ]; then
HAD_PREV=yes
mkdir -p "$BACKUP_DIR"
for p in templates/home.tmpl public/assets/img; do
if [ -e "$CUSTOM_DIR/$p" ]; then
mkdir -p "$BACKUP_DIR/$(dirname "$p")"
cp -a "$CUSTOM_DIR/$p" "$BACKUP_DIR/$p"
echo "==> Backup salvato: $BACKUP_DIR/$p"
fi
done
else
echo "==> Nessuna personalizzazione precedente, niente da salvare."
fi
# 2) Copia dei nuovi file
mkdir -p "$CUSTOM_DIR/templates" "$CUSTOM_DIR/public/assets/img"
cp "$SRC_DIR/templates/home.tmpl" "$CUSTOM_DIR/templates/home.tmpl"
cp "$SRC_DIR/public/assets/img/"* "$CUSTOM_DIR/public/assets/img/"
echo "==> File copiati:"
ls -l "$CUSTOM_DIR/templates/home.tmpl"
ls -l "$CUSTOM_DIR/public/assets/img/"
# 3) Permessi corretti (il processo gitea gira come utente gitea)
chown -R gitea:gitea "$CUSTOM_DIR"
echo "==> Permessi impostati (gitea:gitea)."
# 4) Stato per il rollback
{
echo "installed_at=$STAMP"
echo "backup_dir=$BACKUP_DIR"
echo "had_custom=$HAD_PREV"
} > "$STATE_FILE"
echo "==> Stato rollback salvato in $STATE_FILE"
}
# ---------------------------------------------------------------- rollback
rollback_theme() {
# 1) Leggi lo stato di installazione (se esiste)
BACKUP_DIR=""
HAD_PREV=no
if [ -f "$STATE_FILE" ]; then
source "$STATE_FILE" 2>/dev/null || true
echo "==> Stato trovato: installato $installed_at, backup=${backup_dir:-nessuno}, precedente=$had_custom"
fi
# 2) Rimuovi i file del tema
rm -f "$CUSTOM_DIR/templates/home.tmpl"
rm -rf "$CUSTOM_DIR/public/assets/img"
echo "==> File del tema rimossi (home.tmpl e assets/img)."
# 3) Ripristina l'eventuale personalizzazione precedente dal backup
if [ "$HAD_PREV" = "yes" ] && [ -n "${BACKUP_DIR:-}" ] && [ -d "$BACKUP_DIR" ]; then
echo "==> Ripristino personalizzazione precedente da $BACKUP_DIR"
if [ -f "$BACKUP_DIR/templates/home.tmpl" ]; then
mkdir -p "$CUSTOM_DIR/templates"
cp -a "$BACKUP_DIR/templates/home.tmpl" "$CUSTOM_DIR/templates/home.tmpl"
fi
if [ -d "$BACKUP_DIR/public/assets/img" ]; then
mkdir -p "$CUSTOM_DIR/public/assets/img"
cp -a "$BACKUP_DIR/public/assets/img/." "$CUSTOM_DIR/public/assets/img/"
fi
fi
# 4) Rimuovi lo stato e le cartelle eventualmente vuote
rm -f "$STATE_FILE"
rmdir "$CUSTOM_DIR/public/assets/img" "$CUSTOM_DIR/public/assets" "$CUSTOM_DIR/public" 2>/dev/null || true
rmdir "$CUSTOM_DIR/templates" 2>/dev/null || true
echo "==> Stato rollback pulito."
# 5) Permessi
chown -R gitea:gitea "$CUSTOM_DIR" 2>/dev/null || true
}
# ---------------------------------------------------------------- esegui
if [ "$MODE" = "install" ]; then
install_theme
else
rollback_theme
fi
# ---------------------------------------------------------------- restart+verify
systemctl restart gitea
sleep 6
echo "==> Stato servizio: $(systemctl is-active gitea)"
if [ "$MODE" = "install" ]; then
echo "==> Verifica asset (favicon/logo):"
curl -sk -o /dev/null -w " /assets/img/favicon.svg -> %{http_code}\n" https://127.0.0.1/assets/img/favicon.svg 2>/dev/null || true
curl -sk -o /dev/null -w " /assets/img/logo.svg -> %{http_code}\n" https://127.0.0.1/assets/img/logo.svg 2>/dev/null || true
fi
echo ""
echo "FATTO ($MODE). Ricarica https://git.zomas.net (Ctrl+Shift+R per bypassare la cache)."
+80
View File
@@ -0,0 +1,80 @@
#!/bin/bash
# Installa homepage moderna + favicon personalizzate per Gitea.
# DA ESEGUIRE COME ROOT SUL VPS (o con sudo).
# Uso: bash install_gitea_theme.sh
set -euo pipefail
CUSTOM_DIR="${CUSTOM_DIR:-/var/lib/gitea/custom}"
SRC_DIR="$(cd "$(dirname "$0")" && pwd)/custom"
STAMP="$(date +%Y%m%d-%H%M%S)"
BACKUP_DIR="${CUSTOM_DIR}/.backup-${STAMP}"
if [ "$(id -u)" != "0" ]; then
echo "ERRORE: devi eseguire questo script come root (o sudo)."
exit 1
fi
if [ ! -d "$SRC_DIR" ]; then
echo "ERRORE: cartella sorgente '$SRC_DIR' non trovata (script in cartella sbagliata?)."
exit 1
fi
echo "==> Target custom dir: $CUSTOM_DIR"
# 1) Backup delle eventuali personalizzazioni esistenti
HAD_PREV=no
if [ -e "$CUSTOM_DIR/templates/home.tmpl" ] || [ -e "$CUSTOM_DIR/public/assets/img" ]; then
HAD_PREV=yes
mkdir -p "$BACKUP_DIR"
for p in templates/home.tmpl public/assets/img; do
if [ -e "$CUSTOM_DIR/$p" ]; then
mkdir -p "$BACKUP_DIR/$(dirname "$p")"
cp -a "$CUSTOM_DIR/$p" "$BACKUP_DIR/$p"
echo "==> Backup salvato: $BACKUP_DIR/$p"
fi
done
else
echo "==> Nessuna personalizzazione precedente, niente da salvare."
fi
# 2) Copia dei nuovi file
mkdir -p "$CUSTOM_DIR/templates" "$CUSTOM_DIR/public/assets/img"
cp "$SRC_DIR/templates/home.tmpl" "$CUSTOM_DIR/templates/home.tmpl"
cp "$SRC_DIR/public/assets/img/"* "$CUSTOM_DIR/public/assets/img/"
echo "==> File copiati:"
ls -l "$CUSTOM_DIR/templates/home.tmpl"
ls -l "$CUSTOM_DIR/public/assets/img/"
# 3) Permessi corretti (il processo gitea gira come utente gitea)
chown -R gitea:gitea "$CUSTOM_DIR"
echo "==> Permessi impostati (gitea:gitea)."
# 3b) Stato per il rollback
STATE_FILE="$CUSTOM_DIR/.gitea-theme-state"
{
echo "installed_at=$STAMP"
echo "backup_dir=$BACKUP_DIR"
echo "had_custom=$HAD_PREV"
} > "$STATE_FILE"
echo "==> Stato rollback salvato in $STATE_FILE"
# 4) Riavvio di Gitea
systemctl restart gitea
sleep 6
# 5) Verifica
echo "==> Stato servizio:"
systemctl is-active gitea
echo "==> Verifica favicon (HTTP code):"
curl -sk -o /dev/null -w " /assets/img/favicon.svg -> %{http_code}\n" https://127.0.0.1/assets/img/favicon.svg \
|| echo " (curl locale non disponibile, verificare via browser)"
echo "==> Verifica logo:"
curl -sk -o /dev/null -w " /assets/img/logo.svg -> %{http_code}\n" https://127.0.0.1/assets/img/logo.svg \
|| true
echo ""
echo "FATTO. Ricarica https://git.zomas.net (con Ctrl+Shift+R per bypassare la cache del browser)."
echo "Per ripristinare la versione originale:"
echo " rm -rf $CUSTOM_DIR/templates/home.tmpl $CUSTOM_DIR/public/assets/img"
echo " systemctl restart gitea"
echo "Backup delle vecchie file (se esistenti): $BACKUP_DIR"
+62
View File
@@ -0,0 +1,62 @@
#!/bin/bash
# Rimuove la homepage personalizzata e la favicon di Gitea, tornando allo
# stato originale (Gitea stock) o a una eventuale personalizzazione precedente.
# DA ESEGUIRE COME ROOT SUL VPS (o con sudo).
# Uso: bash rollback_gitea_theme.sh
set -euo pipefail
CUSTOM_DIR="${CUSTOM_DIR:-/var/lib/gitea/custom}"
STATE_FILE="$CUSTOM_DIR/.gitea-theme-state"
if [ "$(id -u)" != "0" ]; then
echo "ERRORE: devi eseguire questo script come root (o sudo)."
exit 1
fi
echo "==> Ripristino stato iniziale di Gitea (custom) in $CUSTOM_DIR"
# 1) Leggi lo stato di installazione (se esiste)
BACKUP_DIR=""
HAD_PREV=no
if [ -f "$STATE_FILE" ]; then
source "$STATE_FILE" 2>/dev/null || true
echo "==> Stato trovato: installato $installed_at, backup=${backup_dir:-nessuno}, precedente=$had_custom"
fi
# 2) Rimuovi i file del tema
rm -f "$CUSTOM_DIR/templates/home.tmpl"
rm -rf "$CUSTOM_DIR/public/assets/img"
echo "==> File del tema rimossi (home.tmpl e assets/img)."
# 3) Ripristina una eventuale personalizzazione precedente dal backup
RESTORED=no
if [ "$HAD_PREV" = "yes" ] && [ -n "${BACKUP_DIR:-}" ] && [ -d "$BACKUP_DIR" ]; then
echo "==> Ripristino personalizzazione precedente da $BACKUP_DIR"
if [ -f "$BACKUP_DIR/templates/home.tmpl" ]; then
mkdir -p "$CUSTOM_DIR/templates"
cp -a "$BACKUP_DIR/templates/home.tmpl" "$CUSTOM_DIR/templates/home.tmpl"
RESTORED=yes
fi
if [ -d "$BACKUP_DIR/public/assets/img" ]; then
mkdir -p "$CUSTOM_DIR/public/assets/img"
cp -a "$BACKUP_DIR/public/assets/img/." "$CUSTOM_DIR/public/assets/img/"
fi
fi
# 4) Rimuovi lo stato e le cartelle eventualmente vuote
rm -f "$STATE_FILE"
rmdir "$CUSTOM_DIR/public/assets/img" "$CUSTOM_DIR/public/assets" "$CUSTOM_DIR/public" 2>/dev/null || true
rmdir "$CUSTOM_DIR/templates" 2>/dev/null || true
echo "==> Stato rollback pulito."
# 5) Permessi e riavvio
chown -R gitea:gitea "$CUSTOM_DIR" 2>/dev/null || true
systemctl restart gitea
sleep 6
# 6) Verifica
echo "==> Stato servizio: $(systemctl is-active gitea)"
curl -sk -o /dev/null -w " /assets/img/favicon.svg -> %{http_code} (200=stock Gitea, 404=custom rimosso)\n" https://127.0.0.1/assets/img/favicon.svg 2>/dev/null || true
echo ""
echo "FATTO. Ricarica https://git.zomas.net (Ctrl+Shift+R per bypassare la cache)."
@@ -0,0 +1,245 @@
<!DOCTYPE html>
<html lang="en-US" data-theme="gitea-auto">
<head>
<meta http-equiv="Content-Security-Policy" content="default-src * data: blob:;script-src * &#39;nonce-ae317871a9828db681b9e67893e24701&#39;;style-src * &#39;unsafe-inline&#39;;">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Zomas- Git</title>
<link rel="manifest" href="/assets/site-manifest.json">
<meta name="author" content="Gitea - Git with a cup of tea">
<meta name="description" content="Gitea (Git with a cup of tea) is a painless self-hosted Git service written in Go">
<meta name="keywords" content="go,git,self-hosted,gitea">
<meta name="referrer" content="same-origin">
<link rel="icon" href="/assets/img/favicon.svg" type="image/svg+xml">
<link rel="alternate icon" href="/assets/img/favicon.png" type="image/png">
<meta property="og:title" content="Zomas- Git">
<meta property="og:type" content="website">
<meta property="og:image" content="/assets/img/logo.png">
<meta property="og:url" content="https://git.zomas.net">
<meta property="og:description" content="Gitea (Git with a cup of tea) is a painless self-hosted Git service written in Go">
<meta property="og:site_name" content="Zomas- Git">
<link rel="stylesheet" href="/assets/css/index.DleUJaOD.css">
<link rel="stylesheet" href="/assets/css/theme-gitea-auto.v3RW7v-i.css">
<script nonce="ae317871a9828db681b9e67893e24701">
window.addEventListener('error', function(e) {window._globalHandlerErrors=window._globalHandlerErrors||[]; window._globalHandlerErrors.push(e);});
window.addEventListener('unhandledrejection', function(e) {window._globalHandlerErrors=window._globalHandlerErrors||[]; window._globalHandlerErrors.push(e);});
window.config = {
appUrl: 'https:\/\/git.zomas.net\/',
appSubUrl: '',
assetUrlPrefix: '\/assets',
runModeIsProd: true ,
customEmojis: {"codeberg":":codeberg:","git":":git:","gitea":":gitea:","github":":github:","gitlab":":gitlab:","gogs":":gogs:"},
pageData: {},
notificationSettings: {"EventSourceUpdateTime":10000,"MaxTimeout":60000,"MinTimeout":10000,"TimeoutStep":10000},
enableTimeTracking: true ,
mermaidMaxSourceCharacters: 50000 ,
sharedWorkerUri: '\/assets\/js\/eventsource.sharedworker.DV1Z2uJv.js',
i18n: {
error_occurred: "An error occurred",
remove_label_str: "Remove item \"%s\"",
modal_confirm: "Confirm",
modal_cancel: "Cancel",
more_items: "More items",
copy_success: "Copied!",
copy_error: "Copy failed",
},
};
window.config.pageData = window.config.pageData || {};
</script>
<script nonce="ae317871a9828db681b9e67893e24701" src="/assets/js/iife.D2XhYhS2.js"></script>
</head>
<body>
<div class="full height">
<noscript>This website requires JavaScript.</noscript>
<nav id="navbar" aria-label="Navigation Bar">
<div class="navbar-left">
<a class="item" id="navbar-logo" href="/" aria-label="Home">
<img width="30" height="30" src="/assets/img/logo.svg" alt="Logo" aria-hidden="true">
</a>
<div class="ui secondary menu navbar-mobile-right only-mobile">
<button class="item ui icon mini button tw-m-0" id="navbar-expand-toggle" aria-label="Navigation Menu"><svg viewBox="0 0 16 16" class="svg octicon-three-bars" aria-hidden="true" width="16" height="16"><path d="M1 2.75A.75.75 0 0 1 1.75 2h12.5a.75.75 0 0 1 0 1.5H1.75A.75.75 0 0 1 1 2.75m0 5A.75.75 0 0 1 1.75 7h12.5a.75.75 0 0 1 0 1.5H1.75A.75.75 0 0 1 1 7.75M1.75 12h12.5a.75.75 0 0 1 0 1.5H1.75a.75.75 0 0 1 0-1.5"/></svg></button>
</div>
<a class="item" href="/explore/repos">Explore</a>
<a class="item" target="_blank" href="https://docs.gitea.com">Help</a>
</div>
<div class="navbar-right">
<a class="item" rel="nofollow" href="/user/login">
<svg viewBox="0 0 16 16" class="svg octicon-sign-in" aria-hidden="true" width="16" height="16"><path d="M2 2.75C2 1.784 2.784 1 3.75 1h2.5a.75.75 0 0 1 0 1.5h-2.5a.25.25 0 0 0-.25.25v10.5c0 .138.112.25.25.25h2.5a.75.75 0 0 1 0 1.5h-2.5A1.75 1.75 0 0 1 2 13.25Zm6.56 4.5h5.69a.75.75 0 0 1 0 1.5H8.56l1.97 1.97a.749.749 0 0 1-.326 1.275.75.75 0 0 1-.734-.215L6.22 8.53a.75.75 0 0 1 0-1.06l3.25-3.25a.749.749 0 0 1 1.275.326.75.75 0 0 1-.215.734Z"/></svg>
<span class="tw-ml-1">Sign In</span>
</a>
</div>
</nav>
<div role="main" aria-label="Home" class="page-content home">
<div class="tw-mb-8 tw-px-8">
<div class="center">
<img class="logo" width="220" height="220" src="/assets/img/logo.svg" alt="Logo">
<div class="hero">
<h1 class="ui icon header title tw-text-balance">
Zomas- Git
</h1>
<h2 class="tw-text-balance">A painless, self-hosted Git service</h2>
</div>
</div>
</div>
<div class="ui stackable middle very relaxed page grid">
<div class="eight wide center column">
<h1 class="hero ui icon header">
<svg viewBox="0 0 16 16" class="svg octicon-flame" aria-hidden="true" width="16" height="16"><path d="M9.533.753V.752c.217 2.385 1.463 3.626 2.653 4.81C13.37 6.74 14.498 7.863 14.498 10c0 3.5-3 6-6.5 6S1.5 13.512 1.5 10c0-1.298.536-2.56 1.425-3.286.376-.308.862 0 1.035.454C4.46 8.487 5.581 8.419 6 8c.282-.282.341-.811-.003-1.5C4.34 3.187 7.035.75 8.77.146c.39-.137.726.194.763.607M7.998 14.5c2.832 0 5-1.98 5-4.5 0-1.463-.68-2.19-1.879-3.383l-.036-.037c-1.013-1.008-2.3-2.29-2.834-4.434-.322.256-.63.579-.864.953-.432.696-.621 1.58-.046 2.73.473.947.67 2.284-.278 3.232-.61.61-1.545.84-2.403.633a2.8 2.8 0 0 1-1.436-.874A3.2 3.2 0 0 0 3 10c0 2.53 2.164 4.5 4.998 4.5"/></svg> Easy to install
</h1>
<p class="large tw-text-balance">
Simply <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/installation/install-from-binary">run the binary</a> for your platform, ship it with <a target="_blank" rel="noopener noreferrer" href="https://github.com/go-gitea/gitea/tree/master/docker">Docker</a>, or get it <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/installation/install-from-package">packaged</a>.
</p>
</div>
<div class="eight wide center column">
<h1 class="hero ui icon header">
<svg viewBox="0 0 16 16" class="svg octicon-device-desktop" aria-hidden="true" width="16" height="16"><path d="M14.25 1c.966 0 1.75.784 1.75 1.75v7.5A1.75 1.75 0 0 1 14.25 12h-3.727c.099 1.041.52 1.872 1.292 2.757A.752.752 0 0 1 11.25 16h-6.5a.75.75 0 0 1-.565-1.243c.772-.885 1.192-1.716 1.292-2.757H1.75A1.75 1.75 0 0 1 0 10.25v-7.5C0 1.784.784 1 1.75 1ZM1.75 2.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25ZM9.018 12H6.982a5.7 5.7 0 0 1-.765 2.5h3.566a5.7 5.7 0 0 1-.765-2.5"/></svg> Cross-platform
</h1>
<p class="large tw-text-balance">
Gitea runs anywhere <a target="_blank" rel="noopener noreferrer" href="https://go.dev/">Go</a> can compile for: Windows, macOS, Linux, ARM, etc. Choose the one you love!
</p>
</div>
</div>
<div class="ui stackable middle very relaxed page grid">
<div class="eight wide center column">
<h1 class="hero ui icon header">
<svg viewBox="0 0 16 16" class="svg octicon-rocket" aria-hidden="true" width="16" height="16"><path d="M14.064 0h.186C15.216 0 16 .784 16 1.75v.186a8.75 8.75 0 0 1-2.564 6.186l-.458.459q-.472.471-.979.904v3.207c0 .608-.315 1.172-.833 1.49l-2.774 1.707a.75.75 0 0 1-1.11-.418l-.954-3.102a1 1 0 0 1-.145-.125L3.754 9.816a1 1 0 0 1-.124-.145L.528 8.717a.75.75 0 0 1-.418-1.11l1.71-2.774A1.75 1.75 0 0 1 3.31 4h3.204q.433-.508.904-.979l.459-.458A8.75 8.75 0 0 1 14.064 0M8.938 3.623h-.002l-.458.458c-.76.76-1.437 1.598-2.02 2.5l-1.5 2.317 2.143 2.143 2.317-1.5c.902-.583 1.74-1.26 2.499-2.02l.459-.458a7.25 7.25 0 0 0 2.123-5.127V1.75a.25.25 0 0 0-.25-.25h-.186a7.25 7.25 0 0 0-5.125 2.123M3.56 14.56c-.732.732-2.334 1.045-3.005 1.148a.23.23 0 0 1-.201-.064.23.23 0 0 1-.064-.201c.103-.671.416-2.273 1.15-3.003a1.502 1.502 0 1 1 2.12 2.12m6.94-3.935q-.132.09-.266.175l-2.35 1.521.548 1.783 1.949-1.2a.25.25 0 0 0 .119-.213ZM3.678 8.116 5.2 5.766q.087-.135.176-.266H3.309a.25.25 0 0 0-.213.119l-1.2 1.95ZM12 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0"/></svg> Lightweight
</h1>
<p class="large tw-text-balance">
Gitea has low minimal requirements and can run on an inexpensive Raspberry Pi. Save your machine energy!
</p>
</div>
<div class="eight wide center column">
<h1 class="hero ui icon header">
<svg viewBox="0 0 16 16" class="svg octicon-code" aria-hidden="true" width="16" height="16"><path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.75.75 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.75.75 0 0 1 .734.215m-6.56 0a.75.75 0 0 1 1.042.018.75.75 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.75.75 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"/></svg> Open Source
</h1>
<p class="large tw-text-balance">
Go get <a target="_blank" rel="noopener noreferrer" href="https://gitea.dev">gitea.dev</a>! Join us by <a target="_blank" rel="noopener noreferrer" href="https://github.com/go-gitea/gitea">contributing</a> to make this project even better. Don't hesitate to contribute!
</p>
</div>
</div>
</div>
</div>
<footer class="page-footer" role="group" aria-label="Footer">
<div class="left-links" role="contentinfo" aria-label="About Software">
<a target="_blank" href="https://about.gitea.com">Powered by Gitea</a>
<span>
Version:
1.27.3
</span>
<span>
Page: <strong>0ms</strong>
Template: <strong>0ms</strong>
</span>
</div>
<div class="right-links" role="group" aria-label="Links">
<div class="ui dropdown custom" id="footer-theme-selector">
<span class="default-text"><div class="theme-menu-item" data-tooltip-content=""><svg viewBox="490 490 820 820" class="svg gitea-eclipse" aria-hidden="true" width="16" height="16"><path d="M866.7 582.1A321.3 321.3 0 0 0 738.6 623a317.3 317.3 0 0 0-109.1 108.5A418 418 0 0 0 609 772a335.3 335.3 0 0 0-19.6 71.5 205.2 205.2 0 0 0-2.8 45c0 25.8.2 29.3 2.8 45 4.1 25.4 9.9 46.4 19.6 71.5a314.2 314.2 0 0 0 111.6 137.3A306.8 306.8 0 0 0 893 1196a308.6 308.6 0 0 0 303.6-262.5c2.6-15.7 2.8-19.2 2.8-45s-.2-29.3-2.8-45A335.3 335.3 0 0 0 1177 772a314.2 314.2 0 0 0-111.6-137.3A308.3 308.3 0 0 0 918 582c-13-1.1-38.2-1.1-51.3.1M747 663.5l-2.4 16.7c-4 26.4-4.9 41.1-4.3 65.3a323.7 323.7 0 0 0 37.2 145c18.2 36 41.3 66.6 72 95.5a346.4 346.4 0 0 0 208.5 93.1l18 1.6 4.5.5-8.5 8a259.3 259.3 0 0 1-141.5 65.8 281 281 0 0 1-123.9-11.4 267.2 267.2 0 0 1-181.7-269.9c2-27.6 5.7-47.6 13.3-70.7a281.2 281.2 0 0 1 46.4-85c8-10.1 28-30.2 37.9-38.1 13.8-11.1 24.5-18.3 24.5-16.4"/></svg> Auto </div></span>
<div class="menu theme-menu"></div>
</div>
<div class="ui dropdown upward">
<span class="flex-text-inline"><svg viewBox="0 0 16 16" class="svg octicon-globe" aria-hidden="true" width="14" height="14"><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0M5.78 8.75a9.64 9.64 0 0 0 1.363 4.177q.383.64.857 1.215c.245-.296.551-.705.857-1.215A9.64 9.64 0 0 0 10.22 8.75Zm4.44-1.5a9.64 9.64 0 0 0-1.363-4.177c-.307-.51-.612-.919-.857-1.215a10 10 0 0 0-.857 1.215A9.64 9.64 0 0 0 5.78 7.25Zm-5.944 1.5H1.543a6.51 6.51 0 0 0 4.666 5.5q-.184-.271-.352-.552c-.715-1.192-1.437-2.874-1.581-4.948m-2.733-1.5h2.733c.144-2.074.866-3.756 1.58-4.948q.18-.295.353-.552a6.51 6.51 0 0 0-4.666 5.5m10.181 1.5c-.144 2.074-.866 3.756-1.58 4.948q-.18.296-.353.552a6.51 6.51 0 0 0 4.666-5.5Zm2.733-1.5a6.51 6.51 0 0 0-4.666-5.5q.184.272.353.552c.714 1.192 1.436 2.874 1.58 4.948Z"/></svg> English</span>
<div class="menu language-menu">
<a lang="id-ID" data-url="/?lang=id-ID" class="item ">Bahasa Indonesia</a>
<a lang="de-DE" data-url="/?lang=de-DE" class="item ">Deutsch</a>
<a lang="en-US" data-url="/?lang=en-US" class="item selected">English</a>
<a lang="es-ES" data-url="/?lang=es-ES" class="item ">Español</a>
<a lang="fr-FR" data-url="/?lang=fr-FR" class="item ">Français</a>
<a lang="ga-IE" data-url="/?lang=ga-IE" class="item ">Gaeilge</a>
<a lang="it-IT" data-url="/?lang=it-IT" class="item ">Italiano</a>
<a lang="lv-LV" data-url="/?lang=lv-LV" class="item ">Latviešu</a>
<a lang="hu-HU" data-url="/?lang=hu-HU" class="item ">Magyar nyelv</a>
<a lang="nl-NL" data-url="/?lang=nl-NL" class="item ">Nederlands</a>
<a lang="pl-PL" data-url="/?lang=pl-PL" class="item ">Polski</a>
<a lang="pt-PT" data-url="/?lang=pt-PT" class="item ">Português de Portugal</a>
<a lang="pt-BR" data-url="/?lang=pt-BR" class="item ">Português do Brasil</a>
<a lang="fi-FI" data-url="/?lang=fi-FI" class="item ">Suomi</a>
<a lang="sv-SE" data-url="/?lang=sv-SE" class="item ">Svenska</a>
<a lang="tr-TR" data-url="/?lang=tr-TR" class="item ">Türkçe</a>
<a lang="cs-CZ" data-url="/?lang=cs-CZ" class="item ">Čeština</a>
<a lang="el-GR" data-url="/?lang=el-GR" class="item ">Ελληνικά</a>
<a lang="bg-BG" data-url="/?lang=bg-BG" class="item ">Български</a>
<a lang="ru-RU" data-url="/?lang=ru-RU" class="item ">Русский</a>
<a lang="uk-UA" data-url="/?lang=uk-UA" class="item ">Українська</a>
<a lang="fa-IR" data-url="/?lang=fa-IR" class="item ">فارسی</a>
<a lang="ml-IN" data-url="/?lang=ml-IN" class="item ">മലയാളം</a>
<a lang="ja-JP" data-url="/?lang=ja-JP" class="item ">日本語</a>
<a lang="zh-CN" data-url="/?lang=zh-CN" class="item ">简体中文</a>
<a lang="zh-TW" data-url="/?lang=zh-TW" class="item ">繁體中文(台灣)</a>
<a lang="zh-HK" data-url="/?lang=zh-HK" class="item ">繁體中文(香港)</a>
<a lang="ko-KR" data-url="/?lang=ko-KR" class="item ">한국어</a>
</div>
</div>
<a href="/assets/licenses.txt">Licenses</a>
<a href="/api/swagger">API</a>
</div>
</footer>
<script nonce="ae317871a9828db681b9e67893e24701" type="module" src="/assets/js/index.C6rrIx7F.js"></script>
<script nonce="ae317871a9828db681b9e67893e24701" type="module">
if (!window.config?.frontendInited && window.config?.runModeIsProd) alert("Frontend is not initialized, check console errors or asset files.");
</script>
</body>
</html>
+59
View File
@@ -0,0 +1,59 @@
# ============================================================
# INSTALLAZIONE BACKUP AUTOMATICO GITEA (da eseguire da ROOT)
# Incolla tutto questo blocco nel terminale root del VPS.
# ============================================================
# 1) Crea la directory backup
mkdir -p /var/backups/gitea
# 2) Scrivi lo script di backup in /usr/local/sbin (autosufficiente)
cat > /usr/local/sbin/backup_gitea.sh <<'EOF'
#!/bin/bash
# Backup automatico Gitea via `gitea dump` (db sqlite + repos + config in un unico zip).
# Retention: 14 giorni (modificare KEEP_DAYS).
set -euo pipefail
BACKUP_DIR=/var/backups/gitea
KEEP_DAYS=14
STAMP=$(date +%Y%m%d-%H%M%S)
ARC="$BACKUP_DIR/gitea-dump-$STAMP.zip"
mkdir -p "$BACKUP_DIR"
# Esegue il dump come utente 'gitea' (stesso user del servizio)
su -s /bin/bash gitea -c \
"/usr/local/bin/gitea dump --config /etc/gitea/app.ini --file '$ARC' --type zip" \
>/tmp/gitea-dump.log 2>&1
if [ ! -s "$ARC" ]; then
echo "ERRORE: dump non creato" >>/tmp/gitea-dump.log
exit 1
fi
# Pulisce i dump piu' vecchi di KEEP_DAYS
find "$BACKUP_DIR" -name 'gitea-dump-*.zip' -mtime +"$KEEP_DAYS" -delete
echo "OK: $ARC ($(du -h "$ARC" | cut -f1))"
EOF
chmod 0755 /usr/local/sbin/backup_gitea.sh
# 3) TEST: esegui un backup manuale adesso
/usr/local/sbin/backup_gitea.sh
ls -lh /var/backups/gitea/
# 4) Installa il cron giornaliero alle 02:30 via /etc/cron.d
cat > /etc/cron.d/gitea-backup <<'CRON'
# Backup giornaliero Gitea alle 02:30, stdout/stderr su log
30 2 * * * root /usr/local/sbin/backup_gitea.sh >>/tmp/gitea-dump.log 2>&1
CRON
chmod 0644 /etc/cron.d/gitea-backup
# 5) Verifica
echo "--- cron installato ---"
ls -l /etc/cron.d/gitea-backup
echo "--- contenuto ---"
cat /etc/cron.d/gitea-backup
echo "--- sistema crontab attivo? ---"
systemctl is-active cron 2>/dev/null || service cron status 2>/dev/null | head -2 || echo "cron non attivo (verificare)"
echo "--- ultimo backup (zona) ---"
ls -lh /var/backups/gitea/
+249
View File
@@ -0,0 +1,249 @@
# Installazione Gitea su VPS OVH — copia/incolla (root/sudo)
# Obbiettivo: git.zomas.net (Gitea dietro Apache; non tocca zomas.net / zomas.org)
# VPS: Debian 12, 4 vCPU, 7.6GB RAM
# Chi esegue: TU (root o sudo). Esegui i blocchi in ordine.
#
# ⚠️ PREREQUISITO DNS: prima del Passo 5 deve risolvere pubblicamente:
# dig +short git.zomas.net -> deve tornare 145.239.94.49
# (finché dà NXDOMAIN, SALTA il Passo 5 e resta solo in HTTP)
#
###############################################################################
# PASSO 1 — Installa Gitea (binario ufficiale + utente dedicato + sqlite)
###############################################################################
apt-get update && apt-get upgrade -y
apt-get install -y git sqlite3 curl wget
# utente di sistema dedicato (senza login)
adduser --system --group --disabled-password --home /var/lib/gitea gitea
mkdir -p /etc/gitea /var/lib/gitea/custom /var/lib/gitea/data /var/lib/gitea/log
chown -R root:gitea /etc/gitea
chown -R gitea:gitea /var/lib/gitea/
chmod -R g+rws /var/lib/gitea/
chmod -R g+rw /var/lib/gitea/
# ultima versione stabile
VERSION=$(curl -sL https://dl.gitea.com/gitea/version.json | python3 -c "import sys,json;print(json.load(sys.stdin)['latest']['version'])" 2>/dev/null || echo "1.22.0")
echo "Installazione Gitea $VERSION"
curl -sL -o /tmp/gitea "https://dl.gitea.com/gitea/$VERSION/gitea-$VERSION-linux-amd64"
# sposta e rendi eseguibile
install -o root -g root -m 755 /tmp/gitea /usr/local/bin/gitea
/usr/local/bin/gitea --version
###############################################################################
# PASSO 2 — Configurazione Gitea (app.ini)
###############################################################################
cat > /etc/gitea/app.ini <<'EOF'
RUN_USER = gitea
RUN_MODE = prod
[server]
; porta INTERNA: Apache farà da proxy verso questa
HTTP_PORT = 3000
HTTP_ADDR = 127.0.0.1
ROOT_URL = https://git.zomas.net/
DOMAIN = git.zomas.net
DISABLE_SSH = false
SSH_PORT = 2222
LFS_START_SERVER = true
[database]
DB_TYPE = sqlite3
PATH = /var/lib/gitea/data/gitea.db
[repository]
ROOT = /var/lib/gitea/data/gitea-repositories
[service]
DISABLE_REGISTRATION = false ; metti true quando vuoi bloccare le iscrizioni esterne
EOF
chown -R gitea:gitea /etc/gitea
###############################################################################
# PASSO 3 — Servizio systemd
###############################################################################
tee /etc/systemd/system/gitea.service >/dev/null <<'EOF'
[Unit]
Description=Gitea (Git with a cup of tea)
After=syslog.target
After=network.target
[Service]
RestartSec=2s
Type=simple
User=gitea
Group=gitea
WorkingDirectory=/var/lib/gitea/
ExecStart=/usr/local/bin/gitea web --config /etc/gitea/app.ini
Restart=always
Environment=USER=gitea HOME=/var/lib/gitea GITEA_WORK_DIR=/var/lib/gitea
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable gitea
systemctl start gitea
systemctl status gitea --no-pager | head -15
# verifica locale (deve rispondere HTTP)
curl -sI http://127.0.0.1:3000 | head -3
###############################################################################
# PASSO 4 — Virtualhost Apache (reverse proxy verso Gitea)
###############################################################################
# abilita i moduli necessario (i siti zomas.net/zomas.org NON vengono toccati)
a2enmod proxy_http proxy ssl
systemctl reload apache2
# virtualhost HTTP (redirect -> https)
cat > /etc/apache2/sites-available/git.zomas.net.conf <<'EOF'
<VirtualHost *:80>
ServerName git.zomas.net
Redirect permanent / https://git.zomas.net/
</VirtualHost>
EOF
# virtualhost HTTPS (proxy verso Gitea su 127.0.0.1:3000) — certbot poi aggiunge il SSL
cat > /etc/apache2/sites-available/git.zomas.net-ssl.conf <<'EOF'
<VirtualHost *:443>
ServerName git.zomas.net
CustomLog /var/log/apache2/git.zomas.net-access.log combined
ErrorLog /var/log/apache2/git.zomas.net-error.log
ProxyPreserveHost On
RequestHeader set Host %{HTTP_HOST}e
ProxyRequests Off
ProxyPass / http://127.0.0.1:3000/
ProxyPassReverse / http://127.0.0.1:3000/
</VirtualHost>
EOF
# abilita i virtualhost (mantenendo net/org intatti)
a2ensite git.zomas.net.conf
a2ensite git.zomas.net-ssl.conf
systemctl reload apache2
# verifica: il vhost :80 deve rispondere
curl -sI http://127.0.0.1:80 -H "Host: git.zomas.net" | head -3
###############################################################################
# PASSO 5 — Certificato HTTPS con Let's Encrypt
# ⚠️ FAI SOLO QUANDO git.zomas.net risolve pubblicamente (dig +short = 145.239.94.49)
###############################################################################
# richiedi il certificato per git.zomas.net (usa il vhost :80 come challenge)
certbot --apache -d git.zomas.net
# quando ti chiede il redirect HTTP->HTTPS scegli: 2
systemctl reload apache2
# verifica finale HTTPS
curl -sI https://git.zomas.net | head -3
###############################################################################
# PRIMO ACCESSO (dopo il Passo 3, già funziona in HTTP)
###############################################################################
# Apri nel browser: https://git.zomas.net (o http:// se non hai ancora il passo 5)
# Al primo avvio Gitea mostra la pagina di installazione:
# - DB: SQLite3
# - Path DB: /var/lib/gitea/data/gitea.db
# - URL: https://git.zomas.net/
# - Crea l'account amministratore (utente final, nome, email, password)
# Si può rilanciare la procedura con: su gitea -s /bin/bash -c "cd /var/lib/gitea && /usr/local/bin/gitea admin create-user --username admin --password 'ScegliPasswordSicura' --email [email protected] --admin"
# (poi applica via web)
#
# Nota SSH: Gitea usa la porta 2222 per git over SSH (oltre alla web). Da client:
# git clone ssh://[email protected]:2222/<utente>/<repo>.git
###############################################################################
# PASSO 6 — Certificati Let's Encrypt per origine (plugin dns-cloudflare)
# ⚠️ da eseguire come ROOT sul VPS. Il token CF è già in /tmp/cloudflare_tmp.ini
# Genera i cert con challenge DNS: funziona anche con i record messi "proxied".
# NON tocca i vhost esistenti di zomas.net / zomas.org (stesso --cert-name).
###############################################################################
set -ea
mkdir -p /root/.config/letsencrypt
[ -f /tmp/cloudflare_tmp.ini ] && { cp /tmp/cloudflare_tmp.ini /root/.config/letsencrypt/cloudflare.ini; chmod 600 /root/.config/letsencrypt/cloudflare.ini; } || { echo "Manca /tmp/cloudflare_tmp.ini"; exit 1; }
echo "=== 1/3 zomas.net + www ==="
certbot certonly --dns-cloudflare \
--dns-cloudflare-credentials /root/.config/letsencrypt/cloudflare.ini \
--dns-cloudflare-propagation-seconds 60 \
-d zomas.net -d www.zomas.net \
--cert-name zomas.net --non-interactive --agree-tos -m [email protected] --force-renewal
echo "=== 2/3 zomas.org + www ==="
certbot certonly --dns-cloudflare \
--dns-cloudflare-credentials /root/.config/letsencrypt/cloudflare.ini \
--dns-cloudflare-propagation-seconds 60 \
-d zomas.org -d www.zomas.org \
--cert-name zomas.org --non-interactive --agree-tos -m [email protected] --force-renewal
echo "=== 3/3 git.zomas.net ==="
certbot certonly --dns-cloudflare \
--dns-cloudflare-credentials /root/.config/letsencrypt/cloudflare.ini \
--dns-cloudflare-propagation-seconds 60 \
-d git.zomas.net \
--cert-name git.zomas.net --non-interactive --agree-tos -m [email protected]
echo "=== file generati in /etc/letsencrypt/live ==="
ls -la /etc/letsencrypt/live/
echo "=== certificati git ==="
ls -la /etc/letsencrypt/live/git.zomas.net/
###############################################################################
# PASSO 7 — (dopo aver generato i cert) Completare il vhost SSL di git
# e riabilitarlo. Il certificato git ora esiste in live/git.zomas.net.
# ⚠️ Leggi il contenuto di git.zomas.net-ssl.conf e COMPLETA il blocco
# aggiungendo: SSLEngine on + SSLCertificateFile/Key con i path git.
# Esempio (sostituisci tutto il contenuto del file):
###############################################################################
cat > /etc/apache2/sites-available/git.zomas.net-ssl.conf <<'EOF'
<VirtualHost *:443>
ServerName git.zomas.net
CustomLog /var/log/apache2/git.zomas.net-access.log combined
ErrorLog /var/log/apache2/git.zomas.net-error.log
SSLEngine on
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/git.zomas.net/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/git.zomas.net/privkey.pem
ProxyPreserveHost On
RequestHeader set Host %{HTTP_HOST}e
ProxyRequests Off
ProxyPass / http://127.0.0.1:3000/
ProxyPassReverse / http://127.0.0.1:3000/
</VirtualHost>
EOF
# riabilita il vhost SSL di git (dopo aver verificato che i cert esistono)
a2ensite git.zomas.net-ssl.conf
apache2ctl configtest
systemctl reload apache2
# verifica certificato da linea di comando
curl -sk -o /dev/null -w "https git (via IP/SNI) HTTP %{http_code}\n" https://127.0.0.1 -H "Host: git.zomas.net" --resolve git.zomas.net:443:127.0.0.1
###############################################################################
# PASSO 8 — Pannello Cloudflare: attiva il proxy (arancio) SOLO sui record web
# ⚠️ NON toccare: MX, mail.*, sole, calendar, docs, _dmarc, SPF, SRV
# Metti "Proxy (arancio)" su:
# - git.zomas.net (già arancio)
# - zomas.net (A)
# - www.zomas.net (CNAME)
# - zomas.org (A)
# - www.zomas.org (CNAME)
# Poi in SSL/TLS -> Overview seleziona: "Full (strict)"
###############################################################################