Skip to main content

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

Metadata

Release files for slum 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for slum 0.1.1
File Size Uploaded Provenance Actions
slum-0.1.1.tar.gz 28.6 kB Without provenance Details for slum-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for slum 0.1.1
File Interpreter ABI Platform Actions
slum-0.1.1-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for slum-0.1.1-cp312-cp312-macosx_11_0_arm64.whl

Total release size: 1.7 MB

Release files / slum-0.1.1.tar.gz

Download URL slum-0.1.1.tar.gz
Size 28.6 kB
Tags Source
SHA-256 checksum
How to use checksums
3b35e3e9dbbda8bd97b1a68b0fd5d3193c2debb44b8232ca440624801f126ac5
BLAKE2b-256 checksum
How to use checksums
d3cff649b0485bf1b00de9579954e6c5b1e85da197c9b21efcef4b00d172991b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.10.2

Release files / slum-0.1.1-cp312-cp312-macosx_11_0_arm64.whl

Download URL slum-0.1.1-cp312-cp312-macosx_11_0_arm64.whl
Size 1.6 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
685ecc9392a023936ed8eec5928302c703893cfce481f0d8d83bcd1483be1608
BLAKE2b-256 checksum
How to use checksums
a26049b7213e3e227b3e223125bd4058e57995e4e93f89a8e44669f0f38b6e40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.10.2

Security for slum 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page