Day 8: Self hosted cloud storage for photos ith immich on Raspberry Pi 5
Start server
BOOK=/ssd/share/book
cat < docker-compose.yaml <<EOF
services:
alist:
image: 'xhofe/alist:latest'
container_name: alist
volumes:
- ../data/alist:/opt/alist/data
- /ssd/share/book:/book:ro
network_mode: 'host'
environment:
- PUID=0
- PGID=0
- UMASK=022
restart: unless-stopped
EOF
docker compose up -d
docker exec -it alist ./alist admin set changeme
Access website
The job is running, now you can login from the browser, http://raspberrypi.local:5244 with
username: admin
password: changeme
To add the book folder:
- Click Manage
- Click Storage
- Click Add
- Choose Local
- Mount Path: /pi
- Root folder path: /boot
- Root folder path: /boot
- Click Save
Access using Boox
You can also access from Boox reader, using webdav feature. The url of server is: http://raspberrypi.local:5244/dav/
Download using aria2
Copy between cloud storage
You can copy folder from one cloud to another, but sometimes it gets stuck, then mount davfs will work.
- First mount(remember to disable 2FA)
sudo apt install davfs2
sudo mount -t davfs http://192.168.86.112:5244/dav/ /mnt
- Then copy by file
cat clone
#!/bin/bash
set -x
SRC=/home/pi/data/google
DEST=/home/pi/data/aliyun
SRC_FOLDER=/mnt/google/全部媒体
DEST_FOLDER=/mnt/aliyun/全部媒体
#cat $SRC | while read -r file
IFS=$'\n'
i=0
for file in $(cat $SRC)
do
FOUND=$(grep -e "^$file$" $DEST|wc -l)
if [[ $FOUND -gt 0 ]]; then
echo "$file already downloaded"
else
echo cp "$SRC_FOLDER/$file" "$DEST_FOLDER/$file"
i=$((i+1))
if [[ $((i%100)) -eq 0 ]];then
read -p "please enter to continue"
fi
cp "$SRC_FOLDER/$file" "$DEST_FOLDER/$file"
fi
done
sudo bash clone
Next: Day 9