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
- Enter "System Settings" → "Upload Settings" from the top left menu
- Find "Telegram Channel Configuration"
- Click "Add Channel"
- 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
- Click "Save Settings"
Configure R2 Channel
For server deployment, Cloudflare R2 storage is added by default. The following steps are only for Cloudflare deployment:
- Bind R2 bucket in project settings:
- Select "Settings" → "Bindings"
- Add "R2 bucket"
- Variable name:
img_r2
- R2 bucket: Select the created bucket
- 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.
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 Name | Purpose | Type | Content Specification |
---|---|---|---|
siteTitle | Website Title | String | Only supports string type, set to your custom website title |
siteIcon | Website Icon | String | Only supports string type, set to your custom website icon link |
ownerName | Image Hosting Name | String | Only supports string type, set to your custom image hosting name (default is Sanyue ) |
logoUrl | Image Hosting Logo | String | Only supports string type, set to your custom image hosting logo link |
announcement | Announcement | String | Only supports string type, can be HTML format, set to your custom announcement content (if any) |
loginBkImg | Login Page Background | List/String | 1. 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. |
uploadBkImg | Upload Page Background | List/String | Same as above |
bkInterval | Background Switch Interval | Positive Integer | Set to background image carousel time, default 3000 , unit ms .For example, if you want to switch every 10s, set to 10000 . |
bkOpacity | Background Image Transparency | Float 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 |
footerLink | Footer Portal Link | String | Only supports string type, set to your custom destination address (like personal blog link) |
disableFooter | Hide Footer | boolean | Supports boolean type, set to true to disable footer, default false |
urlPrefix | Default URL Prefix | String | Only 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 domainCF_EMAIL
: Cloudflare account emailCF_API_KEY
: Cloudflare Global API Key
🔧 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 Name | Type | Required | Description | Example Value |
---|---|---|---|---|
BASIC_USER | string | No | Admin username | admin |
BASIC_PASS | string | No | Admin password | your_secure_password |
AUTH_CODE | string | No | Upload authentication code | your_auth_code |
Storage Channel Configuration
Telegram Channel
Variable Name | Type | Required | Description | Example Value |
---|---|---|---|---|
TG_BOT_TOKEN | string | Yes | Telegram Bot Token | 123456789:ABCdefGHI... |
TG_CHAT_ID | string | Yes | Telegram Channel ID | -1001234567890 |
Feature Switch Configuration
Variable Name | Type | Default | Description |
---|---|---|---|
AllowRandom | boolean | false | Enable random image API |
WhiteList_Mode | boolean | false | Enable whitelist mode |
disable_telemetry | boolean | false | Disable telemetry data |
Security Configuration
Variable Name | Type | Description | Example Value |
---|---|---|---|
ALLOWED_DOMAINS | string | List of domains allowed to access | domain1.com,domain2.com |
ModerateContentApiKey | string | Image content review API Key | your_api_key |
CDN Cache Configuration
Variable Name | Type | Description | Purpose |
---|---|---|---|
CF_ZONE_ID | string | Cloudflare Zone ID | Automatically clear CDN cache |
CF_EMAIL | string | Cloudflare account email | Automatically clear CDN cache |
CF_API_KEY | string | Cloudflare Global API Key | Automatically clear CDN cache |