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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add HTTPS to File Browser Docker #3194

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ RUN chmod +x /healthcheck.sh # Make the script executable
HEALTHCHECK --start-period=2s --interval=5s --timeout=3s \
CMD /healthcheck.sh || exit 1

VOLUME /srv
RUN mkdir -p /Certs

VOLUME /srv /Certs
EXPOSE 80

COPY docker_config.json /.filebrowser.json
Expand Down
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,31 @@ For installation instructions please refer to our docs at [https://filebrowser.o
## Contributing

If you're interested in contributing to this project, our docs are best places to start [https://filebrowser.org/contributing](https://filebrowser.org/contributing).

## Help for SSL Docker

To use SSL in Docker you must make this volumes configuration like this table

| Host/volume | Path in container | Description |
| :------------- | :------- | :-------------------------------- |
| `/home/devops/configFilebrowser/filebrowser.db` | `/filebrowser.db` | **Required**. for Database |
| `/home/devops/configFilebrowser/filebrowser.json` | `/filebrowser.json` | **Required**. for Configuration file (*) |
| `/home/devops/exemple.com` | `/Certs` | **Required**. for Certs |
| `/portainer/Downloads` | `/srv` | **Required**. Folder to be shared |


(*) and make the configuration in json file like this

```http
{
"port": 8080, //the same port as your host container
"baseURL": "",
"address": "exemple.com",
"log": "stdout",
"database": "/filebrowser.db",
"root": "/srv",
"cert": "/Certs/fullchain.pem",
"key": "/Certs/privkey.pem"
}
```
6 changes: 4 additions & 2 deletions docker_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"baseURL": "",
"address": "",
"log": "stdout",
"database": "/database.db",
"root": "/srv"
"database": "/filebrowser.db",
"root": "/srv",
"cert": "/Certs/fullchain.pem",
"key": "/Certs/privkey.pem"
}
11 changes: 8 additions & 3 deletions healthcheck.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/sh
PORT=${FB_PORT:-$(jq -r .port /.filebrowser.json)}
ADDRESS=${FB_ADDRESS:-$(jq -r .address /.filebrowser.json)}
PORT=${FB_PORT:-$(jq -r .port filebrowser.json)}
ADDRESS=${FB_ADDRESS:-$(jq -r .address filebrowser.json)}
ADDRESS=${ADDRESS:-localhost}
curl -f http://$ADDRESS:$PORT/health || exit 1
VAR=$(jq -r .cert filebrowser.json)
if [ -z "${VAR}" ]; then
curl -f http://$ADDRESS:$PORT/health || exit 1
else
curl -f https://$ADDRESS:$PORT/health || exit 1
fi