README ¶
Inazuma
Inazuma is a front-end proxy server with cache capability, built using Go. It uses S3-like object storage as the cache database and can store the content of HTTP GET requests in the object storage. It can also accept HTTP PURGE requests to update the cache in a queue, processing the requests asynchronously to avoid excessive load on the upstream server.
Features
- Caching of HTTP GET requests in S3-like object storage
- Support for cache bypass based on specific cookies or query parameters
- Support for different Chinese-language variants through the
Accept-Language
header - Asynchronous cache updates using Kafka and Redis
- Docker and GitHub Actions integration for easy deployment
Installation
Prerequisites
- Go (1.17 or later)
- An S3-like object storage service (e.g., Amazon S3, MinIO)
- A Kafka server
- A Redis server
Building the application
- Clone the repository:
git clone https://github.com/mudkipme/inazuma.git
- Change into the
inazuma
directory:
cd inazuma
- Build the Go application:
go build -o inazuma
Configuration
Configure the application using the following environment variables:
UPSTREAM_SERVER
: The upstream server's URL (e.g.,http://example.com
)S3_ENDPOINT
: The S3-compatible object storage endpoint (e.g.,http://localhost:9000
)S3_REGION
: The S3-compatible object storage region (e.g.,us-east-1
)S3_ACCESS_KEY
: The S3-compatible object storage access keyS3_SECRET_KEY
: The S3-compatible object storage secret keyS3_BUCKET
: The S3-compatible object storage bucket nameKAFKA_BROKER
: The Kafka broker's address (e.g.,localhost:9092
)KAFKA_TOPIC
: The Kafka topic for PURGE requestsREDIS_ADDR
: The Redis server's address (e.g.,localhost:6379
)REDIS_PASSWORD
: The Redis server's password (if any)REDIS_DB
: The Redis server's database number
Usage
Run the application with the following command:
./inazuma
The proxy server will start listening on port 8080 by default.
License
Inazuma is licensed under the MIT License. See the LICENSE file for details.
The initial commit of this project is 100% created with GPT-4, including the README file. Here are the screenshots of the conversation between me and the AI model.
Documentation ¶
There is no documentation for this package.