diff options
| author | tjpcc <tjp@ctrl-c.club> | 2023-09-08 14:54:59 -0600 |
|---|---|---|
| committer | tjpcc <tjp@ctrl-c.club> | 2023-09-08 14:54:59 -0600 |
| commit | 4c0e1bc89de2a60baaa098c049cf69bac8537055 (patch) | |
| tree | 69412a5d844aebd706862c9548090c1152a27a8e /config.go | |
| parent | ac353033162038a4bf6f837bdfeb869f22e7160b (diff) | |
finger support
Diffstat (limited to 'config.go')
| -rw-r--r-- | config.go | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -21,11 +21,22 @@ type config struct { tlsCertFile string uploaderFingerprints []string + + fingerResponses map[string]string } func configure() config { fingerprints := strings.Split(os.Getenv("UPLOADER_FINGERPRINTS"), ",") + fingers := map[string]string{} + for _, pair := range os.Environ() { + key, val, _ := strings.Cut(pair, "=") + if !strings.HasPrefix(key, "FINGER_") { + continue + } + fingers[strings.ToLower(key[7:])] = val + } + return config{ hostname: os.Getenv("HOST_NAME"), geminiRoot: os.Getenv("GEMINI_ROOT"), @@ -33,6 +44,8 @@ func configure() config { tlsCertFile: os.Getenv("TLS_CERT_FILE"), uploaderFingerprints: fingerprints, + + fingerResponses: fingers, } } |
