«Aislamiento por diseño, no por disciplina» — (“Isolation by design, not by discipline”)
Plano de control administrativo y orquestador del conjunto Stratum Sovereign Multi-Tenant Architecture.
Stratum es una arquitectura de referencia y un conjunto de herramientas para operar múltiples organizaciones (inquilinos) sobre una misma infraestructura, con aislamiento de red por organización y un plano de control administrativo en línea de comandos. Está diseñada para reducir la dependencia de la disciplina operativa en el aislamiento entre inquilinos, y no constituye garantía de resultado.📖 Guía de Uso & Manual de Operaciones en Español
📚 Overleaf Community Edition Integration & Architecture
stratum-cli is the command-line orchestrator designed to operate and automate multi-organization infrastructure running on Stratum-Core.
It automates database scripting, mitigates configuration drift, and streamlines tenant management by providing deterministic, zero-dependency management commands.
stratum db create <org> <service> --engine [mongo|postgres]
│
┌───────────────┴───────────────┐
▼ ▼
MongoDB Engine PostgreSQL Engine
[org]_[service] (DB) [org]_[service] (DB)
[org] (readWrite User) [org] (Owner Role)
Auto-Generated Password Auto-Generated Password
│ │
└───────────────┬───────────────┘
▼
Output Ready-to-Copy .env
- 🔒 Deterministic Naming Pattern: Enforces
[org]_[service](e.g.sgpt_overleaf,isora_portal,client_nextcloud). - 📁 Agnostic Directory Architecture: Zero hardcoded paths. Automatic sibling repository auto-discovery (
../stratum-core), configuration via JSON profile (/etc/stratum/config.jsonor~/.config/stratum/config.json), CLI flag override (-C / --core-path), and environment variables (STRATUM_CORE_PATH). - 🔑 Cryptographic Password Generation: Generates 24-character high-entropy alphanumeric credentials automatically via CSPRNG.
- ⚡ Zero External Dependencies: Built with Python standard library (
subprocess,argparse,secrets,pathlib) to run immediately on any Linux host. - 🛡️ Isolated Tenant Backups: Creates compressed, isolated database dumps (
.archive.gz/.pgdump) without touching other tenants. - 🌐 Declarative Ingress Routing: Generates and hot-reloads modular Layer 7 Nginx virtual hosts in sovereign organization islands with zero downtime.
- 🩺 Health & Status Inspector: Real-time visibility into the health of all platform containers with dynamic tunnel discovery.
- 🌐 Full Internationalization (i18n): Native support for Spanish (
es) and English (en) via-l / --langor persistent config.
Before installing and executing stratum-cli, verify that the following platform and system dependencies are satisfied:
stratum-cli operates directly against the infrastructure layers of the Stratum Platform:
-
Stratum-Core
The foundational infrastructure tier (Tier 1). Must be deployed or cloned locally.stratum-climanages its database containers (stratum-database-postgres,stratum-database-mongo) and network boundaries. -
Stratum-Org
The Organization Island infrastructure tier (Tier 2). Required when managing tenant ingress virtual host routes viastratum route.
| Item | Requirement | Notes |
|---|---|---|
| Python | 3.10 or later | Uses only standard library modules (subprocess, argparse, secrets, pathlib) |
| Docker Engine | 24.0 or later | Required for container inspection, backup exec, and status commands |
| Docker Compose | v2.20 or later | Required for cluster management and health monitoring |
| Operating System | Linux (x86_64 or arm64) | Production VPS, physical server, or dev environment |
Clone the repository anywhere on your system and run the installer:
# Clone the repository
git clone https://github.com/sandra-puerto/stratum-cli.git /opt/stratum-cli
cd /opt/stratum-cli
# Run the installer
sudo bash install.shThe installer auto-detects stratum-core if cloned in the sibling directory, configures the default backup directory as a sibling (../stratum-backups), creates timestamped safety backups of any existing binary/config before upgrading with automated rollback, and sets up /usr/local/bin/stratum.
For developers and sysadmins without sudo privileges:
INSTALL_DIR=~/.local/bin bash install.shsudo bash install.sh --yes --core-path /srv/infra/stratum-coreVerify the installation:
stratum config show
stratum doctorInspect and modify your deployment paths without manual file editing:
# Display active paths and resolution sources
stratum config show
# Set a custom Stratum-Core path
stratum config set core_path /srv/apps/stratum-core
# Set custom backup storage location
stratum config set backup_dir /mnt/backups
# Set default CLI language
stratum config set default_lang esCreates an isolated database, creates the application user, sets permissions, and prints the connection strings ready for the tenant's .env:
stratum db create sgpt overleaf --engine mongoOutput:
========================================================================
[+] STRATUM MULTI-TENANT PROVISIONING SUCCESSFUL (MongoDB)
========================================================================
Tenant Database .... : sgpt_overleaf
Application User ... : sgpt
Generated Password . : K9x#mP2vL!8wQzRtY4uX7nB1
Proxy Boundary Host : stratum-database-nginx:27017
Auth Source ........ : sgpt_overleaf
------------------------------------------------------------------------
Copy-Paste for Tenant .env file:
# --- Stratum Boundary Persistence (Tenant: SGPT) ---
STRATUM_DB_HOST=stratum-database-nginx
MONGO_APP_USER=sgpt
MONGO_APP_PASSWORD=K9x#mP2vL!8wQzRtY4uX7nB1
MONGO_DB_NAME=sgpt_overleaf
MONGO_AUTH_SOURCE=sgpt_overleaf
MONGO_URL=mongodb://sgpt:K9x#mP2vL!8wQzRtY4uX7nB1@stratum-database-nginx:27017/sgpt_overleaf?authSource=sgpt_overleaf
========================================================================
stratum db create isora nextcloud --engine postgresConfigures, inventories, validates, and hot-reloads Nginx virtual host routes inside the tenant's sovereign boundary router (stratum-org/nginx/conf.d/<service>.conf). It performs syntax testing inside the running container (nginx -t) and executes an automated rollback if syntax validation fails, ensuring zero traffic disruption:
# Provision an ingress route for Overleaf (auto-resolves /opt/<ORG>/stratum-org)
stratum route add sgpt overleaf --domain latex.sgpt.local --target overleaf:80
# Provision a route with custom upload limit (e.g. 250M for file sharing)
stratum route add isora nextcloud --domain cloud.isora.com --target nextcloud:80 --max-body 250M
# Inventory all active routes for an organization
stratum route list sgpt
# Test configuration and trigger zero-downtime hot reload
stratum route reload sgpt
# Remove an obsolete route
stratum route remove sgpt overleafCreates an isolated, compressed dump of only that specific client's data:
stratum backup sgpt overleaf --engine mongoDefault Output: <parent-directory>/stratum-backups/sgpt/sgpt_overleaf_YYYYMMDD_HHMMSS.archive.gz
You can also specify a custom destination directory:
stratum backup sgpt overleaf --engine mongo -o /mnt/storage/backupsGenerates high-entropy, shell-safe alphanumeric credentials, Redis passwords, session keys, and tokens. In addition to OS-level CSPRNG (/dev/urandom / CryptGenRandom), Stratum incorporates a Multi-Layered Real Entropy Harvester:
- Planetary Atmospheric Chaos: Queries real-time meteorological sensors (temperature, barometric pressure, wind speed, relative humidity) across randomized global locations (e.g. Reykjavik, Tokyo, Ushuaia, Nairobi, Honolulu, Svalbard).
- Network Transit Jitter: Samples nanosecond socket propagation variations.
- Micro-architectural Hardware Jitter: Analyzes nanosecond CPU execution variations across cache lines and branch predictors.
- HMAC-SHA512 Entropy Sponge: Cryptographically compresses all environmental and physical measurements with kernel entropy.
- Zero-Friction Offline Resilience: If the node is offline or behind strict firewalls, it automatically falls back with zero latency to local CPU hardware jitter and kernel CSPRNG.
# Generate a single 32-character secret with real atmospheric & hardware entropy
stratum secret
# Generate a 24-character database password
stratum secret -l 24
# Generate 3 secrets at once in a single harvest (for Redis, Overleaf session secret, and tokens)
stratum secret -n 3
# Fast, air-gapped generation without external network calls
stratum secret --offline
# Machine-readable output for bash scripts or .env automation (prints raw strings only)
stratum secret -qDynamically discovers core services and all running tenant tunnels:
stratum statusRuns an enterprise audit of Linux kernel parameters (vm.overcommit_memory), secret .env file permissions, Docker daemon health, backup destination write permissions, and configuration topology:
stratum doctorstratum-cli uses the Strategy & Registry Pattern. Adding support for a new engine (e.g. MariaDB, ClickHouse, SQLite) takes less than 30 lines of code without touching the core CLI:
- Create a new file
stratum_cli/engines/mariadb.py:from .base import BaseDatabaseEngine, ProvisioningResult, register_engine @register_engine("mariadb") class MariaDBEngine(BaseDatabaseEngine): @property def engine_name(self) -> str: return "MariaDB Relational Engine" @property def target_container(self) -> str: return "stratum-database-mariadb" def provision(self, org: str, service: str, password=None) -> ProvisioningResult: # Implement provisioning logic via exec_in_container ... def backup(self, org: str, service: str, output_dir) -> Path: # Implement streaming dump via mariadb-dump ...
- Import the new class in
stratum_cli/engines/__init__.py. - The new engine will immediately be available in
stratum db create <org> <service> -e mariadbandstratum db list-engines.
Stratum-CLI was architected and implemented by Sandra Gabriela Puerto Torres and is the intellectual property of the author and all her associated brands (including Isora Cloud Group).
As the administrative control plane, stratum-cli manages multi-tier infrastructure by strictly respecting the upward dependency chain:
- Tier 1 (
stratum-core): Platform foundation, Layer 4 database proxy, and shared DMZ network. - Tier 2 (
stratum-org): Organization island boundary router and dedicated tenant network. - Tier 3 (Workloads): Application workloads that attach upward to Tier 2 and Tier 1.
stratum-cli does not introduce cyclic dependencies between layers.
- Websites: https://stratum.isora.com.co · https://sandrapuerto.com
- General Inquiries: [email protected]
- Security Operations: [email protected]
- Legal & IP: [email protected]
- Core Platform: Stratum-Core
This project is licensed under the Functional Source License, Version 1.1, Apache 2.0 Change License (FSL-1.1-Apache-2.0). See the LICENSE file for details.
IMPORTANT LEGAL NOTICE / AVISO LEGAL:
No Guarantee of Outcome (Obligación de medio, no de resultado):
stratum-cliis an administrative utility and reference orchestrator designed to assist operators in executing configuration and container management workflows. It is provided on an "AS IS" and "AS AVAILABLE" basis, without warranties of any kind, whether express, implied, statutory, or otherwise, including but not limited to the implied warranties of merchantability, fitness for a particular purpose, title, security, or non-infringement.While
stratum-cliautomates provisioning according to isolation-by-design patterns, it does NOT guarantee absolute operational security, system uptime, or prevention of misconfigurations resulting from improper environment inputs or unauthorized host-level modifications. Operators and deploying organizations remain solely responsible for validating generated credentials, managing backups, and securing host environments.
All product names, trademarks, registered trademarks, service marks, and company names mentioned in this tool and documentation (including Docker®, PostgreSQL®, MongoDB®, Nginx®, Python®, and Cloudflare®) are the property of their respective holders. Their use is strictly nominative and descriptive, and does not imply affiliation, sponsorship, or endorsement.