安装
pip3 install radicale
配置文件
/etc/radicale/config
[server]
#服务器配置选项(IPv4 和 IPv6)进行更改
hosts = 0.0.0.0:5232
#设置https访问,注意证书是nginx下的
ssl = True
certificate = /etc/nginx/cert/1_xxxxxx.com_bundle.crt
key = /etc/nginx/cert/2_xxxxxx.com.key
#最大并发数
max_connections = 20
# 最大文件100 Megabyte
max_content_length = 100000000
# 30 seconds
timeout = 30
[storage]
#数据存储在文件夹中
filesystem_folder = /usr/radicale/collections
[auth]
type = htpasswd
htpasswd_filename = /etc/radicale/users
# encryption method used in the htpasswd file
htpasswd_encryption = plain
# 密码输入错误延迟(秒)
delay = 120
/etc/radicale/users
zhangsan:password1
lisi:password2
配置作为服务运行
建立用户和组
useradd --system --user-group --home-dir / --shell /sbin/nologin radicale
创建目录并赋权
mkdir -p /usr/radicale/collections && chown -R radicale:radicale /usr/radicale/collections
创建配置文件
/etc/systemd/system/radicale.service
[Unit]
Description=A simple CalDAV (calendar) and CardDAV (contact) server
After=network.target
Requires=network.target
[Service]
ExecStart=/usr/bin/env python3 -m radicale
Restart=on-failure
User=radicale
# Deny other users access to the calendar data
UMask=0027
# Optional security settings
PrivateTmp=true
ProtectSystem=strict
ProtectHome=true
PrivateDevices=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectControlGroups=true
NoNewPrivileges=true
ReadWritePaths=/var/lib/radicale/collections
[Install]
WantedBy=multi-user.target
服务命令
# Enable the service
$ systemctl enable radicale
# Start the service
$ systemctl start radicale
# Check the status of the service
$ systemctl status radicale
# View all log messages
$ journalctl --unit radicale.service
网友评论