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
pull/393/head
dstoffel 5 months ago committed by GitHub
parent e64f1ede52
commit 4ab509b8ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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"

Loading…
Cancel
Save