[新服务] pcloud+rclone+dufs实现pcloud 2fa和webdav共存

date
Feb 14, 2023
slug
newservice-
status
Published
summary
新服务-
tags
service
type
Post
URL

Summary

  • because pcloud doesn’t support webdav when 2fa is enabled
  • so solve it with rclone+dufs

步骤

rclone to mount pcloud to local folder

apt update -y && sleep 1; apt upgrade -y && apt autoremove -y
curl https://rclone.org/install.sh | sudo bash
rclone config

# 中间某一步骤需要在你本地的机器上运行这个命令进行授权,然后把成功后获得的一串token放入到配置当中
rclone authorize "pcloud" "eyJob3N0bC5jb20ifQ"

# mount

drivename='pcloud'
targetloc="/drive/${drivename}"
mkdir -p ${targetloc} && ln -s ${targetloc} ~/${drivename}
cat > /etc/systemd/system/rclone_${drivename}.service <<EOF
[Unit]
Description=rclone_${drivename}

[Service]
User=root
# mount root folder of remote drive
# 根据磁盘大小设定 cache size (--vfs-cache-max-size 6G --vfs-cache-max-age 6h) 也可以只设定 max-age
# 如果用于bt下载和小硬盘的话, 建议比如Aria2当中concurrent download 变成12

# 本地硬盘如果够大的话
ExecStart=/usr/bin/rclone mount ${drivename}: ${targetloc} --copy-links --no-gzip-encoding --no-check-certificate --allow-other --allow-non-empty --umask 000 --vfs-cache-mode writes --vfs-cache-max-size 24G --vfs-cache-max-age 24h --vfs-read-chunk-size 64M --daemon-timeout 30m

[Install]
WantedBy=multi-user.target
EOF

systemctl daemon-reload
systemctl start rclone_${drivename}
systemctl enable rclone_${drivename}

rclone about pcloud:
notion image
notion image
notion image
 
notion image

dufs to create a new webdav service

export DOCKER_PROJ=dufs
#export DOCKER_PORT=18870
mkdir -p /data/$DOCKER_PROJ/data; cd /data/$DOCKER_PROJ

ln -s /drive/pcloud ./data/drive_pcloud_dav

cat > docker-compose.yml <<EOF
version: '3'
services:
  dufs:
    image: sigoden/dufs
    volumes:
      - ./data:/data
      # follow symlink to folders outside
      - ./data/drive_pcloud_dav:/data/drive_pcloud_dav
    #ports:
    #  - 5000:5000
    command: /data -A --auth /@Your-Username:Your-Password
    tty: true
    stdin_open: true
    restart: always
networks:
  default:
    name: npm_nginx_proxy_manager-network
    external: true
EOF
docker-compose down; docker-compose up -d; sleep 1s; docker-compose logs -f

cloudflare + npm

notion image
notion image

synology to use cloudsync to backup to

or access domain set up through cloudflare
notion image
notion image

验证


© Ying Bun 2021 - 2024