Skip to content

Commit 22b2ad5

Browse files
dstoffelmatifali
andauthored
fix(filebrowser): failed to set server_base_path if db is not existing (#393)
Co-authored-by: M Atif Ali <me@matifali.dev>
1 parent 6e66ff5 commit 22b2ad5

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

filebrowser/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ A file browser for your workspace.
1515
module "filebrowser" {
1616
count = data.coder_workspace.me.start_count
1717
source = "registry.coder.com/modules/filebrowser/coder"
18-
version = "1.0.23"
18+
version = "1.0.29"
1919
agent_id = coder_agent.example.id
2020
}
2121
```
@@ -30,7 +30,7 @@ module "filebrowser" {
3030
module "filebrowser" {
3131
count = data.coder_workspace.me.start_count
3232
source = "registry.coder.com/modules/filebrowser/coder"
33-
version = "1.0.23"
33+
version = "1.0.29"
3434
agent_id = coder_agent.example.id
3535
folder = "/home/coder/project"
3636
}
@@ -42,7 +42,7 @@ module "filebrowser" {
4242
module "filebrowser" {
4343
count = data.coder_workspace.me.start_count
4444
source = "registry.coder.com/modules/filebrowser/coder"
45-
version = "1.0.23"
45+
version = "1.0.29"
4646
agent_id = coder_agent.example.id
4747
database_path = ".config/filebrowser.db"
4848
}
@@ -54,7 +54,7 @@ module "filebrowser" {
5454
module "filebrowser" {
5555
count = data.coder_workspace.me.start_count
5656
source = "registry.coder.com/modules/filebrowser/coder"
57-
version = "1.0.23"
57+
version = "1.0.29"
5858
agent_id = coder_agent.example.id
5959
agent_name = "main"
6060
subdomain = false

filebrowser/main.test.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ describe("filebrowser", async () => {
3939
"",
4040
"📂 Serving /root at http://localhost:13339 ",
4141
"",
42-
"Running 'filebrowser --noauth --root /root --port 13339' ",
42+
"Running 'filebrowser --noauth --root /root --port 13339 --baseurl ' ",
4343
"",
4444
"📝 Logs at /tmp/filebrowser.log",
4545
]);
@@ -61,7 +61,7 @@ describe("filebrowser", async () => {
6161
"",
6262
"📂 Serving /root at http://localhost:13339 ",
6363
"",
64-
"Running 'filebrowser --noauth --root /root --port 13339 -d .config/filebrowser.db' ",
64+
"Running 'filebrowser --noauth --root /root --port 13339 -d .config/filebrowser.db --baseurl ' ",
6565
"",
6666
"📝 Logs at /tmp/filebrowser.log",
6767
]);
@@ -75,15 +75,15 @@ describe("filebrowser", async () => {
7575
const output = await executeScriptInContainer(state, "alpine");
7676
expect(output.exitCode).toBe(0);
7777
expect(output.stdout).toEqual([
78-
"\u001B[0;1mInstalling filebrowser ",
78+
"\u001b[0;1mInstalling filebrowser ",
7979
"",
8080
"🥳 Installation complete! ",
8181
"",
8282
"👷 Starting filebrowser in background... ",
8383
"",
8484
"📂 Serving /home/coder/project at http://localhost:13339 ",
8585
"",
86-
"Running 'filebrowser --noauth --root /home/coder/project --port 13339' ",
86+
"Running 'filebrowser --noauth --root /home/coder/project --port 13339 --baseurl ' ",
8787
"",
8888
"📝 Logs at /tmp/filebrowser.log",
8989
]);
@@ -106,7 +106,7 @@ describe("filebrowser", async () => {
106106
"",
107107
"📂 Serving /root at http://localhost:13339 ",
108108
"",
109-
"Running 'filebrowser --noauth --root /root --port 13339' ",
109+
"Running 'filebrowser --noauth --root /root --port 13339 --baseurl /@default/default.main/apps/filebrowser' ",
110110
"",
111111
"📝 Logs at /tmp/filebrowser.log",
112112
]);

filebrowser/run.sh

+2-5
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,10 @@ if [ "${DB_PATH}" != "filebrowser.db" ]; then
2121
DB_FLAG=" -d ${DB_PATH}"
2222
fi
2323

24-
# set baseurl to be able to run if sudomain=false; if subdomain=true the SERVER_BASE_PATH value will be ""
25-
filebrowser config set --baseurl "${SERVER_BASE_PATH}"$${DB_FLAG} > ${LOG_PATH} 2>&1
26-
2724
printf "📂 Serving $${ROOT_DIR} at http://localhost:${PORT} \n\n"
2825

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

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

3330
printf "📝 Logs at ${LOG_PATH} \n\n"

0 commit comments

Comments
 (0)