挂载NFS网盘
参见上一篇
前情
之前是使用CloudReve作为网盘服务器的,试用了一下Alist,发现挺好用的,替换。
安装
cd /opt/
curl -O 'https://cdn.dongpo.li/static/alist-linux-amd64.tar.gz'
mkdir alist-linux-amd64
tar -zxvf alist-linux-amd64.tar.gz
mv alist alist-linux-amd64
./alist server
以上第一次启动之后,控制台会打印admin的密码,记录,之后不会展示了。
安装服务&开启启动
touch /etc/systemd/system/alist.service
vim /etc/systemd/system/alist.service
systemctl enable alist
systemctl start alist
systemctl status alist
[Unit]
Description = Alist
After = network.target
[Service]
User=root
WorkingDirectory = /opt/alist-linux-amd64/
ExecStart = /opt/alist-linux-amd64/alist server
Restart = on-abnormal
RestartSec = 5s
KillMode = mixed
StandardOutput = null
StandardError = syslog
[Install]
WantedBy = multi-user.target
内网穿透端口
[alist]
type = tcp
local_ip = 127.0.0.1
local_port = 5244
remote_port = 5244
内网穿透服务器配置
主要是Nginx配置
touch /etc/nginx/conf.d/alist.sketcherly.xyz.conf
vim /etc/nginx/conf.d/alist.sketcherly.xyz.conf
upstream alist.sketcherly.xyz.upstream {
server localhost:5244 weight=1 max_fails=3 fail_timeout=10s;
}
server {
listen 443 ssl;
server_name alist.sketcherly.xyz;
#填写证书文件名称
ssl_certificate /etc/nginx/conf.d/cert/sketcherly.xyz.crt;
#填写证书私钥文件名称··
ssl_certificate_key /etc/nginx/conf.d/cert/sketcherly.xyz.key;
ssl_session_timeout 5m;
#表示使用的加密套件的类型
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
#表示使用的TLS协议的类型,您需要自行评估是否配置TLSv1.1协议。
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
location / {
proxy_pass http://alist.sketcherly.xyz.upstream/;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_max_temp_file_size 0;
client_max_body_size 1024g;
proxy_redirect off;
proxy_read_timeout 240s;
}
}
域名映射
略。。
配置存储
登上alist后台,账号 admin,密码:刚才控制台输出的密码
管理(在footer)-> 存储 -> 添加
主要修改
驱动 本机存储
挂载路径 /
根文件夹路径 /data/user1/
保存