Unverified Commit 0fc1dab2 authored by wndnjs0's avatar wndnjs0 Committed by GitHub

fix: add unix socket file permission setting (755 -> 660) (#5849)

parent 88cb58ab
...@@ -6,6 +6,7 @@ import ( ...@@ -6,6 +6,7 @@ import (
"log/slog" "log/slog"
"net" "net"
"net/http" "net/http"
"os"
"sync" "sync"
"time" "time"
...@@ -108,6 +109,13 @@ func (s *Server) Start(ctx context.Context) error { ...@@ -108,6 +109,13 @@ func (s *Server) Start(ctx context.Context) error {
return errors.Wrap(err, "failed to listen") return errors.Wrap(err, "failed to listen")
} }
if network == "unix" {
if err := os.Chmod(address, 0660); err != nil {
_ = listener.Close()
return errors.Wrap(err, "failed to chmod socket")
}
}
// Start Echo server directly (no cmux needed - all traffic is HTTP). // Start Echo server directly (no cmux needed - all traffic is HTTP).
s.httpServer = &http.Server{Handler: s.echoServer} s.httpServer = &http.Server{Handler: s.echoServer}
go func() { go func() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment