From 7517538d2fccd75dbfb4f8b5ac9194bf0bbbda76 Mon Sep 17 00:00:00 2001 From: tjpcc Date: Fri, 8 Sep 2023 14:54:50 -0600 Subject: fixes & improvements - refactored main.go to do everything which requires root *first*, before dropping privs. this includes binding to finger and gopher ports. - added gopher support! - fixed CGI handling - new cgi-bin/private directory handling in gemini which requires specific TLS client certs (can't do this in gopher, no TLS) - sliderule version bump brings in lots of fixes on the sliderule side --- config.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'config.go') diff --git a/config.go b/config.go index 6af9808..a758903 100644 --- a/config.go +++ b/config.go @@ -16,17 +16,18 @@ type config struct { hostname string geminiRoot string + gopherRoot string tlsKeyFile string tlsCertFile string - uploaderFingerprints []string + privilegedUsers []string fingerResponses map[string]string } func configure() config { - fingerprints := strings.Split(os.Getenv("UPLOADER_FINGERPRINTS"), ",") + privileged := strings.Split(os.Getenv("PRIVILEGED_FINGERPRINTS"), ",") fingers := map[string]string{} for _, pair := range os.Environ() { @@ -40,10 +41,11 @@ func configure() config { return config{ hostname: os.Getenv("HOST_NAME"), geminiRoot: os.Getenv("GEMINI_ROOT"), + gopherRoot: os.Getenv("GOPHER_ROOT"), tlsKeyFile: os.Getenv("TLS_KEY_FILE"), tlsCertFile: os.Getenv("TLS_CERT_FILE"), - uploaderFingerprints: fingerprints, + privilegedUsers: privileged, fingerResponses: fingers, } -- cgit v1.2.3