搭建 WebDAV 服务

༺小ʚɞ寞༻ Wiki评论23,387字数 1050阅读3分30秒阅读模式

搭建 WebDAV 服务

迫于需要使用 Joplin 开源笔记同步功能,所以自己搭一个 WebDav 服务

Simple Go WebDAV server

下载到指定目录

wget https://github.com/hacdias/webdav/releases/download/v4.0.0/linux-amd64-webdav.tar.gz
tar -xvzf linux-amd64-webdav.tar.gz 
mv webdav /usr/bin/webdav 
rm -rf linux-amd64-webdav.tar.gz

创建 WebDAV 目录

mkdir -p /joplin/webdav

配置文件

vi webdav.yaml
# Server related settings
address: 0.0.0.0
port: 6666
auth: true
tls: false
cert: cert.pem
key: key.pem
prefix: /

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

# CORS configuration
cors:
  enabled: true
  credentials: true
  allowed_headers:
    - Depth
  allowed_hosts:
    - http://localhost:6666
  allowed_methods:
    - GET
  exposed_headers:
    - Content-Length
    - Content-Range

users:
  - username: admin
    password: admin
    scope: /joplin/webdav/

这里设置的端口是 6666,账号密码均为 admin,WebDAV 目录是 /joplin/webdav/ 可自行更改

创建 Systemd 自启服务

vi /usr/lib/systemd/system/webdav.service
[Unit]
Description=WebDAV server
After=network.target

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

[Install]
WantedBy=multi-user.target

管理命令

systemctl daemon-reload
systemctl start webdav
systemctl enable webdav
systemctl status webdav

weinxin
LuckTang's Blog 站长语录
LuckTang's Blog,欢迎各位来访!这是我的QQ,扫一扫,加好友。大家一起交流博客建站技术,分享前沿资讯!
linux系统中如何打开察看img文件内容 Wiki

linux系统中如何打开察看img文件内容

可以把img的文件理解成一个磁盘,一个以文件的二进制形式存在的磁盘。 磁盘里面肯定有一些分区。 因此可直接mount进行挂载磁盘里面的分区。 第一,要知道img磁盘文件,对应分区的开始位置。 用分区程...
匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定