Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
containerize
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package registry
Container registry
Operate
Terraform modules
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Studio R215
containerize
Commits
05c2b03e
Commit
05c2b03e
authored
7 months ago
by
Sebastian Karius
Browse files
Options
Downloads
Patches
Plain Diff
dev coder filebrowser module
parent
1b4e4a73
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
terraform/filebrowser/README.md
+46
-0
46 additions, 0 deletions
terraform/filebrowser/README.md
terraform/filebrowser/main.test.ts
+91
-0
91 additions, 0 deletions
terraform/filebrowser/main.test.ts
with
137 additions
and
0 deletions
terraform/filebrowser/README.md
0 → 100644
+
46
−
0
View file @
05c2b03e
---
display_name
:
File Browser
description
:
A file browser for your workspace
icon
:
../.icons/filebrowser.svg
maintainer_github
:
coder
verified
:
true
tags
:
[
helper
,
filebrowser
]
---
# File Browser
A file browser for your workspace.
```
tf
module
"filebrowser"
{
source
=
"registry.coder.com/modules/filebrowser/coder"
version
=
"1.0.8"
agent_id
=
coder_agent
.
example
.
id
}
```

## Examples
### Serve a specific directory
```
tf
module
"filebrowser"
{
source
=
"registry.coder.com/modules/filebrowser/coder"
version
=
"1.0.8"
agent_id
=
coder_agent
.
example
.
id
folder
=
"/home/coder/project"
}
```
### Specify location of `filebrowser.db`
```
tf
module
"filebrowser"
{
source
=
"registry.coder.com/modules/filebrowser/coder"
version
=
"1.0.8"
agent_id
=
coder_agent
.
example
.
id
database_path
=
".config/filebrowser.db"
}
```
This diff is collapsed.
Click to expand it.
terraform/filebrowser/main.test.ts
0 → 100644
+
91
−
0
View file @
05c2b03e
import
{
describe
,
expect
,
it
}
from
"
bun:test
"
;
import
{
executeScriptInContainer
,
runTerraformApply
,
runTerraformInit
,
testRequiredVariables
,
}
from
"
../test
"
;
describe
(
"
filebrowser
"
,
async
()
=>
{
await
runTerraformInit
(
import
.
meta
.
dir
);
testRequiredVariables
(
import
.
meta
.
dir
,
{
agent_id
:
"
foo
"
,
});
it
(
"
fails with wrong database_path
"
,
async
()
=>
{
const
state
=
await
runTerraformApply
(
import
.
meta
.
dir
,
{
agent_id
:
"
foo
"
,
database_path
:
"
nofb
"
,
}).
catch
((
e
)
=>
{
if
(
!
e
.
message
.
startsWith
(
"
\n
Error: Invalid value for variable
"
))
{
throw
e
;
}
});
});
it
(
"
runs with default
"
,
async
()
=>
{
const
state
=
await
runTerraformApply
(
import
.
meta
.
dir
,
{
agent_id
:
"
foo
"
,
});
const
output
=
await
executeScriptInContainer
(
state
,
"
alpine
"
);
expect
(
output
.
exitCode
).
toBe
(
0
);
expect
(
output
.
stdout
).
toEqual
([
"
\
u001b[0;1mInstalling filebrowser
"
,
""
,
"
🥳 Installation complete!
"
,
""
,
"
👷 Starting filebrowser in background...
"
,
""
,
"
📂 Serving /root at http://localhost:13339
"
,
""
,
"
Running 'filebrowser --noauth --root /root --port 13339'
"
,
""
,
"
📝 Logs at /tmp/filebrowser.log
"
,
]);
});
it
(
"
runs with database_path var
"
,
async
()
=>
{
const
state
=
await
runTerraformApply
(
import
.
meta
.
dir
,
{
agent_id
:
"
foo
"
,
database_path
:
"
.config/filebrowser.db
"
,
});
const
output
=
await
executeScriptInContainer
(
state
,
"
alpine
"
);
expect
(
output
.
exitCode
).
toBe
(
0
);
expect
(
output
.
stdout
).
toEqual
([
"
\
u001b[0;1mInstalling filebrowser
"
,
""
,
"
🥳 Installation complete!
"
,
""
,
"
👷 Starting filebrowser in background...
"
,
""
,
"
📂 Serving /root at http://localhost:13339
"
,
""
,
"
Running 'filebrowser --noauth --root /root --port 13339 -d .config/filebrowser.db'
"
,
""
,
"
📝 Logs at /tmp/filebrowser.log
"
,
]);
});
it
(
"
runs with folder var
"
,
async
()
=>
{
const
state
=
await
runTerraformApply
(
import
.
meta
.
dir
,
{
agent_id
:
"
foo
"
,
folder
:
"
/home/coder/project
"
,
});
const
output
=
await
executeScriptInContainer
(
state
,
"
alpine
"
);
expect
(
output
.
exitCode
).
toBe
(
0
);
expect
(
output
.
stdout
).
toEqual
([
"
\
u001B[0;1mInstalling filebrowser
"
,
""
,
"
🥳 Installation complete!
"
,
""
,
"
👷 Starting filebrowser in background...
"
,
""
,
"
📂 Serving /home/coder/project at http://localhost:13339
"
,
""
,
"
Running 'filebrowser --noauth --root /home/coder/project --port 13339'
"
,
""
,
"
📝 Logs at /tmp/filebrowser.log
"
,
]);
});
});
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment