Web de la acampada del 26S

Home con directo, comunicados y organización. HTML y CSS, sin JS.
Configuración de nginx, timer del directo y limpieza de EXIF.
This commit is contained in:
hacklab 2026-09-29 10:10:54 +02:00
commit f78773bb87
15 changed files with 1335 additions and 0 deletions

16
deploy/directo.service Normal file
View file

@ -0,0 +1,16 @@
[Unit]
Description=acampada26s: regenera el bloque DIRECTO de la home
After=oasis.service
[Service]
Type=oneshot
User=oasis
Environment=OASIS_DIR=/home/oasis/oasis
Environment=FEED=@CAMBIAR.ed25519
Environment=WEB=/var/www/acampada26s.net/index.html
# node tiene que estar en el PATH del servicio (o poner la ruta completa)
ExecStart=/bin/sh -c 'node /opt/26s/tools/ultimos.js "$FEED" 5 | python3 /opt/26s/tools/directo.py "$WEB"'
NoNewPrivileges=yes
ProtectSystem=strict
ReadWritePaths=/var/www/acampada26s.net
PrivateTmp=yes

9
deploy/directo.timer Normal file
View file

@ -0,0 +1,9 @@
[Unit]
Description=acampada26s: DIRECTO cada minuto
[Timer]
OnBootSec=1min
OnUnitActiveSec=1min
[Install]
WantedBy=timers.target

16
deploy/hub.conf Normal file
View file

@ -0,0 +1,16 @@
# Copiar a /etc/nginx/snippets/acampada26s-hub.conf
# OASIS escuchando en 127.0.0.1:3000 (node backend.js --public --no-open --host=127.0.0.1)
limit_except GET HEAD { deny all; }
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP "";
proxy_set_header X-Forwarded-For "";
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 120s;
proxy_buffering on;
# add_header en location anula los del server: se repiten aquí todos menos la CSP.
add_header Strict-Transport-Security "max-age=63072000" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "no-referrer" always;
add_header X-Frame-Options "DENY" always;

54
deploy/nginx.conf Normal file
View file

@ -0,0 +1,54 @@
# acampada26s.net
# Estático en /var/www/acampada26s.net (contenido de site/).
# /c -> HUB clearnet de OASIS (solo lectura) del pub de la acampada.
server_tokens off;
# Logs sin IP completa: se guarda solo la /24.
map $remote_addr $ip_anon {
~(?P<ip>\d+\.\d+\.\d+)\.\d+ $ip.0;
~(?P<ip>[^:]+:[^:]+): $ip::;
default 0.0.0.0;
}
log_format anon '$ip_anon [$time_local] "$request" $status $body_bytes_sent';
server {
listen 80;
listen [::]:80;
server_name acampada26s.net www.acampada26s.net;
return 301 https://acampada26s.net$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name acampada26s.net www.acampada26s.net;
ssl_certificate /etc/letsencrypt/live/acampada26s.net/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/acampada26s.net/privkey.pem;
access_log /var/log/nginx/acampada26s.access.log anon;
root /var/www/acampada26s.net;
index index.html;
add_header Content-Security-Policy "default-src 'none'; style-src 'self'; img-src 'self'; font-src 'self'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'" always;
add_header Strict-Transport-Security "max-age=63072000" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "no-referrer" always;
add_header Permissions-Policy "camera=(), microphone=(), geolocation=(), interest-cohort=()" always;
location / {
limit_except GET HEAD { deny all; }
try_files $uri $uri/ =404;
}
location ~* \.(css|woff2|jpg|jpeg|png|webp)$ {
limit_except GET HEAD { deny all; }
expires 7d;
}
# HUB de OASIS. Trae CSS inline, así que hub.conf redefine las cabeceras sin la CSP.
location = /c { include /etc/nginx/snippets/acampada26s-hub.conf; }
location ^~ /c/ { include /etc/nginx/snippets/acampada26s-hub.conf; }
}