Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(filebrowser): failed to set server_base_path if db is not existing #393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 4 additions & 4 deletions filebrowser/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ A file browser for your workspace.
module "filebrowser" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/filebrowser/coder"
version = "1.0.23"
version = "1.0.29"
agent_id = coder_agent.example.id
}
```
Expand All @@ -30,7 +30,7 @@ module "filebrowser" {
module "filebrowser" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/filebrowser/coder"
version = "1.0.23"
version = "1.0.29"
agent_id = coder_agent.example.id
folder = "/home/coder/project"
}
Expand All @@ -42,7 +42,7 @@ module "filebrowser" {
module "filebrowser" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/filebrowser/coder"
version = "1.0.23"
version = "1.0.29"
agent_id = coder_agent.example.id
database_path = ".config/filebrowser.db"
}
Expand All @@ -54,7 +54,7 @@ module "filebrowser" {
module "filebrowser" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/filebrowser/coder"
version = "1.0.23"
version = "1.0.29"
agent_id = coder_agent.example.id
agent_name = "main"
subdomain = false
Expand Down
10 changes: 5 additions & 5 deletions filebrowser/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe("filebrowser", async () => {
"",
"πŸ“‚ Serving /root at http://localhost:13339 ",
"",
"Running 'filebrowser --noauth --root /root --port 13339' ",
"Running 'filebrowser --noauth --root /root --port 13339 --baseurl ' ",
"",
"πŸ“ Logs at /tmp/filebrowser.log",
]);
Expand All @@ -61,7 +61,7 @@ describe("filebrowser", async () => {
"",
"πŸ“‚ Serving /root at http://localhost:13339 ",
"",
"Running 'filebrowser --noauth --root /root --port 13339 -d .config/filebrowser.db' ",
"Running 'filebrowser --noauth --root /root --port 13339 -d .config/filebrowser.db --baseurl ' ",
"",
"πŸ“ Logs at /tmp/filebrowser.log",
]);
Expand All @@ -75,15 +75,15 @@ describe("filebrowser", async () => {
const output = await executeScriptInContainer(state, "alpine");
expect(output.exitCode).toBe(0);
expect(output.stdout).toEqual([
"\u001B[0;1mInstalling filebrowser ",
"\u001b[0;1mInstalling filebrowser ",
"",
"πŸ₯³ Installation complete! ",
"",
"πŸ‘· Starting filebrowser in background... ",
"",
"πŸ“‚ Serving /home/coder/project at http://localhost:13339 ",
"",
"Running 'filebrowser --noauth --root /home/coder/project --port 13339' ",
"Running 'filebrowser --noauth --root /home/coder/project --port 13339 --baseurl ' ",
"",
"πŸ“ Logs at /tmp/filebrowser.log",
]);
Expand All @@ -106,7 +106,7 @@ describe("filebrowser", async () => {
"",
"πŸ“‚ Serving /root at http://localhost:13339 ",
"",
"Running 'filebrowser --noauth --root /root --port 13339' ",
"Running 'filebrowser --noauth --root /root --port 13339 --baseurl /@default/default.main/apps/filebrowser' ",
"",
"πŸ“ Logs at /tmp/filebrowser.log",
]);
Expand Down
7 changes: 2 additions & 5 deletions filebrowser/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,10 @@ if [ "${DB_PATH}" != "filebrowser.db" ]; then
DB_FLAG=" -d ${DB_PATH}"
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}"$${DB_FLAG} > ${LOG_PATH} 2>&1

printf "πŸ“‚ Serving $${ROOT_DIR} at http://localhost:${PORT} \n\n"

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

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

printf "πŸ“ Logs at ${LOG_PATH} \n\n"