Skip to content

Configuration Guide

This section details the various configuration options and custom settings for CloudFlare ImgBed.

🗂️ Storage Channel Configuration

After deployment is complete, access your domain and enter the admin backend to configure storage channels.

Access Admin Backend

Visit https://your-domain/dashboard

Note

The admin backend requires no password by default. Please set an admin username and password promptly after logging in.

Configure Telegram Channel

  1. Enter "System Settings" → "Upload Settings" from the top left menu
  2. Find "Telegram Channel Configuration"
  3. Click "Add Channel"
  4. Fill in the prepared Token and Chat ID:
    • Channel Name: Custom name (e.g., Main Channel)
    • Bot Token: Token obtained from @BotFather
    • Chat ID: Channel ID (with - sign)
    • Enable Status: On
  5. Click "Save Settings"

Configure R2 Channel

For server deployment, Cloudflare R2 storage is added by default. The following steps are only for Cloudflare deployment:

  1. Bind R2 bucket in project settings:
    • Select "Settings" → "Bindings"
    • Add "R2 bucket"
    • Variable name: img_r2
    • R2 bucket: Select the created bucket

Configure R2 Channel

  1. Configure in admin backend:
    • Enter "System Settings" → "Upload Settings"
    • Configure R2 channel parameters
    • If image review is needed, fill in R2 public access link

Note

Please note the free tier limits of Cloudflare R2, exceeding which may incur costs. Note

Configure S3 Channel

Fill in the S3 channel configuration in the admin backend:

  • Access Key ID: Access key ID
  • Secret Access Key: Secret access key
  • Bucket Name: Bucket name
  • Endpoint: Service endpoint (complete host-style URL, e.g., https://s3.us-east-005.backblazeb2.com)
  • Region: Storage region (optional)

🔒 Security Settings

Security-related settings are configured in "System Settings" → "Security Settings" in the admin backend

Authentication Management

  • User Authentication: Used for web user login and API authentication
  • Admin Authentication: Admin username and password for accessing the admin backend

Upload Management

  • Image Review: Review channel currently only supports moderatecontent.com. Use the steps in Prerequisites to get the API Key

Access Management

  • Domain Filtering
    • Allowed Domains: List of domains allowed to access (leave empty to allow all domains, otherwise manually add the image hosting's own domain)
    • Whitelist Mode: When enabled, only files added to the whitelist can be accessed

🌐 Web Settings

Frontend web-related settings are configured in "System Settings" → "Web Settings" in the admin backend

Field NamePurposeTypeContent Specification
siteTitleWebsite TitleStringOnly supports string type, set to your custom website title
siteIconWebsite IconStringOnly supports string type, set to your custom website icon link
ownerNameImage Hosting NameStringOnly supports string type, set to your custom image hosting name (default is Sanyue)
logoUrlImage Hosting LogoStringOnly supports string type, set to your custom image hosting logo link
announcementAnnouncementStringOnly supports string type, can be HTML format, set to your custom announcement content (if any)
loginBkImgLogin Page BackgroundList/String1. When field type is list, list elements are image links to be added to the carousel list (when list has only one image, it becomes a fixed background), like ["1.jpg","2.jpg"]
2. When field type is string, currently only supports string value bing, setting this value enables bing random image carousel mode.
uploadBkImgUpload Page BackgroundList/StringSame as above
bkIntervalBackground Switch IntervalPositive IntegerSet to background image carousel time, default 3000, unit ms.
For example, if you want to switch every 10s, set to 10000.
bkOpacityBackground Image TransparencyFloat in (0,1]Displayed background image transparency, default is 1.
If you think the display effect is poor, you can customize it, like 0.8
footerLinkFooter Portal LinkStringOnly supports string type, set to your custom destination address (like personal blog link)
disableFooterHide FooterbooleanSupports boolean type, set to true to disable footer, default false
urlPrefixDefault URL PrefixStringOnly supports string type, set to custom global default link prefix, this prefix will override the original default prefix, but will not override user-customized link prefixes

🛠️ Other Settings

Other setting items are configured in "System Settings" → "Other Settings" in the admin backend

Remote Telemetry

This helps developers capture and locate bugs, but may collect information such as access links and domain names during the process. If you don't want to disclose such information to project developers, please disable this feature in the admin backend.

Random Image API

  • Directory: Directories with random image permissions, default is root directory, multiple directories separated by commas; all directories use absolute paths, e.g., /img/cover, indicating that files in this directory and all its subdirectories can be accessed by the random image API

CloudFlare API Token

Under normal circumstances, due to the existence of CloudFlare CDN cache, operations such as deletion, blacklisting, and whitelisting in the admin backend will not take effect immediately and need to wait until the cache expires. To make operations take effect immediately, it is recommended to set this item as follows:

  • CF_ZONE_ID: Cloudflare Zone ID of the bound domain How to get
  • CF_EMAIL: Cloudflare account email
  • CF_API_KEY: Cloudflare Global API Key How to get

🔧 Environment Variables List

Note

Environment variable setting method has been deprecated after v2.0. Please configure the following in the admin backend.

Basic Authentication Configuration

Variable NameTypeRequiredDescriptionExample Value
BASIC_USERstringNoAdmin usernameadmin
BASIC_PASSstringNoAdmin passwordyour_secure_password
AUTH_CODEstringNoUpload authentication codeyour_auth_code

Storage Channel Configuration

Telegram Channel

Variable NameTypeRequiredDescriptionExample Value
TG_BOT_TOKENstringYesTelegram Bot Token123456789:ABCdefGHI...
TG_CHAT_IDstringYesTelegram Channel ID-1001234567890

Feature Switch Configuration

Variable NameTypeDefaultDescription
AllowRandombooleanfalseEnable random image API
WhiteList_ModebooleanfalseEnable whitelist mode
disable_telemetrybooleanfalseDisable telemetry data

Security Configuration

Variable NameTypeDescriptionExample Value
ALLOWED_DOMAINSstringList of domains allowed to accessdomain1.com,domain2.com
ModerateContentApiKeystringImage content review API Keyyour_api_key

CDN Cache Configuration

Variable NameTypeDescriptionPurpose
CF_ZONE_IDstringCloudflare Zone IDAutomatically clear CDN cache
CF_EMAILstringCloudflare account emailAutomatically clear CDN cache
CF_API_KEYstringCloudflare Global API KeyAutomatically clear CDN cache

Released under the MIT License