mirror of
https://github.com/Dasemu/si-no-o-indiferente.git
synced 2026-11-26 23:36:25 +00:00
Add Historias Incompletas: web+APK story game with Gemini-powered daily deck
Node/Express backend generates 5 lateral-thinking mystery stories a day via Gemini and serves the latest batch; React/Vite frontend (Capacitor-wrapped for Android) plays them pass-and-play style, falling back to a bundled set of 16 original stories when the backend has nothing new or is unreachable. Includes systemd/nginx deploy config for a Docker-less Debian LXC. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
de0dfec6af
commit
7f3e6cc839
97 files changed
+6803
-1
No files matched your search
@@ -0,0 +1,31 @@
|
||||
# Ejemplo de virtual host para nginx en el LXC de Debian.
|
||||
# Sirve el frontend (build estatica de Vite) y reversa-proxea /api al backend
|
||||
# Node que corre en localhost:8787 via el servicio systemd story-api.
|
||||
#
|
||||
# Copialo a /etc/nginx/sites-available/historias, ajusta el dominio y la ruta,
|
||||
# y despues:
|
||||
# ln -s /etc/nginx/sites-available/historias /etc/nginx/sites-enabled/historias
|
||||
# nginx -t && systemctl reload nginx
|
||||
# Para TLS con Let's Encrypt: certbot --nginx -d tu-dominio.com
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name tu-dominio.com;
|
||||
|
||||
root /opt/historias/frontend/dist;
|
||||
index index.html;
|
||||
|
||||
location /api/ {
|
||||
proxy_pass http://127.0.0.1:8787/api/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files $uri /index.html;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
[Unit]
|
||||
Description=API de Historias Incompletas
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=historias
|
||||
Group=historias
|
||||
WorkingDirectory=/opt/historias/backend
|
||||
EnvironmentFile=/opt/historias/backend/.env
|
||||
ExecStart=/usr/bin/node /opt/historias/backend/dist/index.js
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
# Endurecimiento basico del sandbox systemd
|
||||
NoNewPrivileges=true
|
||||
ProtectSystem=strict
|
||||
ProtectHome=true
|
||||
ReadWritePaths=/opt/historias/backend/data
|
||||
PrivateTmp=true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=Genera 5 historias nuevas del dia con Gemini
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=historias
|
||||
Group=historias
|
||||
WorkingDirectory=/opt/historias/backend
|
||||
EnvironmentFile=/opt/historias/backend/.env
|
||||
ExecStart=/usr/bin/node /opt/historias/backend/dist/scripts/generateDaily.js
|
||||
@@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=Dispara la generacion diaria de historias (story-generate.service)
|
||||
|
||||
[Timer]
|
||||
OnCalendar=*-*-* 06:00:00
|
||||
RandomizedDelaySec=600
|
||||
Persistent=true
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
Reference in new issue
Block a user