diff options
| author | Xe Iaso <me@xeiaso.net> | 2024-02-18 13:45:22 -0500 |
|---|---|---|
| committer | Xe Iaso <me@xeiaso.net> | 2024-02-18 13:45:22 -0500 |
| commit | 65b9829f9e3e3bee6aac17c4037a352d4a7901b2 (patch) | |
| tree | 4b81b5519387c804dafbe7382eb8f246124ec8df | |
| parent | 8d63fd1b351cf9ffd99555b21017cc503dd1d0fe (diff) | |
| download | xesite-65b9829f9e3e3bee6aac17c4037a352d4a7901b2.tar.xz xesite-65b9829f9e3e3bee6aac17c4037a352d4a7901b2.zip | |
cmd/xesite: move internal api to unprivileged port
Signed-off-by: Xe Iaso <me@xeiaso.net>
| -rw-r--r-- | cmd/xesite/internalapi.go | 2 | ||||
| -rw-r--r-- | cmd/xesite/main.go | 1 | ||||
| -rw-r--r-- | fly/xesite/fly.toml | 35 |
3 files changed, 20 insertions, 18 deletions
diff --git a/cmd/xesite/internalapi.go b/cmd/xesite/internalapi.go index 99516fc..c0dfa9c 100644 --- a/cmd/xesite/internalapi.go +++ b/cmd/xesite/internalapi.go @@ -36,7 +36,7 @@ func internalAPI(fs *lume.FS) { mux.Handle(adminpb.AdminPathPrefix, adminpb.NewAdminServer(&AdminAPI{fs: fs})) - ln, err := net.Listen("tcp", ":80") + ln, err := net.Listen("tcp", *internalAPIBind) if err != nil { log.Fatal(err) } diff --git a/cmd/xesite/main.go b/cmd/xesite/main.go index a70ddc7..0f8f060 100644 --- a/cmd/xesite/main.go +++ b/cmd/xesite/main.go @@ -26,6 +26,7 @@ var ( gitBranch = flag.String("git-branch", "main", "Git branch to clone") gitRepo = flag.String("git-repo", "https://github.com/Xe/site", "Git repository to clone") githubSecret = flag.String("github-secret", "", "GitHub secret to use for webhooks") + internalAPIBind = flag.String("internal-api-bind", ":3001", "Port to listen on for the internal API") miToken = flag.String("mi-token", "", "Token to use for the mi API") patreonSaasProxyURL = flag.String("patreon-saasproxy-url", "http://xesite-patreon-saasproxy.flycast", "URL to use for the patreon saasproxy") siteURL = flag.String("site-url", "https://xeiaso.net/", "URL to use for the site") diff --git a/fly/xesite/fly.toml b/fly/xesite/fly.toml index c1455f5..c016d4a 100644 --- a/fly/xesite/fly.toml +++ b/fly/xesite/fly.toml @@ -17,22 +17,23 @@ DATA_DIR = "/data" GIT_BRANCH = "main" SITE_URL = "https://xeiaso.net/" PATH = "/bin" +INTERNAL_API_BIND = ":80" [[services]] - internal_port = 3000 - processes = ["app"] - protocol = "tcp" - - [services.concurrency] - hard_limit = 300 - soft_limit = 250 - type = "connections" - - [[services.ports]] - force_https = true - handlers = ["http"] - port = 80 - - [[services.ports]] - handlers = ["tls", "http"] - port = 443 +internal_port = 3000 +processes = ["app"] +protocol = "tcp" + +[services.concurrency] +hard_limit = 300 +soft_limit = 250 +type = "connections" + +[[services.ports]] +force_https = true +handlers = ["http"] +port = 80 + +[[services.ports]] +handlers = ["tls", "http"] +port = 443 |
