fr1: вебхук Маруси — vhost astra.ruzzy.dev и пользователь туннеля marusia-tunnel
- nginx: vhost astra.ruzzy.dev (LE), только POST /marusia/webhook/ → 127.0.0.1:18788, limit_req 1r/s, 64k, без access log, error_log crit (секрет в пути); ссылка zz-, чтобы не перехватить ответ на неизвестный SNI у git - sshd: Match User marusia-tunnel — только remote forward 127.0.0.1:18788; добавлен в AllowUsers - живые конфиги fr1 в stacks/astra-marusia/ вместо nginx-location.example - fr1.md: эффективные настройки sshd проверены под root, отпечатки host-ключей - туннель ещё не поднят, интеграция не завершена (хвост в fr1.md) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
3159921a4d
commit
e2bd908198
@@ -0,0 +1,56 @@
|
||||
# Публичный вход в разговорный сервис «Астра» для Маруси (stacks/astra-marusia).
|
||||
# Цепочка: VK → nginx → 127.0.0.1:18788 (обратный SSH-туннель от rpi, пользователь marusia-tunnel) → rpi 127.0.0.1:8788.
|
||||
# ⚠️ Секрет — часть пути. Поэтому в location нет access_log, а error_log только crit:
|
||||
# на уровне error nginx пишет строку запроса (с секретом) при 502/limit_req.
|
||||
server {
|
||||
server_name astra.ruzzy.dev;
|
||||
server_tokens off;
|
||||
|
||||
location ^~ /marusia/webhook/ {
|
||||
access_log off;
|
||||
error_log /var/log/nginx/marusia-webhook.error.log crit;
|
||||
|
||||
client_max_body_size 64k;
|
||||
client_body_timeout 5s;
|
||||
|
||||
limit_except POST {
|
||||
deny all;
|
||||
}
|
||||
|
||||
limit_req zone=marusia_webhook burst=5 nodelay;
|
||||
limit_req_status 429;
|
||||
|
||||
proxy_connect_timeout 1s;
|
||||
proxy_send_timeout 5s;
|
||||
proxy_read_timeout 5s;
|
||||
|
||||
# /marusia/webhook/<секрет> → /webhook/<секрет>
|
||||
proxy_pass http://127.0.0.1:18788/webhook/;
|
||||
}
|
||||
|
||||
location / {
|
||||
return 404;
|
||||
}
|
||||
|
||||
listen 443 ssl;
|
||||
ssl_certificate /etc/letsencrypt/live/astra.ruzzy.dev/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/astra.ruzzy.dev/privkey.pem;
|
||||
include /etc/letsencrypt/options-ssl-nginx.conf;
|
||||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name astra.ruzzy.dev;
|
||||
server_tokens off;
|
||||
|
||||
# по HTTP секрет уже утёк в сеть; хотя бы не пишем его в лог и не редиректим
|
||||
location ^~ /marusia/ {
|
||||
access_log off;
|
||||
return 404;
|
||||
}
|
||||
|
||||
location / {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user