Twitterï¼ä¸çæå¾ã®ä¸äººã«ãªãã¾ã§ãã®ååã§å¼ã³ç¶ããï¼ã§ãã¯ã¡ãã£ã¨åã«æ¸ãããæè¿çµå©ãããã¨ãªãã¨å®¶æéã§äºå®è¡¨ãå ±æãããã¨ããé¡æãåºã¦ããããã¡ããiCloudã®ã«ã¬ã³ãã¼ãäºå®è¡¨å ±æãµã¼ãã¹ã¯ãããããã¯ã©ã¦ããªã©ã¨ãããã®ã¯ãªããåãªãä»äººã®ã³ã³ãã¥ã¼ã¿ã ãã¨ããã¢ããã¼ãæ²ãã¦ããã®ã§åºæ¥ãã°èªåã§ãµã¼ããç«ã¡ä¸ããããã¤ãã§ã«ä½ã£ã¦ãRaspberryPiã®ä½¿ãéã«ããªãããã
ã¨è¨ãããã§ãã©ãã®ã家åºã§ãä½ã£ã¦ãRaspberryPiã«CalDAVãµã¼ãã§ããRadicaleãã¤ã³ã¹ãã¼ã«ãã¦ã»ã«ããã¹ãã£ã³ã°ãCloudflaredã使ã£ã¦èª°ã§ã1ã¤ã¯æã£ã¦ããç¬èªãã¡ã¤ã³ããã¢ã¯ã»ã¹ã§ããããã«ããã
"docker Radicale"ã§æ¤ç´¢ãã¦åºã¦ããQiitaã®è¨äºã®ã¯ãã¼ã¸ã§ã³ã¢ããããã¦ãªãã®ã§ä½¿ããªããdockerã¯ã¤ã³ã¹ãã¼ã«ããã¦ãããã®ã¨ãã¦è©±ãé²ããã
ä»å使ãã®ã¯ããã
https://hub.docker.com/r/tomsquest/docker-radicale/
横ã«ãããã¨ãããä¸è¨ã®ã³ãã³ãã§dockerhubããpullããã
docker pull tomsquest/docker-radicale
Radicaleç¨ã®ãã£ã¬ã¯ããªãä½ã£ã¦ãã®ä¸ã«configãã£ã¬ã¯ããªã¨dataãã£ã¬ã¯ããªãä½ããããã«èµ·åç¨ã®docker-compose.ymlãä½æãä¸è¨ã®ãµã¤ãã§ã¯ãªãããªã³ã¯ãåãã¦ããã®ã§ãgithubããç´æ¥æ¾ã£ã¦ããã
mkdir radicale-docker cd ./radicale-docker/ mkdir data mkdir config wget https://raw.githubusercontent.com/tomsquest/docker-radicale/refs/heads/master/docker-compose.yml
github.comãããå ã«å°ã å¼ã£ã¦ãããã¾ããã¼ãã¯127.0.0.1ãã0.0.0.0ã«ï¼ãã®å¤æ´ãããªãã¨ãã¼ã«ã«ãã¹ã以å¤ããã¢ã¯ã»ã¹ã§ããªãï¼ãã¾ãRaspberryPiã®ç°å¢ã§ã¯ãªã½ã¼ã¹å¶éå¨ããåããªãï¼ã³ã³ããèªä½ã¯åããèµ·åæã«ã¢ã©ã¼ããåºãï¼ã®ã¨ã30ç§ãã¨ã«æ»æ´»ç£è¦ãããã¨ãã°ãåã¾ãã®ã§ã³ã¡ã³ãã¢ã¦ããããã¾ããè¨å®ãã¡ã¤ã«ãèªè¨¼ãã¡ã¤ã«ãå ¥ããconfigãã£ã¬ã¯ããªãããªã¥ã¼ã ã«ãã¦ã³ãããããå¤æ´ããdocker-compose.ymlã以ä¸ã®éãã
services: radicale: image: tomsquest/docker-radicale container_name: radicale ports: - 0.0.0.0:5232:5232 init: true read_only: true security_opt: - no-new-privileges:true cap_drop: - ALL cap_add: - SETUID - SETGID - CHOWN - KILL # deploy: # resources: # limits: # memory: 256M # pids: 50 #healthcheck: # test: curl -f http://127.0.0.1:5232 || exit 1 # interval: 30s # retries: 3 restart: unless-stopped volumes: - ./data:/data - ./config/:/config
ãã¨ã¯ã³ã³ãã£ã°ã¨ã¦ã¼ã¶èªè¨¼å¨ããè¡ãã°ãããã¦ã¼ã¶èªè¨¼ã®ãã¹ããã©ã¯ãã£ã¹ã¯bcryptã§ããããããã©ã«ãã®python3ã ã¨å¥ã«ããã±ã¼ã¸ãå¿ è¦ãªã®ã§æ¬¡åçã¨ãã¦ã½ã«ãä»ãSHA-512ãé¸ã¶ãconfigãã£ã¬ã¯ããªã«ç§»åããconfigãã¡ã¤ã«ãä½æããã
cd config sudo vim config
å 容ã¯ä¸è¨ã®éããserverã®hostsãªãã·ã§ã³ã§0.0.0.0ãæå®ãããã¨ã«ããããã¼ã«ã«ãã¹ã以å¤ããã®ã¢ã¯ã»ã¹ã許å¯ãããauthã¯ãã¹ã¯ã¼ãã®å½¢å¼ã¨ä¿åå ´æãstorageã¯ãã¼ã¿ã®ä¿åå ´æã®æå®ã
[server] hosts = 0.0.0.0:5232 [auth] type = htpasswd htpasswd_filename = /config/users htpasswd_encryption = sha512 [storage] filesystem_folder = /data/collections
次ã«ã¦ã¼ã¶èªè¨¼ã§ãããä¸ã«è¨å®ããã¨ãããhtpasswdå½¢å¼ã®usersã¨ãããã¡ã¤ã«ããã®ãã£ã¬ã¯ããªã«ä½ããããããApacheãã¤ã³ã¹ãã¼ã«ããã®ãé¢åã ãããã¨è¨ã£ã¦æ¤ç´¢ããã¨åºã¦ãããªã³ã©ã¤ã³ã®htpasswdãã¡ã¤ã«ä½æãã¼ã¸ã使ãã®ãæªããã®ã§ãããã©ã«ãã§å ¥ã£ã¦ããopensslã使ãããã½ã«ããä¹±æ°çæã³ãã³ãã使ãã°èªåã§ä½ããã¨ãåºæ¥ãã
echo "USER:$(openssl passwd -6 -salt $(openssl rand -base64 6) PASSWORD)" > users
ãã®ã³ãã³ãã®USERã¨PASSWORDãé©å½ã«è¨å®ãã¦ããã°è¯ãããªããå½ç¶ãã®ã³ãã³ãã¯å¹³æã®ãã¹ã¯ã¼ããå«ãã ã¾ã¾.bash_historyã«ãã®ã¾ã¾æ®ãã®ã§ã¡ããã¨åé¤ãã¦ç½®ããã¨ã
ããã§ã¯radicaleãã£ã¬ã¯ããªã«æ»ã£ã¦docker-compose.ymlãèµ·åãã¦ããã
cd /home/pi/radicale-docker/ sudo docker compose up -d
æ£å¸¸ã«åãã¦ãããè¦ã¦ã¿ãã
docker ps -a
çµäºããããã°ä¸è¨ã³ãã³ããæ示ããã
sudo docker compose down
ããã§åä½ãã¦ããã³ã³ãããä¸è¦§è¡¨ç¤ºããããåé¡ãããã°ããããããã¨ãæ¸ãã¦ããã¯ãã ãåé¡ãç¡ããã°æ¯è¦PCãã192.168.11.4:5323ã¸ã¢ã¯ã»ã¹ããã¨ä¸ã«ç¤ºããããªãã°ã¤ã³ãã¼ã¸ãéãã
ããã«ä¸ã§è¨å®ããã¦ã¼ã¶åã¨ãã¹ã¯ã¼ããå ¥åããã°ãã°ã¤ã³ã§ãããæåã®ç¶æ ã§ã¯ä½ããªãã®ã§ãå³ä¸ã®ï¼ãã¿ã³ãæ¼ãã¦æ°è¦ã«ã«ã¬ã³ãã¼ãä½æããã
ããã§ãµã¼ãå´ã®è¨å®ã¯çµããããã®ã¾ã¾ã«ã¼ã¿ãå¼ã£ã¦ãã¼ãã空ãã¦ãããçããã°å¤é¨ãããç¹ããããåè¿°ã®éãCloudflaredã使ã£ã¦ä¿æãããã¡ã¤ã³åããç°¡åã«ã¢ã¯ã»ã¹ããããã«åºæ¥ãã®ã§æ¬¡ã®è¨äºã§ãããç´¹ä»ãããã