-
Notifications
You must be signed in to change notification settings - Fork 60
fix(filebrowser): configure before running #400
Changes from 1 commit
2c30497
462a79f
fb156fa
36dc852
4d7af0c
9acc25c
36450ff
bf86489
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,18 +23,18 @@ fi | |
|
||
# Check if filebrowser db exists | ||
if [ ! -f ${DB_PATH} ]; then | ||
filebrowser $DB_FLAG config init >> ${LOG_PATH} 2>&1 | ||
filebrowser $DB_FLAG users add admin "" --perm.admin=true --viewMode=mosaic >> ${LOG_PATH} 2>&1 | ||
filebrowser $DB_FLAG config init 2>&1 | tee -a ${LOG_PATH} | ||
filebrowser $DB_FLAG users add admin "" --perm.admin=true --viewMode=mosaic 2>&1 | tee -a ${LOG_PATH} | ||
fi | ||
|
||
filebrowser $DB_FLAG config set --baseurl=${SERVER_BASE_PATH} --port=${PORT} --auth.method=noauth --root=$ROOT_DIR >> ${LOG_PATH} 2>&1 | ||
filebrowser $DB_FLAG config set --baseurl=${SERVER_BASE_PATH} --port=${PORT} --auth.method=noauth --root=$ROOT_DIR 2>&1 | tee -a ${LOG_PATH} | ||
|
||
printf "👷 Starting filebrowser in background... \n\n" | ||
|
||
|
||
printf "📂 Serving $${ROOT_DIR} at http://localhost:${PORT} \n\n" | ||
|
||
printf "Running 'filebrowser $DB_FLAG' \n\n" | ||
printf "Running 'filebrowser %s' \n\n" "$DB_FLAG" | ||
|
||
filebrowser $DB_FLAG >> ${LOG_PATH} 2>&1 & | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I want to make it clear that this issue was not introduced by this PR. But I'll just mention this again; this will break if args=()
if [ "${DB_PATH}" != "filebrowser.db" ]; then
args+=(-d "${DB_PATH}")
fi Then use this as: filebrowser "${args[@]}" (I did not verify if This syntax works even in bash-3.2, so should be fine to use. (I opted for arrays as I see we already have a heavy dependency on Bash here.) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TBH There's a lot of places that it could break because of spaces in the path, the LOG_PATH and SERVER_BASE_PATH could also cause problems. I do think I found a bit easier and more readable way to handle it. Filebrowser supports the FB_DATABASE environment variable. So I just set that at the top inside quotes and then it doesn't matter, it works with or without spaces. |
||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.