From 4ab509b8caa860a75cc35af333a34df3523ba7d2 Mon Sep 17 00:00:00 2001 From: dstoffel Date: Wed, 29 Jan 2025 11:09:28 +0100 Subject: [PATCH 1/5] bugfix: failed to set server_base_path if db is not existing On the first start, the DB do not exist and the "filebrowser config set --baseurl" will failed. filebrowser was starting with the wrong baseurl (subdomain=false). it starts correctly on the second try if the db was persisted. this fix set the correct baseurl even if the db was not existing --- filebrowser/run.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/filebrowser/run.sh b/filebrowser/run.sh index 6931f05e..57d09b76 100644 --- a/filebrowser/run.sh +++ b/filebrowser/run.sh @@ -21,13 +21,11 @@ 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} -b ${SERVER_BASE_PATH}' \n\n" + +filebrowser --noauth --root $ROOT_DIR --port ${PORT}$${DB_FLAG} -b ${SERVER_BASE_PATH} > ${LOG_PATH} 2>&1 & -filebrowser --noauth --root $ROOT_DIR --port ${PORT}$${DB_FLAG} > ${LOG_PATH} 2>&1 & printf "📝 Logs at ${LOG_PATH} \n\n" From 83f0e569b5a4d6d3153fcb53543d8f8f48fda074 Mon Sep 17 00:00:00 2001 From: dstoffel Date: Wed, 5 Feb 2025 09:47:45 +0100 Subject: [PATCH 2/5] Update filebrowser/run.sh Co-authored-by: M Atif Ali --- filebrowser/run.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/filebrowser/run.sh b/filebrowser/run.sh index 57d09b76..d8c71874 100644 --- a/filebrowser/run.sh +++ b/filebrowser/run.sh @@ -23,9 +23,9 @@ fi printf "📂 Serving $${ROOT_DIR} at http://localhost:${PORT} \n\n" -printf "Running 'filebrowser --noauth --root $ROOT_DIR --port ${PORT}$${DB_FLAG} -b ${SERVER_BASE_PATH}' \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} -b ${SERVER_BASE_PATH} > ${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" From 1067c2e0fdd6aa424a22f974d165ac6a1488f8a2 Mon Sep 17 00:00:00 2001 From: dstoffel Date: Wed, 5 Feb 2025 15:50:38 +0100 Subject: [PATCH 3/5] Update main.test.ts --- filebrowser/main.test.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/filebrowser/main.test.ts b/filebrowser/main.test.ts index 7dd49724..368075b2 100644 --- a/filebrowser/main.test.ts +++ b/filebrowser/main.test.ts @@ -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", ]); @@ -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", ]); @@ -75,7 +75,7 @@ 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! ", "", @@ -83,7 +83,7 @@ describe("filebrowser", async () => { "", "📂 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", ]); @@ -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", ]); From 5c91af500267917bfc40829976f8c1a1645dd9bf Mon Sep 17 00:00:00 2001 From: dstoffel Date: Wed, 5 Feb 2025 22:13:41 +0100 Subject: [PATCH 4/5] removed empty line to pass bun fmt --- filebrowser/run.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/filebrowser/run.sh b/filebrowser/run.sh index d8c71874..d6afea02 100644 --- a/filebrowser/run.sh +++ b/filebrowser/run.sh @@ -27,5 +27,4 @@ printf "Running 'filebrowser --noauth --root $ROOT_DIR --port ${PORT}$${DB_FLAG} filebrowser --noauth --root $ROOT_DIR --port ${PORT}$${DB_FLAG} --baseurl ${SERVER_BASE_PATH} > ${LOG_PATH} 2>&1 & - printf "📝 Logs at ${LOG_PATH} \n\n" From 8c842b9bef91b97fb394fb333b5d7b46bdd895c5 Mon Sep 17 00:00:00 2001 From: dstoffel Date: Thu, 6 Feb 2025 11:52:09 +0100 Subject: [PATCH 5/5] Update README.md - update-version.sh --- filebrowser/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/filebrowser/README.md b/filebrowser/README.md index b111127e..13e06577 100644 --- a/filebrowser/README.md +++ b/filebrowser/README.md @@ -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 } ``` @@ -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" } @@ -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" } @@ -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