叁月柒 7663b8e2f5 Merge pull request #299 from lengsukq/main
新增webdav支持
2025-08-28 11:16:37 +08:00
2025-06-25 21:48:29 +08:00
2025-08-24 12:01:33 +08:00
2025-08-23 11:35:11 +08:00
2025-01-11 16:02:08 +08:00
2025-08-24 12:01:33 +08:00
2025-05-11 13:43:49 +08:00
2025-07-27 23:06:46 +08:00
2025-05-11 14:14:55 +08:00
2025-05-21 17:15:33 +08:00
2025-08-24 12:01:33 +08:00
2025-05-12 23:32:03 +08:00
2025-07-16 10:24:03 +08:00
2025-07-10 14:59:41 +08:00

logo

🗂️Open-source file hosting solution, supporting Docker and serverless deployment, supporting multiple storage channels such as Telegram Bot, Cloudflare R2, S3, etc.

简体中文 | English | Official Website


Important

Please check the announcement for upgrade notes on version 2.0!

Announcement

Pinned

  1. If you encounter issues during deployment or usage, please carefully read the documentation, FAQ, and existing issues first.
  2. Note: This repository is a remake of the Telegraph-Image project. If you like this project, please support the original one as well.

2025.2.6 Version 2.0 Upgrade Notes

The v2.0 version has been released, with many changes and optimizations compared to v1.0. However, the beta version may have potential instability. If you prefer stability, you may delay updating.

Due to changes in the build command, this update requires manual operation. Please follow these steps:

  • Sync your forked repository to the latest version (ignore if already synced automatically)
  • Go to the Pages management page, enter Settings -> Build, edit the Build configuration, and set the Build command to npm install
  • All new version settings have been migrated to the Admin Panel -> System Settings interface, so generally no need to configure environment variables anymore. Settings made in the system settings interface will override environment variable settings. However, to ensure compatibility of images uploaded via the Telegram channel with the old version, please keep any previously set Telegram-related environment variables!
  • After confirming the above settings are correct, go to the Pages management page, enter Deployments, and Retry the last failed deployment.

Notification About Switching to Telegram Channel

Due to abuse of the telegraph image hosting, the upload channel has switched to Telegram Channel. Please update to the latest version (see the last section of chapter 3.1 for update instructions) and set TG_BOT_TOKEN and TG_CHAT_ID according to the deployment requirements in the documentation, otherwise upload functionality will not work.

Also, the KV database is now mandatory; if not configured before, please configure it as per the documentation.

For issues, please check section 5 FAQ first.

1. Introduction

Free file hosting solution with full lifecycle features including upload, management, read, and delete, supporting authentication, directories, image moderation, random images, and other features (see Feature Docs for details).

CloudFlare

2. Document

Provides detailed deployment documentation, feature docs, development plans, update logs, FAQ, and more to help you get started quickly.

recent update

3. Demo

Demo Address: CloudFlare ImgBed Access Password: cfbed

image-20250313204101984

image-20250313204138886

Other page screenshots

image-20250313204308225

image-20250314152355339

status-page

image-20250313204325002

4. WebDAV Bridge Service

This project provides a powerful WebDAV Bridge Cloudflare Worker that allows you to access and manage hosted files through the standard WebDAV protocol.

4.1 Features

  • 🔒 Authentication: Supports Basic Auth authentication with username/password
  • 📁 Directory Browsing: Complete directory structure display, supports both HTML pages and WebDAV clients
  • 📤 File Upload: Upload files to specified directories using PUT method
  • 🗑️ File Deletion: Support for deleting individual files or entire folders
  • 📥 File Download: Direct file downloads with automatic proxy to upstream storage
  • 🌐 CORS Support: Built-in CORS support ensuring proper web client access

4.2 Supported WebDAV Methods

