其他技術 ---- Cloudreve 個人公,私有網盤搭建

Cloudreve 個人公,私有網盤搭建

環境

Golang version = 1.13

yum install golang

MySQL version >= 5.7

安裝

安裝之前需要有golang 的環境,這裏不討論sqllite 的方式

下載安裝文件

Releases · cloudreve/Cloudreve (github.com)

去上面下載地址下載對應版本,這裏我選擇的是amd64 這個版本。

解壓安裝文件

#解壓獲取到的主程序
tar -zxvf cloudreve_VERSION_OS_ARCH.tar.gz

# 賦予執行權限
chmod +x ./cloudreve

添加配置文件

創建一個conf.ini 的配置文件

nano /home/cloud/config.conf

編寫配置文件

  1. 使用MySQL
[Database]
; 數據庫類型,目前支持 sqlite/mysql/mssql/postgres
Type = mysql
; MySQL 端口
Port = 3306
; 用戶名
User = root
; 密碼
Password = root
; 數據庫地址
Host = 127.0.0.1
; 數據庫名稱
Name = v3
; 數據表前綴
TablePrefix = cd
; 字符集
Charset = utf8
  1. 使用redis
[Redis]
Server = 127.0.0.1:6379
Password = your password
DB = 0
  1. 啓用https
[SSL]
Listen = :443
CertPath = /home/fullchain.pem
KeyPath = /home/privkey.pem

首次啓動

使用MySQL 方式啓動,配置完成後第一次啓動會有一個管理員賬號,密碼

cloudreve -c /home/cloud/config.conf

此時會有一個初始的管理員賬號密碼,最好記錄下來。

開放5212端口,此時就可以訪問了。

登錄後第一次最好修改管理員密碼。

配置開機自啓動

  • 創建工作目錄

mkdir /home/cloud

  • 編輯 /usr/lib/systemd/system/cloudreve.service
[Unit]
Description=Cloudreve
Documentation=https://docs.cloudreve.org
After=network.target
Wants=network.target

[Service]
# cloudreve 文件的存放路徑,跟上面的一樣,請根據自己的情況設置,默認儲存策略的文件會儲存在其中
WorkingDirectory=/home/cloudreve

# 如果你是mysql,請使用這個
ExecStart=/home/cloud/cloudreve -c /home/cloud/config.conf

Restart=on-abnormal
RestartSec=5s
KillMode=mixed

StandardOutput=null
StandardError=syslog

[Install]
WantedBy=multi-user.target
  • 更新systemctl systemctl daemon-reload
# 更新配置
systemctl daemon-reload

# 啓動服務
systemctl start cloudreve

# 設置開機啓動
systemctl enable cloudreve

# 取消開機啓動
systemctl disable cloudreve

#查看cloudreve的運行狀態
systemctl status cloudreve

安裝離線下載Aria2

Aria2一鍵安裝管理腳本(可用於Cloudreve網盤離線下載) - 清酒踏月 (lkxin.cn)

wget -N --no-check-certificate https://www.lkxin.cn/Aria2/aria2.sh && chmod +x aria2.sh && bash aria2.sh

配置離線下載

進入管理面板>離線下載節點>編輯

image

image

配置RPC 服務器地址,授權令牌,臨時下載絕對路徑

授權令牌需要查看aria2 的配置文件/usr/local/caddy/www/aria2/Download

image

最後記得測試aria2通信

以上安裝就完成了

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章