From 4fb1be665729cfee524a5786a4af783adbc4d741 Mon Sep 17 00:00:00 2001 From: Bernhard B Date: Sat, 7 Mar 2026 21:17:45 +0100 Subject: [PATCH] removed fifo pathname from json-rpc config * not needed anymore --- src/scripts/jsonrpc2-helper.go | 20 ++------------------ src/utils/config.go | 14 +++----------- 2 files changed, 5 insertions(+), 29 deletions(-) diff --git a/src/scripts/jsonrpc2-helper.go b/src/scripts/jsonrpc2-helper.go index 829f089..16309c7 100644 --- a/src/scripts/jsonrpc2-helper.go +++ b/src/scripts/jsonrpc2-helper.go @@ -3,7 +3,6 @@ package main import ( "fmt" "io/ioutil" - "os" "os/exec" "strings" @@ -41,23 +40,8 @@ func main() { jsonRpc2ClientConfig := utils.NewJsonRpc2ClientConfig() var tcpPort int64 = 6001 - fifoPathname := "/tmp/sigsocket1" - jsonRpc2ClientConfig.AddEntry(utils.MULTI_ACCOUNT_NUMBER, utils.JsonRpc2ClientConfigEntry{TcpPort: tcpPort, FifoPathname: fifoPathname}) - - os.Remove(fifoPathname) //remove any existing named pipe - - _, err := exec.Command("mkfifo", fifoPathname).Output() - if err != nil { - log.Fatal("Couldn't create fifo with name ", fifoPathname, ": ", err.Error()) - } - - uid := utils.GetEnv("SIGNAL_CLI_UID", "1000") - gid := utils.GetEnv("SIGNAL_CLI_GID", "1000") - _, err = exec.Command("chown", uid+":"+gid, fifoPathname).Output() - if err != nil { - log.Fatal("Couldn't change permissions of fifo with name ", fifoPathname, ": ", err.Error()) - } + jsonRpc2ClientConfig.AddEntry(utils.MULTI_ACCOUNT_NUMBER, utils.JsonRpc2ClientConfigEntry{TcpPort: tcpPort}) signalCliIgnoreAttachments := "" ignoreAttachments := utils.GetEnv("JSON_RPC_IGNORE_ATTACHMENTS", "") @@ -73,7 +57,7 @@ func main() { supervisorctlProgramName := "signal-cli-json-rpc-1" supervisorctlLogFolder := "/var/log/" + supervisorctlProgramName - _, err = exec.Command("mkdir", "-p", supervisorctlLogFolder).Output() + _, err := exec.Command("mkdir", "-p", supervisorctlLogFolder).Output() if err != nil { log.Fatal("Couldn't create log folder ", supervisorctlLogFolder, ": ", err.Error()) } diff --git a/src/utils/config.go b/src/utils/config.go index feb525b..9163b2c 100644 --- a/src/utils/config.go +++ b/src/utils/config.go @@ -2,15 +2,15 @@ package utils import ( "errors" - "gopkg.in/yaml.v2" "io/ioutil" + + "gopkg.in/yaml.v2" ) const MULTI_ACCOUNT_NUMBER string = "" type JsonRpc2ClientConfigEntry struct { - TcpPort int64 `yaml:"tcp_port"` - FifoPathname string `yaml:"fifo_pathname"` + TcpPort int64 `yaml:"tcp_port"` } type JsonRpc2ClientConfigEntries struct { @@ -47,14 +47,6 @@ func (c *JsonRpc2ClientConfig) GetTcpPortForNumber(number string) (int64, error) return 0, errors.New("Number " + number + " not found in local map") } -func (c *JsonRpc2ClientConfig) GetFifoPathnameForNumber(number string) (string, error) { - if val, ok := c.config.Entries[number]; ok { - return val.FifoPathname, nil - } - - return "", errors.New("Number " + number + " not found in local map") -} - func (c *JsonRpc2ClientConfig) GetTcpPortsForNumbers() map[string]int64 { mapping := make(map[string]int64) for number, val := range c.config.Entries {