move all subpath build logic to terraform

pull/286/head
Seppdo 11 months ago committed by GitHub
parent edb7182f1d
commit 1f2c0b616e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -83,8 +83,7 @@ resource "coder_script" "filebrowser" {
LOG_PATH : var.log_path, LOG_PATH : var.log_path,
DB_PATH : var.database_path, DB_PATH : var.database_path,
SUBDOMAIN : var.subdomain, SUBDOMAIN : var.subdomain,
SERVER_BASE_PATH : format("/@%s/%s.%s/apps/filebrowser", SERVER_BASE_PATH : var.subdomain ? "" : format("/@%s/%s.%s/apps/filebrowser", data.coder_workspace_owner.me.name, data.coder_workspace.me.name, var.agent_name),
data.coder_workspace_owner.me.name, data.coder_workspace.me.name, var.agent_name),
}) })
run_on_start = true run_on_start = true
} }

@ -17,12 +17,8 @@ if [ "${DB_PATH}" != "filebrowser.db" ]; then
DB_FLAG=" -d ${DB_PATH}" DB_FLAG=" -d ${DB_PATH}"
fi fi
# set baseurl if subdomain = false # set baseurl to be able to run if sudomain=false; if subdomain=true the SERVER_BASE_PATH value will be ""
if [ "${SUBDOMAIN}" == "false" ]; then filebrowser config set --baseurl "${SERVER_BASE_PATH}" > ${LOG_PATH} 2>&1
filebrowser config set --baseurl "${SERVER_BASE_PATH}" > ${LOG_PATH} 2>&1
else
filebrowser config set --baseurl "" > ${LOG_PATH} 2>&1
fi
printf "📂 Serving $${ROOT_DIR} at http://localhost:${PORT} \n\n" printf "📂 Serving $${ROOT_DIR} at http://localhost:${PORT} \n\n"

Loading…
Cancel
Save