a webdav server of mutil user mutil path

webdavSmump

a webdav server of mutil user mutil path

  • 因公司文件共享需求,寻找一个文件共享服务端软件,找了一圈发现现存的开源webdav服务软件极少实现了不同用户访问不同共享文件夹的。找现成的反倒不如自己写一个快,就写了本项目。原需求如下:

需求

总体描述:需要一个多用户文件共享方案,以满足企业单位员工在单位和互联网上共享文件的需要

需求点收集

  1. 每一个用户都有自己的私人文件夹,部门共享文件夹,企业公共文件夹三个基本文件夹(也可使用挂载三个盘解决)
  2. 可从单位内部和互联网访问文件夹
  3. 方面的图形化用户及目录管理界面(还未实现,目前通过修改配置文件管理用户及用户访问的目录)
  4. 可方便的在windows、linux下映射挂载为盘,移动终端上有app可以访问
  5. 加密传输

解决方案

传输协议选择

原则:采用通用传输协议

淘汰的协议

  1. 因互联网传输安全性问题淘汰ftp协议
  2. 因安全性问题淘汰smb协议
  3. 因管理及挂载技术原因淘汰iscsi协议
  4. 因管理及挂载技术原因淘汰NFS协议

备选协议

  1. sftp
  2. webdav

服务软件选择

第一选择:支持webdav多用户管理的服务软件

seafile 可道云 群晖drive、https://github.com/hacdias/webdav(二进制版本在树莓派多连接传输时会崩溃)

  • 淘汰原因:系统复杂,安装麻烦,有一定的学习曲线或不稳定

第二选择:linux内置的sftp服务软件

  • 淘汰原因,用户管理和linux系统绑定,权限管理麻烦。

第三选择:定制开发webdav服务软件

最终选择自已定制开发webdav服务软件即本系统。

系统特点

  1. 安装简单,如果以https方式运行就一个可执行文件、一个配置文件,一个公钥文件、一个私钥文件;如果是以http方式运行只需要前两个文件就可以正常运行。
  2. 支持多用户登录,不同的用户访问不同的服务器文件夹
  3. 加密通讯
  4. 方便互联网和内部访问
  5. 可运行在windows、linux、树莓派、macos等几乎所有操作系统下(只要golang支持的操作系统都可以运行)
  6. 性能较好,文件传输输快,可同时传输多个文件。

安装指南

配置文件说明:

{
    "serviceport":8899,
    "cakey":"server.key",
    "cacrt":"server.crt",
    "prefixdir":"/srv/dev-disk-by-uuid-79746475560579FF/",
    "users":[
    {"username":"abc","password":"123","userpath":"minaaa"},
    {"username":"abc2","password":"202cb962ac59075b964b07152d234b70","userpath":"abc2"}
    ]
}
  • serviceport:服务端口
  • cakey:私钥证书存取路径
  • cacrt:公钥证书存取路径
  • prefixdir:服务器端共享文件夹的前缀,和userpath合起来组成共享给某个用户的文件夹在服务器上的绝对路径
  • users:用户集合,每一行对应一个用户描述,分别是用户名、用户口令(可以是明文也可以放置经md5哈稀后的口令)、服务器上分配给用户的共享文件夹名
  • 用户对webdav的存取路径名和用户名一致,配置文件不再体现。

安装过程

  1. 下载并编译主程序文件
  2. 把配置文件config.json和主程序文件放入同一文件夹中
  3. 在同一目录内放置供https通讯使用的公钥文件和私钥文件(没公钥文件和私钥文件也没关系,系统会转为http方式运行)
  4. 按实际情况编辑好配置文件config.json并保存
  5. 运行主程序文件
  6. 用任一webdav客户端软件访问本服务程序
  • 记得在用户访问前要把配置文件中userpath表示的目录创建好,否则用户访问的时候由于系统无法找到目录,会提示用户路径无法找到

已知webdav缺点:

  1. 客户端挂载问题:实测在linux下和在macos下,把webdav挂载成盘后,不管是命令行还是GUI拷贝文件都存在缓存问题,数据不能及时到达服务端。客户端提示文件拷贝完成,服务端看到文件大小还是0,即使umount掉盘数据还是不能及时到达服务器造成数据丢失。使用手机端的各种文件管理器、raidrive未发现丢失数据情况,同样一块远程共享,同时用webdav和smb共享,linux和macos下挂盘后拷贝数据,smb可把数据实时传给服务器,webdav就不行
  2. 延迟问题:实测把同样的服务端目录通过smb和webdav共享出来,用同一个客户端的两种协议访问,在文件夹内文件较多(nnn以上)时,smb反应较快,而webdav则有一到几秒的延迟时间才能显示文件列表。
  3. 在线播放问题(使用FE文件游览器):和问题2一样的环境,在线播放nnnM的视频文件,smb基本能秒出,webdav则需要几秒的缓存时间。
Similar Resources

Gowebdav - A golang WebDAV client library and command line tool.

GoWebDAV A golang WebDAV client library. Main features gowebdav library allows to perform following actions on the remote WebDAV server: create path g

Jan 3, 2023

A simple cli tool for switching git user easily inspired by Git-User-Switch

A simple cli tool for switching git user easily inspired by Git-User-Switch

gitsu A simple cli tool for switching git user easily inspired by Git-User-Switch Installation Binary releases are here. Homebrew brew install matsuyo

Dec 31, 2022

App with CRUD for user, with palindrome checker for user's first and last name

Run db container first, so that app does not connect to db while db has not started yet docker-compose up -d db docker-compose up -d app CRUD endpoint

Dec 9, 2021

Gum - Git User Manager (GUM) - Switch between git user profiles

Gum - Git User Manager (GUM) - Switch between git user profiles

