Skip to main content

Fleet orchestrator for tenement servers

Project description

slum

Fleet orchestrator for tenement servers.

slum routes requests to the correct tenement server based on subdomain, manages the tenant→server registry, and provides an API for programmatic control.

Installation

cargo install slum

Quick Start

# Add tenement servers to your fleet
slum server-add 10.0.0.1:9000 -n tenement-1
slum server-add 10.0.0.2:9000 -n tenement-2

# Add tenants (auto-balances across servers)
slum tenant-add romneys
slum tenant-add smiths
slum tenant-add jones

# Check status
slum status

# Start the proxy server
slum serve -p 8080

How It Works

Request: romneys.ourfam.lol/api/events
              │
              ▼
┌─────────────────────────────┐
│ slum (reverse proxy)        │
│ - Extract tenant: "romneys" │
│ - Lookup: romneys → server1 │
│ - Proxy to server1          │
└─────────────────────────────┘
              │
              ▼
┌─────────────────────────────┐
│ tenement-1 (10.0.0.1:9000)  │
│ - Receives request          │
│ - Spawns/routes to process  │
└─────────────────────────────┘

CLI Commands

# Server management
slum server-add <address> [-n name]    # Add a tenement server
slum server-list                        # List all servers
slum server-remove <id-or-name>         # Remove a server

# Tenant management
slum tenant-add <id> [-s server]        # Add tenant (auto-picks server if not specified)
slum tenant-list                        # List all tenants
slum tenant-remove <id>                 # Remove tenant

# Operations
slum serve [-p port]                    # Start proxy server
slum status                             # Fleet overview

HTTP API

When running slum serve, these endpoints are available:

GET  /api/health                # Health check
GET  /api/servers               # List servers
POST /api/servers               # Add server {"name": "...", "address": "..."}
DELETE /api/servers/:id         # Remove server

GET  /api/tenants               # List tenants
POST /api/tenants               # Add tenant {"id": "...", "server": "...", "config": "..."}
DELETE /api/tenants/:id         # Remove tenant

All other requests are proxied to the appropriate tenement server based on the Host header subdomain.

Architecture

┌─────────────────────────────────────────────────────────────────────┐
│ Village / Apartment / Your SaaS                                     │
│ - Signup, billing, UI                                               │
│ - Calls slum API to manage tenants                                  │
└─────────────────────────────────────────────────────────────────────┘
                              │ uses
                              ▼
┌─────────────────────────────────────────────────────────────────────┐
│ slum (this project)                                                 │
│ - Routes requests by subdomain → server                             │
│ - Registry: which tenant lives where                                │
│ - API for programmatic control                                      │
└─────────────────────────────────────────────────────────────────────┘
                              │ manages
                              ▼
┌─────────────────┐  ┌─────────────────┐  ┌─────────────────┐
│ tenement        │  │ tenement        │  │ tenement        │
│ (server 1)      │  │ (server 2)      │  │ (server 3)      │
│ N processes     │  │ N processes     │  │ N processes     │
└─────────────────┘  └─────────────────┘  └─────────────────┘

License

Apache 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

slum-0.1.1.tar.gz (28.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

slum-0.1.1-cp312-cp312-macosx_11_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

Details for the file slum-0.1.1.tar.gz.

File metadata

  • Download URL: slum-0.1.1.tar.gz
  • Upload date:
  • Size: 28.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.10.2

File hashes

Hashes for slum-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3b35e3e9dbbda8bd97b1a68b0fd5d3193c2debb44b8232ca440624801f126ac5
MD5 7be9fe3580cae1745432cd91a5de0079
BLAKE2b-256 d3cff649b0485bf1b00de9579954e6c5b1e85da197c9b21efcef4b00d172991b

See more details on using hashes here.

File details

Details for the file slum-0.1.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for slum-0.1.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 685ecc9392a023936ed8eec5928302c703893cfce481f0d8d83bcd1483be1608
MD5 eb34354f5d7fde96adb11f54e5d69f5b
BLAKE2b-256 a26049b7213e3e227b3e223125bd4058e57995e4e93f89a8e44669f0f38b6e40

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page