Image Hosting
Moraya supports uploading images to external hosting services, replacing local paths with permanent URLs. Configure your preferred image host in Settings (Cmd+,) > Images.
Supported Providers
| Provider | API | Authentication |
|---|---|---|
| SM.MS | https://sm.ms/api/v2/upload | Bearer Token |
| Imgur | https://api.imgur.com/3/image | Client-ID Header |
| GitHub | GitHub Contents API | Bearer Token (PAT) |
| Qiniu Kodo | Qiniu Upload API | Access Key + Secret Key |
| Aliyun OSS | OSS REST API | AccessKey ID + AccessKey Secret |
| Tencent COS | COS XML API | SecretId + SecretKey |
| AWS S3 | S3 REST API | Access Key + Secret Key |
| Google Cloud Storage | JSON API | Service Account Key |
| Custom | User-defined endpoint | Bearer Token + Custom Headers |
Adding a Provider
Click “Add Host” in Settings > Images to see the provider selection menu. Providers are grouped by category:
- Image Beds — SM.MS, Imgur
- Git Repository — GitHub
- Object Storage — Qiniu Kodo, Aliyun OSS, Tencent COS, AWS S3, Google Cloud Storage
- Custom — Any REST API endpoint
Configuration
SM.MS
- Register at sm.ms and get your API token
- Select SM.MS as the provider in Settings > Images
- Paste your API token
Imgur
- Register an application at Imgur API
- Select Imgur as the provider
- Enter your Client-ID
GitHub
- Create a Personal Access Token with
reposcope - Select GitHub as the provider
- Enter your repository URL, branch, upload directory, and token
- Choose CDN: raw.githubusercontent.com (direct) or jsDelivr (CDN-accelerated)
Qiniu Kodo
- Register at Qiniu Cloud and create a storage bucket
- Select Qiniu Kodo as the provider
- Enter your Access Key, Secret Key, Bucket name, and Region
- Optionally set a custom domain for CDN access
Aliyun OSS
- Register at Alibaba Cloud and create an OSS bucket
- Select Aliyun OSS as the provider
- Enter your AccessKey ID, AccessKey Secret, Bucket, and Region (e.g.,
oss-cn-hangzhou) - Optionally set a custom domain
Tencent COS
- Register at Tencent Cloud and create a COS bucket
- Select Tencent COS as the provider
- Enter your SecretId, SecretKey, Bucket, and Region (e.g.,
ap-guangzhou)
AWS S3
- Create an S3 bucket in your AWS Console
- Select AWS S3 as the provider
- Enter your Access Key, Secret Key, Bucket, and Region (e.g.,
us-east-1)
Google Cloud Storage
- Create a bucket in your Google Cloud Console
- Select Google Cloud Storage as the provider
- Enter your Service Account Key, Bucket name, and Project ID
Custom
- Select Custom as the provider
- Enter your upload endpoint URL
- Configure any required headers as a JSON object
Upload Methods
Manual Upload
Right-click an image in the editor and select “Upload to Image Host”. The local path will be replaced with the returned URL.
Auto Upload
Enable Auto Upload in Settings > Images. When you paste or drag an image into the editor, it will be automatically uploaded to your configured service.
Test Upload
Click “Test Upload” in Settings to verify your configuration. Moraya sends a tiny 1×1 red pixel PNG to test the connection.
Import from Publish Targets
If you’ve configured a GitHub publish target (see Publish Targets), you can import its repository settings directly into the GitHub image hosting configuration with one click.