add filebrowser db path var

This commit is contained in:
Stephen Kirby
2023-10-05 20:27:54 +00:00
parent 9f110e6e63
commit b39fe7c4e8
2 changed files with 9 additions and 2 deletions

View File

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

View File

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