From 704fece5dc0fb501386af4c0bf3871ad0cf3f7f9 Mon Sep 17 00:00:00 2001 From: DevelopmentCats Date: Wed, 2 Jul 2025 19:25:11 +0000 Subject: [PATCH 1/9] fix(filebrowser): remove duplicate await in tests and add baseline test This commit fixes a duplicate `await` in the `filebrowser` module's test file, ensuring proper execution of the `executeScriptInContainer` function. Additionally, a baseline test has been added to validate the output of the script execution. --- registry/coder/modules/filebrowser/main.test.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/registry/coder/modules/filebrowser/main.test.ts b/registry/coder/modules/filebrowser/main.test.ts index 136fa25e2..52626aa11 100644 --- a/registry/coder/modules/filebrowser/main.test.ts +++ b/registry/coder/modules/filebrowser/main.test.ts @@ -63,7 +63,7 @@ describe("filebrowser", async () => { database_path: ".config/filebrowser.db", }); - const output = await await executeScriptInContainer( + const output = await executeScriptInContainer( state, "alpine/curl", "sh", @@ -78,12 +78,14 @@ describe("filebrowser", async () => { agent_id: "foo", folder: "/home/coder/project", }); - const output = await await executeScriptInContainer( + const output = await executeScriptInContainer( state, "alpine/curl", "sh", "apk add bash", ); + + testBaseLine(output); }); it("runs with subdomain=false", async () => { @@ -93,7 +95,7 @@ describe("filebrowser", async () => { subdomain: false, }); - const output = await await executeScriptInContainer( + const output = await executeScriptInContainer( state, "alpine/curl", "sh", From a461b7aba78e792df7883cfa1bb7369fe765b799 Mon Sep 17 00:00:00 2001 From: DevelopmentCats Date: Wed, 2 Jul 2025 20:51:38 +0000 Subject: [PATCH 2/9] fix(filebrowser): increase timeout for tests to ensure stability --- registry/coder/modules/filebrowser/main.test.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/registry/coder/modules/filebrowser/main.test.ts b/registry/coder/modules/filebrowser/main.test.ts index 52626aa11..b74b137d2 100644 --- a/registry/coder/modules/filebrowser/main.test.ts +++ b/registry/coder/modules/filebrowser/main.test.ts @@ -55,7 +55,7 @@ describe("filebrowser", async () => { ); testBaseLine(output); - }); + }, 15000); it("runs with database_path var", async () => { const state = await runTerraformApply(import.meta.dir, { @@ -71,7 +71,7 @@ describe("filebrowser", async () => { ); testBaseLine(output); - }); + }, 15000); it("runs with folder var", async () => { const state = await runTerraformApply(import.meta.dir, { @@ -85,8 +85,7 @@ describe("filebrowser", async () => { "apk add bash", ); - testBaseLine(output); - }); + }, 15000); it("runs with subdomain=false", async () => { const state = await runTerraformApply(import.meta.dir, { @@ -103,5 +102,5 @@ describe("filebrowser", async () => { ); testBaseLine(output); - }); + }, 15000); }); From 93283ae5f5f311f933393c0879daaba4298ba58d Mon Sep 17 00:00:00 2001 From: DevelopmentCats Date: Wed, 2 Jul 2025 20:51:59 +0000 Subject: [PATCH 3/9] fix(filebrowser): remove duplicate LOG_PATH entry in coder_script resource --- registry/coder/modules/filebrowser/main.tf | 1 - 1 file changed, 1 deletion(-) diff --git a/registry/coder/modules/filebrowser/main.tf b/registry/coder/modules/filebrowser/main.tf index 3c0178211..7537b51e8 100644 --- a/registry/coder/modules/filebrowser/main.tf +++ b/registry/coder/modules/filebrowser/main.tf @@ -97,7 +97,6 @@ resource "coder_script" "filebrowser" { LOG_PATH : var.log_path, PORT : var.port, FOLDER : var.folder, - LOG_PATH : var.log_path, DB_PATH : var.database_path, SUBDOMAIN : var.subdomain, SERVER_BASE_PATH : local.server_base_path From 528dc79ccfb0f25e190abbd1fdcc2cee7acb5bd2 Mon Sep 17 00:00:00 2001 From: DevelopmentCats Date: Wed, 2 Jul 2025 20:52:51 +0000 Subject: [PATCH 4/9] fix(filebrowser): remove unnecessary admin user creation in run script since it was causing failure because of empty password and is not needed since noauth is set --- registry/coder/modules/filebrowser/run.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/registry/coder/modules/filebrowser/run.sh b/registry/coder/modules/filebrowser/run.sh index ffb87f042..990d897a2 100644 --- a/registry/coder/modules/filebrowser/run.sh +++ b/registry/coder/modules/filebrowser/run.sh @@ -25,7 +25,6 @@ export FB_DATABASE="${DB_PATH}" # Check if filebrowser db exists if [[ ! -f "${DB_PATH}" ]]; then filebrowser config init 2>&1 | tee -a ${LOG_PATH} - filebrowser users add admin "" --perm.admin=true --viewMode=mosaic 2>&1 | tee -a ${LOG_PATH} fi filebrowser config set --baseurl=${SERVER_BASE_PATH} --port=${PORT} --auth.method=noauth --root=$ROOT_DIR 2>&1 | tee -a ${LOG_PATH} From 0547aa43f673dad979121f3dd33f35a67db17ee3 Mon Sep 17 00:00:00 2001 From: DevelopmentCats Date: Wed, 2 Jul 2025 20:56:54 +0000 Subject: [PATCH 5/9] fix(filebrowser): update version to 1.1.1 in README for patch version update --- registry/coder/modules/filebrowser/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/registry/coder/modules/filebrowser/README.md b/registry/coder/modules/filebrowser/README.md index d3604179e..eac68eaed 100644 --- a/registry/coder/modules/filebrowser/README.md +++ b/registry/coder/modules/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/coder/filebrowser/coder" - version = "1.1.0" + version = "1.1.1" 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/coder/filebrowser/coder" - version = "1.1.0" + version = "1.1.1" 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/coder/filebrowser/coder" - version = "1.1.0" + version = "1.1.1" 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/coder/filebrowser/coder" - version = "1.1.0" + version = "1.1.1" agent_id = coder_agent.example.id agent_name = "main" subdomain = false From dff25e6a35b441789108f6fc705c166e5d77de9d Mon Sep 17 00:00:00 2001 From: DevelopmentCats Date: Thu, 3 Jul 2025 02:17:08 +0000 Subject: [PATCH 6/9] feat(filebrowser): add no-auth environment variable for filebrowser configuration --- registry/coder/modules/filebrowser/main.tf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/registry/coder/modules/filebrowser/main.tf b/registry/coder/modules/filebrowser/main.tf index 7537b51e8..b47009c7a 100644 --- a/registry/coder/modules/filebrowser/main.tf +++ b/registry/coder/modules/filebrowser/main.tf @@ -127,3 +127,9 @@ locals { url = "http://localhost:${var.port}${local.server_base_path}" healthcheck_url = "http://localhost:${var.port}${local.server_base_path}/health" } + +resource "coder_env" "fb_noauth" { + agent_id = var.agent_id + name = "FB_NOAUTH" + value = "true" +} From 3c3daee525502ae713198cc031e0f6d00e8df9ae Mon Sep 17 00:00:00 2001 From: DevelopmentCats Date: Thu, 3 Jul 2025 02:56:41 +0000 Subject: [PATCH 7/9] feat(filebrowser): add back default admin user creation in run script for initial setup --- registry/coder/modules/filebrowser/run.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/registry/coder/modules/filebrowser/run.sh b/registry/coder/modules/filebrowser/run.sh index 990d897a2..ffb87f042 100644 --- a/registry/coder/modules/filebrowser/run.sh +++ b/registry/coder/modules/filebrowser/run.sh @@ -25,6 +25,7 @@ export FB_DATABASE="${DB_PATH}" # Check if filebrowser db exists if [[ ! -f "${DB_PATH}" ]]; then filebrowser config init 2>&1 | tee -a ${LOG_PATH} + filebrowser users add admin "" --perm.admin=true --viewMode=mosaic 2>&1 | tee -a ${LOG_PATH} fi filebrowser config set --baseurl=${SERVER_BASE_PATH} --port=${PORT} --auth.method=noauth --root=$ROOT_DIR 2>&1 | tee -a ${LOG_PATH} From 6e68a4de828231821823e72cb802d65b20b97de8 Mon Sep 17 00:00:00 2001 From: DevelopmentCats Date: Thu, 3 Jul 2025 03:47:47 +0000 Subject: [PATCH 8/9] fix(filebrowser): set default password for admin user during initial setup in run script in order to satisfy fb user requirements --- registry/coder/modules/filebrowser/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registry/coder/modules/filebrowser/run.sh b/registry/coder/modules/filebrowser/run.sh index ffb87f042..ea4b857a3 100644 --- a/registry/coder/modules/filebrowser/run.sh +++ b/registry/coder/modules/filebrowser/run.sh @@ -25,7 +25,7 @@ export FB_DATABASE="${DB_PATH}" # Check if filebrowser db exists if [[ ! -f "${DB_PATH}" ]]; then filebrowser config init 2>&1 | tee -a ${LOG_PATH} - filebrowser users add admin "" --perm.admin=true --viewMode=mosaic 2>&1 | tee -a ${LOG_PATH} + filebrowser users add admin "coderPASSWORD" --perm.admin=true --viewMode=mosaic 2>&1 | tee -a ${LOG_PATH} fi filebrowser config set --baseurl=${SERVER_BASE_PATH} --port=${PORT} --auth.method=noauth --root=$ROOT_DIR 2>&1 | tee -a ${LOG_PATH} From 3b91f49500594a82cb6660749ae45be3b000b277 Mon Sep 17 00:00:00 2001 From: DevelopmentCats Date: Thu, 3 Jul 2025 03:49:20 +0000 Subject: [PATCH 9/9] fix(filebrowser): remove no-auth environment variable from filebrowser configuration since its done in cli --- registry/coder/modules/filebrowser/main.tf | 5 ----- 1 file changed, 5 deletions(-) diff --git a/registry/coder/modules/filebrowser/main.tf b/registry/coder/modules/filebrowser/main.tf index b47009c7a..498682dd8 100644 --- a/registry/coder/modules/filebrowser/main.tf +++ b/registry/coder/modules/filebrowser/main.tf @@ -128,8 +128,3 @@ locals { healthcheck_url = "http://localhost:${var.port}${local.server_base_path}/health" } -resource "coder_env" "fb_noauth" { - agent_id = var.agent_id - name = "FB_NOAUTH" - value = "true" -}