Git User Manager (GUM) Add your profile info to config.yaml Build project: go bu

Feb 14, 2022

Go-user-service - User creation with Kafka producer

📁 The Project This project is a simple user API developed to study microservice

Aug 19, 2022

This is a simple file storage server. User can upload file, delete file and list file on the server.

This is a simple file storage server.  User can upload file,  delete file and list file on the server.

Simple File Storage Server This is a simple file storage server. User can upload file, delete file and list file on the server. If you want to build a

Jan 19, 2022

Rasterx is an SVG 2.0 path compliant rasterizer that can use either the golang vector or a derivative of the freetype anti-aliaser.

Rasterx is an SVG 2.0 path compliant rasterizer that can use either the golang vector or a derivative of the freetype anti-aliaser.

rasterx Rasterx is a golang rasterizer that implements path stroking functions capable of SVG 2.0 compliant 'arc' joins and explicit loop closing. Pat

Nov 1, 2022

A path tracer written in Go.

A path tracer written in Go.

pt: a golang path tracer This is a CPU-only, unidirectional path tracing engine written in Go. It has lots of features and a simple API. Features Supp

Jan 5, 2023

Path parsing for segment unmarshaling and slicing.

parth go get github.com/codemodus/parth/v2 Package parth provides path parsing for segment unmarshaling and slicing. In other words, parth provides s

Sep 27, 2022

:runner:runs go generate recursively on a specified path or environment variable and can filter by regex

Package generate Package generate runs go generate recursively on a specified path or environment variable like $GOPATH and can filter by regex Why wo

Sep 27, 2022

A tools to find the path of a specific key in deep nested JSON.

A tools to find the path of a specific key in deep nested JSON.

如何快速从深层嵌套 JSON 中找到特定的 Key #公众号 在爬虫开发的过程中,我们经常遇到一些 Ajax 加载的接口会返回 JSON 数据。

Dec 13, 2022

An HTTP service for customizing import path of your Go packages.

Go Packages A self-host HTTP service that allow customizing your Go package import paths. Features Reports. Badges. I18N. Preview I launch up a free H

Nov 27, 2022

Path to a Software Architect

Path to a Software Architect

Contents What is a Software Architect? Levels of Architecture Typical Activities Important Skills (1) Design (2) Decide (3) Simplify (4) Code (5) Docu

Dec 28, 2022

Report unwanted import path and declaration usages

Report unwanted import path and declaration usages

faillint Faillint is a simple Go linter that fails when a specific set of import paths or exported path's functions, constant, vars or types are used.

Dec 28, 2022

Grab is a tool that downloads source code repositories into a convenient directory layout created from the repo's URL's domain and path

Grab is a tool that downloads source code repositories into a convenient directory layout created from the repo's URL's domain and path. It supports Git, Mercurial (hg), Subversion, and Bazaar repositories.

Jun 2, 2022

TProx is a fast reverse proxy path traversal detector and directory bruteforcer.

TProx is a fast reverse proxy path traversal detector and directory bruteforcer.

TProx is a fast reverse proxy path traversal detector and directory bruteforcer Install • Usage • Examples • Join Discord Install Options From Source

Nov 9, 2022

FSManager - Tree view Simple util to displays the directory structure of a path or of the disk in a drive graphically.

FSManager - Tree view Simple util to displays the directory structure of a path or of the disk in a drive graphically. If you don't specify a drive or

Oct 9, 2021

This is a Go Cli app that receives an string path to a log file, and based on it generates and prints in console an encoded polyline with the locations found in the log file.

This is a Go Cli app that receives an string path to a log file, and based on it generates  and prints in console an encoded polyline with the locations found in the log file.

GEOENCODE GO CLI APP DESCRIPTION This is a Go Cli app that receives an string path to a log file, and based on it generates and prints in console an e

Oct 1, 2021
oDrop, a fast efficient cross-platform file transfer software for server and home environments

oDrop is a cross-platform LAN file transfer software to efficiently transfer files between computers, oDrop is useful in environments where GUI is not available.

Jun 4, 2022
fsync - a file sync server

fsync - a file sync server

Aug 25, 2022
Distributed File Store Application Consist of API Server to handle file operations and command line tool to do operations

Filestore Distributed File Store Application Consist of API Server to handle file operations and command line tool to do operations (store named binar

Nov 7, 2021
aqua is a simple file uploading and sharing server for personal use.
aqua is a simple file uploading and sharing server for personal use.

aqua is a simple file uploading and sharing server for personal use. It is built to be easy to set up and host on your own server, for example to use it in combination with uploading tools like ShareX.

Jul 7, 2022
Fully featured and highly configurable SFTP server with optional FTP/S and WebDAV support - S3, Google Cloud Storage, Azure Blob

SFTPGo Fully featured and highly configurable SFTP server with optional FTP/S and WebDAV support, written in Go. Several storage backends are supporte

Jan 9, 2023
WebDAV server for SSH. Similar to sshfs but does not require proprietary MacFUSE on macOS

sshwebdav: WebDAV server for SSH sshwebdav provides a WebDAV server for a remote SSH host. sshwebdav is similar to sshfs but does not require propriet

Nov 9, 2022
SFTPGo - Fully featured and highly configurable SFTP server with optional FTP/S and WebDAV support - S3, Google Cloud Storage, Azure Blob

SFTPGo - Fully featured and highly configurable SFTP server with optional FTP/S and WebDAV support - S3, Google Cloud Storage, Azure Blob

Jan 4, 2023
Visualize plant growth over time with Go, WebDAV and WASM; @pojntfx's entry for #growlab.

Growlapse Visualize plant growth over time with Go, WebDAV and WASM; @pojntfx's entry for #growlab. Installation Containerized You can get the Docker

Feb 21, 2022