Deployment Guide

Quickly deploy your own KiroGate instance

๐Ÿ“‹

Requirements

๐Ÿ
Python 3.10+
๐Ÿ“ฆ
pip or poetry
๐ŸŒ
Network Access
โš™๏ธ

Environment Variables

# Required
PROXY_API_KEY="your-secret-api-key"      # Proxy server password

# Optional (simple mode only)
# If you use combined mode (PROXY_API_KEY:REFRESH_TOKEN), this setting can be omitted.
REFRESH_TOKEN="your-kiro-refresh-token"  # Kiro Refresh Token

# Other optional settings
KIRO_REGION="us-east-1"                  # AWS region
PROFILE_ARN="arn:aws:..."                # Profile ARN
LOG_LEVEL="INFO"                          # Log level

# Or use a credentials file
KIRO_CREDS_FILE="~/.kiro/credentials.json"

๐Ÿ’ก Configuration notes

  • โ€ข Simple mode: Requires the REFRESH_TOKEN environment variable.
  • โ€ข Combined mode (recommended): No REFRESH_TOKEN required; users pass it in the request.
  • โ€ข Multi-tenant deployment: Combined mode lets multiple users share the same gateway instance.
๐Ÿ

Run Locally

# Clone the repository
git clone https://github.com/dext7r/KiroGate.git
cd KiroGate

# Install dependencies
pip install -r requirements.txt

# Configure environment variables
cp .env.example .env
# Edit .env to fill in the configuration

# Start the service
python main.py
๐Ÿณ

Docker Deployment

Docker Compose (Recommended)

# Copy the config file
cp .env.example .env
# Edit .env to fill in your credentials

# Start the service (creates the persistent volume automatically)
docker-compose up -d

# View logs
docker logs -f kirogate

Manual Docker Run

docker build -t kirogate .
docker run -d -p 8000:8000 \
  -v kirogate_data:/app/data \
  -e PROXY_API_KEY="your-key" \
  -e ADMIN_PASSWORD="your-admin-pwd" \
  --name kirogate kirogate
๐Ÿš€

Fly.io Deployment

# 1. Install the Fly CLI and log in
curl -L https://fly.io/install.sh | sh
fly auth login

# 2. Create the app
fly apps create kirogate

# 3. Create a persistent volume (important to prevent data loss)
fly volumes create kirogate_data --region nrt --size 1

# 4. Set environment variables
fly secrets set PROXY_API_KEY="your-password"
fly secrets set ADMIN_PASSWORD="your-admin-password"
fly secrets set ADMIN_SECRET_KEY="your-random-secret"

# 5. Deploy
fly deploy
๐Ÿ’พ

Data Persistence

โš ๏ธ Important

User data (database) must be persisted, otherwise every deployment will lose all users, tokens, and API keys!

๐Ÿณ Docker Compose

Named volume kirogate_data:/app/data is already configured; use docker-compose down to retain data.

๐Ÿš€ Fly.io

Create the volume manually: fly volumes create kirogate_data --region nrt --size 1

๐Ÿ”

Obtain a Refresh Token

๐ŸŒ Option 1: Browser (Recommended)

  1. 1Open https://app.kiro.dev/account/usage and log in.
  2. 2Press F12 to open DevTools.
  3. 3Click Application โ†’ Storage โ†’ Cookies.
  4. 4Select https://app.kiro.dev.
  5. 5Copy the value of RefreshToken.

๐Ÿ› ๏ธ Option 2: Kiro Account Manager

Use Kiro Account Manager to easily manage refresh tokens for multiple accounts.