Method Function Description
PROPFIND List directory contents Get file and folder lists, supports WebDAV clients
GET Download file/browse directory File downloads or HTML directory browsing pages
PUT Upload file Upload files to specified paths and folders
DELETE Delete file/folder Support for deleting individual files or entire directories
OPTIONS Protocol detection Returns supported WebDAV methods and features
MKCOL Create directory Create new folders (automatically supported)

4.3 Deployment Configuration

4.3.1 Environment Variables

Set the following environment variables in your Cloudflare Worker:

# WebDAV authentication credentials
AUTH_USER=your_username          # WebDAV login username
AUTH_PASS=your_password          # WebDAV login password

# Upstream API configuration
UPSTREAM_HOST=your-imgbed.domain.com  # Your image bed domain
API_TOKEN=your_api_token         # API access token

For a better user experience, it's highly recommended to bind a custom domain to your WebDAV Worker:

  1. Prepare Domain: Ensure you have an available domain that is hosted on Cloudflare

  2. Add Custom Route:

    • Go to Cloudflare Workers console
    • Select your WebDAV Worker
    • Click the Triggers tab
    • Click Add Custom Domain
    • Enter your subdomain, e.g.: webdav.yourdomain.com
    • Click Add Domain
  3. SSL Certificate: Cloudflare will automatically provide a free SSL certificate for your custom domain

Advantages of Using Custom Domain:

  • 🌟 Better Compatibility: Avoid limitations some WebDAV clients have with .workers.dev domains
  • 🔒 Enhanced Security: Custom domains are generally more trusted by clients
  • 📱 Mobile Friendly: iOS/Android devices have better support for custom domains
  • 🎯 Brand Consistency: Use a unified domain system with your image hosting service

4.4 Usage

Browser Access

Access the Worker address directly in your browser and enter authentication credentials to browse file directories:

# Using custom domain (recommended)
https://webdav.yourdomain.com/

# Or using default Worker domain
https://your-webdav-worker.your-subdomain.workers.dev/

WebDAV Clients

You can use any WebDAV-compatible client to connect:

Windows File Explorer:

  1. Open "This PC"
  2. Right-click and select "Add a network location"
  3. Enter the WebDAV Worker address
  4. Enter username and password

macOS Finder:

  1. Press Cmd+K in Finder
  2. Enter WebDAV address (custom domain recommended):
    • https://webdav.yourdomain.com or
    • https://your-webdav-worker.your-subdomain.workers.dev
  3. Enter authentication credentials

Third-party Clients:

  • File managers like Cyberduck, WinSCP, FileZilla Pro
  • Mobile: FE File Explorer, Documents by Readdle, etc.

4.5 Key Features

  • Smart Path Handling: Automatic path processing with support for Chinese characters and special characters
  • Paginated Loading: Large directories are automatically paginated for improved performance
  • Error Handling: Comprehensive error handling with user-friendly error messages
  • Cache Optimization: Proper browser caching utilization for improved access speed
  • Secure & Reliable: Based on Cloudflare Worker edge computing with global acceleration

Through WebDAV Bridge, you can manage hosted files just like using a local folder, achieving a true "cloud drive" experience!

5. Tips

  • Frontend is open source, see MarSeventh/Sanyue-ImgHub.

  • Ecosystem: We welcome community participation in the ecosystem construction. Feel free to submit PRs or Issues, and high-quality content can be found on the official ecosystem page.

  • Sponsor: Maintaining the project is not easy. If you like it, please support the author. Your support is the motivation to keep going~

  • Sponsors: Thanks to the following sponsors for supporting this project!

    sponsors

  • Contributors: Thanks to the following contributors for their selfless contributions!

    Contributors

5. Star History

If you like the project, please give a free star, thank you very much!

Star History Chart

6. Special Sponsors

Description
Open-source file hosting solution based on CloudFlare (Image hosting/File storage/Cloud drive) / 基于 CloudFlare 的开源文件托管解决方案(图床/文件床/网盘)
Readme MIT 611 MiB
Languages
JavaScript 100%