feat: initial environment management

- caddy/m4mini.Caddyfile: Main reverse proxy config (all DDNS)
- machines/: Documentation for 3 machines
- env/: Environment variable templates
This commit is contained in:
2026-11-08 17:07:26 +08:00
parent 6787d1465c
commit 3c33f79c9d
6 changed files with 237 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
# Caddyfile Management
| Machine | IP | Caddyfile | Role |
|---------|-----|-----------|------|
| m4mini | 192.168.110.210 | m4mini.Caddyfile | Main reverse proxy (all DDNS) |
| m5max128 | 192.168.110.200 | *(none - proxied by m4mini)* | Runtime + SPA server |
| m5max48 | 192.168.110.201 | *(none - proxied by m4mini)* | Runtime + Gitea mirror |
+187
View File
@@ -0,0 +1,187 @@
# Caddyfile for m4mini (192.168.110.210) - Main reverse proxy
{
email admin@accusys.com.tw
metrics
}
# 定義日誌 Snippet
(common_log) {
log {
output file /Users/accusys/momentry/log/{args[0]}.log {
roll_size 100mb
roll_keep 5
roll_keep_for 720h
}
format json
}
}
# router 5 (192.168.5.1)
router5.momentry.ddns.net {
reverse_proxy 192.168.5.1:80 {
header_up Host {upstream_hostport}
}
import common_log router5_access
}
# router 110 (192.168.110.1)
router110.momentry.ddns.net {
reverse_proxy 192.168.110.1:80 {
header_up Host {upstream_hostport}
}
import common_log router110_access
}
router0.momentry.ddns.net {
handle_path /admin/* {
uri strip_prefix /admin
reverse_proxy 192.168.0.1:80 {
header_up Host 192.168.0.1
header_up X-Forwarded-Proto http # 告诉后端:原始是 HTTP
header_up X-Real-IP {remote_host}
}
}
import common_log router0_access
}
# n8n
n8n.momentry.ddns.net {
@metrics {
path /metrics
}
respond @metrics 403
reverse_proxy 127.0.0.1:5678 {
flush_interval -1
}
import common_log n8n_access
}
# seaweed (SeaweedFS)
seaweed.momentry.ddns.net {
reverse_proxy 127.0.0.1:8888
import common_log seaweed_access
}
# sftpgo (sftpgo)
m4minisftpgo.momentry.ddns.net {
reverse_proxy 127.0.0.1:8081
import common_log m4minisftpgo_access
}
# webdav (sftpgo)
webdav.momentry.ddns.net {
reverse_proxy 127.0.0.1:8090
import common_log webdav_access
}
# qdrant (qdrant)
qdrant.momentry.ddns.net {
reverse_proxy 127.0.0.1:6333
import common_log qdrant_access
}
# Gitea (Gitea)
gitea.momentry.ddns.net {
reverse_proxy 127.0.0.1:3000
encode gzip
import common_log gitea_access
}
# Chat (Open WebUI)
chat.momentry.ddns.net {
reverse_proxy 127.0.0.1:8085
import common_log chat_access
}
# Netdata
netdata.momentry.ddns.net {
reverse_proxy 127.0.0.1:19999
import common_log netdata_access
}
# Grafana
grafana.momentry.ddns.net {
reverse_proxy 127.0.0.1:3001
import common_log grafana_access
}
# TrueNAS
truenas.momentry.ddns.net {
reverse_proxy 192.168.0.219:80 192.168.110.219:80
import common_log truenas_access
}
# Momentry Dashboard (Static HTML)
:3200 {
handle /api/* {
reverse_proxy localhost:3002
}
handle {
root * /Users/accusys/momentry_dashboard/dist
encode gzip
try_files {path} /index.html
file_server
}
}
# Momentry Core API
api.momentry.ddns.net {
reverse_proxy localhost:3002
import common_log momentry_api_access
}
# M5 SFTPGo
m5max48sftpgo.momentry.ddns.net {
reverse_proxy 192.168.110.201:8081
import common_log m5max48sftpgo_access
}
# M5 WordPress
m5wp.momentry.ddns.net {
tls internal
# Local video files: direct serve, zero backend overhead
handle_path /files/* {
root * /Users/accusys/momentry/var/sftpgo/data
file_server
}
# Media proxy: bypasses inactive WordPress Code Snippet 61
# Rewrites path, preserves original query string
@handle_media path /wp-json/momentry/v1/media
handle @handle_media {
rewrite * /api/v1/media-proxy
reverse_proxy localhost:3002 {
header_up X-API-Key muser_68600856036340bcafc01930eb4bd839_1774418104_97221b69
}
}
reverse_proxy localhost:9002
import common_log m5wp_access
}
# M5 Momentry Core API
m5api.momentry.ddns.net {
tls internal
reverse_proxy localhost:3002
import common_log m5api_access
}
# Momentry Studio (Vue3 Frontend)
studio.momentry.ddns.net {
reverse_proxy localhost:5173
import common_log studio_access
}
# M4ProMini - Nextorage Services
nextorage.momentry.ddns.net {
reverse_proxy localhost:5173 {
header_up Host {upstream_hostport}
}
encode gzip
import common_log nextorage_access
}
+3
View File
@@ -0,0 +1,3 @@
# 環境變數管理
每台機器的環境變數存放在此目錄
+16
View File
@@ -0,0 +1,16 @@
# m4mini (192.168.110.210)
- CPU: Apple M4
- RAM: 64GB
- Role: Reverse proxy (Caddy) + Gitea + Infrastructure
## Services
- Caddy (:80/:443) - Reverse proxy for all DDNS
- Gitea (:3000) - Git server
- PostgreSQL (:5432)
- Redis (:6379)
- Qdrant (:6333)
- LLM (:8080)
- OpenWebUI (:8085)
- Grafana (:3001)
- Netdata (:19999)
- n8n (:5678)
+14
View File
@@ -0,0 +1,14 @@
# m5max128 / nextorage (192.168.110.200 / 10.10.10.88)
- CPU: Apple M4 Pro
- RAM: 64GB
- Role: Main runtime machine
## Services
- Momentry API (:3002)
- Momentry Worker
- Proxy/SPA Server (:8888)
- MarkBase (:11438)
- SFTPGo (:8081/:2022)
- Gitea (:3000) - Local mirror
- LLM (:8080/:8082)
- Embedding (:11436)
+9
View File
@@ -0,0 +1,9 @@
# m5max48 (192.168.110.201)
- Role: Secondary runtime machine
## Services
- Momentry API (:3002)
- Gitea (:3000)
- SFTPGo (:8081)
- WordPress (:80)
- CoreDoc (:8000)