You've already forked audiobookshelf
support unix socket
This commit is contained in:
36
0001-support-unix-socket.patch
Normal file
36
0001-support-unix-socket.patch
Normal file
@ -0,0 +1,36 @@
|
||||
From 070fc3ff00d21939ddc127273467f42ef0bb4767 Mon Sep 17 00:00:00 2001
|
||||
From: Balakrishnan Balasubramanian <git.user@balki.me>
|
||||
Date: Wed, 12 Feb 2025 11:18:31 -0500
|
||||
Subject: [PATCH] support unix socket
|
||||
|
||||
|
||||
diff --git a/server/Server.js b/server/Server.js
|
||||
index c3e73ae..115d170 100644
|
||||
--- a/server/Server.js
|
||||
+++ b/server/Server.js
|
||||
@@ -395,10 +395,18 @@ class Server {
|
||||
})
|
||||
router.get('/healthcheck', (req, res) => res.sendStatus(200))
|
||||
|
||||
- this.server.listen(this.Port, this.Host, () => {
|
||||
- if (this.Host) Logger.info(`Listening on http://${this.Host}:${this.Port}`)
|
||||
- else Logger.info(`Listening on port :${this.Port}`)
|
||||
- })
|
||||
+ if(fs.pathExistsSync("/run/audiobookshelf")) {
|
||||
+ const sockPath = "/run/audiobookshelf/web.sock"
|
||||
+ this.server.listen(sockPath, () => {
|
||||
+ fs.chmodSync(sockPath, 0o666);
|
||||
+ Logger.info(`Listening on unix socket :${sockPath}`)
|
||||
+ })
|
||||
+ } else {
|
||||
+ this.server.listen(this.Port, this.Host, () => {
|
||||
+ if (this.Host) Logger.info(`Listening on http://${this.Host}:${this.Port}`)
|
||||
+ else Logger.info(`Listening on port :${this.Port}`)
|
||||
+ })
|
||||
+ }
|
||||
|
||||
// Start listening for socket connections
|
||||
SocketAuthority.initialize(this)
|
||||
--
|
||||
2.48.1
|
||||
|
Reference in New Issue
Block a user