docs: improvements to building and docs (#5234)

This commit is contained in:
Henrique Dias
2025-06-29 09:28:39 +02:00
committed by GitHub
parent 5a07291306
commit 2d1a82b73f
28 changed files with 122 additions and 170 deletions

6
www/.gitignore vendored Normal file
View File

@@ -0,0 +1,6 @@
docs/LICENSE
docs/code-of-conduct.md
docs/contributing.md
docs/security.md
docs/changelog.md
public

4
www/Dockerfile Normal file
View File

@@ -0,0 +1,4 @@
FROM squidfunk/mkdocs-material
COPY requirements.txt requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

149
www/docs/configuration.md Normal file
View File

@@ -0,0 +1,149 @@
# Configuration
Most of the configuration can be understood through our Command Line Interface documentation. Although there are some specific topics that we want to cover on this section.
## Custom Branding
You are able to customize your File Browser installation by changing its name to any other you want, by adding a global custom style sheet and by using your own logotype if you want. To address this, there are three configuration options that can be changed:
* **Name:** which is the instance name that will show up on login and signup pages. This won't replace the version message in the sidebar.
* **Disable external links:** this will disable any external links (except the ones to this documentation).
* **Folder:** is the path to a directory that can contain two items:
* **custom.css**, containing the styles you want to apply to your installation.
* **img** a directory whose files can replace the [default logotypes](https://github.com/filebrowser/filebrowser/tree/master/frontend/public/img) in the application.
These options can be either set via the CLI interface using the following command:
```sh
filebrowser config set --branding.name "My Name" \
--branding.files "/abs/path/to/my/dir" \
--branding.disableExternal
```
Or can be set under 'Branding directory path' in **Settings → Global Settings**.
> [!NOTE]
>
> If using Docker then remember to bind this directory, for example as `/home/username/containers/filebrowser/branding:/branding`
For custom icons to be recognized you need to create `img` and `img/icons` directories and place the svg in the `branding/img` directory:
```
- filebrowser
- branding
- img
- icons
- logo.svg
- filebrowser.db
```
To replace the favicon you need to place this in the `img/icons` directory but also note that some of the other PNG icon types will be required too (see the default logotypes link above) as the browser will normally use the highest resolution option available (at a minimum the 16x16 and 32x32 options). You can use the [Real Favicon Generator](https://realfavicongenerator.net/) to generate these for you from your base image.
The icons are cached, to make the new ones appear more quickly open developer tools in your browser, then click on the Application tab, then Storage and then 'Clear Site Data'.
## Authentication Method
Right now, there are three possible authentication methods. Each one of them has its own capabilities and specification. If you are interested in contributing with one more authentication method, please [check the guidelines](contributing.md).
### JSON Auth (default)
We call it JSON Authentication but it is just the default authentication method and the one that is provided by default if you don't make any changes. It is set by default, but if you've made changes before you can revert to using JSON auth:
```sh
filebrowser config set --auth.method=json
```
This method can also be extended with **reCAPTCHA** verification during login:
```sh
filebrowser config set --auth.method=json \
--recaptcha.key site-key \
--recaptcha.secret private-key
```
By default, we use [Google's reCAPTCHA](https://developers.google.com/recaptcha/docs/display) service. If you live in China, or want to use other provider, you can change the host with the following command:
```sh
filebrowser config set --recaptcha.host https://recaptcha.net
```
Where `https://recaptcha.net` is any provider you want.
> [!CAUTION]
>
> Note that you **always** need to set the `--auth.method` flag when changing authentication configurations and that it will completely overwrite your current settings. [This is a known issue.](https://github.com/filebrowser/filebrowser/issues/715)
### Proxy Header
If you have a reverse proxy you want to use to login your users, you do it via our `proxy` authentication method. To configure this method, your proxy must send an HTTP header containing the username of the logged in user:
```sh
filebrowser config set --auth.method=proxy --auth.header=X-My-Header
```
Where `X-My-Header` is the HTTP header provided by your proxy with the username.
> [!WARNING]
>
> File Browser will blindly trust the provided header. If the proxy can be bypassed, an attacker could simply attach the header and get admin access.
### No Authentication
We also provide a no authentication mechanism for users that want to use File Browser privately such in a home network. By setting this authentication method, the user with **id 1** will be used as the default users. Creating more users won't have any effect.
```sh
filebrowser config set --auth.method=noauth
```
## Command Runner
The command runner is a feature that enables you to execute any shell command you want before or after a certain event. Right now, these are the events:
* Copy
* Rename
* Upload
* Delete
* Save
Also, during the execution of the commands set for those hooks, there will be some environment variables available to help you perform your commands:
* `FILE` with the full absolute path to the changed file.
* `SCOPE` with the path to user's scope.
* `TRIGGER` with the name of the event.
* `USERNAME` with the user's username.
* `DESTINATION` with the absolute path to the destination. Only used for **copy** and **rename.**
At this moment, you can edit the commands via the command line interface, using the following commands \(please check the flag `--help` to know more about them\):
```bash
filebrowser cmds add before_copy "echo $FILE"
filebrowser cmds rm before_copy 0
filebrowser cmds ls
```
Or you can use the web interface to manage them via **Settings****Global Settings**.
## Command Execution
> [!CAUTION]
>
> The **command execution** functionality has been disabled for all existent and new installations by default from version v2.33.8 and onwards, due to continuous and known security vulnerabilities. You should only use this feature if you are aware of all of the security risks involved. For more up to date information, consult issue [#5199](https://github.com/filebrowser/filebrowser/issues/5199).
Within File Browser you can toggle the shell (`< >` icon at the top right) and this will open a shell command window at the bottom of the screen. This functionality can be turned on using the environment variable `FB_DISABLE_EXEC=false` or the flag `--disable-exec=false`.
By default no commands are available as the command list is empty. To enable commands these need to either be done on a per-user basis (including for the Admin user).
You can do this by adding them in Settings > User Management > (edit user) > Commands or to *apply to all new users created from that point forward* they can be set in Settings > Global Settings
> [!NOTE]
>
> If using a proxy manager then remember to enable websockets support for the File Browser proxy
> [!NOTE]
>
> If using Docker and you want to add a new command that is not in the base image then you will need to build a custom Docker image using `filebrowser/filebrowser` as a base image. For example to add 7z:
>
> ```docker
> FROM filebrowser/filebrowser
> RUN sudo apt install p7zip-full
> ```

59
www/docs/index.md Normal file
View File

@@ -0,0 +1,59 @@
<style>
.md-content .md-typeset h1 {
display: none;
}
</style>
<p align="center">
<img src="https://raw.githubusercontent.com/filebrowser/logo/master/banner.png" width="550"/>
</p>
![Preview](static/example.gif)
> [!WARNING]
>
> This project is currently on **maintenance-only** mode. For more information, read the information on [GitHub](https://github.com/filebrowser/filebrowser#project-status).
File Browser provides a file managing interface within a specified directory and it can be used to upload, delete, preview and edit your files. It is a **create-your-own-cloud**-kind of software where you can just install it on your server, direct it to a path and access your files through a nice web interface.
## Features
<div class="grid cards" markdown>
- **Easy Login System**
---
![](./static/1.jpg)
- **Sleek Interface**
---
![](./static/2.jpg)
- **User Management**
---
![](./static/3.jpg)
- **File Editing**
---
![](./static/4.jpg)
- **Custom Commands**
---
![](./static/5.jpg)
- **Customization**
---
![](./static/6.jpg)
</div>

80
www/docs/installation.md Normal file
View File

@@ -0,0 +1,80 @@
# Installation
File Browser is a single binary and can be used as a standalone executable. Although, some might prefer to use it with [Docker](https://www.docker.com) or [Caddy](https://caddyserver.com), which is a fantastic web server that enables HTTPS by default. Its installation is quite straightforward independently on which system you want to use.
## Quick Setup
The quickest way for beginners to start using File Browser is by opening your terminal and executing the following commands:
### Brew
```sh
brew tap filebrowser/tap
brew install filebrowser
filebrowser -r /path/to/your/files
```
### Unix
```sh
curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash
filebrowser -r /path/to/your/files
```
### Windows
```sh
iwr -useb https://raw.githubusercontent.com/filebrowser/get/master/get.ps1 | iex
filebrowser -r /path/to/your/files
```
### Configuring
Done! It will bootstrap a database in which all the configurations and users are stored. Now, you can see on your command line the address in which your instance is running. You just need to go to that URL and use the following credentials:
* Username: `admin`
* Password: (printed in your console)
Although this is the fastest way to bootstrap an instance, we recommend you to take a look at other possible options, by checking `config init --help` and `config set --help`, to make the installation as safe and customized as it can be.
## Docker
File Browser is available as two different Docker images, which can be found on [Docker Hub](https://hub.docker.com/r/filebrowser/filebrowser).
### Alpine
```sh
docker run \
-v /path/to/srv:/srv \
-v /path/to/database:/database \
-v /path/to/config:/config \
-p 8080:80 \
filebrowser/filebrowser
```
The default user has PID 1000 and GID 1000. Please make sure that this user has access to the different mounted volumes. To change the user running inside the Docker image, you need to use the [`--user` flag](https://docs.docker.com/engine/containers/run/#user).
### s6 overlay
The `s6` image is based on LinuxServer and leverages the [s6-overlay](https://github.com/just-containers/s6-overlay) system for a standard, highly customizable image. It should be used as follows:
```shell
docker run \
-v /path/to/srv:/srv \
-v /path/to/database:/database \
-v /path/to/config:/config \
-e PUID=$(id -u) \
-e PGID=$(id -g) \
-p 8080:80 \
filebrowser/filebrowser:s6
```
### Notes
Where:
- `/path/to/srv` contains the files root directory for File Browser
- `/path/to/config` contains a `settings.json` file
- `/path/to/database` contains a `filebrowser.db` file
Both `settings.json` and `filebrowser.db` will automatically be initialized if they don't exist.

BIN
www/docs/static/1.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

BIN
www/docs/static/2.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

BIN
www/docs/static/3.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

BIN
www/docs/static/4.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

BIN
www/docs/static/5.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

BIN
www/docs/static/6.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
www/docs/static/example.gif vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 477 KiB

BIN
www/docs/static/favicon.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
www/docs/static/logo.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

106
www/mkdocs.yml Normal file
View File

@@ -0,0 +1,106 @@
site_name: File Browser
site_description: 'A web-based file browser and manager for your files'
site_author: 'File Browser Community'
site_url: 'https://filebrowser.org'
repo_name: 'filebrowser/filebrowser'
repo_url: 'https://github.com/filebrowser/filebrowser'
copyright: 'Copyright &copy; 2025 File Browser Community'
theme:
name: material
language: en
logo: static/logo.png
favicon: static/favicon.png
palette:
- scheme: default
primary: blue
accent: light blue
toggle:
icon: material/lightbulb
name: Switch to dark mode
- scheme: slate
primary: blue
accent: light blue
toggle:
icon: material/lightbulb-outline
name: Switch to light mode
font:
text: Roboto
code: Roboto Mono
features:
- navigation.tabs
- navigation.tabs.sticky
- navigation.sections
- navigation.expand
- navigation.indexes
- navigation.top
- navigation.instant
- search.suggest
- search.highlight
- search.share
- content.code.copy
- toc.follow
- toc.integrate
icon:
repo: fontawesome/brands/github
edit: material/pencil
view: material/eye
plugins:
- search:
separator: '[\\s\\-\\/]+'
- offline
- minify:
minify_html: true
markdown_extensions:
- smarty
- sane_lists
- abbr
- admonition
- attr_list
- def_list
- footnotes
- meta
- md_in_html
- toc:
permalink: true
- pymdownx.caret
- pymdownx.highlight:
anchor_linenums: true
use_pygments: true
- pymdownx.inlinehilite
- pymdownx.keys
- pymdownx.mark
- pymdownx.smartsymbols
- pymdownx.superfences
- pymdownx.tabbed:
alternate_style: true
- pymdownx.tasklist:
custom_checkbox: true
- pymdownx.tilde
- callouts
- github-callouts
extra:
generator: false
social:
- icon: fontawesome/brands/github
link: https://github.com/filebrowser/filebrowser
- icon: fontawesome/brands/docker
link: https://hub.docker.com/r/filebrowser/filebrowser
nav:
- Home: index.md
- Installation: installation.md
- Configuration: configuration.md
- Contributing:
- Contributing: contributing.md
- Code of Conduct: code-of-conduct.md
- Security Policy: security.md
- Changelog: changelog.md

4
www/requirements.txt Normal file
View File

@@ -0,0 +1,4 @@
mkdocs-material
mkdocs-minify-plugin
mkdocs-redirects
markdown-callouts