Skip to content
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

bug(filebrowser): Base URL Configuration Issue in FileBrowser Module #309

Closed
link-webcreations opened this issue Oct 1, 2024 · 3 comments · Fixed by #320
Closed

bug(filebrowser): Base URL Configuration Issue in FileBrowser Module #309

link-webcreations opened this issue Oct 1, 2024 · 3 comments · Fixed by #320

Comments

@link-webcreations
Copy link

link-webcreations commented Oct 1, 2024

Base URL Configuration Issue in FileBrowser Module

Problem Description

There's an issue in the FileBrowser module version 1.0.19, specifically in the filebrowser/run.sh#L21 script. The script attempts to customize the server Base URL before starting the server in the background. However, this customization only works when the database is located at the default path, ~/filebrowser.db.

If the database location has been modified (e.g.: database_path = "/home/coder/.filebrowser/filebrowser.db"), the script tries to update the default database location, resulting in no changes. Consequently, the Base URL remains empty.

Current Behavior

# Current implementation
filebrowser config set --baseurl "${SERVER_BASE_PATH}" > ${LOG_PATH} 2>&1

This line only works correctly with the default database location.

Proposed Solution

To address this issue, we can leverage the existing mechanism used for starting the server. Here's the proposed change:

# 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
+filebrowser config set --baseurl "${SERVER_BASE_PATH}"$${DB_FLAG} > ${LOG_PATH} 2>&1

This modification could ensures that the Base URL is correctly set regardless of the database location (to be tested).

@jeehoonkang
Copy link

@matifali it seems it's a genuine bug. I'm experiencing the same symptom :)

@matifali
Copy link
Member

Thank you, @jeehoonkang. I think #320 will fix this.

@matifali
Copy link
Member

Hi @jeehoonkang Could you test the updated module using

module "filebrowser" {
  source        = "git::https://github.com/yandolfat/modules.git//filebrowser?ref=patches/filebrowser"
  agent_id      = coder_agent.example.id
  agent_name    = "main"
  subdomain     = false
  database_path = ".config/filebrowser.db"
}

Let me know if that works and I will merge the PR and cut a new release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants