No description
Find a file
2023-12-25 13:46:32 +01:00
src add yml config system + initial routes 2023-12-25 13:46:32 +01:00
.gitignore add yml config system + initial routes 2023-12-25 13:46:32 +01:00
Cargo.lock add yml config system + initial routes 2023-12-25 13:46:32 +01:00
Cargo.toml add yml config system + initial routes 2023-12-25 13:46:32 +01:00
README.md add yml config system + initial routes 2023-12-25 13:46:32 +01:00

Rust Image Proxy

Overview

This Rust project is a versatile image proxy designed to efficiently handle image requests. Users can customize the caching behavior through a YAML configuration file, choosing between in-memory and on-disk caching based on provided regular expressions.

Features

  • Image Proxy: Efficiently fetches and serves images from remote sources.
  • Caching: Supports both in-memory and on-disk caching for improved performance.
  • Configuration: Customize caching behavior using a YAML configuration file.
  • Regex-Based Caching: Specify caching strategy based on a regular expression.

Getting Started

Prerequisites

  • Rust must be installed.

Installation

Clone the repository:

git clone https://gitea.qpismont.fr/qpismont/imgproxy-rs.git
cd rust-image-proxy

Build the project:

cargo build --release

Configuration

Create a YAML configuration file (config.yml) with the following structure:

storages:
  - strategy: !Memory
      ttl: 12
      max_size: 1000
    regex: "REGEX_HERE"
  - strategy: !Memory
      ttl: 32
      max_size: 16000
    regex: "REGEX_HERE"
  - strategy: !Disk
      path: "./cache"
      max_size: 128000
    regex: "REGEX_HERE"

secret_key: "SECRET_KEY_FOR_SECURE_URL"

Adjust the regex values and storage configurations as needed.

Usage

Run the proxy using the following command:

cargo run --release