feat: 🏡 make apps

This commit is contained in:
zhaoyupeng
2025-11-26 16:17:38 +08:00
parent 1d3c159c00
commit 4ec58ce4e5
32 changed files with 1856 additions and 107 deletions

View File

@@ -10,21 +10,23 @@ import (
"yizhisec.com/hsv2/forge/pkg/downloader"
)
// make proxy for 8443, 443
// by caddy, managed by systemd
// steps:
// 1. download caddy release binary: url(https://artifactory.yizhisec.com:443/artifactory/filestore/hsv2/bin/caddy)
// 2. generate caddyfile
// 3. generate systemd service file
func (m *maker) Proxy(ctx context.Context) error {
const (
binURL = "https://artifactory.yizhisec.com:443/artifactory/filestore/hsv2/bin/caddy"
caddyfileTpl = `:8443 {
reverse_proxy __UPSTREAM_8443__
}
caddyfileTpl = `{
layer4 {
:8443 {
route {
proxy __UPSTREAMS_8443__
}
}
:443 {
reverse_proxy __UPSTREAM_443__
:443 {
route {
proxy __UPSTREAMS_443__
}
}
}
}`
systemdSvc = `[Unit]
Description=YiZhiSec Caddy Reverse Proxy
@@ -38,7 +40,7 @@ StandardOutput=journal
StandardError=journal
Nice=-20
Restart=always
RestartSec=15
RestartSec=5
[Install]
WantedBy=multi-user.target`