Files
goma-gateway/README.md

209 lines
5.5 KiB
Markdown
Raw Normal View History

2024-11-20 08:24:39 +01:00
# Goma Gateway - simple Lightweight High-Performance API Gateway Management.
2024-10-27 06:10:27 +01:00
```
_____
/ ____|
| | __ ___ _ __ ___ __ _
| | |_ |/ _ \| '_ ` _ \ / _` |
| |__| | (_) | | | | | | (_| |
\_____|\___/|_| |_| |_|\__,_|
```
2024-11-18 14:54:05 +01:00
Goma Gateway is a lightweight High-Performance API Gateway Management.
2024-10-27 06:10:27 +01:00
2024-11-24 06:18:40 +01:00
[![Tests](https://github.com/jkaninda/goma-gateway/actions/workflows/test.yml/badge.svg)](https://github.com/jkaninda/goma-gateway/actions/workflows/test.yml)
[![GitHub Release](https://img.shields.io/github/v/release/jkaninda/goma-gateway)](https://github.com/jkaninda/goma-gateway/releases)
[![Go Report Card](https://goreportcard.com/badge/github.com/jkaninda/goma-gateway)](https://goreportcard.com/report/github.com/jkaninda/goma-gateway)
2024-10-27 06:10:27 +01:00
[![Go Reference](https://pkg.go.dev/badge/github.com/jkaninda/goma-gateway.svg)](https://pkg.go.dev/github.com/jkaninda/goma-gateway)
![Docker Image Size (latest by date)](https://img.shields.io/docker/image-size/jkaninda/goma-gateway?style=flat-square)
2024-11-24 06:18:40 +01:00
![Docker Pulls](https://img.shields.io/docker/pulls/jkaninda/goma-gateway?style=flat-square)
2024-10-27 06:10:27 +01:00
2024-11-02 13:58:01 +01:00
<img src="https://raw.githubusercontent.com/jkaninda/goma-gateway/main/logo.png" width="150" alt="Goma logo">
2024-11-02 13:45:17 +01:00
2024-11-04 06:00:28 +01:00
----
2024-11-02 21:19:35 +01:00
Architecture:
2024-11-02 21:20:45 +01:00
<img src="https://raw.githubusercontent.com/jkaninda/goma-gateway/main/goma-gateway.png" width="912" alt="Goma archi">
2024-11-02 21:19:35 +01:00
2024-10-27 06:10:27 +01:00
## Links:
- [Docker Hub](https://hub.docker.com/r/jkaninda/goma-gateway)
- [Github](https://github.com/jkaninda/goma-gateway)
2024-11-02 12:54:12 +01:00
### Documentation is found at <https://jkaninda.github.io/goma-gateway>
2024-11-18 10:40:12 +01:00
## Features
It's designed to be straightforward and efficient, offering a rich set of features, including:
### Core Features
- **RESTful API Gateway Management**
Simplify the management of your API Gateway with powerful tools.
- **Domain/Host-Based Request Routing**
Route requests based on specific domains or hosts.
- **Multi-Domain Request Routing**
Handle requests across multiple domains seamlessly.
- **Reverse Proxy**
Efficiently forward client requests to backend servers.
- **WebSocket Proxy**
Enable real-time communication via WebSocket support.
### Security and Control
- **Cross-Origin Resource Sharing (CORS)**
Define and manage cross-origin policies for secure interactions.
- **Custom Headers**
Add and modify headers to meet specific requirements.
- **Backend Errors Interceptor**
Catch and handle backend errors effectively.
- **Block Common Exploits Middleware**
- Detect patterns indicating SQL injection attempts.
- Identify basic cross-site scripting (XSS) attempts.
- **Authentication Middleware**
- Support for **JWT** with client authorization based on request results.
- **Basic-Auth** and **OAuth** authentication mechanisms.
### Monitoring and Performance
- **Logging**
Comprehensive request and response logging.
- **Metrics**
Gather insights and monitor performance metrics.
- **Rate Limiting**
- **In-Memory Rate Limiting**: Client IP-based request throttling.
- **Distributed Rate Limiting**: Leverage Redis for scalable, client IP-based rate limits.
- **Load Balancing**
Use a round-robin algorithm for efficient load distribution.
### Configuration and Flexibility
2024-11-22 18:19:20 +01:00
- **Support for Multiple Route and Middleware Configuration Files**
2024-11-18 10:40:12 +01:00
Organize routes across multiple `.yml` or `.yaml` files.
- **TLS Support**
Ensure secure communication with TLS integration.
- **HTTP Method Restrictions**
Limit HTTP methods for specific routes to enhance control.
Define your routes and middleware directly in code for seamless configuration.
2024-11-02 12:39:31 +01:00
2024-11-04 06:00:28 +01:00
----
2024-11-03 04:01:18 +01:00
2024-10-27 06:10:27 +01:00
## Usage
### 1. Initialize configuration
You can generate the configuration file using `config init --output /etc/goma/config.yml` command.
2024-11-04 07:48:03 +01:00
The default configuration is automatically generated if any configuration file is not provided, and is available at `/etc/goma/goma.yml`
2024-11-04 07:37:47 +01:00
2024-10-27 06:10:27 +01:00
```shell
docker run --rm --name goma-gateway \
-v "${PWD}/config:/etc/goma/" \
jkaninda/goma-gateway config init --output /etc/goma/goma.yml
2024-10-27 06:10:27 +01:00
```
2024-11-10 21:34:52 +01:00
## 2. Check configuration
```shell
docker run --rm --name goma-gateway \
-v "${PWD}/config:/etc/goma/" \
-p 8080:8080 \
jkaninda/goma-gateway config check --config /etc/goma/config.yml
```
### 3. Run server
2024-10-27 06:10:27 +01:00
```shell
docker run --rm --name goma-gateway \
-v "${PWD}/config:/etc/goma/" \
-p 8080:8080 \
2024-10-27 06:10:27 +01:00
jkaninda/goma-gateway server
```
2024-11-10 21:34:52 +01:00
### 4. Start server with a custom config
2024-10-27 06:10:27 +01:00
```shell
docker run --rm --name goma-gateway \
-v "${PWD}/config:/etc/goma/" \
-p 8080:8080 \
-p 8443:8443 \
jkaninda/goma-gateway server --config /etc/goma/config.yml
2024-10-27 06:10:27 +01:00
```
### 4. Healthcheck
- Goma Gateway health check: `/health/live`
2024-11-10 21:34:52 +01:00
- Routes health check: `/health/routes`
2024-10-27 07:24:50 +01:00
2024-11-04 06:00:28 +01:00
### 5. Simple deployment in docker compose file
```yaml
services:
goma-gateway:
image: jkaninda/goma-gateway
command: server
ports:
- "8080:8080"
2024-11-04 06:00:28 +01:00
volumes:
- ./config:/etc/goma/
2024-11-04 06:00:28 +01:00
```
2024-11-09 04:52:05 +01:00
## Supported Systems
2024-10-27 06:10:27 +01:00
2024-11-09 04:52:05 +01:00
- [x] Linux
- [x] MacOS
- [x] Windows
Please download the binary from the [release page](https://github.com/jkaninda/goma-gateway/releases).
2024-11-10 21:30:54 +01:00
2024-11-10 20:19:46 +01:00
Init configs:
```shell
./goma config init --output config.yml
```
To run
```shell
./goma server --config config.yml
```
2024-11-10 20:19:46 +01:00
2024-11-09 04:52:05 +01:00
## Deployment
2024-10-27 06:10:27 +01:00
- Docker
2024-11-09 04:52:05 +01:00
- Kubernetes
2024-11-04 07:37:47 +01:00
## Contributing
The Goma Gateway project welcomes all contributors. We appreciate your help!
## Give a Star! ⭐
If you like or are using Goma Gateway, please give it a star. Thanks!
2024-11-09 04:52:05 +01:00
Please share.
2024-11-04 07:37:47 +01:00
## License
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.
## Copyright
Copyright (c) 2024 Jonas Kaninda