-
Notifications
You must be signed in to change notification settings - Fork 32
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
feat(filebrowser): check if already installed #334
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the contribution.
Can you please run bun update-version
or ./scripts/update-version.sh
.
Done |
Hi @IamTaoChen could you also run |
During testing, I encountered an error in main.tf related to the variable validation logic: modules2 git:(main) ✗ bun test filebrowser/main.test.ts --verbose
bun test v1.1.33 (247456b6)
filebrowser/main.test.ts:
Terraform encountered problems during initialisation, including problems
with the configuration, described below.
The Terraform configuration must be valid before initialization so that
Terraform can determine which modules and providers need to be installed.
╷
│ Error: Invalid reference in variable validation
│
│ on main.tf line 27, in variable "agent_name":
│ 27: condition = var.subdomain || var.agent_name != ""
│
│ The condition for variable "agent_name" can only refer to the variable itself, using var.agent_name.
╵ Terraform’s validation rules don’t allow a variable’s validation logic to reference other variables, such as Should I proceed by temporarily masking the validation to unblock the tests, or would you recommend another way to handle this dependency. |
@IamTaoChen Let us remove the I am actually doing some changes in https://github.com/coder/modules/blob/atif/qol-improvments/filebrowser/main.tf Feel free to bring them in for filebrowser in your PR. |
Now, it passed the test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for your contribution!
printf "$${BOLD}Installing filebrowser \n\n" | ||
|
||
curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash | ||
# Check if filebrowser is installed | ||
if ! command -v filebrowser &> /dev/null; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(No action, just commentary.)
This is nice, but unfortunately it's rare that users will benefit since it's usually installed to /usr/local/bin
. For containers it's rarely persisted.
It'd be cool if we could store this in $CODER_SCRIPT_BIN_DIR
instead. Usually this is within /tmp
but it's possible to change by starting the coder agent with CODER_AGENT_SCRIPT_DATA_DIR=/path/to/persistent/dir
.
This is something to consider for all modules, should we track this in a new issue @matifali?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is nice, but unfortunately it's rare that users will benefit since it's usually installed to /usr/local/bin. For containers it's rarely persisted.
For air-gapped scenarios where the image already has it installed this is beneficial.
It'd be cool if we could store this in $CODER_SCRIPT_BIN_DIR instead. Usually this is within /tmp but it's possible to change by starting the coder agent with CODER_AGENT_SCRIPT_DATA_DIR=/path/to/persistent/dir.
I am a bit confused about $CODER_SCRIPT_BIN_DIR and $CODER_AGENT_SCRIPT_DATA_DIR. Do we have them already and how are the used? Or are you proposing this new concept.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For air-gapped scenarios where the image already has it installed this is beneficial.
👍🏻
I am a bit confused about $CODER_SCRIPT_BIN_DIR and $CODER_AGENT_SCRIPT_DATA_DIR. Do we have them already and how are the used? Or are you proposing this new concept.
We have them.
Let's say you run the agent this way:
coder agent --script-data-dir=/home/coder/.local/coder-script
Now all coder scripts will be executed with the following environment variables:
CODER_SCRIPT_DATA_DIR=/home/coder/.local/coder-script/[UUID]
CODER_SCRIPT_BIN_DIR=/home/coder/.local/coder-script/bin
And the coder agent will automatically add /home/coder/.local/coder-script/bin
to the PATH
.
Even without specifying the script dir, a default will be used, you can verify this in your workspace:
ls /tmp/coder-script-data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is super useful and we should start using it in our modules.
Hi I just noticed that |
Fixes #15365 We used to hit https://raw.githubusercontent.com/filebrowser/logo/master/icon_raw.svg for the filebrowser icon but coder/modules#334 modified the icon URL to point to a self-hosted icon. I simply copied the icon from the `coder/modules` repo.
Fixes #15365 We used to hit https://raw.githubusercontent.com/filebrowser/logo/master/icon_raw.svg for the filebrowser icon but coder/modules#334 modified the icon URL to point to a self-hosted icon. I simply copied the icon from the `coder/modules` repo. (cherry picked from commit dc29b81)
Fixes #15365 We used to hit https://raw.githubusercontent.com/filebrowser/logo/master/icon_raw.svg for the filebrowser icon but coder/modules#334 modified the icon URL to point to a self-hosted icon. I simply copied the icon from the `coder/modules` repo. (cherry picked from commit dc29b81) Co-authored-by: Cian Johnston <[email protected]>
Add check if the
filebrowser
exist