PanIndex是一个简易的网盘目录列表程序,支持网盘模式:本地,天翼云,阿里teambition,这篇文章就用宝塔面板来搭建这个列表程序。宝塔服务器面板,宝塔服务器面板,一键全能部署及管理,送你3188元礼包,点我领取https://www.bt.cn/?invite_code=MV9lYmllamI=
宝塔面板安装PanIndex – 支持天翼云,阿里云盘,Teambition的网盘目录列表程序
平台支持
由于PanIndex交叉编译需要cgo(sqlite),目前很多平台还不能很好的支持,如果你有特殊的编译需求,请告知我,我会尽量添加
Linux (x86 / amd64 / arm / arm64 )
Windows 7 及之后版本(x86 / amd64 )
macos(amd64)
1、简介
项目:https://github.com/libsgh/PanIndex
文档:https://libsgh.github.io/PanIndex/
v2.0.2: Merge pull request #48 from libsgh/dev
@libsgh libsgh released this 2 days ago**
支持阿里云盘
解决天翼云打包下载失败的问题
本地模式支持文件夹打包下载
支持下载链接一键复制
mdui增加主题切换按钮,可自由切换暗黑明亮模式,更加灵活
天翼云下载异常处理,避免内存溢出
支持全局(账号内)搜索文件(夹)
支持配置SSL证书,配置参数
支持指定data存储路径,默认为程序同级data下,配置参数
系统配置-支持自定义网站图标favicon.ico
解决跳转导航目录盘符丢失问题
2、准备
宝塔面板
Nginx1.19
Supervisor管理器(软件商店中自行搜索安装)
3、部署1
1)下载程序,这里测试的系统是centos8 64位,所以我们选择这个版本下载,其他根据自己的系统选择。
程序下载:
https://github.com/libsgh/PanIndex/releases/download/v2.0.4/PanIndex-v2.0.4-linux-amd64.tar.gz
2)下载后解压,额,默认下载到了root目录,这个可以自行调整。解压就在宝塔面板里解压吧。你也可以用命令如下:
tar -xvf PanIndex-v2.0.4-linux-amd64.tar.gz
注意: v2.0.2版 不需要配置config.json文件
现在只需要在后台地址:http://ip:port/?admin 直接配置即可
直接运行
启动参数
-host=0.0.0.0 #绑定host,默认0.0.0.0
-port=5238 #绑定端口号,默认5238
-debug=false #调试模式,默认false
-data_path=/path/to/data #数据目录(配置、目录信息、临时文件目录)
-cert_file=/path/to/fullchain.pem # 开启ssl,证书文件
-key_file=/path/to/privkey.pem # 开启ssl,证书文件密钥
$ tar -xvf PanIndex-v2.0.4-linux-amd64.tar.gz
#nohup ./PanIndex -host=0.0.0.0 -port=5238 -debug=false > PanIndex.log &
$ nohup ./PanIndex > PanIndex.log &
3)配置config.json文件,在你的程序根目录找到这个文件开始配置。(以下是1.0.6版配置)
注意:
mode:网盘选择,默认是cloud189,如果是阿里teambition,那么就改成teambition即可。
user:天翼的账号
password:天翼网盘的登录密码
{
"host": "0.0.0.0",
"port": 5238
"mode": "cloud189",
"user": "189xxxx5460",
"password": "xxxx",
"root_id": "-11",
"pwd_dir_id": [
{
"id": "51496311321353335",
"pwd": "1234"
}
],
"hide_file_id": "",
"heroku_app_url":"https://pan-index.herokuapp.com",
"api_token": "1234",
"theme": "boot",
"damagou": {
"username":"",
"password":""
},
"only_Referer": [],
"cron_exps": {
"refresh_cookie": "0 0 8 1/1 * ?",
"update_folder_cache": "0 0 0/1 * * ?",
"heroku_keep_alive": "0 0/5 * * * ?"
}
}
4)配置Supervisor管理器,添加进程守护,具体看图:

注意:
名称:随意
运行目录:这里是放在里root目录
启动命令:
nohup ./PanIndex > PanIndex.log &
或者
nohup ./PanIndex -debug=false >PanIndex.log &
5)浏览器访问 :ip:5238 即可看到效果,如果打不开,需要在安全中放行8000端口。

注意: v2.0.1版 不需要配置config.json文件
现在只需要在后台地址:http://ip:port/?admin 直接配置即可
4、部署2 (以下是1.0.6版配置)
部署阿里teambition的网盘~~
1)直接配置config.json文件
{
"host": "0.0.0.0",
"port": 5238
"mode": "teambition",
"user": "189xxx5460",
"password": "xxxx",
"root_id": "5fe14988401ce25551c525551e3",
"pwd_dir_id": [
{
"id": "51496311321353335",
"pwd": "1234"
}
],
"hide_file_id": "",
"heroku_app_url":"https://pan-index.herokuapp.com",
"api_token": "1234",
"theme": "boot",
"damagou": {
"username":"",
"password":""
},
"only_Referer": [],
"cron_exps": {
"refresh_cookie": "0 0 8 1/1 * ?",
"update_folder_cache": "0 0 0/1 * * ?",
"heroku_keep_alive": "0 0/5 * * * ?"
}
}
heroku安装
注册登录账号并绑卡,因为herokuku免费版有使用小时数限制,绑定信用卡可以使应用一直在线,不扣费
点击↓按钮跳转到heroku部署页面,修改 CONFIG

点击 Deploy app 完成部署
docker安装
参考下面命令,需要注意配置依靠环境变量,与配置文件的格式稍有不同,加密文件夹格式为id:1234;id2:2345。环境变量配置优先级高于config.json的配置。也可以挂载容器内的/app目录,在宿主机自定义config.json,data目录中是数据库文件
docker pull iicm/pan-index:latest
docker stop PanIndex
docker rm PanIndex
docker run -itd \
--restart=always \
--name PanIndex \
-p 5238:5238 \
-v /home/single/data/docker/data/PanIndex/data:/app/data \
-e PORT="5238" \
iicm/pan-index:latest
从源码运行
安装git和golang 设置go环境变量go env -w GO111MODULE=on 如果是国内服务器,设置下代理go env -w GOPROXY=https://goproxy.cn,direct 从源码直接运行
$ git clone https://github.com/libsgh/PanIndex.git
$ cd PanIndex
$ nohup go run main.go > PanIndex.log &
也可以下载源码后自行编译成二进制程序再执行 以linux,amd64为例
$ CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -o PanIndex
$ nohup ./PanIndex &
定时任务
cookie刷新 0 0 4 1/1 * ?
目录缓存刷新 0 0 0/1 * * ?
heroku防止休眠 0 0/5 * * * ?
7、最后
以上是简单的利用panindex搭建天翼和teambition的列表目录的教程,具体修改还需要参考作者的文档教程。
https://libsgh.github.io/PanIndex
转载请注明:PanIndex v2.4 – 支持天翼云,阿里云盘,OneDrive-目录列表程序-宝塔面板安装 | 轻谈浅唱 – Mi导航