Filebrowser 一款电脑文件分享网页版

Filebrowser 一款电脑文件分享网页版

Salvio Blog@ixsay.com

https://filebrowser.org/index.html

img

可以使用用户登录,也可以匿名访问

配合bat脚本更是便捷

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
77
78
79
80
81
82
@echo off
setlocal enabledelayedexpansion
title FileBrowser v2.57.1 启动工具

:start
cls
echo =================================================
echo FileBrowser 自动配置 (v2.57.1)
echo =================================================
echo.

:: --- 第一步:获取并选择 IP ---
set i=0
set "ip[0]=0.0.0.0"
for /f "tokens=2 delims=:" %%a in ('ipconfig ^| findstr /i "IPv4"') do (
set /a i+=1
for /f "tokens=*" %%g in ("%%a") do set "ip[!i!]=%%g"
)

echo [第一步] 请选择绑定的 IP 地址:
echo 0. 0.0.0.0 (推荐)
for /l %%j in (1,1,%i%) do (
echo %%j. !ip[%%j]!
)
echo.
set "ip_choice="
set /p "ip_choice=请输入 IP 序号 (直接回车默认 0): "
if "%ip_choice%"=="" set "ip_choice=0"

:: 提取选定的 IP
set "target_ip=!ip[%ip_choice%]!"
if "!target_ip!"=="" (
echo [错误] 序号输入有误。
pause
goto start
)

:: --- 第二步:选择访问模式 ---
echo.
echo -------------------------------------------------
echo [第二步] 请选择访问模式:
echo [1]. 无密码模式 (默认:直接回车)
echo [2]. 账号密码模式 (JSON 验证)
echo -------------------------------------------------
echo.
set "mode_choice="
set /p "mode_choice=请输入选项 (12): "

:: --- 逻辑执行 ---
if not exist "filebrowser.db" filebrowser.exe config init >nul 2>&1

if "%mode_choice%"=="2" (
echo [状态] 已切换为:账号密码模式
filebrowser.exe config set --auth.method=json >nul 2>&1
set "target_port=8080"
) else (
echo [状态] 已切换为:无密码模式
filebrowser.exe config set --auth.method=noauth >nul 2>&1
set "target_port=80"
)

:: 允许手动修改端口
echo.
set /p "custom_port=确认端口 (直接回车使用 !target_port!): "
if not "!custom_port!"=="" set "target_port=!custom_port!"

:: --- 启动 ---
:execute
echo.
echo =================================================
echo [执行] 正在启动 !target_ip!:!target_port!
echo [访问] http://!target_ip!:!target_port!
echo =================================================
filebrowser.exe -a !target_ip! -p !target_port!

if %ERRORLEVEL% NEQ 0 (
echo.
echo [启动失败] 端口可能被占用,请尝试更换端口或以管理员身份运行。
pause
)
goto start

  • Title: Filebrowser 一款电脑文件分享网页版
  • Author: Salvio
  • Created at : 2026-03-24 00:00:00
  • Updated at : 2026-04-30 03:29:12
  • Link: https://blog.ixsay.com/post/d9d7dc3e.html
  • License: All Rights Reserved © Salvio
Comments
On this page
Filebrowser 一款电脑文件分享网页版