diff --git a/bors.toml b/bors.toml new file mode 100644 index 0000000..1259845 --- /dev/null +++ b/bors.toml @@ -0,0 +1,7 @@ +cut_body_after = "" # don't include text from the PR body in the merge commit message +status = [ + "Evaluate flake.nix", + "package %", + "check %", + "devShell %", +] diff --git a/main.go b/main.go index 00ee474..7fc7a2e 100644 --- a/main.go +++ b/main.go @@ -117,7 +117,7 @@ func (s *server) serveConnection(conn *net.UnixConn) { } val, ok := secretMap[*secret] if ok { - if _, err = io.WriteString(conn, val); err != nil { + if _, err = io.WriteString(conn, fmt.Sprint(val)); err != nil { log.Printf("Failed to send secret: %v", err) } } else { diff --git a/secrets.go b/secrets.go index 3cd3f80..e758375 100644 --- a/secrets.go +++ b/secrets.go @@ -6,12 +6,12 @@ import ( "os" ) -func parseServiceSecrets(path string) (map[string]string, error) { +func parseServiceSecrets(path string) (map[string]interface{}, error) { content, err := os.ReadFile(path) if err != nil { return nil, fmt.Errorf("Cannot read json file '%s': %w", path, err) } - var data map[string]string + var data map[string]interface{} err = json.Unmarshal(content, &data) if err != nil { return nil, fmt.Errorf("Cannot parse '%s' as json file: %w", path, err) diff --git a/watcher.go b/watcher.go index e2b73cc..a222a4e 100644 --- a/watcher.go +++ b/watcher.go @@ -134,7 +134,7 @@ func (s *server) watch(inotifyFd int) { log.Printf("Secret map % has no value for key %s", fname, conn.key) continue } - _, err = io.WriteString(conn.connection, val) + _, err = io.WriteString(conn.connection, fmt.Sprint(val)) if err == nil { log.Printf("Served %s to %s", fname, conn.connection.RemoteAddr().String()) } else {