bug(filebrowser): Base URL Configuration Issue in FileBrowser Module
Base URL Configuration Issue in FileBrowser Module
Problem Description
There's an issue in the FileBrowser module version 1.0.19, specifically in the filebrowser/run.sh#L21 script. The script attempts to customize the server Base URL before starting the server in the background. However, this customization only works when the database is located at the default path, ~/filebrowser.db.
If the database location has been modified (e.g.: database_path = "/home/coder/.filebrowser/filebrowser.db"), the script tries to update the default database location, resulting in no changes. Consequently, the Base URL remains empty.
Current Behavior
# Current implementation
filebrowser config set --baseurl "${SERVER_BASE_PATH}" > ${LOG_PATH} 2>&1
This line only works correctly with the default database location.
Proposed Solution
To address this issue, we can leverage the existing mechanism used for starting the server. Here's the proposed change:
# 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}" > ${LOG_PATH} 2>&1
+filebrowser config set --baseurl "${SERVER_BASE_PATH}"$${DB_FLAG} > ${LOG_PATH} 2>&1
This modification could ensures that the Base URL is correctly set regardless of the database location (to be tested).