我的伺服器上需要一個簡單(可靠)的日曆伺服器,最好與我已經使用的 Mozilla Thunderbird 電子郵件用戶端整合。
還有安卓客戶端嗎?
答案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(公用 IP 位址伺服器)中建立新日曆
- 打開雷鳥
- 點擊“事件和任務 > 日曆”
- 按一下「檔案>新>日曆」[或右鍵點選「日曆窗格>日曆清單」區域並選擇「新日曆」]
- 在對話方塊中選擇“在網路上”,然後按一下“下一步”
- 選擇格式和位置,然後按一下“下一步”
- 格式:CalDAV
- 位置:複製並貼上 fakeusercalDAV01 的 URL(全部)
- 輸入名稱、顏色和 Thunderbird 電子郵件帳戶,然後按一下“下一步”
- 名稱:TB 到伺服器實際根數日曆 (TSRRC)
- 顏色:[您希望在 TSRRC 上指示活動的顏色]
- 電子郵件:[預設]
- 點擊“完成”
連接至安卓
在 Android 中建立新日曆(公用 IP 位址伺服器)
- 安裝 DAVdroid
- 打開日曆
- 在日曆中新增帳戶 [不是 DAVdroid]
- 選擇 DAVdroid 作為帳戶類型
- 使用 URL 和使用者名稱登入
- 點日曆在https://公用IP位址:5232/fakeuser/775e38a1-32eg-9e0x-e3tn-fax92930uskl/
- 使用者名稱: 假用戶
- 密碼:[您提供給 htpasswd 的密碼]
- 手動嘗試刷新新日曆幾次,檢查 Radical 日誌以排除故障