go语言编写同时支持Linux和Windows的单文件Web界面文件浏览器filebrowser介绍

支持中文,支持嵌套文件夹上传。

https://filebrowser.org/

https://github.com/filebrowser/filebrowser

文件浏览器是一种自行创建的软件,您可以在其中将其安装在服务器上,将其定向到路径,然后通过一个不错的Web界面访问文件。您有许多可用功能!

 

简易登录系统

 

通过时尚的界面管理文件

 

管理用户,添加权限,设置范围

 

当然,编辑文件!

 

执行自定义命令

 

定制安装

安装

文件浏览器是单个二进制文件,可以用作独立的可执行文件。虽然,有些人可能更喜欢将其与DockerCaddy一起使用,这是一个出色的Web服务器,默认情况下启用HTTPS。 无论您要使用哪个系统,它的安装都非常简单。

快速设置

初学者开始使用文件浏览器的最快方法是打开终端并执行以下命令:

Unix系统

curl -fsSL https://filebrowser.org/get.sh | bash

filebrowser -r /path/to/your/files

 

Windows

iwr -useb https://filebrowser.org/get.ps1 | iex

filebrowser -r /path/to/your/files

 

做完了!它将引导一个存储所有配置和用户的数据库。现在,您可以在命令行上看到运行实例的地址。您只需要转到该URL并使用以下凭据:

·用户名:admin

·密码:admin

您必须更改密码和用户名(如果可以的话),以实现最佳安全性。

尽管这是引导实例的最快方法,但我们建议您查看init 和config设置选项的可能性,以使安装尽可能安全和自定义。

Docker

文件浏览器也可以作为Docker映像使用。您可以在Docker Hub上找到它。用法如下:

docker run \

    -v /path/to/root:/srv \

    -v /path/filebrowser.db:/database.db \

    -v /path/.filebrowser.json:/.filebrowser.json \

    -p 80:80 \

    filebrowser/filebrowser

默认情况下,我们已经有一个带有一些默认设置配置文件,因此您只需挂载根目录和数据库即可。尽管您可以通过使用新的配置文件挂载目录来覆盖。如果您还没有数据库文件,请确保在您指定的路径下创建一个新的空文件。否则,Docker将创建一个空文件夹而不是一个空文件,从而在将数据库安装到容器中时导致错误。

C:\Program Files\filebrowser>filebrowser.exe --help

File Browser CLI lets you create the database to use with File Browser,

manage your users and all the configurations without acessing the

web interface.

 

If you've never run File Browser, you'll need to have a database for

it. Don't worry: you don't need to setup a separate database server.

We're using Bolt DB which is a single file database and all managed

by ourselves.

 

For this specific command, all the flags you have available (except

"config" for the configuration file), can be given either through

environment variables or configuration files.

 

If you don't set "config", it will look for a configuration file called

.filebrowser.{json, toml, yaml, yml} in the following directories:

 

- ./

- $HOME/

- /etc/filebrowser/

 

The precedence of the configuration values are as follows:

 

- flags

- environment variables

- configuration file

- database values

- defaults

 

The environment variables are prefixed by "FB_" followed by the option

name in caps. So to set "database" via an env variable, you should

set FB_DATABASE.

 

Also, if the database path doesn't exist, File Browser will enter into

the quick setup mode and a new database will be bootstraped and a new

user created with the credentials from options "username" and "password".

 

Usage:

  filebrowser [flags]

  filebrowser [command]

 

Available Commands:

  cmds        Command runner management utility

  config      Configuration management utility

  hash        Hashes a password

  help        Help about any command

  rules       Rules management utility

  upgrade     Upgrades an old configuration

  users       Users management utility

  version     Print the version number

 

Flags:

  -a, --address string           address to listen on (default "127.0.0.1")

  -b, --baseurl string           base url

      --cache-dir string         file cache directory (disabled if empty)

  -t, --cert string              tls certificate

  -c, --config string            config file path

  -d, --database string          database path (default "./filebrowser.db")

      --disable-exec             disables Command Runner feature

      --disable-preview-resize   disable resize of image previews

      --disable-thumbnails       disable image thumbnails

  -h, --help                     help for filebrowser

      --img-processors int       image processors count (default 4)

  -k, --key string               tls key

  -l, --log string               log output (default "stdout")

      --noauth                   use the noauth auther when using quick setup

      --password string          hashed password for the first user when using quick config (default "admin")

  -p, --port string              port to listen on (default "8080")

  -r, --root string              root to prepend to relative paths (default ".")

      --socket string            socket to listen to (cannot be used with address, port, cert nor key flags)

      --socket-perm uint32       unix socket file permissions (default 438)

      --username string          username for the first user when using quick config (default "admin")

 

Use "filebrowser [command] --help" for more information about a command

 

C:\Program Files\filebrowser>filebrowser.exe -r c:\ -p 9999

2020/10/23 16:17:18 No config file used

2020/10/23 16:17:18 Listening on 127.0.0.1:9999

   

猜你喜欢

转载自blog.csdn.net/allway2/article/details/109245198
今日推荐