From 4ab509b8caa860a75cc35af333a34df3523ba7d2 Mon Sep 17 00:00:00 2001 From: dstoffel Date: Wed, 29 Jan 2025 11:09:28 +0100 Subject: [PATCH] bugfix: failed to set server_base_path if db is not existing On the first start, the DB do not exist and the "filebrowser config set --baseurl" will failed. filebrowser was starting with the wrong baseurl (subdomain=false). it starts correctly on the second try if the db was persisted. this fix set the correct baseurl even if the db was not existing --- filebrowser/run.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/filebrowser/run.sh b/filebrowser/run.sh index 6931f05..57d09b7 100644 --- a/filebrowser/run.sh +++ b/filebrowser/run.sh @@ -21,13 +21,11 @@ if [ "${DB_PATH}" != "filebrowser.db" ]; then DB_FLAG=" -d ${DB_PATH}" fi -# set baseurl to be able to run if sudomain=false; if subdomain=true the SERVER_BASE_PATH value will be "" -filebrowser config set --baseurl "${SERVER_BASE_PATH}"$${DB_FLAG} > ${LOG_PATH} 2>&1 - printf "📂 Serving $${ROOT_DIR} at http://localhost:${PORT} \n\n" -printf "Running 'filebrowser --noauth --root $ROOT_DIR --port ${PORT}$${DB_FLAG}' \n\n" +printf "Running 'filebrowser --noauth --root $ROOT_DIR --port ${PORT}$${DB_FLAG} -b ${SERVER_BASE_PATH}' \n\n" + +filebrowser --noauth --root $ROOT_DIR --port ${PORT}$${DB_FLAG} -b ${SERVER_BASE_PATH} > ${LOG_PATH} 2>&1 & -filebrowser --noauth --root $ROOT_DIR --port ${PORT}$${DB_FLAG} > ${LOG_PATH} 2>&1 & printf "📝 Logs at ${LOG_PATH} \n\n"