Propagate env var and trim trailing slash

This commit is contained in:
Jaz Volpert
2024-10-04 13:43:15 -07:00
parent b0fe2c6c9a
commit eb5a6c8911
2 changed files with 8 additions and 0 deletions
+7
View File
@@ -87,6 +87,13 @@ func run(args []string) {
Value: cli.NewStringSlice("https://bsky.app", "https://main.bsky.dev", "https://app.staging.bsky.dev"),
EnvVars: []string{"CORS_ALLOWED_ORIGINS"},
},
&cli.StringFlag{
Name: "static-cdn-host",
Usage: "scheme, hostname, and port of static content CDN, don't end with a slash",
Required: false,
Value: "",
EnvVars: []string{"STATIC_CDN_HOST"},
},
},
},
}
+1
View File
@@ -60,6 +60,7 @@ func serve(cctx *cli.Context) error {
basicAuthPassword := cctx.String("basic-auth-password")
corsOrigins := cctx.StringSlice("cors-allowed-origins")
staticCDNHost := cctx.String("static-cdn-host")
staticCDNHost = strings.TrimSuffix(staticCDNHost, "/")
// Echo
e := echo.New()