- Notifications
You must be signed in to change notification settings - Fork59
feat(filebrowser): check if already installed#334
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Uh oh!
There was an error while loading.Please reload this page.
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 runbun 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) ✗ buntest filebrowser/main.test.ts --verbosebuntest v1.1.33 (247456b6)filebrowser/main.test.ts:Terraform encountered problems during initialisation, including problemswith the configuration, described below.The Terraform configuration must be valid before initialization so thatTerraform can determine which modules and providers need to be installed.╷│ Error: Invalid referencein variable validation│ │ on main.tf line 27,in variable"agent_name":│ 27: condition = var.subdomain|| var.agent_name!=""│ │ The conditionfor 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. |
matifali commentedOct 30, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@IamTaoChen Let us remove the I am actually doing some changes inhttps://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 withCODER_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 thePATH
.
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.
f5ab799
intocoder:mainUh oh!
There was an error while loading.Please reload this page.
Hi I just noticed that |
Fixes#15365We used to hithttps://raw.githubusercontent.com/filebrowser/logo/master/icon_raw.svgfor the filebrowser icon butcoder/modules#334 modified the icon URL topoint to a self-hosted icon.I simply copied the icon from the `coder/modules` repo.
Fixes#15365We used to hithttps://raw.githubusercontent.com/filebrowser/logo/master/icon_raw.svgfor the filebrowser icon butcoder/modules#334 modified the icon URL topoint to a self-hosted icon.I simply copied the icon from the `coder/modules` repo.(cherry picked from commitdc29b81)
Fixes#15365We used to hithttps://raw.githubusercontent.com/filebrowser/logo/master/icon_raw.svgfor the filebrowser icon butcoder/modules#334 modified the icon URL topoint to a self-hosted icon.I simply copied the icon from the `coder/modules` repo.(cherry picked from commitdc29b81)Co-authored-by: Cian Johnston <cian@coder.com>
Fixes#15365We used to hithttps://raw.githubusercontent.com/filebrowser/logo/master/icon_raw.svgfor the filebrowser icon butcoder/modules#334 modified the icon URL topoint to a self-hosted icon.I simply copied the icon from the `coder/modules` repo.(cherry picked from commitdc29b81)
Fixes#15365We used to hithttps://raw.githubusercontent.com/filebrowser/logo/master/icon_raw.svgfor the filebrowser icon butcoder/modules#334 modified the icon URL topoint to a self-hosted icon.I simply copied the icon from the `coder/modules` repo.(cherry picked from commitdc29b81)
Add check if the
filebrowser
exist