有时在陌生电脑或急用时,我们往往没有足够的时间登录网盘,而一个网盘列表程序可以很好的解决这个问题,并且可以方便的和他人共享。
PanIndex
下载
从 Github-release
中找到相应平台的安装包,下载并解压到服务器某目录,例如我的为 /www/wwwroot/drive
,在该目录下的主程序重命名为 PanIndex-main
。
随后在该目录下新建 config.json
,以下是一个示例:
{
"host": "0.0.0.0",
"port": 运行的端口,默认为5238,
"log_level": "一般为info或debug",
"data_path": "/www/wwwroot/drive/data",
"cert_file": "",
"key_file": "",
"config_query": "",
"db_type": "sqlite",
"dsn": "/www/wwwroot/drive/data/data.db"
}
运行
这里通过systemd方法运行。在 /etc/systemd/system
文件夹中新建一个 PanIndex.service
文件,内容示例:
[Unit]
Description=PanIndex Service
Documentation=https://libsgh.github.io/PanIndex/
After=network.target
[Service]
User=root
WorkingDirectory=/www/wwwroot/drive
ExecStart=/www/wwwroot/drive/PanIndex-main -c=/www/wwwroot/drive/config.json
Restart=on-failure
RestartPreventExitStatus=23
LimitNPROC=10000
LimitNOFILE=1000000
[Install]
WantedBy=multi-user.target
最后,配置Nginx反代你所设置的端口即可正常访问。
挂载
按照 https://pt.noki.icu/ 教程操作即可。