add filebrowser config
This commit is contained in:
parent
c1eaaf6eb9
commit
0fbb69732e
46
linux/tool/filebrowser.txt
Normal file
46
linux/tool/filebrowser.txt
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
1.直接二进制安装。
|
||||||
|
2.初始化一个设置:
|
||||||
|
filebrowser -d /etc/filebrowser.db config init
|
||||||
|
3.设置端口地址:
|
||||||
|
filebrowser -d /etc/filebrowser.db config set --address 0.0.0.0
|
||||||
|
filebrowser -d /etc/filebrowser.db config set --port 8080
|
||||||
|
4.用户名密码:
|
||||||
|
filebrowser users add admin 123456 --perm.admin -d /etc/filebrowser.db
|
||||||
|
filebrowser users update admin --password 123456 --perm.admin -d /etc/filebrowser.db
|
||||||
|
5.设置日志位置:
|
||||||
|
filebrowser -d /etc/filebrowser.db config set --log /var/log/filebrowser.log
|
||||||
|
6.设置存储根目录:
|
||||||
|
filebrowser -d /etc/filebrowser.db config set --root /home/tang/root-file/vol
|
||||||
|
6.安装服务:
|
||||||
|
sudo vim /etc/systemd/system/filebrowser.service
|
||||||
|
[Unit]
|
||||||
|
Description=File browser
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=/usr/local/bin/filebrowser -d /etc/filebrowser.db
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
sudo systemctl enable filebrowser.service
|
||||||
|
sudo systemctl start filebrowser.service
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
或者:
|
||||||
|
#!/sbin/openrc-run
|
||||||
|
|
||||||
|
name="FileBrowser"
|
||||||
|
description="Lightweight file sharing service"
|
||||||
|
command="/usr/local/bin/filebrowser"
|
||||||
|
command_args="-d /home/tang/root-file/filebrowser.db"
|
||||||
|
command_background=true
|
||||||
|
pidfile="/var/run/${RC_SVCNAME}.pid"
|
||||||
|
|
||||||
|
depend() {
|
||||||
|
need net
|
||||||
|
}
|
||||||
|
chmod +x /etc/init.d/filebrowser
|
||||||
|
启动服务 rc-service filebrowser start
|
||||||
|
停止服务 rc-service filebrowser stop
|
||||||
|
重启服务 rc-service filebrowser restart
|
||||||
|
查看状态 rc-service filebrowser status
|
||||||
|
开机自启 rc-update add filebrowser default
|
||||||
|
取消开机自启 rc-update del filebrowser
|
Loading…
x
Reference in New Issue
Block a user