GolangNote

Golang笔记

golang 实现的基于web的文件管理-filebrowser

Permalink

FileBrowser 在指定目录中提供了一个文件管理界面,可用于上传,删除,预览,重命名和编辑文件。它允许创建多个用户,每个用户都可以有自己的目录。它可以用作独立的应用程序。

用来做本地文件管理很方便

下载已编译好的可实行文件,双击即可运行

Bash:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
% ./filebrowser -h
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
  completion  Generate the autocompletion script for the specified shell
  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
      --disable-type-detection-by-header   disables type detection by reading file headers
  -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.

不带任何参数运行

Bash:
1
2
3
% ./filebrowser   
2023/04/19 10:59:49 No config file used
2023/04/19 10:59:49 Listening on 127.0.0.1:8080

它使用 bbolt 嵌入式数据库,绿色应用,不想用时一键删除,方便又干净

本文网址: https://golangnote.com/topic/319.html 转摘请注明来源

Related articles

Golang实现简单的Socks5代理

Socks5 代理较 `http/https` 代理有较好的性能,下面是借鉴某个著名开源软件的 local 实现的简单代理。...

Golang phantomjs 动态代理实现

phantomjs 是个很优秀的软件,虽然现在被chrome headless 抢了风头,但在某些特定场合,使用phantomjs 还是很方便,这里是介绍使用Go 实现动态代理。...

Golang Web 程序生产环境独立部署示例

一个 web 应用通常是跑在一个前端代理,如 Nginx 后,这样可以方便的在同一个服务器部署多个应用。这里说的独立部署是指让 go web 程序直接暴露在外面,独占 443、80 端口(俗称裸跑)。这样做除了性能有些提高外,更重要的是部署方便。...

Write a Comment to "golang 实现的基于web的文件管理-filebrowser"

Submit Comment Login
Based on Golang + fastHTTP + sdb | go1.22.3 Processed in 1ms