美文网首页
使用 Docker 镜像安装 Radicale3

使用 Docker 镜像安装 Radicale3

作者: 火锅加零度 | 来源:发表于2021-03-30 12:59 被阅读0次
    1. 安装 Docker 环境

    2. 下载 Radicale 镜像

    docker pull cnkmmk/radicale:3.0.6-r0
    
    1. 配置文件的准备

    一共3个配置文件,config, users, rights
    users 为用户帐号记录,我使用的是MD5,生成可以直接使用 htpasswd 在线工具 https://tool.oschina.net/htpasswd,一个用户一行,格式为:username:password

    mkdir -p /home/radicale/{etc,collections}
    
    echo 'username:$apr1$OcPL.lFw$KBVFjrNTksW0exp5TeKjj.' > /home/radicale/etc/users
    
    cat << EOF > /home/radicale/etc/config
    [server]
    hosts = 0.0.0.0:5232
    
    [encoding]
    request = utf-8
    stock = utf-8
    
    [auth]
    type = htpasswd
    htpasswd_filename = /etc/radicale/users
    htpasswd_encryption = md5
    
    [rights]
    type = from_file
    file = /etc/radicale/rights
    
    [storage]
    filesystem_folder = /var/lib/radicale/collections
    EOF
    
    cat << EOF > /home/radicale/etc/rights
    [root]
    user: .+
    collection:
    permissions: R
    
    [principal]
    user: .+
    collection: {user}
    permissions: RW
    
    [calendars]
    user: .+
    collection: {user}/[^/]+
    permissions: rw
    EOF
    
    1. 启动容器
    docker run -itd --name Radicale -v /home/radicale/etc:/etc/radicale -v /home/radicale/collections:/var/lib/radicale/collections -p 5232:5232 --restart=always  cnkmmk/radicale:3.0.6-r0
    

    相关文章

      网友评论

          本文标题:使用 Docker 镜像安装 Radicale3

          本文链接:https://www.haomeiwen.com/subject/uiawhltx.html