diff options
| author | Rose Hogenson <rosehogenson@posteo.net> | 2025-11-10 18:30:52 -0800 |
|---|---|---|
| committer | Rose Hogenson <rosehogenson@posteo.net> | 2025-11-10 18:30:52 -0800 |
| commit | 7fa280987ea3bea7329a598766c118bf09ff7d71 (patch) | |
| tree | e607e750e48fda97e05e7df9281df5c8bf20d90a /roseh.moe.go | |
| parent | f6a33d126e101ac5d691ac747634825cd8c5aa6f (diff) | |
| download | roseh.moe-7fa280987ea3bea7329a598766c118bf09ff7d71.tar.zst | |
Get the credentials directory from a flag
Diffstat (limited to 'roseh.moe.go')
| -rw-r--r-- | roseh.moe.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/roseh.moe.go b/roseh.moe.go index 97487de..bf00e81 100644 --- a/roseh.moe.go +++ b/roseh.moe.go @@ -34,7 +34,7 @@ var ( selfURL = flag.String("self-url", "http://localhost:42069", "base URL of the server") secretsFile = flag.String("secrets", "secrets.ccl", "secrets file") configFile = flag.String("config", "config.ccl", "configuration file (ccl format https://pkg.go.dev/roseh.moe/pkg/ccl)") - https = flag.Bool("https", false, "use https") + https = flag.String("https", "", "directory containing cert.pem and key.pem, or empty string to use unencrypted http") serverStartTime = time.Now() ) @@ -582,8 +582,8 @@ func main() { addr := fmt.Sprintf(":%d", *port) log.Printf("Listening on %q", addr) - if *https { - log.Fatal(http.ListenAndServeTLS(addr, "/var/lib/acme/roseh.moe/cert.pem", "/var/lib/acme/roseh.moe/key.pem", nil)) + if *https != "" { + log.Fatal(http.ListenAndServeTLS(addr, *https+"/cert.pem", *https+"/key.pem", nil)) } else { log.Fatal(http.ListenAndServe(addr, nil)) } |
