feat: 🏡 make apps
This commit is contained in:
@@ -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`
|
||||
|
||||
Reference in New Issue
Block a user