Files
goma-gateway/README.md

147 lines
3.8 KiB
Markdown
Raw Normal View History

2024-11-04 06:00:28 +01:00
# Goma Gateway - simple lightweight API Gateway Management.
2024-10-27 06:10:27 +01:00
```
_____
/ ____|
| | __ ___ _ __ ___ __ _
| | |_ |/ _ \| '_ ` _ \ / _` |
| |__| | (_) | | | | | | (_| |
\_____|\___/|_| |_| |_|\__,_|
```
2024-11-04 06:00:28 +01:00
Goma Gateway is a lightweight API Gateway Management.
2024-10-27 06:10:27 +01:00
2024-10-27 07:24:50 +01:00
[![Build](https://github.com/jkaninda/goma-gateway/actions/workflows/release.yml/badge.svg)](https://github.com/jkaninda/goma-gateway/actions/workflows/release.yml)
[![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-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-02 12:39:31 +01:00
### Features
It's designed to be straightforward and efficient, offering features, like:
2024-11-02 12:39:31 +01:00
- RESTFull API Gateway management
- Domain/host based request routing
- Multi domain request routing
2024-11-04 05:36:52 +01:00
- Reverse Proxy
- Websocket Proxy
2024-11-02 12:39:31 +01:00
- Cross-Origin Resource Sharing (CORS)
2024-11-04 05:35:57 +01:00
- Custom Headers
- Backend Errors interceptor
2024-11-09 15:18:43 +01:00
- Logging
- Metrics
- Supports Load Balancing, round-robin algorithm
2024-11-07 00:00:58 +01:00
- Support TLS
- Block common exploits middleware
- Patterns to detect SQL injection attempts
- Pattern to detect simple XSS attempts
2024-11-02 12:39:31 +01:00
- Authentication middleware
- JWT `client authorization based on the result of a request`
- Basic-Auth
- OAuth
2024-11-02 12:39:31 +01:00
- Rate limiting
- In-Memory Token Bucket based
- In-Memory client IP based
- Limit HTTP methods allowed for a particular route.
2024-11-02 12:39:31 +01:00
### Todo:
2024-11-09 11:05:21 +01:00
- [ ] Load Balancing Healthcheck, disable unavailable servers
2024-11-09 15:18:43 +01:00
- [ ] Blocklist IP address middleware
- [ ] Distributed Rate Limiting for In-Memory client IP based across multiple instances using Redis
2024-10-27 06:10:27 +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
```
### 2. Run server
```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
```
### 3. Start server with a custom config
```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-05 20:48:20 +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
## 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