Home Login

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:
  1. Click Manage
  2. Click Storage
  3. Click Add
  4. Choose Local
  5. Mount Path: /pi
  6. Root folder path: /boot
  7. Root folder path: /boot
  8. 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.
  1. First mount(remember to disable 2FA)
  2. sudo apt install davfs2
    sudo mount -t davfs http://192.168.86.112:5244/dav/ /mnt
    
  3. Then copy by file
  4. 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