主机论坛

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 184|回复: 8

用兰空图床搭设阿里云盘图床

[复制链接]

66

主题

171

帖子

596

积分

高级会员

Rank: 4

积分
596
发表于 2022-5-3 11:21:04 | 显示全部楼层 |阅读模式
我只是一个自己折腾的小白,大佬要是看到我写的直摇头的话请忽略我的方法

直接在兰空图床上设置阿里云盘webdav的话用不了(可以上传,但是在论坛引用地址的话没图片,这是我试的,其他人直接在兰空设置webdav能直接用的话当我没说,我水平有限),所以先挂载为本地硬盘就行。

一、在服务器上搭设docker版阿里云盘webdav
docker run -d --name=aliyundrive-webdav --restart=unless-stopped -p 8080:8080 \
  -v /etc/aliyundrive-webdav/:/etc/aliyundrive-webdav/ \
  -e REFRESH_TOKEN='your refresh token' \
  -e WEBDAV_AUTH_USER=admin \
  -e WEBDAV_AUTH_PASSWORD=admin \
  messense/aliyundrive-webdav

二、安装rclone
curl https://rclone.org/install.sh | sudo bash

三、配置rclone
root@truenas[~]# rclone config
2022/01/18 14:12:40 NOTICE: Config file "/root/.config/rclone/rclone.conf" not found - using defaults
No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n
name> aliyundriver
Option Storage.
Type of storage to configure.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value.
39 / Uptobox
\ "uptobox"
40 / Webdav
\ "webdav"
41 / Yandex Disk
\ "yandex"
Storage> 40
Option url.
URL of http host to connect to.
E.g. https://example.com.
Enter a string value. Press Enter for the default ("").
url> http://10.0.0.10:8080/ #阿里云盘webdav地址,就是你的服务器的地址+端口
Option vendor.
Name of the Webdav site/service/software you are using.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value.
1 / Nextcloud
\ "nextcloud"
2 / Owncloud
\ "owncloud"
3 / Sharepoint Online, authenticated by Microsoft account
\ "sharepoint"
4 / Sharepoint with NTLM authentication, usually self-hosted or on-premises
\ "sharepoint-ntlm"
5 / Other site/service or software
\ "other"
vendor> 5
Option user.
User name.
In case NTLM authentication is used, the username should be in the format 'Domain\User'.
Enter a string value. Press Enter for the default ("").
user> admin
Option pass.
Password.
Choose an alternative below. Press Enter for the default (n).
y) Yes type in my own password
g) Generate random password
n) No leave this optional password blank (default)
y/g/n> y
Enter the password:
password:      #用户名账号和密码我自己是设置的和webdav一样的,也许可以随便设置,我没尝试
Confirm the password:
password:
Option bearer_token.
Bearer token instead of user/pass (e.g. a Macaroon).
Enter a string value. Press Enter for the default ("").
bearer_token>
Edit advanced config?
y) Yes
n) No (default)
y/n> n
--------------------
[alidriver]
type = webdav
url = http://10.0.0.10:8880/
vendor = other
user = admin
pass = *** ENCRYPTED ***
--------------------
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> y
Current remotes:
Name                 Type
====                 ====
aliyundriver        webdav         #记住你设置的name
e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c)  remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> q

四、挂载
1、建立目录
mkdir /mnt  系统没mnt目录就先建立
mkdir /mnt/aliyundriver一步一步来

2、创建挂载点
rclone mount rclone配置文件name:目录 /mnt/aliyundriver --cache-dir /tmp --allow-other --vfs-cache-mode writes --allow-non-empty &
所以我的是
rclone mount aliyundriver:/ /mnt/aliyundriver --cache-dir /tmp --allow-other --vfs-cache-mode writes --allow-non-empty &

这样就挂载到服务器成为本地硬盘了。

五、nginx设置
编辑/www/server/nginx/conf/nginx.conf文件
server项添加
location /tu {
     root  /mnt/aliyundriver/图床;#定义服务器的默认网站根目录位置  
     index index.html index.php index.htm;#定义首页索引文件的名称  


/tu 是兰空图床访问网址的根路径,根据自己修改,兰空设置与这里一样就行




六、设置兰空图床存储策略





回复

使用道具 举报

690

主题

2375

帖子

6224

积分

论坛元老

Rank: 8Rank: 8

积分
6224
发表于 2022-5-3 11:25:23 | 显示全部楼层
看到这么多字我就知道这篇帖子与我无关了
回复

使用道具 举报

4

主题

167

帖子

584

积分

高级会员

Rank: 4

积分
584
发表于 2022-5-3 11:25:37 | 显示全部楼层
不错,回头试试
回复

使用道具 举报

2

主题

170

帖子

468

积分

中级会员

Rank: 3Rank: 3

积分
468
发表于 2022-5-3 11:34:59 | 显示全部楼层
……
回复

使用道具 举报

193

主题

1211

帖子

3561

积分

论坛元老

Rank: 8Rank: 8

积分
3561
发表于 2022-5-3 11:51:41 | 显示全部楼层
一看就很牛逼。我不会
回复

使用道具 举报

18

主题

408

帖子

1338

积分

金牌会员

Rank: 6Rank: 6

积分
1338
发表于 2022-5-3 12:34:40 | 显示全部楼层
我也不会
回复

使用道具 举报

554

主题

3328

帖子

8614

积分

论坛元老

Rank: 8Rank: 8

积分
8614
发表于 2022-5-3 12:39:45 | 显示全部楼层
我干过 甚至建站都试过 卡的一批 不仅有防盗链而去还封号
回复

使用道具 举报

2

主题

406

帖子

1364

积分

金牌会员

Rank: 6Rank: 6

积分
1364
发表于 2022-5-3 12:59:11 | 显示全部楼层
阿里云盘请求量大了直接封号的
回复

使用道具 举报

77

主题

275

帖子

897

积分

高级会员

Rank: 4

积分
897
发表于 2022-5-3 13:59:48 | 显示全部楼层
不怕封号的嘛
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|主机论坛

GMT+8, 2024-4-24 15:15 , Processed in 0.097561 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表