无神通 大佬有话说 :
写了一个网盘程序,代替 ys168
ys168 懂的都懂,可惜市面上没有找到差不多的网盘程序,自己用 Python 写了个,演示地址:
网址:141.94.115.2
密码:poiuytrewq
1C1G 50G 硬盘 50M 的小水管凑合用下,过两天就改密码了,以下为源码及安装指南。
安装要求:
Python >= 3.9,目前主流发行版应该只有 Debian11 能满足吧,更低 Python 版本懒得兼容了。
Nginx,版本没有特别要求,但因为用到了 X-Accel-Redirect,必须要使用 Nginx,当然你也可以自己兼容其他程序。
安装步骤:
以下安装步骤基于 Debian11 全程使用 Root 用户。
1. 创建文件夹,下载源码或者复制粘贴到 addfile.py 文件,这里直接下载
mkdir /opt/addfile
cd /opt/addfile
wget http://141.94.115.2/addfile.py
2. 编辑 addfile.py(可选步骤)
ROOT = Path(‘/home/wwwroot/default’)
PASSWORD = ‘poiuytrewq’
将文件开头这两行换成你自己想要的目录和密码。
3. 安装依赖
apt install python3-pip
pip3 install index.py jinja2 uvicorn gunicorn
4. 创建专用用户和用户组
groupadd addfile
useradd -s /sbin/nologin -M -g addfile addfile
修改目录拥有者,不然无**常读写文件,记得对应你上面的程序和数据目录。
chown -R addfile:addfile /opt/addfile
chown -R addfile:addfile /home/wwwroot/default
5. 创建并写入 /etc/systemd/system/addfile.service
Description=addfile daemon
After=network.target
Type=notify
User=addfile
Group=addfile
RuntimeDirectory=addfile
WorkingDirectory=/opt/addfile
ExecStart=/usr/local/bin/gunicorn -k uvicorn.workers.UvicornWorker addfile:app
ExecReload=/bin/kill -s HUP $MAINPID
KillMode=mixed
TimeoutStopSec=5
PrivateTmp=true
WantedBy=multi-user.target
写入完毕后就可以启动了
systemctl start addfile
systemctl enable addfile
6. 配置 Nginx 文件
location /
{
proxy_pass http://127.0.0.1:8000;
}
location /__x__/
{
internal;
alias /home/wwwroot/default/;
}
关键的就这两行,重载配置就好了
nginx -s reload
aipage 大佬有话说 :
绑定,这是小鸡上的盘?
无神通 大佬有话说 :
aipage 大佬有话说 : 2021-12-30 20:08
绑定,这是小鸡上的盘?
小鸡上的,只能用本地文件
你是个好人 大佬有话说 :
413 Request Entity Too Large
nginx yc021t
aipage 大佬有话说 :
哈哈,赶紧关了。你看MJJ都传了啥上去。yc014t
AaronYYDS 大佬有话说 :
不能放歌曲
gr58046576 大佬有话说 :
能实现跟ys168一样吗?无限开分盘https://cdn.jsdelivr.net/gh/master-of-forums/master-of-forums/public/images/patch.gif
无神通 大佬有话说 :
你是个好人 大佬有话说 : 2021-12-30 20:11
nginx 限制了 50M,这个自己部署的时候改下就行了
小便超人 大佬有话说 :
我登录了怎么还无法下载。
kylehao 大佬有话说 :
能支持onedrive么