From 0fbb69732eb1b55d281e1deb80d1dd736bd4545b Mon Sep 17 00:00:00 2001 From: taynpg Date: Mon, 24 Mar 2025 21:59:58 +0800 Subject: [PATCH] add filebrowser config --- linux/tool/filebrowser.txt | 46 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 linux/tool/filebrowser.txt diff --git a/linux/tool/filebrowser.txt b/linux/tool/filebrowser.txt new file mode 100644 index 0000000..2d154d3 --- /dev/null +++ b/linux/tool/filebrowser.txt @@ -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