搭建私人通訊錄/日歷同步服務_使用cardDAV/calDAV服務
轉載注明來源: 本文鏈接 來自osnosn的博客,寫於 2020-02-18.
-
Radicale, Radicale (對carddav支持好)
- radicale 1.x 是PY2的。
- 能用。支持 CardDAV-Sync-free-0.4.5和DAVdroid(DAVx5)2.6.3
- 訪問的時候,比較慢。似乎同一時間只能支持一個IP訪問。
- radicale 2.1.11 是PY3的。
- pip3安裝,總共4個包(radicale,vobject,python-dateutil,six),4個包約占1.5MB
- 速度很快。能用。支持 CardDAV-Sync-free-0.4.5和DAVdroid(DAVx5)2.6.3 (gitlab)
- 支持多用戶(多賬號),多賬號的通訊錄,分別保存在不同目錄中。
- 目錄名都是hash值。
- 通訊錄記錄同步到服務端,一條記錄為一個獨立的vcf文件,且文件名都是hash值。
- contacts目錄下,無 .git 目錄。
- 創建3個配置文件,執行
radicale -C config
即可。 - 另外: OpenWRT-19.07 中也有 radicale2, 版本為 2.1.11, 還有配置界面。
opkg install radicale2 luci-app-radicale2
(沒試,應該是一樣的)
- radicale 1.x 是PY2的。
## config
[server]
hosts = 0.0.0.0:83
daemon = True
max_connections = 20
max_content_length = 10000000
timeout = 30
ssl = False
[auth]
type = htpasswd
# absolute filename. NO relative.
htpasswd_filename = /root/radicale/user
htpasswd_encryption = plain
delay = 1
[storage]
# absolute filename. NO relative.
filesystem_folder = /root/radicale/data
[web]
type = internal
[logging]
debug = True
# relative/absolute filename.
config = log.config
## log.config
[loggers]
keys = root
[handlers]
keys = file
[formatters]
keys = full
[logger_root]
# Change this to DEBUG or INFO for higher verbosity.
level = WARNING
handlers = file
[handler_file]
class = FileHandler
# Specify the output file here. relative/absolute filename.
args = ('mylog.log',)
formatter = full
[formatter_full]
format = %(asctime)s - [%(thread)x] %(levelname)s: %(message)s
## user
test:test
username:passwrod
-
xandikos, xandikos
- 版本 0.1.0
- 沒有配置文件。執行
xandikos -D /root/xandikos/data -l 0.0.0.0 -p 88 --autocreate --dump-dav-xml
log會直接顯示在終端上。 - PY3的包。pip3安裝,總共11個包(xandikos,icalendar,dulwich,defusedxml,jinja2,pytz,python-dateutil,urllib3,certifi,MarkupSafe,six),11個包約占10.7MB
- 本身無賬號認證。需要apache或nginx提供賬號認證。
- 支持 DAVdroid(DAVx5)2.6.3, 不支持CardDAV-Sync-free-0.4.5。
- 目錄名都是hash值。
- 通訊錄記錄同步到服務端,一條記錄為一個獨立的vcf文件,且文件名都是hash值。
- contacts目錄下,有 .git 目錄。
- 當webdav用的話,MKCOL能實際創建目錄(同時創建了.git)。創建的目錄不顯示(易碼中看不到)。不能做純WEBDAV服務用。
-
fennel
- v0.0.1-beta (2019-09-27)
- GO語言的,有binary包下載。
- 用
htpasswd
創建demouser.htpasswd
,寫好配置文件fennel.config.json
於執行文件相同目錄。 - 執行
./fenneld-v0.0.1-beta
# fennel.config.json
{
"log": {
"level": "debug"
},
"www": {
"host": "0.0.0.0",
"port": "83"
},
"auth": {
"module": "htpasswd",
"file": "demouser.htpasswd"
},
"folder": {
"templates": "templates"
},
"db": {
"dialect": "sqlite3",
"args": "fennel.db",
"logmode": "true"
}
}
似乎沒寫完,不知道怎么用。DAVx5連接失敗。說"找不到 calDAV/CardDAV 服務"
-
NextCloud (對carddav支持很好)
- 安裝比較復雜,請看官網的文檔。
- DAVdroid(DAVx5)2.6.3 支持很好。配置好賬號后,通訊錄,日歷,個人提醒 就都可以同步了。
- webdav對易碼的支持也很好。還可以用 Nextcloud-note(安卓app) 來寫雲筆記。
- 本身還是個雲盤。安卓版雲盤app本身就可以備份手機通訊錄(打包為一個文件,上傳到雲盤目錄)
- 支持多賬號。
- 需要 nginx/apache + php + mysql , 比較龐大。