Sign inSign up

host1syan/davsync

By host1syan

Updated 3 months ago

Image
0

161

host1syan/davsync repository overview

Go Size License Arch

dav-sync

WebDAV 同步与管理面板 · WebDAV Sync & Management Panel

轻量级 WebDAV 文件同步与管理工具,提供 Web 图形界面。无需 CLI,零外部依赖,单文件部署,完美适用于自建 NAS、私有云等场景。

A lightweight WebDAV sync and management panel with a web UI. Zero external dependencies, single binary deployment — ideal for self-hosted NAS, private cloud, and homelab setups.


功能 Features

中文English
网页图形化管理,告别命令行Web-based panel, no CLI required
文件浏览、上传、下载、删除、新建目录File browser, upload, download, delete, mkdir
多种同步模式:本地→远程、远程→本地、双向同步Multiple sync modes: push, pull, bidirectional
可选删除目标端多余文件Optional deletion of extra files on target
后端驱动自动同步(goroutine 定时执行,服务重启后自动恢复)Backend-driven auto-sync (goroutine timer, survives restarts)
同步日志(上传/下载/删除/跳过 数量、耗时、错误)Sync logs with counts, duration, errors
本地 vs 远程双栏文件对比Side-by-side local vs remote file comparison
登录认证保护(SHA-256 哈希密码,session 过期自动退出)Login authentication (SHA-256 hashed passwords, session expiry)
支持自签名证书 / 跳过 TLS 验证Self-signed cert support / TLS skip
从 scratch 构建的极简 Docker 镜像FROM scratch — minimal Docker image
跨平台:Linux / Windows / macOSCross-platform: Linux / Windows / macOS
中文 & 英文双语界面Chinese & English bilingual UI

快速开始 Quick Start

一行命令启动 One‑Liner
docker run -d \
  -p 8080:8080 \
  -e DAV_URL="https://your-webdav-server.com/dav/" \
  -e DAV_USER="your-username" \
  -e DAV_PASS="your-password" \
  -v dav-sync-data:/app \
  --name dav-sync \
  host1syan/davsync:latest

浏览器打开 http://localhost:8080,默认登录密码 123(登录后可在面板修改)。

Open http://localhost:8080, default login password: 123 (changeable in the panel).


环境变量 Environment Variables

变量 Variable必填 Required说明 Description
DAV_URLWebDAV 服务器地址,未设置可在面板配置 / WebDAV server URL (configurable in panel)
DAV_USERWebDAV 用户名,未设置可在面板配置 / WebDAV username (configurable in panel)
DAV_PASSWebDAV 密码,未设置可在面板配置 / WebDAV password (configurable in panel)
PORT监听端口,默认 8080 / Listen port, default 8080
DAV_INSECURE设为 1true 跳过 TLS 证书验证 / Set to 1 or true to skip TLS cert verification

💡 以上环境变量均非必填 — 可在 Web 面板中直接配置,配置会自动保存到 config.json 并持久化。 All env vars are optional — configure via the web panel instead and settings persist in config.json.


操作方法 Usage Guide

首次使用 First Run
  1. 启动容器后访问 http://localhost:8080
  2. 输入登录密码 123,点击登录
  3. 在左侧面板填写 WebDAV 连接信息(地址 / 用户名 / 密码),点击保存并测试
  4. 开始管理你的 WebDAV 文件!
同步功能 Sync
  • 方向 Direction:推送到远程(Push)、拉取到本地(Pull)、双向同步(Both)
  • 删除 Delete:勾选「删除目标端多余文件」可自动清理目标端不存在于源端的文件
  • 自动同步 Auto Sync:可设定定时自动同步,服务重启后自动恢复

配置持久化 Config Persistence

所有配置(连接参数、同步设置、登录密码)保存到容器的 /app/config.json。务必挂载数据卷以防丢失。

All configuration (connection, sync settings, password) is stored in /app/config.json. Mount a volume to persist data across container restarts.

-v dav-sync-data:/app

安全性 Security

  • 登录密码使用 SHA-256 哈希存储,不存明文

  • Session 使用随机 UUID + 24 小时过期机制

  • Web 面板与 WebDAV 服务器之间使用 Basic Auth(HTTPS 下安全)

  • 支持跳过 TLS 验证(适用于内网自签名证书场景)

  • Passwords stored as SHA-256 hashes, never in plaintext

  • Sessions use random UUIDs with 24h expiry

  • Basic Auth between panel and WebDAV server (secure under HTTPS)

  • TLS verification can be skipped for internal self-signed certs


Docker Hub 镜像信息 Image Info

  • 基础镜像 Base Image: scratch(空镜像,仅含二进制 / Contains only the binary)
  • 二进制路径 Binary: /app/dav-sync
  • 默认端口 Port: 8080
  • 架构 Architectures: linux/amd64, linux/arm64, linux/arm/v7
  • 数据持久化 Persistence: 挂载 /app 目录 / Mount /app directory

Docker Compose 示例

services:
  dav-sync:
    image: host1syan/davsync:latest
    container_name: dav-sync
    ports:
      - "8080:8080"
    environment:
      DAV_URL: "https://your-webdav-server.com/dav/"
      DAV_USER: "username"
      DAV_PASS: "password"
      # DAV_INSECURE: "true"   # 跳过 TLS 验证(自签名证书时启用)
    volumes:
      - dav-sync-data:/app
    restart: unless-stopped

volumes:
  dav-sync-data:

自行构建 Build from Source

git clone https://github.com/your-repo/dav-sync.git
cd dav-sync

# 静态编译 Static build
CGO_ENABLED=0 go build -ldflags="-s -w" -o dav-sync

# Docker 构建 Docker build
docker build -t dav-sync .

技术栈 Tech Stack

  • 语言 Language: Go 1.21+
  • 前端 Frontend: 单页 HTML + JavaScript(内嵌 embed)
  • 数据库: 无 / None(配置存 JSON 文件)
  • 外部依赖 External Deps: 零 / Zero

License

MIT


dav-sync — 让 WebDAV 管理更简单 · Making WebDAV management simple

Tag summary

Content type

Image

Digest

sha256:1ffda296b

Size

2.3 MB

Last updated

3 months ago

docker pull host1syan/davsync