docs: вся документация egorin в своей папке — обзор, DEPLOY на gate, макет горэлектросети, конфиги (секрет не в git)
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
# /opt/egorin-api/.env — бэкенд-шлюз egorin (gate). НЕ коммитить в git.
|
||||
PORT=4100
|
||||
JWT_SECRET=egorin-gate-2026-CHANGE-IF-NEEDED
|
||||
DATA_DIR=/opt/egorin-api/data
|
||||
|
||||
# Яндекс ID (приложение «Железный монитор»)
|
||||
YANDEX_CLIENT_ID=12f8169bc7f74571b53e90a2bafea786
|
||||
YANDEX_CLIENT_SECRET=<секрет в .env на gate, НЕ в git>
|
||||
YANDEX_REDIRECT=https://egorin.r.servaki.online/api/auth/yandex/callback
|
||||
YANDEX_ADMINS=mpo-inform@yandex.ru
|
||||
|
||||
# Источники данных — включатся по мере готовности стеков (иначе демо-fallback):
|
||||
# MQTT_URL=mqtt://mosquitto:1883
|
||||
# INFLUX_URL=http://influxdb:8086
|
||||
# TRACCAR_URL=http://traccar:8082
|
||||
@@ -0,0 +1,40 @@
|
||||
# /etc/nginx/sites-available/egorin.r.servaki.online.conf (gate 5.101.118.232)
|
||||
# HTTP-first. certbot --nginx -d egorin.r.servaki.online довыпустит серт и добавит 443.
|
||||
# Рядом с панелью «Ворота» (другой server_name) — её не трогает.
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name egorin.r.servaki.online;
|
||||
|
||||
root /var/www/egorin.r.servaki.online;
|
||||
index index.html;
|
||||
|
||||
# SPA
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
location /assets/ {
|
||||
expires 30d;
|
||||
add_header Cache-Control "public, immutable";
|
||||
try_files $uri =404;
|
||||
}
|
||||
# Бэкенд-шлюз (Yandex OAuth + данные) на 127.0.0.1:4100
|
||||
location /api/ {
|
||||
proxy_pass http://127.0.0.1:4100;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
location /socket {
|
||||
proxy_pass http://127.0.0.1:4100;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $host;
|
||||
}
|
||||
|
||||
gzip on;
|
||||
gzip_types text/css application/javascript application/json image/svg+xml;
|
||||
access_log /var/log/nginx/egorin.access.log;
|
||||
error_log /var/log/nginx/egorin.error.log;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=Egorin / Servaki Monitor API gateway (Node)
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/opt/egorin-api/server
|
||||
EnvironmentFile=/opt/egorin-api/.env
|
||||
ExecStart=/usr/bin/node src/server.js
|
||||
Restart=on-failure
|
||||
RestartSec=3
|
||||
User=www-data
|
||||
Group=www-data
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user