Реструктуризация: два глобальных раздела — Яша и Семен
Весь контент перенесён в content/yasha/ (7 подразделов). Создан content/semen/ с подразделами: changelog, kb, diary. Навигация — dropdown в навбаре, двухуровневое меню в hugo.toml. Шаблоны, сайдбар, поиск обновлены под вложенные секции.
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
+++
|
||||
title = "Инструкции"
|
||||
draft = false
|
||||
+++
|
||||
@@ -0,0 +1,75 @@
|
||||
---
|
||||
title: "Подключение claw.a2v.space (OpenClaw)"
|
||||
date: 2026-03-29
|
||||
tags: ["openclaw", "ssh", "nginx", "vps", "reverse-proxy"]
|
||||
---
|
||||
|
||||
## Архитектура
|
||||
|
||||
```
|
||||
Mac Studio (192.168.0.37:18789)
|
||||
→ autossh SSH-туннель
|
||||
→ VPS 95.163.232.9:8080
|
||||
→ nginx HTTPS
|
||||
→ https://claw.a2v.space
|
||||
```
|
||||
|
||||
## Шаги настройки
|
||||
|
||||
### 1. DNS
|
||||
|
||||
A-запись `claw.a2v.space` → `95.163.232.9`
|
||||
|
||||
NS-серверы: `ns1.hosting.reg.ru`, `ns2.hosting.reg.ru`
|
||||
|
||||
### 2. Mac Studio — OpenClaw
|
||||
|
||||
- Порт: 18789
|
||||
- Конфиг: `~/.openclaw/openclaw.json`
|
||||
|
||||
### 3. SSH-туннель (launchd)
|
||||
|
||||
Plist: `~/Library/LaunchAgents/com.openclaw.sshtunnel.plist`
|
||||
|
||||
Ключевой флаг: `-R 8080:localhost:18789`
|
||||
|
||||
### 4. VPS — nginx конфиг
|
||||
|
||||
```nginx
|
||||
server {
|
||||
listen 80;
|
||||
server_name claw.a2v.space;
|
||||
return 301 https://$server_name$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name claw.a2v.space;
|
||||
|
||||
ssl_certificate /etc/letsencrypt/live/claw.a2v.space/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/claw.a2v.space/privkey.pem;
|
||||
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:8080;
|
||||
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;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 5. SSL-сертификат
|
||||
|
||||
```bash
|
||||
certbot certonly --nginx -d claw.a2v.space
|
||||
```
|
||||
|
||||
### 6. OpenClaw config
|
||||
|
||||
```json
|
||||
{
|
||||
"allowedOrigins": ["https://claw.a2v.space"],
|
||||
"trustedProxies": ["127.0.0.1"]
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,59 @@
|
||||
---
|
||||
title: "Подключение code.a2v.space (OpenCode)"
|
||||
date: 2026-03-29
|
||||
tags: ["opencode", "ssh", "nginx", "vps", "reverse-proxy"]
|
||||
---
|
||||
|
||||
## Архитектура
|
||||
|
||||
```
|
||||
Mac Studio (localhost:4096)
|
||||
→ autossh SSH-туннель (-R 8081:localhost:4096)
|
||||
→ VPS 95.163.232.9:8081
|
||||
→ nginx HTTPS
|
||||
→ https://code.a2v.space
|
||||
```
|
||||
|
||||
## Параметры
|
||||
|
||||
| Параметр | Значение |
|
||||
|----------|----------|
|
||||
| Локальный порт | 4096 |
|
||||
| Туннель порт | 8081 |
|
||||
| pm2 процесс | `opencode` |
|
||||
| SSL сертификат | `/etc/letsencrypt/live/code.a2v.space/` |
|
||||
|
||||
## nginx конфиг
|
||||
|
||||
```nginx
|
||||
server {
|
||||
listen 80;
|
||||
server_name code.a2v.space;
|
||||
return 301 https://$server_name$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name code.a2v.space;
|
||||
|
||||
ssl_certificate /etc/letsencrypt/live/code.a2v.space/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/code.a2v.space/privkey.pem;
|
||||
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:8081;
|
||||
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;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## SSL-сертификат
|
||||
|
||||
```bash
|
||||
certbot certonly --nginx -d code.a2v.space
|
||||
```
|
||||
@@ -0,0 +1,73 @@
|
||||
---
|
||||
title: "Подключение sand.a2v.space (Leadera Project)"
|
||||
date: 2026-03-29
|
||||
tags: ["angular", "go", "docker", "nginx", "vps", "reverse-proxy"]
|
||||
---
|
||||
|
||||
## Архитектура
|
||||
|
||||
```
|
||||
Mac Studio
|
||||
├─ Frontend (Angular) :4200 (pm2: leadera-fe)
|
||||
├─ Backend (Go) :8080 (pm2: leadera-api)
|
||||
└─ PostgreSQL 16 в Docker (Colima, container: app-leadera-db)
|
||||
→ autossh SSH-туннель (-R 8082:localhost:4200 -R 8083:localhost:8080)
|
||||
→ VPS 95.163.232.9
|
||||
→ nginx HTTPS
|
||||
→ https://sand.a2v.space
|
||||
```
|
||||
|
||||
## Параметры
|
||||
|
||||
| Компонент | Локальный порт | Туннель порт | pm2 имя |
|
||||
|-----------|----------------|--------------|---------|
|
||||
| Frontend (Angular) | 4200 | 8082 | leadera-fe |
|
||||
| Backend (Go) | 8080 | 8083 | leadera-api |
|
||||
|
||||
SSL сертификат: `/etc/letsencrypt/live/sand.a2v.space/`
|
||||
|
||||
## nginx конфиг
|
||||
|
||||
```nginx
|
||||
server {
|
||||
listen 80;
|
||||
server_name sand.a2v.space;
|
||||
return 301 https://$server_name$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name sand.a2v.space;
|
||||
|
||||
ssl_certificate /etc/letsencrypt/live/sand.a2v.space/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/sand.a2v.space/privkey.pem;
|
||||
|
||||
location /api {
|
||||
proxy_pass http://127.0.0.1:8083;
|
||||
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 / {
|
||||
proxy_pass http://127.0.0.1:8082;
|
||||
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;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## База данных
|
||||
|
||||
PostgreSQL 16 в Docker через Colima:
|
||||
- Container: `app-leadera-db`
|
||||
- Port: 5432
|
||||
|
||||
## SSL-сертификат
|
||||
|
||||
```bash
|
||||
certbot certonly --nginx -d sand.a2v.space
|
||||
```
|
||||
@@ -0,0 +1,72 @@
|
||||
---
|
||||
title: "SSH туннели для VPS reverse proxy"
|
||||
date: 2026-03-29
|
||||
tags: ["ssh", "tunnel", "vps", "reverse-proxy"]
|
||||
description: "Настройка SSH туннелей для доступа к сервисам на Mac Studio через VPS"
|
||||
---
|
||||
|
||||
## Настройка SSH туннелей
|
||||
|
||||
### VPS reg.ru (95.163.232.9)
|
||||
|
||||
```bash
|
||||
# На Mac Studio: создать туннель для каждого сервиса
|
||||
ssh -N -R 8080:localhost:8080 root@95.163.232.9 # leadera-api
|
||||
ssh -N -R 8081:localhost:4096 root@95.163.232.9 # opencode
|
||||
ssh -N -R 8082:localhost:4200 root@95.163.232.9 # leadera-fe
|
||||
ssh -N -R 8083:localhost:8080 root@95.163.232.9 # docs-a2v
|
||||
```
|
||||
|
||||
### Настройка launchd plist
|
||||
|
||||
**Файл**: `~/Library/LaunchAgents/com.openclaw.sshtunnel.plist`
|
||||
|
||||
```xml
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>Label</key>
|
||||
<string>com.openclaw.sshtunnel</string>
|
||||
<key>ProgramArguments</key>
|
||||
<array>
|
||||
<string>ssh</string>
|
||||
<string>-N</string>
|
||||
<string>-R</string>
|
||||
<string>8080:localhost:8080</string>
|
||||
<string>root@95.163.232.9</string>
|
||||
</array>
|
||||
<key>RunAtLoad</key>
|
||||
<true/>
|
||||
<key>KeepAlive</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
```
|
||||
|
||||
### Автозапуск
|
||||
|
||||
```bash
|
||||
# Загрузить plist
|
||||
launchctl load ~/Library/LaunchAgents/com.openclaw.sshtunnel.plist
|
||||
|
||||
# Проверить статус
|
||||
launchctl list | grep sshtunnel
|
||||
|
||||
# Удалить (при необходимости)
|
||||
launchctl unload ~/Library/LaunchAgents/com.openclaw.sshtunnel.plist
|
||||
```
|
||||
|
||||
## Доступ к сервисам
|
||||
|
||||
Через reverse proxy на VPS:
|
||||
- **code.a2v.space**: порт 8080 → Mac Studio:4096
|
||||
- **claw.a2v.space**: порт 8081 → Mac Studio:8080 (leadera-api)
|
||||
- **sand.a2v.space**: порт 8082 → Mac Studio:4200 (leadera-fe)
|
||||
- **docs.a2v.space**: порт 8083 → Mac Studio:8080 (docs-a2v)
|
||||
|
||||
## SSL
|
||||
|
||||
Все сервисы используют Let's Encrypt сертификаты:
|
||||
- Путь: `/etc/letsencrypt/live/{claw,code,sand}.a2v.space/`
|
||||
- Автопродление через certbot
|
||||
@@ -0,0 +1,102 @@
|
||||
---
|
||||
title: "Настройка VPS как реверс-прокси"
|
||||
date: 2026-03-29
|
||||
tags: ["vps", "nginx", "ssh", "reverse-proxy", "devops"]
|
||||
---
|
||||
|
||||
## Общая схема
|
||||
|
||||
```
|
||||
Mac Studio (локальная сеть)
|
||||
→ autossh (SSH-туннели)
|
||||
→ VPS 95.163.232.9 (Debian)
|
||||
→ nginx (HTTPS reverse proxy)
|
||||
→ интернет
|
||||
```
|
||||
|
||||
## Что нужно на VPS
|
||||
|
||||
### 1. Установленные пакеты
|
||||
|
||||
```bash
|
||||
apt update
|
||||
apt install nginx certbot python3-certbot-nginx
|
||||
```
|
||||
|
||||
### 2. SSH-доступ
|
||||
|
||||
- Авторизация только по ключам
|
||||
- Публичный ключ с Mac Studio добавлен в `/root/.ssh/authorized_keys`
|
||||
|
||||
### 3. nginx
|
||||
|
||||
Для каждого домена создать server block:
|
||||
|
||||
- HTTP → редирект на HTTPS
|
||||
- HTTPS с SSL-сертификатом Let's Encrypt
|
||||
- `proxy_pass` на localhost-порт туннеля
|
||||
|
||||
Пример структуры:
|
||||
|
||||
```
|
||||
/etc/nginx/sites-available/
|
||||
claw.a2v.space.conf
|
||||
code.a2v.space.conf
|
||||
sand.a2v.space.conf
|
||||
```
|
||||
|
||||
### 4. SSL-сертификаты
|
||||
|
||||
```bash
|
||||
certbot certonly --nginx -d <domain>
|
||||
certbot renew --dry-run # проверить автообновление
|
||||
```
|
||||
|
||||
## Что нужно на Mac Studio
|
||||
|
||||
### autossh через launchd
|
||||
|
||||
Plist: `~/Library/LaunchAgents/com.openclaw.sshtunnel.plist`
|
||||
|
||||
Один plist с несколькими `-R` флагами:
|
||||
|
||||
```xml
|
||||
<key>ProgramArguments</key>
|
||||
<array>
|
||||
<string>/usr/local/bin/autossh</string>
|
||||
<string>-M</string>
|
||||
<string>0</string>
|
||||
<string>-R</string>
|
||||
<string>8080:localhost:18789</string>
|
||||
<string>-R</string>
|
||||
<string>8081:localhost:4096</string>
|
||||
<string>-R</string>
|
||||
<string>8082:localhost:4200</string>
|
||||
<string>-R</string>
|
||||
<string>8083:localhost:8080</string>
|
||||
<string>root@95.163.232.9</string>
|
||||
<string>-N</string>
|
||||
<string>-i</string>
|
||||
<string>/Users/<user>/.ssh/id_rsa</string>
|
||||
</array>
|
||||
```
|
||||
|
||||
### Управление launchd
|
||||
|
||||
```bash
|
||||
launchctl load ~/Library/LaunchAgents/com.openclaw.sshtunnel.plist
|
||||
launchctl start com.openclaw.sshtunnel
|
||||
launchctl stop com.openclaw.sshtunnel
|
||||
```
|
||||
|
||||
## Проверка
|
||||
|
||||
```bash
|
||||
# На VPS
|
||||
ss -tlnp | grep -E '808[0-3]'
|
||||
|
||||
# Снаружи
|
||||
curl -I https://claw.a2v.space
|
||||
curl -I https://code.a2v.space
|
||||
curl -I https://sand.a2v.space
|
||||
```
|
||||
Reference in New Issue
Block a user