8000 feat(filebrowser): support subdomain = false by Seppdo · Pull Request #286 · 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.

feat(filebrowser): support subdomain = false #286

Merged
merged 21 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
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
Prev Previous commit
Next Next commit
move all subpath build logic to terraform
  • Loading branch information
Seppdo authored Aug 30, 2024
commit 1f2c0b616e65d6fa0a7bd8e703db45c63ea53825
3 changes: 1 addition & 2 deletions filebrowser/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ resource "coder_script" "filebrowser" {
LOG_PATH : var.log_path,
DB_PATH : var.database_path,
SUBDOMAIN : var.subdomain,
SERVER_BASE_PATH : format("/@%s/%s.%s/apps/filebrowser",
data.coder_workspace_owner.me.name, data.coder_workspace.me.name, var.agent_name),
SERVER_BASE_PATH : var.subdomain ? "" : format("/@% 8000 s/%s.%s/apps/filebrowser", data.coder_workspace_owner.me.name, data.coder_workspace.me.name, var.agent_name),
})
run_on_start = true
}
Expand Down
8 changes: 2 additions & 6 deletions filebrowser/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,8 @@ if [ "${DB_PATH}" != "filebrowser.db" ]; then
DB_FLAG=" -d ${DB_PATH}"
fi

# set baseurl if subdomain = false
if [ "${SUBDOMAIN}" == "false" ]; then
filebrowser config set --baseurl "${SERVER_BASE_PATH}" > ${LOG_PATH} 2>&1
else
filebrowser config set --baseurl "" > ${LOG_PATH} 2>&1
fi
# set baseurl to be able to run if sudomain=false; if subdomain=true the SERVER_BASE_PATH value will be ""
filebrowser config set --baseurl "${SERVER_BASE_PATH}" > ${LOG_PATH} 2>&1

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

Expand Down
Loading
0