Compare commits

..

2 Commits

Author SHA1 Message Date
Rohit Vighne
20d86e9ea6
Merge 76e5e54a674a2e8b4403589229950f0c52319576 into a51da7b8ecec94024cf0e87cc7f36f6ec6d5032f 2025-03-26 16:57:03 +00:00
Rohit Vighne
76e5e54a67 Listen on AF_UNIX socket if -addr is a path 2025-03-26 12:54:12 -04:00
3 changed files with 11 additions and 14 deletions

View File

@ -90,8 +90,8 @@ func main() {
log.SetOutput(os.Stdout)
}
if open && strings.HasPrefix(addr, "unix:") {
log.Fatal("Cannot open ", addr, " in browser")
if open && strings.ContainsRune(addr, os.PathSeparator) {
log.Fatal("Cannot open unix socket path (", addr, ") in browser")
}
if db == "" {

View File

@ -13,9 +13,9 @@ The latest prebuilt binaries for Linux/MacOS/Windows are available
[here](https://github.com/nkanaev/yarr/releases/latest).
The archives follow the naming convention `yarr_{OS}_{ARCH}[_gui].zip`, where:
* `OS` is the target operating system
* `ARCH` is the CPU architecture (`arm64` for AArch64, `amd64` for X86-64)
* `-gui` indicates that the binary ships with the GUI (tray icon), and is a command line application if omitted
* `OS` corresponds to the target operating system (darwin/linux/windows for Linux, MacOS, Windows, respectively)
* `ARCH` is the CPU architecture (`arm64` for AMD64/Aarch64, `amd64` for X86-64)
* `-gui` indicates that the application ships with the GUI (tray icon), and is a command line application if omitted
Usage instructions:

View File

@ -56,19 +56,16 @@ func (s *Server) Start() {
s.worker.RefreshFeeds()
}
var ln net.Listener
var err error
if path, isUnix := strings.CutPrefix(s.Addr, "unix:"); isUnix {
err = os.Remove(path)
network := "tcp"
if strings.ContainsRune(s.Addr, os.PathSeparator) {
network = "unix"
err := os.Remove(s.Addr)
if err != nil {
log.Print(err)
log.Fatal(err)
}
ln, err = net.Listen("unix", path)
} else {
ln, err = net.Listen("tcp", s.Addr)
}
ln, err := net.Listen(network, s.Addr)
if err != nil {
log.Fatal(err)
}