Sign inSign up

superhuang/super-api-manager

By superhuang

Updated 2 months ago

Self-hosted API management, request debugging, environments, and automated collection runs.

Image
0

250

superhuang/super-api-manager repository overview

Super API Manager

Self-hosted API management and request debugging with projects, environments, OpenAPI import, reusable requests, response examples, and collection runs.

Source: SuperHuang-CN/SuperApiManager

Image

docker pull superhuang/super-api-manager:0.1.0

0.1.0 supports linux/amd64 and linux/arm64. The image contains the API on port 4070 and the web frontend on port 4071. Persistent application data is stored below /data.

Quick start

docker volume create super-api-manager-data

docker run -d \
  --name super-api-manager \
  --restart unless-stopped \
  -p 127.0.0.1:4070:4070 \
  -p 127.0.0.1:4071:4071 \
  -e SUPER_API_MANAGER_DATABASE_PROVIDER=SQLITE \
  -e SUPER_API_MANAGER_DATABASE_URL=file:/data/super-api-manager.db \
  -e SUPER_API_MANAGER_SECRET_KEY=replace-with-a-stable-random-secret \
  -e ALLOW_PRIVATE_NETWORK=true \
  -v super-api-manager-data:/data \
  superhuang/super-api-manager:0.1.0

Keep SUPER_API_MANAGER_SECRET_KEY stable and backed up. It encrypts saved environment secrets. Set ALLOW_PRIVATE_NETWORK=false when users must not send requests to private network targets.

Reverse proxy under any path

The web process does not proxy API requests. Put both ports behind the same public origin:

location = /api-manager {
    return 308 /api-manager/;
}

location /api-manager/api/ {
    proxy_pass http://127.0.0.1:4070/api/;
    proxy_set_header Host $http_host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-Prefix /api-manager;
    proxy_cookie_path / /api-manager/;
}

location /api-manager/action/ {
    proxy_pass http://127.0.0.1:4070/action/;
    proxy_set_header Host $http_host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-Prefix /api-manager;
    proxy_cookie_path / /api-manager/;
}

location /api-manager/ {
    proxy_pass http://127.0.0.1:4071/;
    proxy_set_header Host $http_host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-Prefix /api-manager;
}

The trailing slash on every proxy_pass is required. Replace /api-manager with any public prefix. When Nginx runs in the same Compose project, use the service name instead of 127.0.0.1. Do not create a Docker network manually; Compose's default network is sufficient.

Remote system storage supports PostgreSQL, MySQL, and MariaDB through SUPER_API_MANAGER_DATABASE_PROVIDER and SUPER_API_MANAGER_DATABASE_URL.

Tag summary

Content type

Image

Digest

sha256:c9c88924b

Size

179.7 MB

Last updated

2 months ago

docker pull superhuang/super-api-manager:0.1.0-amd64