Add HOST config for docker and debian

This commit is contained in:
advplyr 2022-03-17 08:18:39 -05:00
parent d561a48229
commit e36c31c5e7
3 changed files with 9 additions and 4 deletions

View File

@ -6,6 +6,7 @@ FFMPEG_INSTALL_DIR="/usr/lib/audiobookshelf-ffmpeg/"
DEFAULT_AUDIOBOOK_PATH="/usr/share/audiobookshelf/audiobooks"
DEFAULT_DATA_PATH="/usr/share/audiobookshelf"
DEFAULT_PORT=7331
DEFAULT_HOST="0.0.0.0"
CONFIG_PATH="/etc/default/audiobookshelf"
@ -82,7 +83,8 @@ setup_config_interactive() {
CONFIG_PATH=$DATA_PATH/config
FFMPEG_PATH=/usr/lib/audiobookshelf-ffmpeg/ffmpeg
FFPROBE_PATH=/usr/lib/audiobookshelf-ffmpeg/ffprobe
PORT=$PORT"
PORT=$PORT
HOST=$DEFAULT_HOST"
echo "$config_text"
@ -105,7 +107,8 @@ setup_config() {
CONFIG_PATH=$DEFAULT_DATA_PATH/config
FFMPEG_PATH=/usr/lib/audiobookshelf-ffmpeg/ffmpeg
FFPROBE_PATH=/usr/lib/audiobookshelf-ffmpeg/ffprobe
PORT=$DEFAULT_PORT"
PORT=$DEFAULT_PORT
HOST=$DEFAULT_HOST"
echo "$config_text"

View File

@ -16,6 +16,7 @@ if (isDev) {
}
const PORT = process.env.PORT || 80
const HOST = process.env.HOST || '0.0.0.0'
const CONFIG_PATH = process.env.CONFIG_PATH || '/config'
const AUDIOBOOK_PATH = process.env.AUDIOBOOK_PATH || '/audiobooks'
const METADATA_PATH = process.env.METADATA_PATH || '/metadata'
@ -24,5 +25,5 @@ const GID = process.env.AUDIOBOOKSHELF_GID || 100
console.log('Config', CONFIG_PATH, METADATA_PATH, AUDIOBOOK_PATH)
const Server = new server(PORT, UID, GID, CONFIG_PATH, METADATA_PATH, AUDIOBOOK_PATH)
const Server = new server(PORT, HOST, UID, GID, CONFIG_PATH, METADATA_PATH, AUDIOBOOK_PATH)
Server.start()

View File

@ -2,7 +2,8 @@ const optionDefinitions = [
{ name: 'config', alias: 'c', type: String },
{ name: 'audiobooks', alias: 'a', type: String },
{ name: 'metadata', alias: 'm', type: String },
{ name: 'port', alias: 'p', type: String }
{ name: 'port', alias: 'p', type: String },
{ name: 'host', alias: 'h', type: String }
]
const commandLineArgs = require('command-line-args')