Radicale 是一款简单、可靠的日历服务器

Radicale 是一款简单、可靠的日历服务器

我需要在我的服务器上安装一个简单(可靠)的日历服务器,最好与我已经使用的 Mozilla Thunderbird 电子邮件客户端集成。

还有 Android 客户端吗?

答案1

Radicale 是一款简单、可靠的日历服务器

摘自https://github.com/Kozea/Radicale/wiki/Simple-installation

安装简单

##### Install dependencies for Radicale
ServerUSER@Server:~$ sudo apt-get install python3-pip
##### Install dependencies for bcrypt encryption method
ServerUSER@Server:~$ sudo python3 -m pip install --upgrade passlib bcrypt
##### -H flag uses root's home rather than USER's home
ServerUSER@Server:~$ sudo -H python3 -m pip install --upgrade radicale

配置简单

##### Put user "fakeuser" in a new "users" file
ServerUSER@SERVER:~$ sudo htpasswd -B -c /etc/radicale/users fakeuser
New password:
Re-type new password:
##### Add another user
ServerUSER@SERVER:~$ sudo htpasswd -B /etc/radicale/users user2
New password:
Re-type new password:
##### Install dependencies for bcrypt encryption method
ServerUSER@SERVER:~$ sudo python3 -m pip install --upgrade passlib bcrypt

编辑配置文件

ServerUSER@SERVER:~$ sudo nano /etc/radicale/config

告诉 Radicale 在哪里可以找到用户

##### Add these lines under relevant portions of [auth] section
type = htpasswd
htpasswd_filename = /etc/radicale/users
# encryption method used in the htpasswd file
htpasswd_encryption = bcrypt

添加一些安全限制

##### Add these lines under relevant portions of [server] section
max_connections = 20
# 1 Megabyte
max_content_length = 10000000
# 10 seconds
timeout = 10

##### Add these lines under relevant portions of [auth] section
# Average delay after failed login attempts in seconds
delay = 1

编辑文件以允许来自其他机器的 SSL/TLS 连接

##### Add these lines under relevant portions of [server] section
hosts = 0.0.0.0:5232
##### By setting ssl = True, Radicale no longer responds to HTTP requests.
ssl = True
certificate = /etc/ssl/radicale.cert.pem
key = /etc/ssl/radicale.key.pem

SSL/TLS 密钥

制作自签名 SSL/TLS 证书,以允许 HTTPS 连接到服务器上的 Radical 服务

##### You can hit enter as an answer to all the questions to set the default except this one: 
##### "Common Name (eg, YOUR name) []:" where you will enter your domain name or dns record 
##### used for your development server, or in case of wildcard certificates, 
##### use an astrisk, like this: *.mycompany.com 
##### By using a self-signed certificate, your browser should warn you of this fact.
##### Confirm exception as you wish, but this exception is necessary to visit page.
ServerUSER@Server:~$ openssl req -nodes -newkey rsa:2048 -keyout /etc/ssl/radicale.key.pem -out /etc/ssl/radicale.cert.pem -x509 -days 365

Common Name (eg, YOUR name) []: developmentserver12345

激进服务

在服务器上设置服务以允许 Radicale 一直在后台运行

##### Create "radicale" user and group for Radicale service
ServerUSER@Server:~$ sudo useradd --system --home-dir / --shell /sbin/nologin radicale
##### Make storage folder writable by user "radicale"
ServerUSER@Server:~$ sudo mkdir -p /var/lib/radicale/collections
ServerUSER@Server:~$ sudo chown -R radicale:radicale /var/lib/radicale/collections
##### Make storage folder non-readable by others
ServerUSER@Server:~$ sudo chmod -R o= /var/lib/radicale/collections

创建文件 /etc/systemd/system/radicale.service

ServerUSER@Server:~$ sudo nano /etc/systemd/system/radicale.service

将以下内容剪切并粘贴并保存到 /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
ServerUSER@Server:~$ sudo systemctl enable radicale
# Start the service
ServerUSER@Server:~$ sudo systemctl start radicale
# Check the status of the service
ServerUSER@Server:~$ sudo systemctl status radicale
# View all log messages
ServerUSER@Server:~$ sudo journalctl --unit radicale.service

连接到 Thunderbird

在 Thunderbird 中创建新日历(公共 IP 地址服务器)

  • 打开 Thunderbird
    • 点击“事件和任务 > 日历”
    • 单击“文件 > 新建 > 日历”[或右键单击“日历窗格 > 日历列表”区域并选择“新建日历”]
    • 在对话框中选择“在网络上”,点击“下一步”
    • 选择格式和位置并单击“下一步”
    • 输入名称、颜色和 Thunderbird 电子邮件帐户,然后单击“下一步”
      • 名称:TB 到服务器真实激进日历 (TSRRC)
      • 颜色:[您希望用颜色来表示 TSRRC 上的事件]
      • 电子邮件:[默认]
    • 点击“完成”

连接到 Android

在 Android 中创建新日历(公共 IP 地址服务器)

  • 安装 DAVdroid
  • 打开日历
  • 手动尝试刷新新日历几次,检查 Radicale 日志以进行故障排除

答案2

相关内容