8000 fix(filebrowser): configure before running by evilhamsterman · Pull Request #400 · coder/modules · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

fix(filebrowser): configure before running #400

Merged
merged 8 commits into from
Mar 21, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix filebrowser config
  • Loading branch information
evilhamsterman committed Feb 8, 2025
commit 2c304978d11884fdf0a264c0c738173e9a407f54
16 changes: 13 additions & 3 deletions filebrowser/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fi

printf "🥳 Installation complete! \n\n"

printf "👷 Starting filebrowser in background... \n\n"
printf "🛠️ Configuring filebrowser \n\n"

ROOT_DIR=${FOLDER}
ROOT_DIR=$${ROOT_DIR/\~/$HOME}
Expand All @@ -21,10 +21,20 @@ if [ "${DB_PATH}" != "filebrowser.db" ]; then
DB_FLAG=" -d ${DB_PATH}"
fi

# Check if filebrowser db exists
if [ ! -f ${DB_PATH} ]; then
filebrowser $DB_FLAG config init > ${LOG_PATH} 2>&1
filebrowser $DB_FLAG config set --baseurl ${SERVER_BASE_PATH} --port ${PORT} --auth.method=noauth --root $ROOT_DIR > ${LOG_PATH} 2>&1
filebrowser $DB_FLAG users add admin "" --perm.admin=true > ${LOG_PATH} 2>&1
fi

printf "👷 Starting filebrowser in background... \n\n"


printf "📂 Serving $${ROOT_DIR} at http://localhost:${PORT} \n\n"

printf "Running 'filebrowser --noauth --root $ROOT_DIR --port ${PORT}$${DB_FLAG} --baseurl ${SERVER_BASE_PATH}' \n\n"
printf "Running 'filebrowser $DB_FLAG' \n\n"

filebrowser --noauth --root $ROOT_DIR --port ${PORT}$${DB_FLAG} --baseurl ${SERVER_BASE_PATH} > ${LOG_PATH} 2>&1 &
filebrowser $DB_FLAG > ${LOG_PATH} 2>&1 &

printf "📝 Logs at ${LOG_PATH} \n\n"
0