Sign inSign up

haierkeys/obsidian-image-api-gateway

By haierkeys

•Updated 11 months ago

Provide image resizing, cropping, upload/download, and cloud storage features for Obsidian CIAU.

Image
API management
Databases & storage
0

10K+

haierkeys/obsidian-image-api-gateway repository overview

⁠Obsidian Image API Gateway

version license

This project provides image uploading, storage, and cloud synchronization services for the Custom Image Auto Uploader⁠ Obsidian plugin.

⁠Feature List

  • Supports image uploading
  • Supports token authorization to enhance API security
  • Supports HTTP access to images (basic functionality, Nginx is recommended as an alternative)
  • Storage support:
    • Save to both local and cloud storage for easy migration
    • Local storage support (designed for NAS, functionality tested)
    • Support for Alibaba Cloud OSS storage (implemented but untested)
    • Support for Cloudflare R2 storage (implemented and tested)
    • Support for Amazon S3 (implemented and tested)
    • Added MinIO storage support (v1.5+)
    • Google ECS support (to be developed)
  • Provides Docker installation support for use on home NAS or remote servers
  • Provides public service API & web interface for public service usage User Public Interface & Web Interface⁠

⁠Changelog

To view the complete update details, please visit Changelog⁠.

⁠Pricing

This software is open-source and free. If you would like to show your appreciation or support continued development, you can do so via the following method:

BuyMeACoffee

⁠Quick Start

⁠Installation
  • Directory Setup

    # Create the required directories for the project
    mkdir -p /data/image-api
    cd /data/image-api
    
    mkdir -p ./config && mkdir -p ./storage/logs && mkdir -p ./storage/uploads
    

    On first startup, if the configuration file is not downloaded, the program will automatically generate a default configuration in config/config.yaml.

    If you want to download the default configuration from the network, use the following command:

    # Download the default configuration file from the open-source repository to the config directory
    wget -P ./config/ https://raw.githubusercontent.com/haierkeys/obsidian-image-api-gateway/main/config/config.yaml
    
  • Containerized Installation (Docker Method)

    Assuming your server stores images at /data/storage/uploads, execute the following commands:

    # Pull the latest container image
    docker pull haierkeys/obsidian-image-api-gateway:latest
    
    # Create and start the container
    docker run -tid --name image-api \
            -p 9000:9000 -p 9001:9001 \
            -v /data/image-api/storage/:/api/storage/ \
            -v /data/image-api/config/:/api/config/ \
            haierkeys/obsidian-image-api-gateway:latest
    
⁠Usage
  • Using the Single-Service API

    Supports Local Storage, OSS, Cloudflare R2, Amazon S3, and MinIO.

    Modify config.yaml⁠

    Change http-port and auth-token options.

    Start the gateway program.

    The API gateway address is http://{IP:PORT}/api/upload

    The API access token is the content of auth-token.

  • Using the Multi-User Public Service API

    Supports OSS, Cloudflare R2, and Amazon S3.

    Modify config.yaml⁠

    Change http-port and database.

    Also, set user.is-enable and user.register-is-enable to true.

    Start the gateway program.

    Access the WebGUI at http://{IP:PORT} to configure user registration.

    Image

    The API gateway address is http://{IP:PORT}/api/user/upload.

    Click on WebGUI to copy API configuration and obtain setup details.

⁠Configuration Instructions

The default configuration file is named config.yaml. Place it in the root directory or the config directory.

For more configuration details, refer to:

⁠Other Resources

Tag summary

Content type

Image

Digest

sha256:bc6d2449c…

Size

61.7 MB

Last updated

11 months ago

docker pull haierkeys/obsidian-image-api-gateway