diff --git a/filebrowser/main.tf b/filebrowser/main.tf index e624004..0fd336d 100644 --- a/filebrowser/main.tf +++ b/filebrowser/main.tf @@ -15,6 +15,12 @@ variable "agent_id" { description = "The ID of a Coder agent." } +variable "db_path" { + type = string + description = "The path to the filebrowser database." + default = "~/filebrowser.db" +} + variable "log_path" { type = string description = "The path to log filebrowser to." @@ -42,6 +48,7 @@ resource "coder_script" "filebrowser" { PORT : var.port, FOLDER : var.folder, LOG_PATH : var.log_path, + DB_PATH : var.db_path, }) run_on_start = true } diff --git a/filebrowser/run.sh b/filebrowser/run.sh index 91bf368..e846631 100644 --- a/filebrowser/run.sh +++ b/filebrowser/run.sh @@ -14,8 +14,8 @@ ROOT_DIR=$${ROOT_DIR/\~/$HOME} printf "📂 Serving $${ROOT_DIR} at http://localhost:${PORT} \n\n" -printf "Running 'filebrowser --noauth --root $ROOT_DIR --port ${PORT}' \n\n" +printf "Running 'filebrowser --noauth --root $ROOT_DIR --port ${PORT} -d ${DB_PATH}' \n\n" -filebrowser --noauth --root $ROOT_DIR --port ${PORT} >${LOG_PATH} 2>&1 & +filebrowser --noauth --root $ROOT_DIR --port ${PORT} -d ${DB_PATH} >${LOG_PATH} 2>&1 & printf "📝 Logs at ${LOG_PATH} \n\n"