搭建webdav服務器實現靜讀天下同步


下載webdav程序

Github地址https://github.com/hacdias/webdav/releases 我的是樹莓派3b,所以下載linux-armv7-webdav.tar.gz。 windows的話下載windows-amd64-webdav.zip。

<!-- more -->

windows

在webdav.exe同目錄新建一個config.yaml填寫

# Server related settings
address: 0.0.0.0
port: 51234
auth: true
tls: false
cert: cert.pem
key: key.pem

# Default user settings (will be merged)
scope: .
modify: true
rules: []

users:
  - username: admin
    password: admin
    scope: d:/webdav/user01

最後一行改成自己想要保存的文件夾。 開始菜單,運行,cmd,裏運行webdav.exe就可以了。

linux(Raspberry 3B上的archlinuxarm)

開啓服務 在/etc/systemd/system裏新建文件webdav.service

[Unit]
Description=WebDAV server
After=network.target

[Service]
Type=simple
User=root
ExecStart=/usr/bin/webdav --config /etc/webdav/config.yaml
Restart=on-failure

[Install]
WantedBy=multi-user.target

在/etc/webdav/config.yaml裏填寫

# Server related settings
address: 0.0.0.0
port: 51234
auth: true
tls: false
cert: cert.pem
key: key.pem

# Default user settings (will be merged)
scope: .
modify: true
rules: []

users:
  - username: admin
    password: admin
    scope: /root/webdav/user01

最後一行改成自己想要保存的文件夾。 運行 systemctl enable webdav systemctl start webdav 查看狀態systemctl status webdav,顯示Listening on [::]:51234就可以了。

靜讀天下專業版設置

隨便打開一本書,右上角3個點,其他選項,通過webdav...,webdav url填服務器的ip地址加端口,例如:http://192.168.1.100:51234,用戶名密碼admin,其他不用改。 之後每次打開關閉書就可以同步了。

個人博客

https://andi.wang/

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章