Sito di presentazione my-vps
Find a file
opencode ea82fa0e4a
All checks were successful
deploy-myvps-site / deploy (push) Successful in 16s
Recreate Podman container before generating systemd unit
2026-11-22 23:25:22 +00:00
.forgejo/workflows Add my-vps presentation site with public/restricted split 2026-11-22 23:19:25 +00:00
public Add my-vps presentation site with public/restricted split 2026-11-22 23:19:25 +00:00
scripts Recreate Podman container before generating systemd unit 2026-11-22 23:25:22 +00:00
src Add my-vps presentation site with public/restricted split 2026-11-22 23:19:25 +00:00
.gitignore Add my-vps presentation site with public/restricted split 2026-11-22 23:19:25 +00:00
astro.config.mjs Add my-vps presentation site with public/restricted split 2026-11-22 23:19:25 +00:00
deploy.sh Add my-vps presentation site with public/restricted split 2026-11-22 23:19:25 +00:00
docker-compose.yml Add my-vps presentation site with public/restricted split 2026-11-22 23:19:25 +00:00
Dockerfile Add my-vps presentation site with public/restricted split 2026-11-22 23:19:25 +00:00
nginx.conf Add my-vps presentation site with public/restricted split 2026-11-22 23:19:25 +00:00
package-lock.json Add my-vps presentation site with public/restricted split 2026-11-22 23:19:25 +00:00
package.json Add my-vps presentation site with public/restricted split 2026-11-22 23:19:25 +00:00
README.md Add my-vps presentation site with public/restricted split 2026-11-22 23:19:25 +00:00
tsconfig.json Add my-vps presentation site with public/restricted split 2026-11-22 23:19:25 +00:00

myvps-site

Sito di presentazione di my-vps, separato da astro-blog.

  • www.194.164.167.80.nip.io — area pubblica.
  • www.194.164.167.80.nip.io/riservata/ — area protetta da Authelia (SSO).

Il codice sta in questo repo; i testi stanno nel repo contenuti privato myvps-site-content (pages/*.md), copiati in src/content/pages/ in fase di build. Nessun segreto, token o URL credenziata deve finire in questo repo.

Modello di visibilità

Come nel blog, la visibilità è decisa dal frontmatter:

  • draft: true — pagina esclusa del tutto dalla build.
  • default — pagina pubblica sotto /<slug>/ e nel feed /rss.xml.
  • restricted: true — pagina generata solo sotto /riservata/<slug>/, assente da home, indici e RSS.

Il filtro è unico: getVisiblePages(scope) in src/lib/pages.ts (default public). Qualsiasi nuova pagina che legge la collection deve usarlo.

Regola di contenuto: in area pubblica solo concetti e servizi pubblici (blog, indice progetti). URL dirette, host interni, IP, porte, nomi container, link a repo private, runbook e backup/DR solo in /riservata/*.

Struttura

myvps-site/
├── Dockerfile, nginx.conf, docker-compose.yml, deploy.sh
├── astro.config.mjs, package.json, tsconfig.json
├── src/
│   ├── consts.ts
│   ├── content/config.ts        # schema pages: draft/restricted/order/pubDate
│   ├── layouts/BaseLayout.astro
│   ├── lib/pages.ts             # getVisiblePages(scope)
│   ├── pages/
│   │   ├── index.astro          # home pubblica
│   │   ├── [...slug].astro      # pagine pubbliche dal repo contenuti
│   │   ├── rss.xml.ts           # solo pagine pubbliche
│   │   └── riservata/
│   │       ├── index.astro
│   │       └── [...slug].astro  # pagine riservate
│   └── styles/global.css
└── public/favicon.svg

Comandi

cp ../myvps-site-content/pages/*.md src/content/pages/
npm install
npm run build
sh deploy.sh

deploy.sh copia i contenuti, builda l'immagine myvps-site:latest e ricrea il container con le label Traefik (router pubblico + router /riservata con middleware authelia@docker). Il file docker-compose.yml descrive la stessa configurazione per un'eventuale gestione tramite Ansible/systemd.

Sull'host il deploy automatico è in /root/.hermes/scripts/deploy-myvps-site.sh (copia di scripts/deploy-host.sh): aggiorna i checkout /opt/myvps-site e /opt/myvps-site-content, builda l'immagine con Podman, gestisce l'unit container-myvps-site.service e verifica la home. Il workflow .forgejo/workflows/deploy.yml è presente in entrambi i repo e lo invoca a ogni push su main tramite il runner self-hosted.