Skip to content

mishankov/proxymini

Repository files navigation

ProxyMini

ProxyMini is a lightweight proxy server written in Go that provides HTTP request logging capabilities

Configuration

Environment variables

  • PROXYMINI_PORT: The port on which the ProxyMini server will listen. Default is 14443.
  • PROXYMINI_CONFIG: The path to the TOML configuration file. Default is "proxymini.conf.toml".
  • PROXYMINI_DB: The path to the database file used for request logging. Default is "rl.db".

Configuration file

ProxyMini uses a TOML file to define proxy routing rules. Example config:

[[proxy]]
prefix = "/api"
target = "http://api-server:8080"

[[proxy]]
prefix = "/auth"
target = "http://auth-service:9000"

More specific rules should be before more general ones.

Proxy Configuration Options

Each proxy entry supports the following options:

  • prefix (required): The URL path prefix to match
  • target (required): The target URL to proxy requests to
  • skipLogging (optional): Set to true to disable request logging for this proxy route
  • insecureTLSSkipVerify (optional): Set to true to skip TLS certificate verification when proxying to HTTPS targets with self-signed or invalid certificates

Example with all options:

[[proxy]]
prefix = "/api"
target = "https://api-server:8443"
skipLogging = false
insecureTLSSkipVerify = true

Logs Retention

ProxyMini can automatically clean up old request logs to prevent database bloat. Configure retention using the retention parameter in your TOML config file:

# Global retention setting (seconds)
retention = 604800  # 7 days

[[proxy]]
prefix = "/api"
target = "http://api-server:8080"
  • retention (optional): Time in seconds to keep request logs before automatic deletion. When set to a value greater than 0, ProxyMini runs a cleanup job every hour to delete logs older than the retention period. Default is 0 (retention disabled - logs are kept indefinitely).

Runtime commands

ProxyMini now runs on Platforma's application + httpserver packages.

# start proxy server
go run ./cmd/proxymini run

# show available commands
go run ./cmd/proxymini --help

SQLite migrations

ProxyMini still uses SQLite for request logs.

  • SQLite schema migration runs automatically during run as a startup task.
  • migrate command is intentionally a no-op for SQLite, because Platforma's native database migration command targets PostgreSQL repositories.

Web UI

ProxyMini includes a web interface for viewing request logs. Access it by navigating to /app

web-ui

Frontend Development (SvelteKit + Bun)

The UI source lives in webui/ and is built as a static site into webapp/static/. The webapp/static/ contents are generated and are not committed to git.

Prerequisites:

  • Bun
  • Task (recommended command runner)

Common commands:

# install frontend dependencies
task ui:install

# build static UI into webapp/static
task ui:build

# run sveltekit dev server
task ui:dev

# build UI + backend binary
task build

# run UI checks + backend tests
task test

Deployment

Download binary from release page or use docker image:

docker pull ghcr.io/mishankov/proxymini:latest

Docker compose example

services:
  proxy:
    image: ghcr.io/mishankov/proxymini:latest
    ports:
      - "14443:14443"
    volumes:
      # mapping config file to container
      - ./proxymini.conf.toml:/app/proxymini.conf.toml:ro
      # mapping folder with database
      - ./data:/app/data:rw

About

🕸️ Lightweight proxy server

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors