go-drive

devld活跃维护

用 Go 写的轻量网盘映射 Web 应用,把本地磁盘、FTP/SFTP、S3、OneDrive、WebDAV、Google Drive 等多种存储统一到一个网页界面里管理文件。

A simple cloud drive mapping web app supports local, FTP/SFTP, S3, OneDrive, WebDAV, Google Drive.

v0.18.0发布于 2026-10-17 14:14 UTC804star73fork同步于 2026-11-10 05:58 UTC

怎么上手

从 README 代码块原样提取,可能是其中一种安装方式
docker run -d --name go-drive \
docker compose up -d
git clone https://github.com/devld/go-drive.git
硬件要求按 README 关键词推断
有 Docker 镜像
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

这个项目的说明还在生成中,先参考下面「最近发版」和 README。

最近发版

5 个版本v0.18.0
  1. v0.18.0Release v0.18.0最新正式版2026-10-17 · 2026-10-17 14:14 UTC

    Highlights

    • Connect MEGA cloud storage, including two-factor sign-in, encrypted transfers, and reusable sessions.
    • Browse ZIP, 7z, and RAR archives, preview their contents, and download selected files or folders as ZIP packages.
    • Edit Markdown visually with Mermaid diagram rendering, and enjoy improved video controls on desktop and mobile.
    • Stored Drive credentials and OAuth data are now encrypted at rest.

    Breaking Changes and Upgrade Notes

    • Encryption key. Existing stored secrets are encrypted automatically on startup. Preserve data-dir/encryption.key, or keep using the same GO_DRIVE_ENCRYPTION_KEY if configured. Database backups require the same key to restore. If both sources exist, they must match.
    • Unfinished uploads. The temporary storage format for chunked uploads has changed. Uploads left unfinished before upgrading must be restarted.
    • Custom Script Drives. Update scripts to the current template and declarations. The Drive environment uses env / DriveEnv in place of utils / DriveUtils; reader methods now receive a ReaderRange instead of separate start and size arguments. Host Entry.name has been removed; derive names from Entry.path. Thumbnail metadata now uses hasThumbnail in place of selfThumbnail and thumbnailUrl.
    • Custom integrations. The old POST /archive endpoint is replaced by artifact-based ZIP preparation and download. Go extensions must also adapt to the updated entry and reader interfaces, consolidated error types, and NewClassSet / With in place of the exported BuiltinClasses catalog.
    • Local filesystem paths. Paths must use the exact names stored on disk. Alternate casing and other filesystem aliases are rejected to prevent permission bypasses. Parent directories must be readable so names can be verified.

    New Features and Improvements

    • MEGA supports configurable root folders and content caching. Deleted or replaced files go to the MEGA rubbish bin by default, with an option for permanent deletion.
    • Archive previews show directory contents and symbolic-link targets. Selected archive members and ordinary Drive files can be packaged for download.
    • Markdown files open in a visual editor with Mermaid diagrams. Diagram source can be shown or hidden while editing, and Mermaid loads only when needed.
    • Video previews offer mouse and touch controls, automatic control hiding, double-tap playback, and swipe-down dismissal on touch devices.
    • WebP is included in the default image previews.
    • Drive configuration reloads run in the background with progress feedback. Admin Drive controls work better on mobile and include contextual documentation links.
    • File menus can start downloads directly, and rename dialogs select the filename without its extension.
    • Chunked uploads report progress more consistently and reject simultaneous writes to the same chunk.
    • Shared file-content caches expire after five minutes by default, reducing stale reads after external changes. Archive work has configurable concurrency limits.
    • Editor loading is lighter, and frontend dependencies have been updated.

    Bug Fixes

    • Fixed a local filesystem permission bypass involving alternate path spellings on filesystems that treat different names as equivalent.
    • Pasting images into the Markdown editor no longer embeds them as base64 data. Image uploads and text pasting remain available.
    • Interrupted WebDAV uploads no longer replace existing files with incomplete data.
    • Remote storage authentication failures no longer appear as an expired go-drive login; Drive initialization errors are shown in the admin form.
    • Background task errors display translated messages, and streaming responses stop safely when requests end.
    • Partial file caches are reused correctly, and writes through the shared file layer are saved back to the Drive.
    • Nested custom request-header fields retain their form types when saved.
    • Entry menus behave more reliably on iOS, and the upload-task butto
  2. nightlyNightly Buildpre-release2026-10-17 · 2026-10-17 12:57 UTC
    查看更新说明

    Nightly build from commit 55ed990727caec7c416ff39d04677d6e00ab2ea8.

    Changes since the latest stable release v0.17.0: https://github.com/devld/go-drive/compare/v0.17.0...55ed990727caec7c416ff39d04677d6e00ab2ea8

    This is a pre-release and may be unstable.

  3. v0.17.0Release v0.17.02026-09-11 · 2026-09-11 16:04 UTC
    查看更新说明

    Highlights

    • Script Drives now run on Goja with modern JavaScript syntax, safer host bindings, immutable Go-backed views, clearer errors, and context-aware execution.
    • Admin Jobs now show live progress for running operations and provide paginated execution history with a clearer task and log view.
    • Script Drives gain explicit progress reporting, Drive-local intervals, forced OAuth token refresh, URL helpers, and JSON response parsing.
    • File-system paths now reject Windows-style backslash traversal sequences.

    Breaking Changes

    • Script Drives. Scripts must be migrated from the old Otto/ES5 API to the Goja API. Host fields and methods now use lowerCamelCase (entry.path, resp.status, resp.json(), oauthLoad, etc.); old PascalCase names and Otto context parameters are not compatible.
    • Script Drive operations. Lifecycle and operation signatures changed. In particular, save, copy, move, and delete receive explicit progress capabilities. Uploading scripts should wrap the consumed reader with reader.withProgress(progress) as documented.
    • Logging. Replace GO_DRIVE_DEBUG=1 with GO_DRIVE_LOGGING_LEVEL=debug. The same setting can be configured as logging.level in config.yml.

    Migration

    1. Back up data-dir and config.yml, then upgrade as usual.
    2. Open Admin → Other Drives, refresh/pull the Script Drive repository, and update every installed Script Drive.
    3. Migrate custom scripts to the current template and declarations, including lowerCamel names, the new lifecycle signatures, and explicit progress handling.
    4. Confirm sign-in, Drive reload, uploads, scheduled work, and jobs after upgrading.

    New Features and Improvements

    • Drive scripts can schedule recurring background work and force an OAuth token refresh when needed.
    • urlUtils and HttpResponse.json() simplify URL and JSON handling in scripts.
    • The script editor provides better JavaScript suggestions, including suggestions inside string literals.
    • Script and native function names are clearer in logs and stack traces; Drive handles also have more useful log and JSON representations.
    • Action and trigger definitions retain a stable registration order.

    Bug Fixes

    • Windows-style path traversal through file-system Drives is blocked.
    • Upload progress is reported consistently for script-backed HTTP operations.

    Full Changelog: https://github.com/devld/go-drive/compare/v0.16.1...v0.17.0

  4. v0.16.1Release v0.16.12026-08-20 · 2026-08-20 12:18 UTC
    查看更新说明

    Highlights

    • Script Drive configuration and updates were rebuilt. After upgrading, refresh the Other Drives repository and update every installed script.
    • OneDrive setup can finish when listing drives is not allowed, and falls back to the default drive.
    • Script Drive errors and logs are easier to read.

    Breaking Changes

    • Script Drives. Existing installed scripts will not work until they are updated. After upgrading the server, go to Admin → Other Drives, refresh/pull the repository, then update every installed Script Drive.

    Migration

    1. Back up data-dir and config.yml, then upgrade as usual.
    2. Open Admin → Other Drives, refresh/pull the repository, and update all installed Script Drives.
    3. Confirm sign-in, Drive reload, and uploads.

    New Features and Improvements

    • Script Drive setup in the admin UI is clearer.
    • OneDrive can complete setup without a working drive list, and still uses the default drive.

    Bug Fixes

    • Script errors show the script name, and logs are easier to read.
    • Script Drive settings can be saved even when some fields are left empty.

    Updates Since v0.16.0

    • Script Drive editing in the admin UI and IDE can catch more script problems before they run.
    • Script Drive operations handle a wider range of inputs more reliably.
    • Script files stay within their configured drive directories.
    • Upload task lists keep a stable, readable layout.

    Full Changelog: https://github.com/devld/go-drive/compare/v0.15.1...v0.16.1

  5. v0.15.1Release v0.15.12026-08-16 · 2026-08-16 10:19 UTC
    查看更新说明

    Highlights

    • Script Drives now use a new adapter API, required name/version metadata, in-place updates from the repository, and faster directory listing.
    • Added a GitHub repository Script Drive, custom request headers for S3 and WebDAV, and a login form that follows the configured auth provider.
    • Improved accessibility, macOS shortcuts, loading states, and overall UI polish.

    Breaking Changes

    • Script Drives. Third-party scripts written for older releases will not load. They need the new @name / @version header comments and the new defineDrive / defineUploader API. Bundled Dropbox, Qiniu, and GitHub adapters are already migrated. After upgrading, update installed scripts from Admin → Other Drives, and re-save Drive settings if you want listing cache enabled. See the Script Drive guide and docs/script-drive-template.js.
    • HTTP API. Drive, upload, task, and admin routes have changed. The bundled web UI, WebDAV, and file buckets are unaffected. Custom API clients and old signed download or thumbnail links need to be updated.

    Migration

    1. Back up data-dir and config.yml, then upgrade as usual.
    2. Rewrite or update third-party Script Drives before relying on them.
    3. Update any custom API usage or stored signed links.
    4. Confirm sign-in, Drive reload, and uploads.

    New Features and Improvements

    • Administrators can refresh the Script Drive repository and update an installed drive without uninstalling it.
    • GitHub repositories can be mounted as a read-only drive, including private repositories.
    • S3 and WebDAV drives accept extra request headers for proxies or upstream requirements. These headers are not sent with browser-side presigned uploads.
    • The login page is built from the auth provider’s form, so LDAP and similar methods use the same flow.
    • On macOS, search, selection, drag-copy, and text save use Command instead of Control (#171).
    • Loading indicators, file-type icons (including HEIC/HEIF), buttons, and glass surfaces are more consistent.

    Bug Fixes

    • Improved keyboard and screen-reader access for menus, media controls, forms, and dialogs.
    • Fullscreen dialogs on admin pages are no longer clipped; file icons no longer show through transparent thumbnails.
    • WebDAV now returns a permission error when creating a folder under an existing but unwritable parent.
    • Script Drive secrets stay hidden in admin forms.
    • Custom browser uploaders load more reliably.

    Full Changelog: https://github.com/devld/go-drive/compare/v0.14.0...v0.15.1

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    go-drive

    A cross-platform, self-hosted file management server with a modern web UI.

    Manage local files and a wide range of cloud storage providers from a single, unified interface.

    License: MIT Go Report Card Vue Docker Docker Pulls GitHub Release

    Live Demo · Documentation · Releases

    English | 简体中文


    Table of Contents

    Overview

    go-drive is a lightweight file-management server written in Go with a Vue/TypeScript frontend. It lets you browse, upload, organize, and share files across many different storage backends — local disks, FTP/SFTP, WebDAV, S3-compatible object storage, OneDrive, Google Drive, MEGA, and more — all through one clean web interface.

    The whole application ships as a single self-contained binary (the web UI and i18n assets are embedded), making it trivial to deploy on a server, NAS, or inside a container.

    Default credentials: user admin, password 123456. Change the password immediately after the first login.

    Features

    • File management — browse, copy, move, rename, and delete with drag-and-drop and paste-to-upload support.
    • Uploads & downloads — chunked uploads for large files and zip packaging for batch downloads.
    • Access control — isolate users, groups, and anonymous visitors with virtual root paths and fine-grained per-path read/write permissions.
    • LDAP authentication — connect to LDAP/LDAPS with just-in-time user creation and automatic group synchronization.
    • Path mounting — mount any drive or subpath into a unified virtual tree.
    • File preview — image gallery powered by PhotoSwipe, built-in audio/video players and PDF viewer, plus configurable external previewers.
    • Archive preview — browse ZIP, 7z, and RAR files in the browser; download individual entries or pack a selection as a zip.
    • Editors — text editing with CodeMirror and full code editing with Monaco Editor.
    • Thumbnails — generate thumbnails for images, text, video, and audio (pluggable handlers, optional libvips/ffmpeg).
    • Filename search — optional indexed filename search across mounted drives.
    • WebDAV access — expose your drives over the WebDAV protocol.
    • Automated jobs — run copy, move, delete, flow, and JavaScript actions on cron schedules or file events, with execution history and logs.
    • File buckets — publish token-protected upload and public-read endpoints with path templates, type/size limits, caching, and hotlink protection.
    • Extensible drives — add new storage backends with JavaScript, no recompilation required.
    • Admin console — manage drives, users, groups, permissions, and jobs from the browser.

    Supported Drives

    DriveNotes
    LocalFiles on the host filesystem
    FTPFTP server
    SFTPSSH file transfer
    WebDAVAny WebDAV-compatible server
    S3Amazon S3 and S3-compatible object storage
    OneDriveMicrosoft OneDrive
    Google DriveGoogle Drive
    MEGAClient-side encrypted cloud storage
    DropboxImplemented as a scripted (JavaScript) drive
    QiniuQiniu Cloud, implemented as a scripted (JavaScript) drive

    See the documentation for per-drive setup details.

    Quick Start

    Docker

    mkdir go-drive-data
    docker run -d --name go-drive \
      -p 8089:8089 \
      -v "$(pwd)/go-drive-data:/app/data" \
      devld/go-drive
    

    go-drive-data is the data directory. Mapping it outside the container ensures your data survives application upgrades. Once running, open http://localhost:8089.

    The official Docker image bundles ffmpeg and libvips, and automatically enables the video/audio and high-performance image thumbnail handlers.

    To customize the configuration, first extract the default config.yml from the image, then mount it back into the container:

    # Extract config.yml from a throwaway container
    cid=$(docker run -d devld/go-drive) && docker cp "$cid:/app/config.yml" . && docker stop "$cid" && docker rm "$cid"
    
    # Run with both the data dir and the config file mapped outside the container
    docker run -d --name go-drive \
      -p 8089:8089 \
      -v "$(pwd)/go-drive-data:/app/data" \
      -v "$(pwd)/config.yml:/app/config.yml" \
      devld/go-drive
    

    Docker Compose

    services:
      go-drive:
        image: devld/go-drive
        container_name: go-drive
        ports:
          - "8089:8089"
        volumes:
          - ./go-drive-data:/app/data
        restart: unless-stopped
    
    docker compose up -d
    

    Prebuilt Binary

    Download the archive for your platform from the Releases page, extract it, and run:

    • Linux
    ./go-drive
    
    • Windows

    Run go-drive.exe.

    By default go-drive reads config.yml from the working directory (if present) and listens on :8089. Useful flags:

    ./go-drive -c /path/to/config.yml   # use a specific config file
    ./go-drive -show-config             # print the parsed configuration
    ./go-drive -v                       # print version information
    

    Configuration

    go-drive is configured through a YAML file. A fully documented reference lives in docs/config.yml; copy it and adjust as needed. Selected options:

    OptionDefaultDescription
    listen:8089Address the HTTP server binds to
    data-dir./dataDirectory for all application data (database, sessions, thumbnails, local files, etc.)
    temp-dirdata-dir/tempTemporary file directory
    max-concurrent-task100Max concurrent tasks (copy, move, delete)
    free-fsfalseAllow Local drives to use absolute paths (security risk)
    trusted-proxiesemptyTrusted proxy IPs/CIDRs for resolving the real client IP
    api-path / web-pathemptyOverride API/static paths when served under a sub-path

    go-drive supports SQLite (default) and MySQL. WebDAV access, full-text search, thumbnail handlers, and reverse-proxy/sub-path deployment are all configured here too — see docs/config.yml and the documentation for the full reference.

    ⚠️ Setting free-fs: true lets admin users browse the entire host filesystem through Local drives. Leave it false unless you understand the implications.

    Building from Source

    Prerequisites: the Go version pinned in go.mod, Node.js 24, and a C toolchain (SQLite requires CGO).

    git clone https://github.com/devld/go-drive.git
    cd go-drive
    
    # Build everything: frontend, backend, and release archive
    make all
    

    make all builds the Vue frontend (web/dist), embeds it together with the i18n assets into the Go binary, and produces a release archive under build/. For frontend-only development:

    cd web
    npm install
    npm run dev        # start the dev server
    npm run lint       # type-check + lint
    npm run build-web  # production build
    

    Contributing

    Contributions are welcome! Please:

    1. Fork the repository and create a feature branch.
    2. For backend changes, run the relevant package tests (go test, and go test -race for concurrent code).
    3. For frontend changes, run npm run lint and npm run build-web from web/.
    4. Use Conventional Commits with a short lowercase scope (e.g. fix(server): ...).
    5. Open a pull request describing the motivation and behavior changes.

    License

    go-drive is released under the MIT License. Copyright © 2020 devld.

    server/webdav is a modified copy of golang.org/x/net/webdav, including that package's internal fork of encoding/xml. It remains Copyright The Go Authors and is covered by the BSD-3-Clause license. See NOTICE.

    drive/mega/internal/gomega is a modified copy of github.com/t3rm1n4l/go-mega. It remains Copyright 2019 Sarath Lakshman and is covered by the MIT License. See NOTICE.