加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

webday_go

一个简易的go版 webdav 服务程序。

编译安装

下载源码

  git clone https://github.com/ser163/webdav_go

进入目录

   cd webdav

编译源码

   go mod download
   go build -ldflags="-s -w"

运行程序

   ./webDav_go .

使用帮助

Usage of webDav_go:
  -a string
        地址
  -p string
        共享路径 (default ".")
  -port int
        端口 (default 8080)

1.直接输入路径

  webDav_go c:\ or webDav_go . (当前目录)

2.使用IP和端口号

   webDav_go -a "192.168.0.11" -port 8081

3.使用path定义路径

   webDav_go -p "/opt/data/webdav" -a "192.168.0.11" -port 8081

4.开启日志

   webDav_go -log true -F "/var/log/webdav.log"

5.只读模式

   webDav_go -R true

6.用户验证

   webDav_go -user "admin" -pass "123"

7.https模式

   webDav_go -ssl true -ssl-key "key.pem" --ssl-cert "cert.pem" -prot 443

8.Linux下在后台运行

   nohup ./webDav &

挂载方法

windows下挂载

打开命令提示工具,从运行中输入cmd命令

   net use Y: http://127.0.0.1:8080/ 123  /user:admin /persistent:YES

123 为服务器密码. http://127.0.0.1:8080/ 为服务器路径 persistent 为保存链接状态

从Windows Vista起,微软就禁用了http形式的基本WebDAV验证形式(KB841215),必须使用https连接 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters 找到BasicAuthLevel把这个值从1改为2,然后进控制面板,服务,把WebClient服务重启(没有启动的就启动它)。

Linux下挂载

   sudo apt install davfs2
   sudo mount.davfs http://locaohost:8080/dav/ /opt/Backup/

参考

此程序参考: Golang 实现简单WebDAV系统

MIT License Copyright (c) 2021 None Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

一个go语言版的webdav服务端程序 展开 收起
Go
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化