1.1 changes
This commit is contained in:
126
CLAUDE.md
126
CLAUDE.md
@@ -15,8 +15,12 @@ spr/
|
|||||||
├── CLAUDE.md # You are here
|
├── CLAUDE.md # You are here
|
||||||
├── README.md # User-facing docs
|
├── README.md # User-facing docs
|
||||||
├── schema.json # Source of truth for models
|
├── schema.json # Source of truth for models
|
||||||
├── config/ # Framework configurations
|
├── cfg/ # Framework configurations
|
||||||
│ └── soleprint.config.json
|
│ ├── soleprint.config.json # Model definitions
|
||||||
|
│ └── amar/ # Room-specific configs (absolute paths to Dockerfiles)
|
||||||
|
│ ├── .env.example
|
||||||
|
│ ├── docker-compose.yml
|
||||||
|
│ └── link/ # Databrowse adapter for amar
|
||||||
│
|
│
|
||||||
├── ctrl/ # Soleprint room's own ctrl
|
├── ctrl/ # Soleprint room's own ctrl
|
||||||
│
|
│
|
||||||
@@ -33,7 +37,7 @@ spr/
|
|||||||
│
|
│
|
||||||
├── station/ # VERSIONED - Tools & execution
|
├── station/ # VERSIONED - Tools & execution
|
||||||
│ ├── tools/ # Utilities, generators, runners
|
│ ├── tools/ # Utilities, generators, runners
|
||||||
│ │ ├── generator/ # Model/framework generator
|
│ │ ├── modelgen/ # Model generation from config/codebases
|
||||||
│ │ ├── datagen/ # Test data generation
|
│ │ ├── datagen/ # Test data generation
|
||||||
│ │ ├── tester/ # Test runner (BDD/playwright)
|
│ │ ├── tester/ # Test runner (BDD/playwright)
|
||||||
│ │ └── ...
|
│ │ └── ...
|
||||||
@@ -43,38 +47,41 @@ spr/
|
|||||||
│
|
│
|
||||||
├── data/ # JSON content files (versioned)
|
├── data/ # JSON content files (versioned)
|
||||||
│
|
│
|
||||||
├── hub/ # VERSIONED base files
|
├── soleprint/ # VERSIONED - Core coordinator
|
||||||
│ ├── main.py # Hub entry point
|
│ ├── main.py # Multi-port entry point (production)
|
||||||
|
│ ├── run.py # Single-port bare-metal dev server
|
||||||
│ ├── index.html # Landing page
|
│ ├── index.html # Landing page
|
||||||
│ ├── requirements.txt # Dependencies
|
│ ├── requirements.txt # Dependencies
|
||||||
│ └── dataloader/ # Data loading module
|
│ └── dataloader/ # Data loading module
|
||||||
│
|
│
|
||||||
├── gen/ # RUNNABLE instance (gitignored, symlinks)
|
├── gen/ # RUNNABLE instance (gitignored, symlinks)
|
||||||
│ ├── main.py # → ../hub/main.py
|
│ ├── main.py # → ../soleprint/main.py
|
||||||
│ ├── index.html # → ../hub/index.html
|
│ ├── run.py # → ../soleprint/run.py
|
||||||
│ ├── requirements.txt # → ../hub/requirements.txt
|
│ ├── index.html # → ../soleprint/index.html
|
||||||
│ ├── dataloader/ # → ../hub/dataloader/
|
│ ├── requirements.txt # → ../soleprint/requirements.txt
|
||||||
|
│ ├── dataloader/ # → ../soleprint/dataloader/
|
||||||
│ ├── artery/ # → ../artery/
|
│ ├── artery/ # → ../artery/
|
||||||
│ ├── atlas/ # → ../atlas/
|
│ ├── atlas/ # → ../atlas/
|
||||||
│ ├── station/ # → ../station/
|
│ ├── station/ # → ../station/
|
||||||
│ ├── data/ # → ../data/
|
│ ├── data/ # → ../data/
|
||||||
|
│ ├── cfg/ # Copied config
|
||||||
│ └── models/ # GENERATED (one-time per client)
|
│ └── models/ # GENERATED (one-time per client)
|
||||||
│ └── pydantic/
|
│ └── pydantic/
|
||||||
│
|
│
|
||||||
└── mainroom/ # Orchestration: soleprint ↔ managed room
|
└── mainroom/ # Orchestration: soleprint ↔ managed room
|
||||||
├── ctrl/ # Orchestration commands
|
├── ctrl/ # Orchestration commands (acts on mainroom)
|
||||||
├── sbwrapper/ # Sidebar wrapper UI
|
├── sbwrapper/ # Sidebar wrapper UI
|
||||||
├── link/ # Adapters (connect without modifying either side)
|
|
||||||
│ └── adapters/ # Framework-specific adapters (django, etc.)
|
|
||||||
└── soleprint/ # Docker configs for soleprint services
|
└── soleprint/ # Docker configs for soleprint services
|
||||||
├── docker-compose.yml
|
├── docker-compose.yml
|
||||||
|
├── docker-compose.nginx.yml # Path-based routing
|
||||||
└── Dockerfile.fastapi
|
└── Dockerfile.fastapi
|
||||||
```
|
```
|
||||||
|
|
||||||
## The Three Systems
|
## The Four Systems
|
||||||
|
|
||||||
| System | Purpose | Tagline |
|
| System | Purpose | Tagline |
|
||||||
|--------|---------|---------|
|
|--------|---------|---------|
|
||||||
|
| **Soleprint** | Core coordinator | Cada paso deja huella |
|
||||||
| **Artery** | Connectors to external services | Todo lo vital |
|
| **Artery** | Connectors to external services | Todo lo vital |
|
||||||
| **Atlas** | Actionable documentation | Mapeando el recorrido |
|
| **Atlas** | Actionable documentation | Mapeando el recorrido |
|
||||||
| **Station** | Tools, environments, execution | Centro de control |
|
| **Station** | Tools, environments, execution | Centro de control |
|
||||||
@@ -103,32 +110,34 @@ A **Room** is an environment with soleprint context, features, and conventions:
|
|||||||
### Mainroom
|
### Mainroom
|
||||||
The **mainroom** orchestrates interaction between soleprint and managed rooms:
|
The **mainroom** orchestrates interaction between soleprint and managed rooms:
|
||||||
- `sbwrapper/` - Sidebar UI overlay for any managed app (quick login, Jira info, etc.)
|
- `sbwrapper/` - Sidebar UI overlay for any managed app (quick login, Jira info, etc.)
|
||||||
- `link/` - Adapters to connect soleprint to managed app data WITHOUT modifying either
|
|
||||||
- `soleprint/` - Docker configs + ctrl scripts for running soleprint services
|
- `soleprint/` - Docker configs + ctrl scripts for running soleprint services
|
||||||
- `ctrl/local/` - Local deployment scripts (push.sh, deploy.sh)
|
- `ctrl/local/` - Local deployment scripts (push.sh, deploy.sh)
|
||||||
- `ctrl/server/` - Server setup scripts
|
- `ctrl/server/` - Server setup scripts
|
||||||
- `ctrl/` - Mainroom-level orchestration commands
|
- `ctrl/` - Mainroom-level orchestration commands
|
||||||
|
|
||||||
Soleprint can run without a managed room (for testing veins, etc.) but is always initiated from mainroom.
|
Soleprint can run without a managed room (for testing veins, etc.).
|
||||||
|
|
||||||
### Hub vs Gen
|
### cfg/ - Configuration
|
||||||
- `hub/` = Versioned base files (main.py, dataloader, index.html)
|
- `cfg/soleprint.config.json` - Framework model definitions
|
||||||
- `gen/` = Gitignored runnable instance with symlinks to hub/ + systems
|
- `cfg/<room>/` - Room-specific configs (e.g., `cfg/amar/`)
|
||||||
|
- Uses absolute paths to external Dockerfiles
|
||||||
|
- Room-specific tools/adapters (e.g., databrowse link adapter)
|
||||||
|
|
||||||
|
### soleprint/ vs gen/
|
||||||
|
- `soleprint/` = Versioned core files (main.py, run.py, dataloader, index.html)
|
||||||
|
- `gen/` = Gitignored runnable instance with symlinks to soleprint/ + systems
|
||||||
- `gen/models/` = Generated models (one-time per client, like an install)
|
- `gen/models/` = Generated models (one-time per client, like an install)
|
||||||
|
|
||||||
**Development:** Edit in hub/, artery/, atlas/, station/, data/ → run from gen/
|
**Development:** Edit in soleprint/, artery/, atlas/, station/, data/ → run from gen/
|
||||||
**Production:** Copy everything (resolve symlinks)
|
**Production:** Copy everything (resolve symlinks)
|
||||||
|
|
||||||
### The Generator
|
### Modelgen (Generic Tool)
|
||||||
Lives in `station/tools/generator/`. It:
|
Lives in `station/tools/modelgen/`. It:
|
||||||
1. Reads `schema.json` (source of truth)
|
1. Reads `cfg/soleprint.config.json` (source of truth)
|
||||||
2. Generates Pydantic models to `gen/models/`
|
2. Generates Pydantic models to `gen/models/`
|
||||||
3. Generation is **one-time per client** (like install)
|
3. Generation is **one-time per client** (like install)
|
||||||
4. Runs standalone (no model dependencies) for bootstrap
|
4. Runs standalone (no model dependencies) for bootstrap
|
||||||
|
|
||||||
### Naming Flexibility
|
|
||||||
Code inside soleprint should NOT have imports too tied to system names. Display names are configurable. Future: swap entire naming domains without breaking functionality.
|
|
||||||
|
|
||||||
## Development Workflow
|
## Development Workflow
|
||||||
|
|
||||||
### Build Tool
|
### Build Tool
|
||||||
@@ -138,23 +147,12 @@ The build script at spr root handles both development and deployment builds:
|
|||||||
```bash
|
```bash
|
||||||
# From spr/
|
# From spr/
|
||||||
python build.py --help
|
python build.py --help
|
||||||
python build.py dev # Build with symlinks
|
python build.py dev # Build with symlinks (soleprint only)
|
||||||
|
python build.py dev --cfg amar # Include amar room config
|
||||||
python build.py deploy --output /path/ # Build for production
|
python build.py deploy --output /path/ # Build for production
|
||||||
python build.py models # Only regenerate models
|
python build.py models # Only regenerate models
|
||||||
```
|
```
|
||||||
|
|
||||||
### Modelgen (Generic Tool)
|
|
||||||
|
|
||||||
Modelgen is a generic model generation tool in `station/tools/modelgen/`:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Generate models from config
|
|
||||||
python -m station.tools.modelgen from-config --config config/soleprint.config.json --output gen/models/
|
|
||||||
|
|
||||||
# Future: extract models from codebases (for databrowse)
|
|
||||||
python -m station.tools.modelgen extract --source /path/to/django/project --output models/
|
|
||||||
```
|
|
||||||
|
|
||||||
### Setting Up Dev Environment
|
### Setting Up Dev Environment
|
||||||
```bash
|
```bash
|
||||||
cd spr/
|
cd spr/
|
||||||
@@ -163,50 +161,48 @@ python build.py dev # Creates gen/ with symlinks
|
|||||||
cd gen/
|
cd gen/
|
||||||
python3 -m venv .venv
|
python3 -m venv .venv
|
||||||
.venv/bin/pip install -r requirements.txt
|
.venv/bin/pip install -r requirements.txt
|
||||||
.venv/bin/python main.py # Hub on :12000
|
.venv/bin/python run.py # Single-port bare-metal dev server
|
||||||
|
# or
|
||||||
|
.venv/bin/python main.py # Multi-port (production-like)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Bare-metal vs Docker
|
||||||
|
- **Bare-metal:** `python run.py` - Single port, all routes internal, for soleprint dev
|
||||||
|
- **Docker:** Use mainroom for managed rooms - separate containers, nginx routing
|
||||||
|
|
||||||
### Building for Deployment
|
### Building for Deployment
|
||||||
```bash
|
```bash
|
||||||
cd spr/
|
cd spr/
|
||||||
python build.py deploy --output ../deploy/soleprint/
|
python build.py deploy --output ../deploy/soleprint/ --cfg amar
|
||||||
|
|
||||||
# Then deploy:
|
# Then deploy:
|
||||||
rsync -av ../deploy/soleprint/ server:/app/soleprint/
|
rsync -av ../deploy/soleprint/ server:/app/soleprint/
|
||||||
ssh server 'cd /app/soleprint && ./run.sh'
|
ssh server 'cd /app/soleprint && ./start.sh'
|
||||||
|
|
||||||
# Or use mainroom ctrl scripts:
|
# Or use mainroom ctrl scripts:
|
||||||
cd mainroom/soleprint/ctrl/local
|
cd mainroom/soleprint/ctrl/local
|
||||||
./deploy.sh
|
./deploy.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
### Regenerating Models Only (rare)
|
|
||||||
```bash
|
|
||||||
cd spr/
|
|
||||||
python build.py models
|
|
||||||
```
|
|
||||||
|
|
||||||
### Orchestrating with Managed Room
|
### Orchestrating with Managed Room
|
||||||
```bash
|
```bash
|
||||||
cd spr/mainroom/ctrl
|
cd spr/mainroom/ctrl
|
||||||
./start.sh # Sets env vars, starts soleprint + link services
|
./start.sh # Sets env vars, starts soleprint + managed room services
|
||||||
```
|
```
|
||||||
|
|
||||||
### Worktrees
|
### Worktrees
|
||||||
Feature development in: `/home/mariano/wdir/wts/spr/<branch>`
|
Feature development in: `/home/mariano/wdir/wts/spr/<branch>`
|
||||||
|
|
||||||
Planned:
|
Planned:
|
||||||
- `databrowse` - Data browser tool (separate CLAUDE.md)
|
- `databrowse` - Data browser tool (uses modelgen extract)
|
||||||
- `sbwrapper` - Sidebar wrapper development
|
- `sbwrapper` - Sidebar wrapper development
|
||||||
|
|
||||||
## External References
|
## External References
|
||||||
|
|
||||||
| What | Location | Notes |
|
| What | Location | Notes |
|
||||||
|------|----------|-------|
|
|------|----------|-------|
|
||||||
| Core Nest (legacy) | `core_nest/` | Original orchestration, being replaced by mainroom |
|
|
||||||
| Amar Backend | `ama/amar_django_back` | Example managed room |
|
| Amar Backend | `ama/amar_django_back` | Example managed room |
|
||||||
| Amar Frontend | `ama/amar_frontend` | Example managed room |
|
| Amar Frontend | `ama/amar_frontend` | Example managed room |
|
||||||
| Pawprint (legacy) | `ama/pawprint` | Original pet-themed naming, deprecated |
|
|
||||||
|
|
||||||
## Tools Status
|
## Tools Status
|
||||||
|
|
||||||
@@ -215,7 +211,6 @@ Planned:
|
|||||||
| modelgen | station/tools/modelgen | Working | Generic model generation (used by build.py, databrowse) |
|
| modelgen | station/tools/modelgen | Working | Generic model generation (used by build.py, databrowse) |
|
||||||
| datagen | station/tools/datagen | Working | Test data generation |
|
| datagen | station/tools/datagen | Working | Test data generation |
|
||||||
| tester | station/tools/tester | Advanced | Full BDD/playwright |
|
| tester | station/tools/tester | Advanced | Full BDD/playwright |
|
||||||
| hub | station/tools/hub | Idea | Port management |
|
|
||||||
| infra | station/tools/infra | Idea | Cloud deploy scripts |
|
| infra | station/tools/infra | Idea | Cloud deploy scripts |
|
||||||
| graphgen | station/tools/graphgen | Idea | Graph generation |
|
| graphgen | station/tools/graphgen | Idea | Graph generation |
|
||||||
|
|
||||||
@@ -223,7 +218,7 @@ Planned:
|
|||||||
|
|
||||||
| Service | Port |
|
| Service | Port |
|
||||||
|---------|------|
|
|---------|------|
|
||||||
| Hub (soleprint) | 12000 |
|
| Soleprint | 12000 |
|
||||||
| Artery | 12001 |
|
| Artery | 12001 |
|
||||||
| Atlas | 12002 |
|
| Atlas | 12002 |
|
||||||
| Station | 12003 |
|
| Station | 12003 |
|
||||||
@@ -233,13 +228,14 @@ Planned:
|
|||||||
**Done:**
|
**Done:**
|
||||||
- [x] Project structure finalized
|
- [x] Project structure finalized
|
||||||
- [x] Schema.json in place
|
- [x] Schema.json in place
|
||||||
- [x] Generator moved to station/tools/
|
- [x] Modelgen in station/tools/
|
||||||
- [x] Hub/gen separation with symlinks
|
- [x] soleprint/gen separation with symlinks
|
||||||
- [x] Mainroom structure from core_nest
|
- [x] Mainroom structure
|
||||||
- [x] Docker configs updated to soleprint naming
|
- [x] Docker configs with nginx path-based routing
|
||||||
- [x] Tools consolidated from pawprint
|
- [x] Build tool with dev/deploy modes and --cfg argument
|
||||||
- [x] Build tool with dev/deploy modes
|
- [x] Bare-metal run.py for single-port dev
|
||||||
- [x] gen/ runs correctly
|
- [x] cfg/amar/ with absolute paths pattern
|
||||||
|
- [x] Renamed: hub→soleprint, config→cfg, nest→room, pawprint→soleprint
|
||||||
|
|
||||||
**Next:**
|
**Next:**
|
||||||
1. [ ] Test mainroom/soleprint/ctrl scripts
|
1. [ ] Test mainroom/soleprint/ctrl scripts
|
||||||
@@ -260,15 +256,19 @@ Planned:
|
|||||||
```bash
|
```bash
|
||||||
# Build for dev (from spr/)
|
# Build for dev (from spr/)
|
||||||
python build.py dev
|
python build.py dev
|
||||||
|
python build.py dev --cfg amar # With amar room config
|
||||||
|
|
||||||
# Start dev server
|
# Start dev server (bare-metal, single-port)
|
||||||
|
cd gen && .venv/bin/python run.py
|
||||||
|
|
||||||
|
# Start production-like (multi-port)
|
||||||
cd gen && .venv/bin/python main.py
|
cd gen && .venv/bin/python main.py
|
||||||
|
|
||||||
# Health check
|
# Health check
|
||||||
curl localhost:12000/health
|
curl localhost:12000/health
|
||||||
|
|
||||||
# Build for deployment
|
# Build for deployment
|
||||||
python build.py deploy --output /path/to/deploy/
|
python build.py deploy --output /path/to/deploy/ --cfg amar
|
||||||
|
|
||||||
# Deploy via ctrl scripts
|
# Deploy via ctrl scripts
|
||||||
cd mainroom/soleprint/ctrl/local && ./deploy.sh
|
cd mainroom/soleprint/ctrl/local && ./deploy.sh
|
||||||
@@ -277,5 +277,5 @@ cd mainroom/soleprint/ctrl/local && ./deploy.sh
|
|||||||
cd mainroom/soleprint && docker compose up -d
|
cd mainroom/soleprint && docker compose up -d
|
||||||
|
|
||||||
# Modelgen (generic tool)
|
# Modelgen (generic tool)
|
||||||
python -m station.tools.modelgen from-config -c config/soleprint.config.json -o gen/models/
|
python -m station.tools.modelgen from-config -c cfg/soleprint.config.json -o gen/models/
|
||||||
```
|
```
|
||||||
|
|||||||
48
README.md
48
README.md
@@ -7,9 +7,14 @@ Development workflow and documentation platform. Run, test, and document everyth
|
|||||||
## Quick Start
|
## Quick Start
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
# Build dev environment
|
||||||
|
python build.py dev
|
||||||
|
|
||||||
|
# Run
|
||||||
cd gen
|
cd gen
|
||||||
pip install -r requirements.txt
|
python3 -m venv .venv
|
||||||
python main.py
|
.venv/bin/pip install -r requirements.txt
|
||||||
|
.venv/bin/python run.py # Single-port bare-metal dev
|
||||||
# Visit http://localhost:12000
|
# Visit http://localhost:12000
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -17,6 +22,7 @@ python main.py
|
|||||||
|
|
||||||
| | System | What it does |
|
| | System | What it does |
|
||||||
|---|--------|--------------|
|
|---|--------|--------------|
|
||||||
|
| 👣 | **Soleprint** | Core coordinator, routing, landing page |
|
||||||
| 💉 | **Artery** | Connectors to external services (Jira, Slack, APIs) |
|
| 💉 | **Artery** | Connectors to external services (Jira, Slack, APIs) |
|
||||||
| 🗺️ | **Atlas** | Actionable documentation (BDD, Gherkin, specs) |
|
| 🗺️ | **Atlas** | Actionable documentation (BDD, Gherkin, specs) |
|
||||||
| 🎛️ | **Station** | Tools, environments, test runners |
|
| 🎛️ | **Station** | Tools, environments, test runners |
|
||||||
@@ -26,25 +32,29 @@ python main.py
|
|||||||
```
|
```
|
||||||
spr/
|
spr/
|
||||||
├── schema.json # Model definitions (source of truth)
|
├── schema.json # Model definitions (source of truth)
|
||||||
├── config/ # Framework configuration
|
├── cfg/ # Framework configuration
|
||||||
├── ctrl/ # Soleprint room ctrl
|
│ ├── soleprint.config.json
|
||||||
|
│ └── amar/ # Room-specific configs
|
||||||
|
│
|
||||||
|
├── soleprint/ # Core coordinator (versioned)
|
||||||
|
│ ├── main.py # Multi-port entry point
|
||||||
|
│ ├── run.py # Single-port bare-metal dev
|
||||||
|
│ └── dataloader/
|
||||||
│
|
│
|
||||||
├── artery/ # Connectors (versioned)
|
├── artery/ # Connectors (versioned)
|
||||||
├── atlas/ # Documentation (versioned)
|
├── atlas/ # Documentation (versioned)
|
||||||
├── station/ # Tools (versioned)
|
├── station/ # Tools (versioned)
|
||||||
│ └── tools/
|
│ └── tools/
|
||||||
│ ├── generator/ # Generates models from schema
|
│ ├── modelgen/ # Generates models from config
|
||||||
│ ├── datagen/ # Test data generation
|
│ ├── datagen/ # Test data generation
|
||||||
│ └── tester/ # BDD/contract test runner
|
│ └── tester/ # BDD/contract test runner
|
||||||
│
|
│
|
||||||
├── data/ # JSON content
|
├── data/ # JSON content
|
||||||
├── hub/ # Base files (main.py, dataloader, etc.)
|
├── gen/ # Runnable instance (symlinks + generated)
|
||||||
├── gen/ # Runnable instance (symlinks + generated models)
|
|
||||||
│
|
│
|
||||||
└── mainroom/ # Orchestration: soleprint ↔ managed room
|
└── mainroom/ # Orchestration: soleprint ↔ managed room
|
||||||
├── ctrl/ # Orchestration commands
|
├── ctrl/ # Orchestration commands
|
||||||
├── sbwrapper/ # Sidebar wrapper UI
|
├── sbwrapper/ # Sidebar wrapper UI
|
||||||
├── link/ # Adapters for managed apps
|
|
||||||
└── soleprint/ # Docker configs
|
└── soleprint/ # Docker configs
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -66,16 +76,14 @@ spr/
|
|||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
### Run locally
|
### Build and run
|
||||||
```bash
|
```bash
|
||||||
cd gen
|
python build.py dev # Soleprint only
|
||||||
python main.py
|
python build.py dev --cfg amar # With amar room config
|
||||||
```
|
|
||||||
|
|
||||||
### Regenerate models (one-time / rare)
|
cd gen
|
||||||
```bash
|
.venv/bin/python run.py # Bare-metal single-port
|
||||||
cd station/tools/generator
|
.venv/bin/python main.py # Multi-port (production-like)
|
||||||
python -m generators.orchestrator --output ../../../gen
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Run with Docker (via mainroom)
|
### Run with Docker (via mainroom)
|
||||||
@@ -88,7 +96,7 @@ docker compose up -d
|
|||||||
|
|
||||||
| Service | Port |
|
| Service | Port |
|
||||||
|---------|------|
|
|---------|------|
|
||||||
| Hub (soleprint) | 12000 |
|
| Soleprint | 12000 |
|
||||||
| Artery | 12001 |
|
| Artery | 12001 |
|
||||||
| Atlas | 12002 |
|
| Atlas | 12002 |
|
||||||
| Station | 12003 |
|
| Station | 12003 |
|
||||||
@@ -96,13 +104,13 @@ docker compose up -d
|
|||||||
## Architecture
|
## Architecture
|
||||||
|
|
||||||
```
|
```
|
||||||
hub/ → Versioned base files (main.py, dataloader)
|
soleprint/ → Versioned core files (main.py, run.py, dataloader)
|
||||||
gen/ → Runnable instance (symlinks to hub/ + systems)
|
gen/ → Runnable instance (symlinks to soleprint/ + systems)
|
||||||
gen/models/ → Generated once per client (like install)
|
gen/models/ → Generated once per client (like install)
|
||||||
|
cfg/ → Configuration (copied to gen/cfg/)
|
||||||
|
|
||||||
mainroom/ → Orchestration layer
|
mainroom/ → Orchestration layer
|
||||||
├── sbwrapper → UI overlay for managed apps
|
├── sbwrapper → UI overlay for managed apps
|
||||||
├── link → Data adapters (no modification to either side)
|
|
||||||
└── soleprint → Docker for soleprint services
|
└── soleprint → Docker for soleprint services
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
127
build.py
127
build.py
@@ -10,13 +10,17 @@ Modes:
|
|||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
python build.py dev
|
python build.py dev
|
||||||
|
python build.py dev --cfg amar
|
||||||
python build.py deploy --output /path/to/deploy/
|
python build.py deploy --output /path/to/deploy/
|
||||||
python build.py models
|
python build.py models
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
# Set up dev environment
|
# Set up dev environment (soleprint only)
|
||||||
python build.py dev
|
python build.py dev
|
||||||
|
|
||||||
|
# Set up dev environment with amar room config
|
||||||
|
python build.py dev --cfg amar
|
||||||
|
|
||||||
# Build for deployment
|
# Build for deployment
|
||||||
python build.py deploy --output ../deploy/soleprint/
|
python build.py deploy --output ../deploy/soleprint/
|
||||||
|
|
||||||
@@ -83,7 +87,7 @@ def generate_models(output_dir: Path):
|
|||||||
Args:
|
Args:
|
||||||
output_dir: Directory where models/pydantic/__init__.py will be created
|
output_dir: Directory where models/pydantic/__init__.py will be created
|
||||||
"""
|
"""
|
||||||
config_path = SPR_ROOT / "config" / "soleprint.config.json"
|
config_path = SPR_ROOT / "cfg" / "soleprint.config.json"
|
||||||
|
|
||||||
if not config_path.exists():
|
if not config_path.exists():
|
||||||
print(f"Warning: Config not found at {config_path}")
|
print(f"Warning: Config not found at {config_path}")
|
||||||
@@ -111,35 +115,74 @@ def generate_models(output_dir: Path):
|
|||||||
return result.returncode == 0
|
return result.returncode == 0
|
||||||
|
|
||||||
|
|
||||||
def build_dev(output_dir: Path):
|
def copy_cfg(output_dir: Path, cfg_name: str | None):
|
||||||
|
"""Copy configuration files to output directory.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
output_dir: Target directory
|
||||||
|
cfg_name: Name of room config (e.g., 'amar'), or None for base only
|
||||||
|
"""
|
||||||
|
cfg_dir = output_dir / "cfg"
|
||||||
|
ensure_dir(cfg_dir)
|
||||||
|
|
||||||
|
# Always copy base config
|
||||||
|
base_config = SPR_ROOT / "cfg" / "soleprint.config.json"
|
||||||
|
if base_config.exists():
|
||||||
|
copy_path(base_config, cfg_dir / "soleprint.config.json")
|
||||||
|
|
||||||
|
# Copy room-specific config if specified
|
||||||
|
if cfg_name:
|
||||||
|
room_cfg = SPR_ROOT / "cfg" / cfg_name
|
||||||
|
if room_cfg.exists() and room_cfg.is_dir():
|
||||||
|
print(f"\nCopying {cfg_name} room config...")
|
||||||
|
for item in room_cfg.iterdir():
|
||||||
|
if item.name == ".env.example":
|
||||||
|
# Copy .env.example to output root as template
|
||||||
|
copy_path(item, output_dir / ".env.example")
|
||||||
|
elif item.is_dir():
|
||||||
|
copy_path(item, cfg_dir / cfg_name / item.name)
|
||||||
|
else:
|
||||||
|
ensure_dir(cfg_dir / cfg_name)
|
||||||
|
copy_path(item, cfg_dir / cfg_name / item.name)
|
||||||
|
else:
|
||||||
|
print(f"Warning: Room config '{cfg_name}' not found at {room_cfg}")
|
||||||
|
|
||||||
|
|
||||||
|
def build_dev(output_dir: Path, cfg_name: str | None = None):
|
||||||
"""
|
"""
|
||||||
Build for development using symlinks.
|
Build for development using symlinks.
|
||||||
|
|
||||||
Structure:
|
Structure:
|
||||||
gen/
|
gen/
|
||||||
├── main.py -> ../hub/main.py
|
├── main.py -> ../soleprint/main.py
|
||||||
├── index.html -> ../hub/index.html
|
├── run.py -> ../soleprint/run.py
|
||||||
├── requirements.txt -> ../hub/requirements.txt
|
├── index.html -> ../soleprint/index.html
|
||||||
├── dataloader/ -> ../hub/dataloader/
|
├── requirements.txt -> ../soleprint/requirements.txt
|
||||||
|
├── dataloader/ -> ../soleprint/dataloader/
|
||||||
├── artery/ -> ../artery/
|
├── artery/ -> ../artery/
|
||||||
├── atlas/ -> ../atlas/
|
├── atlas/ -> ../atlas/
|
||||||
├── station/ -> ../station/
|
├── station/ -> ../station/
|
||||||
├── data/ -> ../data/
|
├── data/ -> ../data/
|
||||||
|
├── cfg/ # Copied config
|
||||||
|
├── .env.example # From cfg/<room>/.env.example
|
||||||
└── models/ # Generated
|
└── models/ # Generated
|
||||||
"""
|
"""
|
||||||
print(f"\n=== Building DEV environment ===")
|
print(f"\n=== Building DEV environment ===")
|
||||||
print(f"SPR root: {SPR_ROOT}")
|
print(f"SPR root: {SPR_ROOT}")
|
||||||
print(f"Output: {output_dir}")
|
print(f"Output: {output_dir}")
|
||||||
|
if cfg_name:
|
||||||
|
print(f"Room cfg: {cfg_name}")
|
||||||
|
|
||||||
ensure_dir(output_dir)
|
ensure_dir(output_dir)
|
||||||
|
|
||||||
# Hub files (symlinks)
|
# Soleprint core files (symlinks)
|
||||||
print("\nLinking hub files...")
|
print("\nLinking soleprint files...")
|
||||||
hub = SPR_ROOT / "hub"
|
soleprint = SPR_ROOT / "soleprint"
|
||||||
create_symlink(hub / "main.py", output_dir / "main.py")
|
create_symlink(soleprint / "main.py", output_dir / "main.py")
|
||||||
create_symlink(hub / "index.html", output_dir / "index.html")
|
create_symlink(soleprint / "run.py", output_dir / "run.py")
|
||||||
create_symlink(hub / "requirements.txt", output_dir / "requirements.txt")
|
create_symlink(soleprint / "index.html", output_dir / "index.html")
|
||||||
create_symlink(hub / "dataloader", output_dir / "dataloader")
|
create_symlink(soleprint / "requirements.txt", output_dir / "requirements.txt")
|
||||||
|
create_symlink(soleprint / "dataloader", output_dir / "dataloader")
|
||||||
|
|
||||||
# System directories (symlinks)
|
# System directories (symlinks)
|
||||||
print("\nLinking systems...")
|
print("\nLinking systems...")
|
||||||
@@ -152,6 +195,10 @@ def build_dev(output_dir: Path):
|
|||||||
print("\nLinking data...")
|
print("\nLinking data...")
|
||||||
create_symlink(SPR_ROOT / "data", output_dir / "data")
|
create_symlink(SPR_ROOT / "data", output_dir / "data")
|
||||||
|
|
||||||
|
# Config (copy, not symlink - may be customized)
|
||||||
|
print("\nCopying config...")
|
||||||
|
copy_cfg(output_dir, cfg_name)
|
||||||
|
|
||||||
# Models (generated) - pass output_dir, modelgen adds models/pydantic
|
# Models (generated) - pass output_dir, modelgen adds models/pydantic
|
||||||
print("\nGenerating models...")
|
print("\nGenerating models...")
|
||||||
if not generate_models(output_dir):
|
if not generate_models(output_dir):
|
||||||
@@ -162,16 +209,19 @@ def build_dev(output_dir: Path):
|
|||||||
print(f" cd {output_dir}")
|
print(f" cd {output_dir}")
|
||||||
print(f" python3 -m venv .venv")
|
print(f" python3 -m venv .venv")
|
||||||
print(f" .venv/bin/pip install -r requirements.txt")
|
print(f" .venv/bin/pip install -r requirements.txt")
|
||||||
print(f" .venv/bin/python main.py")
|
print(f" .venv/bin/python main.py # Multi-port (production-like)")
|
||||||
|
print(f" .venv/bin/python run.py # Single-port (bare-metal dev)")
|
||||||
|
|
||||||
|
|
||||||
def build_deploy(output_dir: Path):
|
def build_deploy(output_dir: Path, cfg_name: str | None = None):
|
||||||
"""
|
"""
|
||||||
Build for deployment by copying all files (no symlinks).
|
Build for deployment by copying all files (no symlinks).
|
||||||
"""
|
"""
|
||||||
print(f"\n=== Building DEPLOY package ===")
|
print(f"\n=== Building DEPLOY package ===")
|
||||||
print(f"SPR root: {SPR_ROOT}")
|
print(f"SPR root: {SPR_ROOT}")
|
||||||
print(f"Output: {output_dir}")
|
print(f"Output: {output_dir}")
|
||||||
|
if cfg_name:
|
||||||
|
print(f"Room cfg: {cfg_name}")
|
||||||
|
|
||||||
if output_dir.exists():
|
if output_dir.exists():
|
||||||
response = input(f"\nOutput directory exists. Overwrite? [y/N] ")
|
response = input(f"\nOutput directory exists. Overwrite? [y/N] ")
|
||||||
@@ -182,13 +232,14 @@ def build_deploy(output_dir: Path):
|
|||||||
|
|
||||||
ensure_dir(output_dir)
|
ensure_dir(output_dir)
|
||||||
|
|
||||||
# Hub files (copy)
|
# Soleprint core files (copy)
|
||||||
print("\nCopying hub files...")
|
print("\nCopying soleprint files...")
|
||||||
hub = SPR_ROOT / "hub"
|
soleprint = SPR_ROOT / "soleprint"
|
||||||
copy_path(hub / "main.py", output_dir / "main.py")
|
copy_path(soleprint / "main.py", output_dir / "main.py")
|
||||||
copy_path(hub / "index.html", output_dir / "index.html")
|
copy_path(soleprint / "run.py", output_dir / "run.py")
|
||||||
copy_path(hub / "requirements.txt", output_dir / "requirements.txt")
|
copy_path(soleprint / "index.html", output_dir / "index.html")
|
||||||
copy_path(hub / "dataloader", output_dir / "dataloader")
|
copy_path(soleprint / "requirements.txt", output_dir / "requirements.txt")
|
||||||
|
copy_path(soleprint / "dataloader", output_dir / "dataloader")
|
||||||
|
|
||||||
# System directories (copy)
|
# System directories (copy)
|
||||||
print("\nCopying systems...")
|
print("\nCopying systems...")
|
||||||
@@ -201,6 +252,10 @@ def build_deploy(output_dir: Path):
|
|||||||
print("\nCopying data...")
|
print("\nCopying data...")
|
||||||
copy_path(SPR_ROOT / "data", output_dir / "data")
|
copy_path(SPR_ROOT / "data", output_dir / "data")
|
||||||
|
|
||||||
|
# Config (copy)
|
||||||
|
print("\nCopying config...")
|
||||||
|
copy_cfg(output_dir, cfg_name)
|
||||||
|
|
||||||
# Models (generate fresh) - pass output_dir, modelgen adds models/pydantic
|
# Models (generate fresh) - pass output_dir, modelgen adds models/pydantic
|
||||||
print("\nGenerating models...")
|
print("\nGenerating models...")
|
||||||
if not generate_models(output_dir):
|
if not generate_models(output_dir):
|
||||||
@@ -215,7 +270,7 @@ def build_deploy(output_dir: Path):
|
|||||||
copy_path(SPR_ROOT / "schema.json", output_dir / "schema.json")
|
copy_path(SPR_ROOT / "schema.json", output_dir / "schema.json")
|
||||||
|
|
||||||
# Create run script
|
# Create run script
|
||||||
run_script = output_dir / "run.sh"
|
run_script = output_dir / "start.sh"
|
||||||
run_script.write_text("""#!/bin/bash
|
run_script.write_text("""#!/bin/bash
|
||||||
# Soleprint runner
|
# Soleprint runner
|
||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
@@ -230,16 +285,16 @@ echo "Starting soleprint on http://localhost:12000"
|
|||||||
.venv/bin/python main.py
|
.venv/bin/python main.py
|
||||||
""")
|
""")
|
||||||
run_script.chmod(0o755)
|
run_script.chmod(0o755)
|
||||||
print(" Created: run.sh")
|
print(" Created: start.sh")
|
||||||
|
|
||||||
total_files = count_files(output_dir)
|
total_files = count_files(output_dir)
|
||||||
print(f"\n✓ Deploy build complete! ({total_files} files)")
|
print(f"\n✓ Deploy build complete! ({total_files} files)")
|
||||||
print(f"\nTo run:")
|
print(f"\nTo run:")
|
||||||
print(f" cd {output_dir}")
|
print(f" cd {output_dir}")
|
||||||
print(f" ./run.sh")
|
print(f" ./start.sh")
|
||||||
print(f"\nOr deploy to server:")
|
print(f"\nOr deploy to server:")
|
||||||
print(f" rsync -av {output_dir}/ server:/app/soleprint/")
|
print(f" rsync -av {output_dir}/ server:/app/soleprint/")
|
||||||
print(f" ssh server 'cd /app/soleprint && ./run.sh'")
|
print(f" ssh server 'cd /app/soleprint && ./start.sh'")
|
||||||
|
|
||||||
|
|
||||||
def build_models():
|
def build_models():
|
||||||
@@ -274,6 +329,13 @@ def main():
|
|||||||
default=SPR_ROOT / "gen",
|
default=SPR_ROOT / "gen",
|
||||||
help="Output directory (default: gen/)",
|
help="Output directory (default: gen/)",
|
||||||
)
|
)
|
||||||
|
dev_parser.add_argument(
|
||||||
|
"--cfg",
|
||||||
|
"-c",
|
||||||
|
type=str,
|
||||||
|
default=None,
|
||||||
|
help="Room config to include (e.g., 'amar')",
|
||||||
|
)
|
||||||
|
|
||||||
# deploy command
|
# deploy command
|
||||||
deploy_parser = subparsers.add_parser(
|
deploy_parser = subparsers.add_parser(
|
||||||
@@ -286,6 +348,13 @@ def main():
|
|||||||
required=True,
|
required=True,
|
||||||
help="Output directory for deployment package",
|
help="Output directory for deployment package",
|
||||||
)
|
)
|
||||||
|
deploy_parser.add_argument(
|
||||||
|
"--cfg",
|
||||||
|
"-c",
|
||||||
|
type=str,
|
||||||
|
default=None,
|
||||||
|
help="Room config to include (e.g., 'amar')",
|
||||||
|
)
|
||||||
|
|
||||||
# models command
|
# models command
|
||||||
subparsers.add_parser("models", help="Only regenerate models")
|
subparsers.add_parser("models", help="Only regenerate models")
|
||||||
@@ -293,9 +362,9 @@ def main():
|
|||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
if args.command == "dev":
|
if args.command == "dev":
|
||||||
build_dev(args.output.resolve())
|
build_dev(args.output.resolve(), args.cfg)
|
||||||
elif args.command == "deploy":
|
elif args.command == "deploy":
|
||||||
build_deploy(args.output.resolve())
|
build_deploy(args.output.resolve(), args.cfg)
|
||||||
elif args.command == "models":
|
elif args.command == "models":
|
||||||
build_models()
|
build_models()
|
||||||
|
|
||||||
|
|||||||
117
cfg/amar/.env.example
Normal file
117
cfg/amar/.env.example
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
# =============================================================================
|
||||||
|
# AMAR Room - Configuration Template
|
||||||
|
# =============================================================================
|
||||||
|
# Copy this to .env and fill in values for your environment.
|
||||||
|
# Uses absolute paths to plug soleprint to existing Dockerfiles.
|
||||||
|
# =============================================================================
|
||||||
|
|
||||||
|
# =============================================================================
|
||||||
|
# DEPLOYMENT
|
||||||
|
# =============================================================================
|
||||||
|
# Container name prefix (e.g., amar_backend, amar_db)
|
||||||
|
DEPLOYMENT_NAME=amar
|
||||||
|
|
||||||
|
# =============================================================================
|
||||||
|
# NETWORK
|
||||||
|
# =============================================================================
|
||||||
|
NETWORK_NAME=amar_network
|
||||||
|
|
||||||
|
# =============================================================================
|
||||||
|
# PATHS (absolute paths to external code/dockerfiles - REQUIRED)
|
||||||
|
# =============================================================================
|
||||||
|
BACKEND_PATH=/abs/path/to/amar_django_back
|
||||||
|
FRONTEND_PATH=/abs/path/to/amar_frontend
|
||||||
|
DOCKERFILE_BACKEND=/abs/path/to/Dockerfile.backend
|
||||||
|
DOCKERFILE_FRONTEND=/abs/path/to/Dockerfile.frontend
|
||||||
|
|
||||||
|
# =============================================================================
|
||||||
|
# DATABASE
|
||||||
|
# =============================================================================
|
||||||
|
# Database dump file (relative to dumps/ directory)
|
||||||
|
DB_DUMP=test.sql
|
||||||
|
|
||||||
|
# =============================================================================
|
||||||
|
# PORTS
|
||||||
|
# =============================================================================
|
||||||
|
BACKEND_PORT=8000
|
||||||
|
FRONTEND_PORT=3000
|
||||||
|
|
||||||
|
# Soleprint ports
|
||||||
|
SOLEPRINT_PORT=12000
|
||||||
|
ARTERY_PORT=12001
|
||||||
|
ATLAS_PORT=12002
|
||||||
|
STATION_PORT=12003
|
||||||
|
|
||||||
|
# =============================================================================
|
||||||
|
# BACKEND SERVER (Uvicorn)
|
||||||
|
# =============================================================================
|
||||||
|
# Dev: 1 worker with hot reload
|
||||||
|
# Prod: 4 workers without reload
|
||||||
|
BACKEND_WORKERS=1
|
||||||
|
BACKEND_RELOAD=--reload
|
||||||
|
|
||||||
|
# Database connection
|
||||||
|
POSTGRES_DB=amarback
|
||||||
|
POSTGRES_USER=postgres
|
||||||
|
POSTGRES_PASSWORD=your_secure_password_here
|
||||||
|
|
||||||
|
# =============================================================================
|
||||||
|
# DJANGO
|
||||||
|
# =============================================================================
|
||||||
|
SECRET_KEY=your_django_secret_key_here
|
||||||
|
DEBUG=False
|
||||||
|
ALLOWED_HOSTS=amar.room.mcrn.ar,localhost
|
||||||
|
DJANGO_ENV=production
|
||||||
|
|
||||||
|
# =============================================================================
|
||||||
|
# CORS
|
||||||
|
# =============================================================================
|
||||||
|
CORS_ALLOW_ALL=false
|
||||||
|
CORS_ALLOWED_ORIGINS=
|
||||||
|
|
||||||
|
# =============================================================================
|
||||||
|
# GOOGLE SERVICES
|
||||||
|
# =============================================================================
|
||||||
|
SUBJECT_CALENDAR=
|
||||||
|
SHEET_ID=
|
||||||
|
RANGE_NAME=
|
||||||
|
GOOGLE_MAPS_API_KEY=
|
||||||
|
|
||||||
|
# =============================================================================
|
||||||
|
# ANALYTICS
|
||||||
|
# =============================================================================
|
||||||
|
GA4_MEASUREMENT_ID=
|
||||||
|
AMPLITUDE_API_KEY=
|
||||||
|
HOTJAR_API_KEY=
|
||||||
|
|
||||||
|
# =============================================================================
|
||||||
|
# MERCADO PAGO
|
||||||
|
# =============================================================================
|
||||||
|
ACCESS_TOKEN_MERCADO_PAGO=
|
||||||
|
MP_PLATFORM_ACCESS_TOKEN=
|
||||||
|
USER_ID=
|
||||||
|
|
||||||
|
# =============================================================================
|
||||||
|
# WEB PUSH
|
||||||
|
# =============================================================================
|
||||||
|
WEBPUSH_VAPID_PUBLIC_KEY=
|
||||||
|
WEBPUSH_VAPID_PRIVATE_KEY=
|
||||||
|
WEBPUSH_VAPID_ADMIN_EMAIL=
|
||||||
|
|
||||||
|
# =============================================================================
|
||||||
|
# INIT
|
||||||
|
# =============================================================================
|
||||||
|
USER_PASSWORD=initial_admin_password
|
||||||
|
|
||||||
|
# =============================================================================
|
||||||
|
# FRONTEND
|
||||||
|
# =============================================================================
|
||||||
|
NEXT_PUBLIC_APP_API_URL_BACKOFFICE=
|
||||||
|
NEXT_PUBLIC_APP_API_URL_STAGE=
|
||||||
|
NEXT_PUBLIC_IS_STAGE=false
|
||||||
|
NEXT_PUBLIC_FB_PIXEL_ID=
|
||||||
|
NEXT_PUBLIC_TAG_MANAGER=
|
||||||
|
NEXT_PUBLIC_WHATSAPP_CONTACT=
|
||||||
|
NEXT_PUBLIC_API_KEY=
|
||||||
|
NEXT_PUBLIC_AMPLITUDE_API_KEY=
|
||||||
|
NEXT_PUBLIC_GMAPS_API_KEY=
|
||||||
202
cfg/amar/docker-compose.yml
Normal file
202
cfg/amar/docker-compose.yml
Normal file
@@ -0,0 +1,202 @@
|
|||||||
|
# Amar Room - Docker Compose
|
||||||
|
#
|
||||||
|
# Creates: db, redis, backend, celery, celery-beat, frontend
|
||||||
|
# Network: Joins external network defined by NETWORK_NAME
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
# cd cfg/amar && docker compose up -d
|
||||||
|
#
|
||||||
|
# Required Environment Variables (from .env):
|
||||||
|
# - DEPLOYMENT_NAME: Prefix for container names
|
||||||
|
# - NETWORK_NAME: Network to join
|
||||||
|
# - BACKEND_PATH, FRONTEND_PATH: Source code paths (absolute)
|
||||||
|
# - DOCKERFILE_BACKEND, DOCKERFILE_FRONTEND: Dockerfile paths (absolute)
|
||||||
|
# - DB_DUMP: Database dump file (relative to dumps/)
|
||||||
|
# - Plus all app-specific vars (POSTGRES_*, etc.)
|
||||||
|
|
||||||
|
services:
|
||||||
|
db:
|
||||||
|
image: postgis/postgis:15-3.4
|
||||||
|
container_name: ${DEPLOYMENT_NAME}_db
|
||||||
|
environment:
|
||||||
|
POSTGRES_DB: ${POSTGRES_DB}
|
||||||
|
POSTGRES_USER: ${POSTGRES_USER}
|
||||||
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||||
|
volumes:
|
||||||
|
- pgdata:/var/lib/postgresql/data
|
||||||
|
# Database dump loaded on init (if volume is empty)
|
||||||
|
- ./dumps/${DB_DUMP}:/docker-entrypoint-initdb.d/dump.sql:ro
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
networks:
|
||||||
|
- default
|
||||||
|
|
||||||
|
redis:
|
||||||
|
image: redis:7-alpine
|
||||||
|
container_name: ${DEPLOYMENT_NAME}_redis
|
||||||
|
volumes:
|
||||||
|
- redisdata:/data
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "redis-cli", "ping"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
networks:
|
||||||
|
- default
|
||||||
|
|
||||||
|
backend:
|
||||||
|
build:
|
||||||
|
context: ${BACKEND_PATH}
|
||||||
|
dockerfile: ${DOCKERFILE_BACKEND}
|
||||||
|
target: runtime
|
||||||
|
container_name: ${DEPLOYMENT_NAME}_backend
|
||||||
|
environment:
|
||||||
|
- SECRET_KEY
|
||||||
|
- DEBUG
|
||||||
|
- ALLOWED_HOSTS
|
||||||
|
- DJANGO_ENV
|
||||||
|
- DB_NAME=${POSTGRES_DB}
|
||||||
|
- DB_USER=${POSTGRES_USER}
|
||||||
|
- DB_PASSWORD=${POSTGRES_PASSWORD}
|
||||||
|
- DB_HOST=db
|
||||||
|
- DB_PORT=5432
|
||||||
|
- CELERY_BROKER_URL=redis://redis:6379/0
|
||||||
|
- CELERY_RESULT_BACKEND=redis://redis:6379/0
|
||||||
|
- CORS_ALLOW_ALL
|
||||||
|
- CORS_ALLOWED_ORIGINS
|
||||||
|
# Uvicorn config (dev: 1 worker + reload, prod: 4 workers)
|
||||||
|
- WORKERS=${BACKEND_WORKERS:-1}
|
||||||
|
- RELOAD=${BACKEND_RELOAD:---reload}
|
||||||
|
# Google
|
||||||
|
- SUBJECT_CALENDAR
|
||||||
|
- SHEET_ID
|
||||||
|
- RANGE_NAME
|
||||||
|
- GOOGLE_MAPS_API_KEY
|
||||||
|
# Analytics
|
||||||
|
- GA4_MEASUREMENT_ID
|
||||||
|
- AMPLITUDE_API_KEY
|
||||||
|
- HOTJAR_API_KEY
|
||||||
|
# Payments
|
||||||
|
- ACCESS_TOKEN_MERCADO_PAGO
|
||||||
|
- MP_PLATFORM_ACCESS_TOKEN
|
||||||
|
- USER_ID
|
||||||
|
# Push
|
||||||
|
- WEBPUSH_VAPID_PUBLIC_KEY
|
||||||
|
- WEBPUSH_VAPID_PRIVATE_KEY
|
||||||
|
- WEBPUSH_VAPID_ADMIN_EMAIL
|
||||||
|
# Init
|
||||||
|
- USER_PASSWORD
|
||||||
|
volumes:
|
||||||
|
- ${BACKEND_PATH}:/app
|
||||||
|
- backend_static:/var/etc/static
|
||||||
|
- backend_media:/app/media
|
||||||
|
ports:
|
||||||
|
- "${BACKEND_PORT}:8000"
|
||||||
|
depends_on:
|
||||||
|
db:
|
||||||
|
condition: service_healthy
|
||||||
|
redis:
|
||||||
|
condition: service_healthy
|
||||||
|
networks:
|
||||||
|
- default
|
||||||
|
command: >
|
||||||
|
sh -c "python manage.py migrate --noinput &&
|
||||||
|
uvicorn amar_django_back.asgi:application --host 0.0.0.0 --port 8000 --workers $${WORKERS:-1} $${RELOAD}"
|
||||||
|
|
||||||
|
celery:
|
||||||
|
build:
|
||||||
|
context: ${BACKEND_PATH}
|
||||||
|
dockerfile: ${DOCKERFILE_BACKEND}
|
||||||
|
target: runtime
|
||||||
|
container_name: ${DEPLOYMENT_NAME}_celery
|
||||||
|
environment:
|
||||||
|
- SECRET_KEY
|
||||||
|
- DEBUG
|
||||||
|
- DJANGO_ENV
|
||||||
|
- DB_NAME=${POSTGRES_DB}
|
||||||
|
- DB_USER=${POSTGRES_USER}
|
||||||
|
- DB_PASSWORD=${POSTGRES_PASSWORD}
|
||||||
|
- DB_HOST=db
|
||||||
|
- DB_PORT=5432
|
||||||
|
- CELERY_BROKER_URL=redis://redis:6379/0
|
||||||
|
- CELERY_RESULT_BACKEND=redis://redis:6379/0
|
||||||
|
volumes:
|
||||||
|
- ${BACKEND_PATH}:/app
|
||||||
|
- backend_media:/app/media
|
||||||
|
depends_on:
|
||||||
|
db:
|
||||||
|
condition: service_healthy
|
||||||
|
redis:
|
||||||
|
condition: service_healthy
|
||||||
|
networks:
|
||||||
|
- default
|
||||||
|
command: celery -A amar_django_back worker -l INFO
|
||||||
|
|
||||||
|
celery-beat:
|
||||||
|
build:
|
||||||
|
context: ${BACKEND_PATH}
|
||||||
|
dockerfile: ${DOCKERFILE_BACKEND}
|
||||||
|
target: runtime
|
||||||
|
container_name: ${DEPLOYMENT_NAME}_celery_beat
|
||||||
|
environment:
|
||||||
|
- SECRET_KEY
|
||||||
|
- DEBUG
|
||||||
|
- DJANGO_ENV
|
||||||
|
- DB_NAME=${POSTGRES_DB}
|
||||||
|
- DB_USER=${POSTGRES_USER}
|
||||||
|
- DB_PASSWORD=${POSTGRES_PASSWORD}
|
||||||
|
- DB_HOST=db
|
||||||
|
- DB_PORT=5432
|
||||||
|
- CELERY_BROKER_URL=redis://redis:6379/0
|
||||||
|
- CELERY_RESULT_BACKEND=redis://redis:6379/0
|
||||||
|
volumes:
|
||||||
|
- ${BACKEND_PATH}:/app
|
||||||
|
depends_on:
|
||||||
|
db:
|
||||||
|
condition: service_healthy
|
||||||
|
redis:
|
||||||
|
condition: service_healthy
|
||||||
|
networks:
|
||||||
|
- default
|
||||||
|
command: celery -A amar_django_back beat -l INFO
|
||||||
|
|
||||||
|
frontend:
|
||||||
|
build:
|
||||||
|
context: ${FRONTEND_PATH}
|
||||||
|
dockerfile: ${DOCKERFILE_FRONTEND}
|
||||||
|
target: development
|
||||||
|
container_name: ${DEPLOYMENT_NAME}_frontend
|
||||||
|
environment:
|
||||||
|
- NEXT_PUBLIC_APP_API_URL_BACKOFFICE
|
||||||
|
- NEXT_PUBLIC_APP_API_URL_STAGE
|
||||||
|
- NEXT_PUBLIC_IS_STAGE
|
||||||
|
- NEXT_PUBLIC_FB_PIXEL_ID
|
||||||
|
- NEXT_PUBLIC_TAG_MANAGER
|
||||||
|
- NEXT_PUBLIC_WHATSAPP_CONTACT
|
||||||
|
- NEXT_PUBLIC_API_KEY
|
||||||
|
- NEXT_PUBLIC_AMPLITUDE_API_KEY
|
||||||
|
- NEXT_PUBLIC_GMAPS_API_KEY
|
||||||
|
volumes:
|
||||||
|
- ${FRONTEND_PATH}/src:/app/src
|
||||||
|
- ${FRONTEND_PATH}/public:/app/public
|
||||||
|
ports:
|
||||||
|
- "${FRONTEND_PORT}:3000"
|
||||||
|
depends_on:
|
||||||
|
- backend
|
||||||
|
networks:
|
||||||
|
- default
|
||||||
|
# CMD from Dockerfile.frontend development stage: npm run dev
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
pgdata:
|
||||||
|
redisdata:
|
||||||
|
backend_static:
|
||||||
|
backend_media:
|
||||||
|
|
||||||
|
networks:
|
||||||
|
default:
|
||||||
|
external: true
|
||||||
|
name: ${NETWORK_NAME}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
# Link Nest - Adapter Layer
|
# Link Room - Adapter Layer
|
||||||
|
|
||||||
Provides framework-agnostic data navigation between managed apps (AMAR) and pawprint.
|
Provides framework-agnostic data navigation between managed apps (AMAR) and soleprint.
|
||||||
|
|
||||||
## Status: Initial Implementation ✅
|
## Status: Initial Implementation ✅
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ Provides framework-agnostic data navigation between managed apps (AMAR) and pawp
|
|||||||
## Architecture
|
## Architecture
|
||||||
|
|
||||||
```
|
```
|
||||||
Managed App (AMAR) ←─── link_nest ───→ Pawprint (Ward)
|
Managed App (AMAR) ←─── link_room ───→ Soleprint (Ward)
|
||||||
↓ ↓ ↓
|
↓ ↓ ↓
|
||||||
Database Adapter Layer Graph Renderer
|
Database Adapter Layer Graph Renderer
|
||||||
(SQL → JSON) (JSON → SVG)
|
(SQL → JSON) (JSON → SVG)
|
||||||
@@ -58,8 +58,8 @@ Managed App (AMAR) ←─── link_nest ───→ Pawprint (Ward)
|
|||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Start (from core_nest/ctrl)
|
# Start (from core_room/ctrl)
|
||||||
./start.sh link_nest -d --build
|
./start.sh link_room -d --build
|
||||||
|
|
||||||
# Test
|
# Test
|
||||||
curl http://localhost:8100/health
|
curl http://localhost:8100/health
|
||||||
@@ -67,12 +67,12 @@ curl http://localhost:8100/api/queries
|
|||||||
curl "http://localhost:8100/api/navigate?query=user_with_pets"
|
curl "http://localhost:8100/api/navigate?query=user_with_pets"
|
||||||
|
|
||||||
# Logs
|
# Logs
|
||||||
docker logs core_nest_link_nest
|
docker logs core_room_link_room
|
||||||
```
|
```
|
||||||
|
|
||||||
## Environment Variables
|
## Environment Variables
|
||||||
|
|
||||||
From `core_nest/.env`:
|
From `core_room/.env`:
|
||||||
- `NEST_NAME` - Container naming
|
- `NEST_NAME` - Container naming
|
||||||
- `NETWORK_NAME` - Docker network
|
- `NETWORK_NAME` - Docker network
|
||||||
- `DB_HOST` - Database host (needs fix: should point to db container)
|
- `DB_HOST` - Database host (needs fix: should point to db container)
|
||||||
@@ -84,7 +84,7 @@ From `core_nest/.env`:
|
|||||||
|
|
||||||
## Next Steps
|
## Next Steps
|
||||||
|
|
||||||
1. **Fix DB connection** - Set correct DB_HOST in core_nest/.env
|
1. **Fix DB connection** - Set correct DB_HOST in core_room/.env
|
||||||
2. **Complete queries** - Add remaining entity types
|
2. **Complete queries** - Add remaining entity types
|
||||||
3. **Ward integration** - Create ward consumer for JSON
|
3. **Ward integration** - Create ward consumer for JSON
|
||||||
4. **Add graphviz rendering** - Move from data_browse reference
|
4. **Add graphviz rendering** - Move from data_browse reference
|
||||||
@@ -93,7 +93,7 @@ From `core_nest/.env`:
|
|||||||
## Files
|
## Files
|
||||||
|
|
||||||
```
|
```
|
||||||
link_nest/
|
link_room/
|
||||||
├── README.md # This file
|
├── README.md # This file
|
||||||
├── main.py # FastAPI app with endpoints
|
├── main.py # FastAPI app with endpoints
|
||||||
├── requirements.txt # Python dependencies
|
├── requirements.txt # Python dependencies
|
||||||
@@ -107,7 +107,7 @@ link_nest/
|
|||||||
## Design Goals
|
## Design Goals
|
||||||
|
|
||||||
✅ **Framework-agnostic** - Works with Django, Rails, Express, etc.
|
✅ **Framework-agnostic** - Works with Django, Rails, Express, etc.
|
||||||
✅ **Decoupled** - Managed app owns data, link_nest translates
|
✅ **Decoupled** - Managed app owns data, link_room translates
|
||||||
✅ **Pluggable** - Adapters for different frameworks
|
✅ **Pluggable** - Adapters for different frameworks
|
||||||
✅ **Authenticated** - Ready for remote deployment
|
✅ **Authenticated** - Ready for remote deployment
|
||||||
✅ **Incremental** - Build and test each piece
|
✅ **Incremental** - Build and test each piece
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
"""
|
"""
|
||||||
Link Nest - Adapter layer between managed apps and pawprint.
|
Link Room - Adapter layer between managed apps and soleprint.
|
||||||
|
|
||||||
Exposes standardized JSON endpoints for data navigation.
|
Exposes standardized JSON endpoints for data navigation.
|
||||||
Framework-agnostic via pluggable adapters.
|
Framework-agnostic via pluggable adapters.
|
||||||
@@ -9,7 +9,7 @@ import os
|
|||||||
from typing import Optional
|
from typing import Optional
|
||||||
from fastapi import FastAPI, HTTPException
|
from fastapi import FastAPI, HTTPException
|
||||||
|
|
||||||
app = FastAPI(title="Link Nest", version="0.1.0")
|
app = FastAPI(title="Link Room", version="0.1.0")
|
||||||
|
|
||||||
# Lazy-loaded adapter instance
|
# Lazy-loaded adapter instance
|
||||||
_adapter = None
|
_adapter = None
|
||||||
@@ -54,7 +54,7 @@ def health():
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
"status": "ok" if adapter_ok else "degraded",
|
"status": "ok" if adapter_ok else "degraded",
|
||||||
"service": "link-nest",
|
"service": "link-room",
|
||||||
"adapter": adapter_type,
|
"adapter": adapter_type,
|
||||||
"adapter_loaded": adapter_ok,
|
"adapter_loaded": adapter_ok,
|
||||||
}
|
}
|
||||||
@@ -136,4 +136,4 @@ Feature development:
|
|||||||
| Soleprint source | `../` (parent directory) |
|
| Soleprint source | `../` (parent directory) |
|
||||||
| Amar backend | `/home/mariano/wdir/ama/amar_django_back` |
|
| Amar backend | `/home/mariano/wdir/ama/amar_django_back` |
|
||||||
| Amar frontend | `/home/mariano/wdir/ama/amar_frontend` |
|
| Amar frontend | `/home/mariano/wdir/ama/amar_frontend` |
|
||||||
| Core nest (legacy) | `/home/mariano/wdir/ama/core_nest` |
|
| Core room (legacy) | `/home/mariano/wdir/ama/core_room` |
|
||||||
@@ -1,19 +1,19 @@
|
|||||||
# Configuration for core_nest deployment
|
# Configuration for core_room deployment
|
||||||
|
|
||||||
# Server configuration
|
# Server configuration
|
||||||
DEPLOY_SERVER=mariano@mcrn.ar
|
DEPLOY_SERVER=mariano@mcrn.ar
|
||||||
|
|
||||||
# Docker deployment (default)
|
# Docker deployment (default)
|
||||||
DEPLOY_REMOTE_PATH=~/core_nest
|
DEPLOY_REMOTE_PATH=~/core_room
|
||||||
|
|
||||||
# Bare metal deployment (--bare-metal flag)
|
# Bare metal deployment (--bare-metal flag)
|
||||||
DEPLOY_BARE_METAL_PATH=~/pawprint
|
DEPLOY_BARE_METAL_PATH=~/soleprint
|
||||||
|
|
||||||
# Local source code paths
|
# Local source code paths
|
||||||
# (Defaults are set in deploy.sh if not specified here)
|
# (Defaults are set in deploy.sh if not specified here)
|
||||||
LOCAL_AMAR_BACKEND=/home/mariano/wdir/ama/amar_django_back
|
LOCAL_AMAR_BACKEND=/home/mariano/wdir/ama/amar_django_back
|
||||||
LOCAL_AMAR_FRONTEND=/home/mariano/wdir/ama/amar_frontend
|
LOCAL_AMAR_FRONTEND=/home/mariano/wdir/ama/amar_frontend
|
||||||
LOCAL_PAWPRINT=/home/mariano/wdir/ama/pawprint
|
LOCAL_SOLEPRINT=/home/mariano/wdir/ama/soleprint
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
# TEST SYNC PATHS (decoupled, standalone)
|
# TEST SYNC PATHS (decoupled, standalone)
|
||||||
@@ -22,4 +22,4 @@ LOCAL_PAWPRINT=/home/mariano/wdir/ama/pawprint
|
|||||||
TEST_SOURCE_PATH=/home/mariano/wdir/ama/amar_django_back/tests/contracts
|
TEST_SOURCE_PATH=/home/mariano/wdir/ama/amar_django_back/tests/contracts
|
||||||
|
|
||||||
# Target: Where ward tester expects tests (volume mount, no restart needed)
|
# Target: Where ward tester expects tests (volume mount, no restart needed)
|
||||||
WARD_TESTS_PATH=/home/mariano/wdir/ama/pawprint/ward/tools/tester/tests
|
WARD_TESTS_PATH=/home/mariano/wdir/ama/soleprint/ward/tools/tester/tests
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Core Nest Control Scripts
|
# Core Room Control Scripts
|
||||||
|
|
||||||
Control scripts for managing the core_nest deployment (amar + pawprint).
|
Control scripts for managing the core_room deployment (amar + soleprint).
|
||||||
|
|
||||||
## Structure
|
## Structure
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ ctrl/
|
|||||||
├── stop.sh # Stop Docker services
|
├── stop.sh # Stop Docker services
|
||||||
└── manual_sync/ # Source code sync scripts
|
└── manual_sync/ # Source code sync scripts
|
||||||
├── sync_ama.sh # Sync amar source code
|
├── sync_ama.sh # Sync amar source code
|
||||||
└── sync_pawprint.sh # Sync pawprint source code
|
└── sync_soleprint.sh # Sync soleprint source code
|
||||||
```
|
```
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
@@ -27,15 +27,15 @@ Edit `.env.sync` to configure deployment:
|
|||||||
```bash
|
```bash
|
||||||
# Server
|
# Server
|
||||||
DEPLOY_SERVER=mariano@mcrn.ar
|
DEPLOY_SERVER=mariano@mcrn.ar
|
||||||
DEPLOY_REMOTE_PATH=~/core_nest
|
DEPLOY_REMOTE_PATH=~/core_room
|
||||||
|
|
||||||
# Local paths
|
# Local paths
|
||||||
LOCAL_PAWPRINT_PATH=/home/mariano/wdir/ama/pawprint
|
LOCAL_SOLEPRINT_PATH=/home/mariano/wdir/ama/soleprint
|
||||||
LOCAL_AMAR_BASE=/home/mariano/wdir/ama
|
LOCAL_AMAR_BASE=/home/mariano/wdir/ama
|
||||||
|
|
||||||
# Remote paths
|
# Remote paths
|
||||||
REMOTE_PAWPRINT_PATH=/home/mariano/pawprint
|
REMOTE_SOLEPRINT_PATH=/home/mariano/soleprint
|
||||||
REMOTE_AMAR_PATH=/home/mariano/core_nest/amar/src
|
REMOTE_AMAR_PATH=/home/mariano/core_room/amar/src
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
@@ -47,7 +47,7 @@ cd ctrl
|
|||||||
./deploy.sh --dry-run # Preview what would be synced
|
./deploy.sh --dry-run # Preview what would be synced
|
||||||
|
|
||||||
# Then on server:
|
# Then on server:
|
||||||
ssh server 'cd ~/core_nest/ctrl && ./build.sh && ./start.sh -d'
|
ssh server 'cd ~/core_room/ctrl && ./build.sh && ./start.sh -d'
|
||||||
```
|
```
|
||||||
|
|
||||||
### Local Development
|
### Local Development
|
||||||
@@ -83,10 +83,10 @@ ssh server 'cd ~/core_nest/ctrl && ./build.sh && ./start.sh -d'
|
|||||||
./status.sh # Show container status
|
./status.sh # Show container status
|
||||||
```
|
```
|
||||||
|
|
||||||
## Nest vs Pawprint Control
|
## Room vs Soleprint Control
|
||||||
|
|
||||||
- **core_nest/ctrl/** - Manages the full nest (amar + pawprint) via Docker
|
- **core_room/ctrl/** - Manages the full room (amar + soleprint) via Docker
|
||||||
- **pawprint/ctrl/** - Manages pawprint services via systemd (alternative deployment)
|
- **soleprint/ctrl/** - Manages soleprint services via systemd (alternative deployment)
|
||||||
|
|
||||||
Use core_nest/ctrl for orchestrating the full nest with Docker Compose.
|
Use core_room/ctrl for orchestrating the full room with Docker Compose.
|
||||||
Use pawprint/ctrl for direct systemd deployment of pawprint services only.
|
Use soleprint/ctrl for direct systemd deployment of soleprint services only.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Build core_nest Docker images
|
# Build core_room Docker images
|
||||||
#
|
#
|
||||||
# Usage:
|
# Usage:
|
||||||
# ./build.sh # Build all
|
# ./build.sh # Build all
|
||||||
@@ -11,7 +11,7 @@ set -e
|
|||||||
# Change to parent directory (services are in ../service_name)
|
# Change to parent directory (services are in ../service_name)
|
||||||
cd "$(dirname "$0")/.."
|
cd "$(dirname "$0")/.."
|
||||||
|
|
||||||
# Export core_nest/.env vars so child docker-compose files can use them
|
# Export core_room/.env vars so child docker-compose files can use them
|
||||||
if [ -f ".env" ]; then
|
if [ -f ".env" ]; then
|
||||||
export $(grep -v '^#' .env | grep -v '^$' | xargs)
|
export $(grep -v '^#' .env | grep -v '^$' | xargs)
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Deploy core_nest to server
|
# Deploy core_room to server
|
||||||
#
|
#
|
||||||
# Two deployment modes:
|
# Two deployment modes:
|
||||||
# 1. Docker (default): Full core_nest structure + source code
|
# 1. Docker (default): Full core_room structure + source code
|
||||||
# 2. Bare metal (--bare-metal): Only pawprint source to systemd services
|
# 2. Bare metal (--bare-metal): Only soleprint source to systemd services
|
||||||
#
|
#
|
||||||
# Usage:
|
# Usage:
|
||||||
# ./deploy.sh # Deploy Docker setup (default)
|
# ./deploy.sh # Deploy Docker setup (default)
|
||||||
# ./deploy.sh --bare-metal # Deploy bare metal pawprint only
|
# ./deploy.sh --bare-metal # Deploy bare metal soleprint only
|
||||||
# ./deploy.sh --dry-run # Preview what would be synced
|
# ./deploy.sh --dry-run # Preview what would be synced
|
||||||
# ./deploy.sh --bare-metal --dry-run # Preview bare metal sync
|
# ./deploy.sh --bare-metal --dry-run # Preview bare metal sync
|
||||||
|
|
||||||
@@ -18,13 +18,13 @@ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|||||||
source "$SCRIPT_DIR/.env.sync" 2>/dev/null || true
|
source "$SCRIPT_DIR/.env.sync" 2>/dev/null || true
|
||||||
|
|
||||||
SERVER="${DEPLOY_SERVER:-mariano@mcrn.ar}"
|
SERVER="${DEPLOY_SERVER:-mariano@mcrn.ar}"
|
||||||
REMOTE_PATH="${DEPLOY_REMOTE_PATH:-~/core_nest}"
|
REMOTE_PATH="${DEPLOY_REMOTE_PATH:-~/core_room}"
|
||||||
BARE_METAL_PATH="${DEPLOY_BARE_METAL_PATH:-~/pawprint}"
|
BARE_METAL_PATH="${DEPLOY_BARE_METAL_PATH:-~/soleprint}"
|
||||||
|
|
||||||
# Source code paths (defaults if not in .env.sync)
|
# Source code paths (defaults if not in .env.sync)
|
||||||
LOCAL_AMAR_BACKEND="${LOCAL_AMAR_BACKEND:-$HOME/wdir/ama/amar_django_back}"
|
LOCAL_AMAR_BACKEND="${LOCAL_AMAR_BACKEND:-$HOME/wdir/ama/amar_django_back}"
|
||||||
LOCAL_AMAR_FRONTEND="${LOCAL_AMAR_FRONTEND:-$HOME/wdir/ama/amar_frontend}"
|
LOCAL_AMAR_FRONTEND="${LOCAL_AMAR_FRONTEND:-$HOME/wdir/ama/amar_frontend}"
|
||||||
LOCAL_PAWPRINT="${LOCAL_PAWPRINT:-$HOME/wdir/ama/pawprint}"
|
LOCAL_SOLEPRINT="${LOCAL_SOLEPRINT:-$HOME/wdir/ama/soleprint}"
|
||||||
|
|
||||||
DRY_RUN=""
|
DRY_RUN=""
|
||||||
BARE_METAL=""
|
BARE_METAL=""
|
||||||
@@ -48,15 +48,15 @@ if [ -n "$BARE_METAL" ]; then
|
|||||||
echo "=== Deploying to Bare Metal (Systemd Services) ==="
|
echo "=== Deploying to Bare Metal (Systemd Services) ==="
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# Only sync pawprint source
|
# Only sync soleprint source
|
||||||
if [ -d "$LOCAL_PAWPRINT" ] && [ -f "$LOCAL_PAWPRINT/main.py" ]; then
|
if [ -d "$LOCAL_SOLEPRINT" ] && [ -f "$LOCAL_SOLEPRINT/main.py" ]; then
|
||||||
echo "Syncing pawprint source to bare metal..."
|
echo "Syncing soleprint source to bare metal..."
|
||||||
$RSYNC_CMD $DRY_RUN \
|
$RSYNC_CMD $DRY_RUN \
|
||||||
"$LOCAL_PAWPRINT/" \
|
"$LOCAL_SOLEPRINT/" \
|
||||||
"$SERVER:$BARE_METAL_PATH/"
|
"$SERVER:$BARE_METAL_PATH/"
|
||||||
echo " ✓ Pawprint synced to $BARE_METAL_PATH"
|
echo " ✓ Soleprint synced to $BARE_METAL_PATH"
|
||||||
else
|
else
|
||||||
echo "⚠ Pawprint not found at: $LOCAL_PAWPRINT"
|
echo "⚠ Soleprint not found at: $LOCAL_SOLEPRINT"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
@@ -70,10 +70,10 @@ if [ -n "$BARE_METAL" ]; then
|
|||||||
echo ""
|
echo ""
|
||||||
echo "Next steps on server (as mariano user):"
|
echo "Next steps on server (as mariano user):"
|
||||||
echo " Restart systemd services:"
|
echo " Restart systemd services:"
|
||||||
echo " sudo systemctl restart pawprint artery album ward"
|
echo " sudo systemctl restart soleprint artery album ward"
|
||||||
echo ""
|
echo ""
|
||||||
echo " Check status:"
|
echo " Check status:"
|
||||||
echo " sudo systemctl status pawprint artery album ward"
|
echo " sudo systemctl status soleprint artery album ward"
|
||||||
echo ""
|
echo ""
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
@@ -84,13 +84,13 @@ fi
|
|||||||
echo "=== Deploying to Docker ==="
|
echo "=== Deploying to Docker ==="
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# 1. Sync core_nest structure (excluding src directories - they're synced separately)
|
# 1. Sync core_room structure (excluding src directories - they're synced separately)
|
||||||
echo "1. Syncing core_nest structure..."
|
echo "1. Syncing core_room structure..."
|
||||||
$RSYNC_CMD $DRY_RUN \
|
$RSYNC_CMD $DRY_RUN \
|
||||||
--exclude='*/src/' \
|
--exclude='*/src/' \
|
||||||
./ \
|
./ \
|
||||||
"$SERVER:$REMOTE_PATH/"
|
"$SERVER:$REMOTE_PATH/"
|
||||||
echo " [OK] Core nest structure synced"
|
echo " [OK] Core room structure synced"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# 2. Sync amar backend source
|
# 2. Sync amar backend source
|
||||||
@@ -117,15 +117,15 @@ else
|
|||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# 4. Sync pawprint source
|
# 4. Sync soleprint source
|
||||||
if [ -d "$LOCAL_PAWPRINT" ] && [ -f "$LOCAL_PAWPRINT/main.py" ]; then
|
if [ -d "$LOCAL_SOLEPRINT" ] && [ -f "$LOCAL_SOLEPRINT/main.py" ]; then
|
||||||
echo "4. Syncing pawprint source..."
|
echo "4. Syncing soleprint source..."
|
||||||
$RSYNC_CMD $DRY_RUN \
|
$RSYNC_CMD $DRY_RUN \
|
||||||
"$LOCAL_PAWPRINT/" \
|
"$LOCAL_SOLEPRINT/" \
|
||||||
"$SERVER:$REMOTE_PATH/pawprint/src/"
|
"$SERVER:$REMOTE_PATH/soleprint/src/"
|
||||||
echo " [OK] Pawprint synced"
|
echo " [OK] Soleprint synced"
|
||||||
else
|
else
|
||||||
echo "4. [INFO] Pawprint not found at: $LOCAL_PAWPRINT"
|
echo "4. [INFO] Soleprint not found at: $LOCAL_SOLEPRINT"
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# View core_nest logs
|
# View core_room logs
|
||||||
#
|
#
|
||||||
# Usage:
|
# Usage:
|
||||||
# ./logs.sh # All logs
|
# ./logs.sh # All logs
|
||||||
# ./logs.sh <service> # Service compose logs (e.g., amar, pawprint)
|
# ./logs.sh <service> # Service compose logs (e.g., amar, soleprint)
|
||||||
# ./logs.sh <container> # Specific container name (e.g., backend, db)
|
# ./logs.sh <container> # Specific container name (e.g., backend, db)
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
@@ -11,7 +11,7 @@ set -e
|
|||||||
# Change to parent directory (services are in ../service_name)
|
# Change to parent directory (services are in ../service_name)
|
||||||
cd "$(dirname "$0")/.."
|
cd "$(dirname "$0")/.."
|
||||||
|
|
||||||
# Export core_nest/.env vars
|
# Export core_room/.env vars
|
||||||
if [ -f ".env" ]; then
|
if [ -f ".env" ]; then
|
||||||
export $(grep -v '^#' .env | grep -v '^$' | xargs)
|
export $(grep -v '^#' .env | grep -v '^$' | xargs)
|
||||||
fi
|
fi
|
||||||
@@ -27,19 +27,19 @@ for dir in */; do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# NEST_NAME comes from core_nest/.env
|
# ROOM_NAME comes from core_room/.env
|
||||||
NEST_NAME=${NEST_NAME:-core_nest}
|
ROOM_NAME=${ROOM_NAME:-core_room}
|
||||||
|
|
||||||
if [[ " ${SERVICE_DIRS[@]} " =~ " ${TARGET} " ]]; then
|
if [[ " ${SERVICE_DIRS[@]} " =~ " ${TARGET} " ]]; then
|
||||||
# Service directory logs
|
# Service directory logs
|
||||||
cd "$TARGET" && docker compose logs -f
|
cd "$TARGET" && docker compose logs -f
|
||||||
elif [ "$TARGET" = "all" ]; then
|
elif [ "$TARGET" = "all" ]; then
|
||||||
# All containers matching NEST_NAME
|
# All containers matching ROOM_NAME
|
||||||
docker logs -f $(docker ps -q --filter "name=${NEST_NAME}") 2>/dev/null || \
|
docker logs -f $(docker ps -q --filter "name=${ROOM_NAME}") 2>/dev/null || \
|
||||||
echo "No ${NEST_NAME} containers running"
|
echo "No ${ROOM_NAME} containers running"
|
||||||
else
|
else
|
||||||
# Specific container name
|
# Specific container name
|
||||||
docker logs -f "${NEST_NAME}_$TARGET" 2>/dev/null || \
|
docker logs -f "${ROOM_NAME}_$TARGET" 2>/dev/null || \
|
||||||
docker logs -f "$TARGET" 2>/dev/null || \
|
docker logs -f "$TARGET" 2>/dev/null || \
|
||||||
echo "Container not found: $TARGET"
|
echo "Container not found: $TARGET"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
# Core Nest - Environment Configuration
|
# Core Room - Environment Configuration
|
||||||
# This configuration is shared across all services in the nest
|
# This configuration is shared across all services in the room
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
# DEPLOYMENT CONFIG
|
# DEPLOYMENT CONFIG
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
# Unique identifier for this deployment (used for container/network names)
|
# Unique identifier for this deployment (used for container/network names)
|
||||||
DEPLOYMENT_NAME=core_nest
|
DEPLOYMENT_NAME=core_room
|
||||||
|
|
||||||
# Nest identifier (logical grouping of services)
|
# Room identifier (logical grouping of services)
|
||||||
NEST_NAME=core_nest
|
ROOM_NAME=core_room
|
||||||
|
|
||||||
# Network name for Docker services
|
# Network name for Docker services
|
||||||
NETWORK_NAME=core_nest_network
|
NETWORK_NAME=core_room_network
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
# DOMAINS (Local Development)
|
# DOMAINS (Local Development)
|
||||||
@@ -19,8 +19,8 @@ NETWORK_NAME=core_nest_network
|
|||||||
# Domain for the managed application (e.g., amar)
|
# Domain for the managed application (e.g., amar)
|
||||||
MANAGED_DOMAIN=amar.local.com
|
MANAGED_DOMAIN=amar.local.com
|
||||||
|
|
||||||
# Domain for pawprint management interface
|
# Domain for soleprint management interface
|
||||||
PAWPRINT_DOMAIN=pawprint.local.com
|
SOLEPRINT_DOMAIN=soleprint.local.com
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
# PORTS (Local Development)
|
# PORTS (Local Development)
|
||||||
@@ -29,8 +29,8 @@ PAWPRINT_DOMAIN=pawprint.local.com
|
|||||||
BACKEND_PORT=8000
|
BACKEND_PORT=8000
|
||||||
FRONTEND_PORT=3000
|
FRONTEND_PORT=3000
|
||||||
|
|
||||||
# Pawprint ecosystem ports
|
# Soleprint ecosystem ports
|
||||||
PAWPRINT_PORT=13000
|
SOLEPRINT_PORT=13000
|
||||||
ARTERY_PORT=13001
|
ARTERY_PORT=13001
|
||||||
ALBUM_PORT=13002
|
ALBUM_PORT=13002
|
||||||
WARD_PORT=13003
|
WARD_PORT=13003
|
||||||
@@ -63,7 +63,7 @@ MANAGED_BACKEND_LOCATIONS='
|
|||||||
'
|
'
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
# MANAGED DOMAIN CONFIG (AMAR-specific - core_nest context)
|
# MANAGED DOMAIN CONFIG (AMAR-specific - core_room context)
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
# Complete nginx location blocks for amar
|
# Complete nginx location blocks for amar
|
||||||
MANAGED_LOCATIONS='
|
MANAGED_LOCATIONS='
|
||||||
@@ -99,12 +99,12 @@ MANAGED_LOCATIONS='
|
|||||||
'
|
'
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
# AMAR PATHS (core_nest specific - managed app)
|
# AMAR PATHS (core_room specific - managed app)
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
BACKEND_PATH=../../amar_django_back
|
BACKEND_PATH=../../amar_django_back
|
||||||
FRONTEND_PATH=../../amar_frontend
|
FRONTEND_PATH=../../amar_frontend
|
||||||
DOCKERFILE_BACKEND=../def/core_nest/amar/Dockerfile.backend
|
DOCKERFILE_BACKEND=../def/core_room/amar/Dockerfile.backend
|
||||||
DOCKERFILE_FRONTEND=../def/core_nest/amar/Dockerfile.frontend
|
DOCKERFILE_FRONTEND=../def/core_room/amar/Dockerfile.frontend
|
||||||
|
|
||||||
# Database seed data
|
# Database seed data
|
||||||
INIT_DB_SEED=test
|
INIT_DB_SEED=test
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ Separate from `ctrl/` which contains **local** orchestration scripts.
|
|||||||
server/
|
server/
|
||||||
├── setup.sh # Idempotent server setup (run on AWS)
|
├── setup.sh # Idempotent server setup (run on AWS)
|
||||||
├── nginx/
|
├── nginx/
|
||||||
│ └── core_nest.conf # Single nginx config for all services
|
│ └── core_room.conf # Single nginx config for all services
|
||||||
└── scripts/ # Any other server-side scripts
|
└── scripts/ # Any other server-side scripts
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ server/
|
|||||||
When deployed, the AWS instance should look like:
|
When deployed, the AWS instance should look like:
|
||||||
|
|
||||||
```
|
```
|
||||||
~/core_nest/ # This repo (deployed via deploy.sh)
|
~/core_room/ # This repo (deployed via deploy.sh)
|
||||||
├── server/ # Server-side scripts
|
├── server/ # Server-side scripts
|
||||||
│ ├── setup.sh # Run this first
|
│ ├── setup.sh # Run this first
|
||||||
│ └── nginx/
|
│ └── nginx/
|
||||||
@@ -37,7 +37,7 @@ When deployed, the AWS instance should look like:
|
|||||||
│ └── src/ # Synced from local via manual_sync/
|
│ └── src/ # Synced from local via manual_sync/
|
||||||
│ ├── back/ # Django source
|
│ ├── back/ # Django source
|
||||||
│ └── front/ # Next.js source
|
│ └── front/ # Next.js source
|
||||||
└── pawprint/
|
└── soleprint/
|
||||||
├── docker-compose.yml
|
├── docker-compose.yml
|
||||||
├── .env # Production values
|
├── .env # Production values
|
||||||
└── (bare metal or src/ depending on deployment)
|
└── (bare metal or src/ depending on deployment)
|
||||||
@@ -49,14 +49,14 @@ When deployed, the AWS instance should look like:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 1. From local machine: Deploy files
|
# 1. From local machine: Deploy files
|
||||||
cd ~/wdir/ama/core_nest/ctrl
|
cd ~/wdir/ama/core_room/ctrl
|
||||||
./deploy.sh
|
./deploy.sh
|
||||||
|
|
||||||
# 2. SSH to server
|
# 2. SSH to server
|
||||||
ssh mariano@mcrn.ar
|
ssh mariano@mcrn.ar
|
||||||
|
|
||||||
# 3. Run server setup (idempotent - safe to re-run)
|
# 3. Run server setup (idempotent - safe to re-run)
|
||||||
cd ~/core_nest/server
|
cd ~/core_room/server
|
||||||
./setup.sh
|
./setup.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -70,19 +70,19 @@ This will:
|
|||||||
### Updates/Changes
|
### Updates/Changes
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# From local: edit server/nginx/core_nest.conf or server/setup.sh
|
# From local: edit server/nginx/core_room.conf or server/setup.sh
|
||||||
# Then deploy:
|
# Then deploy:
|
||||||
./deploy.sh
|
./deploy.sh
|
||||||
|
|
||||||
# On server: re-run setup to apply changes
|
# On server: re-run setup to apply changes
|
||||||
ssh mariano@mcrn.ar 'cd ~/core_nest/server && ./setup.sh'
|
ssh mariano@mcrn.ar 'cd ~/core_room/server && ./setup.sh'
|
||||||
```
|
```
|
||||||
|
|
||||||
### Build and Start Services
|
### Build and Start Services
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# On server (or via SSH):
|
# On server (or via SSH):
|
||||||
cd ~/core_nest/ctrl
|
cd ~/core_room/ctrl
|
||||||
./build.sh # Build all images
|
./build.sh # Build all images
|
||||||
./start.sh -d # Start detached
|
./start.sh -d # Start detached
|
||||||
./status.sh # Check status
|
./status.sh # Check status
|
||||||
@@ -100,11 +100,11 @@ Idempotent setup script that runs on AWS:
|
|||||||
|
|
||||||
**Safe to run multiple times** - won't break existing setup.
|
**Safe to run multiple times** - won't break existing setup.
|
||||||
|
|
||||||
### server/nginx/core_nest.conf
|
### server/nginx/core_room.conf
|
||||||
|
|
||||||
Single nginx config file for all services:
|
Single nginx config file for all services:
|
||||||
- amar.nest.mcrn.ar (frontend + backend)
|
- amar.room.mcrn.ar (frontend + backend)
|
||||||
- pawprint.mcrn.ar
|
- soleprint.mcrn.ar
|
||||||
- artery.mcrn.ar
|
- artery.mcrn.ar
|
||||||
- album.mcrn.ar
|
- album.mcrn.ar
|
||||||
- ward.mcrn.ar
|
- ward.mcrn.ar
|
||||||
@@ -117,8 +117,8 @@ Create production `.env` files:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# On server:
|
# On server:
|
||||||
nano ~/core_nest/amar/.env # Set INIT_DB_SEED=test or prod
|
nano ~/core_room/amar/.env # Set INIT_DB_SEED=test or prod
|
||||||
nano ~/core_nest/pawprint/.env # Set NEST_NAME, ports, etc.
|
nano ~/core_room/soleprint/.env # Set ROOM_NAME, ports, etc.
|
||||||
```
|
```
|
||||||
|
|
||||||
## SSL Certificates
|
## SSL Certificates
|
||||||
@@ -126,10 +126,10 @@ nano ~/core_nest/pawprint/.env # Set NEST_NAME, ports, etc.
|
|||||||
Certificates are managed via Let's Encrypt:
|
Certificates are managed via Let's Encrypt:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Wildcard for *.nest.mcrn.ar (for amar)
|
# Wildcard for *.room.mcrn.ar (for amar)
|
||||||
sudo certbot certonly --manual --preferred-challenges dns -d '*.nest.mcrn.ar'
|
sudo certbot certonly --manual --preferred-challenges dns -d '*.room.mcrn.ar'
|
||||||
|
|
||||||
# Wildcard for *.mcrn.ar (for pawprint services)
|
# Wildcard for *.mcrn.ar (for soleprint services)
|
||||||
sudo certbot certonly --manual --preferred-challenges dns -d '*.mcrn.ar'
|
sudo certbot certonly --manual --preferred-challenges dns -d '*.mcrn.ar'
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -140,12 +140,12 @@ Auto-renewal is handled by certbot systemd timer.
|
|||||||
### Nginx config test fails
|
### Nginx config test fails
|
||||||
```bash
|
```bash
|
||||||
sudo nginx -t
|
sudo nginx -t
|
||||||
# Fix errors in server/nginx/core_nest.conf
|
# Fix errors in server/nginx/core_room.conf
|
||||||
```
|
```
|
||||||
|
|
||||||
### Services won't start
|
### Services won't start
|
||||||
```bash
|
```bash
|
||||||
cd ~/core_nest/ctrl
|
cd ~/core_room/ctrl
|
||||||
./logs.sh # Check all logs
|
./logs.sh # Check all logs
|
||||||
./logs.sh amar # Check specific service
|
./logs.sh amar # Check specific service
|
||||||
docker ps -a # See all containers
|
docker ps -a # See all containers
|
||||||
@@ -154,10 +154,10 @@ docker ps -a # See all containers
|
|||||||
### Database issues
|
### Database issues
|
||||||
```bash
|
```bash
|
||||||
# Check which seed data is configured
|
# Check which seed data is configured
|
||||||
grep INIT_DB_SEED ~/core_nest/amar/.env
|
grep INIT_DB_SEED ~/core_room/amar/.env
|
||||||
|
|
||||||
# Rebuild database (WARNING: deletes data)
|
# Rebuild database (WARNING: deletes data)
|
||||||
cd ~/core_nest
|
cd ~/core_room
|
||||||
docker compose -f amar/docker-compose.yml down -v
|
docker compose -f amar/docker-compose.yml down -v
|
||||||
./ctrl/start.sh amar -d
|
./ctrl/start.sh amar -d
|
||||||
```
|
```
|
||||||
@@ -172,14 +172,14 @@ This allows ward/tester to access tests from amar_django_back_contracts without
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Preview changes
|
# Preview changes
|
||||||
ssh mariano@mcrn.ar 'cd ~/core_nest/ctrl/server && ./setup-symlinks.sh --dry-run'
|
ssh mariano@mcrn.ar 'cd ~/core_room/ctrl/server && ./setup-symlinks.sh --dry-run'
|
||||||
|
|
||||||
# Apply changes
|
# Apply changes
|
||||||
ssh mariano@mcrn.ar 'cd ~/core_nest/ctrl/server && ./setup-symlinks.sh'
|
ssh mariano@mcrn.ar 'cd ~/core_room/ctrl/server && ./setup-symlinks.sh'
|
||||||
```
|
```
|
||||||
|
|
||||||
**What it does:**
|
**What it does:**
|
||||||
- Creates symlinks from `pawprint/src/ward/tools/tester/tests/` to `amar/src/back/tests/contracts/`
|
- Creates symlinks from `soleprint/src/ward/tools/tester/tests/` to `amar/src/back/tests/contracts/`
|
||||||
- Symlinks each domain directory (mascotas, productos, solicitudes, workflows)
|
- Symlinks each domain directory (mascotas, productos, solicitudes, workflows)
|
||||||
- Symlinks shared utilities (endpoints.py, helpers.py, base.py, conftest.py)
|
- Symlinks shared utilities (endpoints.py, helpers.py, base.py, conftest.py)
|
||||||
|
|
||||||
@@ -214,10 +214,10 @@ After setup, verify symlinks are working:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Check symlinks exist
|
# Check symlinks exist
|
||||||
ssh mariano@mcrn.ar 'ls -lah ~/core_nest/pawprint/src/ward/tools/tester/tests'
|
ssh mariano@mcrn.ar 'ls -lah ~/core_room/soleprint/src/ward/tools/tester/tests'
|
||||||
|
|
||||||
# Verify they point to correct location
|
# Verify they point to correct location
|
||||||
ssh mariano@mcrn.ar 'readlink ~/core_nest/pawprint/src/ward/tools/tester/tests/mascotas'
|
ssh mariano@mcrn.ar 'readlink ~/core_room/soleprint/src/ward/tools/tester/tests/mascotas'
|
||||||
|
|
||||||
# Test in browser
|
# Test in browser
|
||||||
open https://ward.mcrn.ar/tools/tester/
|
open https://ward.mcrn.ar/tools/tester/
|
||||||
@@ -230,5 +230,5 @@ open https://ward.mcrn.ar/tools/tester/
|
|||||||
- Database volumes persist in Docker volumes
|
- Database volumes persist in Docker volumes
|
||||||
- Backup database regularly:
|
- Backup database regularly:
|
||||||
```bash
|
```bash
|
||||||
docker exec core_nest_db pg_dump -U postgres amarback > backup.sql
|
docker exec core_room_db pg_dump -U postgres amarback > backup.sql
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -17,20 +17,20 @@ echo "Home directory contents:"
|
|||||||
ls -lah ~/
|
ls -lah ~/
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
echo "core_nest structure (if exists):"
|
echo "core_room structure (if exists):"
|
||||||
if [ -d ~/core_nest ]; then
|
if [ -d ~/core_room ]; then
|
||||||
tree ~/core_nest -L 2 -I ".git" 2>/dev/null || find ~/core_nest -maxdepth 2 -type d | sort
|
tree ~/core_room -L 2 -I ".git" 2>/dev/null || find ~/core_room -maxdepth 2 -type d | sort
|
||||||
else
|
else
|
||||||
echo " ~/core_nest does NOT exist"
|
echo " ~/core_room does NOT exist"
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
echo "pawprint location:"
|
echo "soleprint location:"
|
||||||
if [ -d ~/pawprint ]; then
|
if [ -d ~/soleprint ]; then
|
||||||
ls -lah ~/pawprint/ | head -10
|
ls -lah ~/soleprint/ | head -10
|
||||||
echo " ..."
|
echo " ..."
|
||||||
else
|
else
|
||||||
echo " ~/pawprint does NOT exist"
|
echo " ~/soleprint does NOT exist"
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ docker network ls 2>/dev/null || echo " None"
|
|||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
echo "Docker volumes:"
|
echo "Docker volumes:"
|
||||||
docker volume ls 2>/dev/null | grep -E "core_nest|amar|pawprint|DRIVER" || echo " No core_nest/amar/pawprint volumes"
|
docker volume ls 2>/dev/null | grep -E "core_room|amar|soleprint|DRIVER" || echo " No core_room/amar/soleprint volumes"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
@@ -80,8 +80,8 @@ echo "Sites enabled:"
|
|||||||
ls -lah /etc/nginx/sites-enabled/ 2>/dev/null || echo " Directory does not exist"
|
ls -lah /etc/nginx/sites-enabled/ 2>/dev/null || echo " Directory does not exist"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
echo "Sites available (core_nest related):"
|
echo "Sites available (core_room related):"
|
||||||
ls -lah /etc/nginx/sites-available/ 2>/dev/null | grep -E "nest|amar|pawprint|artery|album|ward" || echo " None found"
|
ls -lah /etc/nginx/sites-available/ 2>/dev/null | grep -E "room|amar|soleprint|artery|album|ward" || echo " None found"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
@@ -106,13 +106,13 @@ echo ""
|
|||||||
# =============================================================================
|
# =============================================================================
|
||||||
echo "=== ENVIRONMENT FILES ==="
|
echo "=== ENVIRONMENT FILES ==="
|
||||||
echo ""
|
echo ""
|
||||||
for location in ~/core_nest/amar ~/core_nest/pawprint ~/pawprint; do
|
for location in ~/core_room/amar ~/core_room/soleprint ~/soleprint; do
|
||||||
if [ -d "$location" ]; then
|
if [ -d "$location" ]; then
|
||||||
echo "$location/.env:"
|
echo "$location/.env:"
|
||||||
if [ -f "$location/.env" ]; then
|
if [ -f "$location/.env" ]; then
|
||||||
echo " EXISTS"
|
echo " EXISTS"
|
||||||
echo " Size: $(stat -c%s "$location/.env" 2>/dev/null || stat -f%z "$location/.env" 2>/dev/null) bytes"
|
echo " Size: $(stat -c%s "$location/.env" 2>/dev/null || stat -f%z "$location/.env" 2>/dev/null) bytes"
|
||||||
echo " NEST_NAME: $(grep "^NEST_NAME=" "$location/.env" 2>/dev/null || echo "not set")"
|
echo " ROOM_NAME: $(grep "^ROOM_NAME=" "$location/.env" 2>/dev/null || echo "not set")"
|
||||||
echo " NETWORK_NAME: $(grep "^NETWORK_NAME=" "$location/.env" 2>/dev/null || echo "not set")"
|
echo " NETWORK_NAME: $(grep "^NETWORK_NAME=" "$location/.env" 2>/dev/null || echo "not set")"
|
||||||
else
|
else
|
||||||
echo " does NOT exist"
|
echo " does NOT exist"
|
||||||
@@ -138,8 +138,8 @@ echo ""
|
|||||||
# =============================================================================
|
# =============================================================================
|
||||||
echo "=== SYSTEMD SERVICES ==="
|
echo "=== SYSTEMD SERVICES ==="
|
||||||
echo ""
|
echo ""
|
||||||
echo "Pawprint-related services:"
|
echo "Soleprint-related services:"
|
||||||
systemctl list-units --type=service --all 2>/dev/null | grep -E "pawprint|artery|album|ward" || echo " None found"
|
systemctl list-units --type=service --all 2>/dev/null | grep -E "soleprint|artery|album|ward" || echo " None found"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
@@ -162,24 +162,24 @@ echo "=== SUMMARY ==="
|
|||||||
echo ""
|
echo ""
|
||||||
echo "Key Questions:"
|
echo "Key Questions:"
|
||||||
echo ""
|
echo ""
|
||||||
echo "1. Is there an existing core_nest deployment?"
|
echo "1. Is there an existing core_room deployment?"
|
||||||
[ -d ~/core_nest ] && echo " YES - ~/core_nest exists" || echo " NO"
|
[ -d ~/core_room ] && echo " YES - ~/core_room exists" || echo " NO"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
echo "2. Are Docker containers running?"
|
echo "2. Are Docker containers running?"
|
||||||
docker ps -q 2>/dev/null | wc -l | xargs -I {} echo " {} containers running"
|
docker ps -q 2>/dev/null | wc -l | xargs -I {} echo " {} containers running"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
echo "3. Is nginx configured for core_nest?"
|
echo "3. Is nginx configured for core_room?"
|
||||||
[ -f /etc/nginx/sites-enabled/core_nest.conf ] && echo " YES - core_nest.conf installed" || echo " NO"
|
[ -f /etc/nginx/sites-enabled/core_room.conf ] && echo " YES - core_room.conf installed" || echo " NO"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
echo "4. Are there old individual nginx configs?"
|
echo "4. Are there old individual nginx configs?"
|
||||||
ls /etc/nginx/sites-enabled/ 2>/dev/null | grep -E "amar|pawprint|artery|album|ward" | wc -l | xargs -I {} echo " {} old configs found"
|
ls /etc/nginx/sites-enabled/ 2>/dev/null | grep -E "amar|soleprint|artery|album|ward" | wc -l | xargs -I {} echo " {} old configs found"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
echo "5. SSL certificates present?"
|
echo "5. SSL certificates present?"
|
||||||
[ -d /etc/letsencrypt/live/nest.mcrn.ar ] && echo " *.nest.mcrn.ar: YES" || echo " *.nest.mcrn.ar: NO"
|
[ -d /etc/letsencrypt/live/room.mcrn.ar ] && echo " *.room.mcrn.ar: YES" || echo " *.room.mcrn.ar: NO"
|
||||||
[ -d /etc/letsencrypt/live/mcrn.ar ] && echo " *.mcrn.ar: YES" || echo " *.mcrn.ar: NO"
|
[ -d /etc/letsencrypt/live/mcrn.ar ] && echo " *.mcrn.ar: YES" || echo " *.mcrn.ar: NO"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# Server Cleanup - Run on AWS to prepare for fresh deployment
|
# Server Cleanup - Run on AWS to prepare for fresh deployment
|
||||||
# This script safely cleans up old deployments
|
# This script safely cleans up old deployments
|
||||||
#
|
#
|
||||||
# Usage: ssh server 'cd ~/core_nest/ctrl/server && ./cleanup.sh'
|
# Usage: ssh server 'cd ~/core_room/ctrl/server && ./cleanup.sh'
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
@@ -29,8 +29,8 @@ echo "Step 1: Stopping Docker containers..."
|
|||||||
|
|
||||||
# Stop containers if Docker is available
|
# Stop containers if Docker is available
|
||||||
if command -v docker &> /dev/null; then
|
if command -v docker &> /dev/null; then
|
||||||
# Stop all core_nest/amar/pawprint containers
|
# Stop all core_room/amar/soleprint containers
|
||||||
CONTAINERS=$(docker ps -q --filter "name=core_nest" --filter "name=amar" --filter "name=pawprint" 2>/dev/null || true)
|
CONTAINERS=$(docker ps -q --filter "name=core_room" --filter "name=amar" --filter "name=soleprint" 2>/dev/null || true)
|
||||||
|
|
||||||
if [ -n "$CONTAINERS" ]; then
|
if [ -n "$CONTAINERS" ]; then
|
||||||
echo " Stopping containers..."
|
echo " Stopping containers..."
|
||||||
@@ -49,7 +49,7 @@ fi
|
|||||||
echo ""
|
echo ""
|
||||||
echo "Step 2: Stopping systemd services..."
|
echo "Step 2: Stopping systemd services..."
|
||||||
|
|
||||||
SERVICES=$(systemctl list-units --type=service --all --no-pager 2>/dev/null | grep -E "pawprint|artery|album|ward" | awk '{print $1}' || true)
|
SERVICES=$(systemctl list-units --type=service --all --no-pager 2>/dev/null | grep -E "soleprint|artery|album|ward" | awk '{print $1}' || true)
|
||||||
|
|
||||||
if [ -n "$SERVICES" ]; then
|
if [ -n "$SERVICES" ]; then
|
||||||
echo " Found services: $SERVICES"
|
echo " Found services: $SERVICES"
|
||||||
@@ -72,12 +72,12 @@ echo "Step 3: Cleaning up old nginx configs..."
|
|||||||
if [ -d /etc/nginx/sites-enabled ]; then
|
if [ -d /etc/nginx/sites-enabled ]; then
|
||||||
# Remove old individual configs
|
# Remove old individual configs
|
||||||
OLD_CONFIGS=(
|
OLD_CONFIGS=(
|
||||||
"amar.nest.mcrn.ar"
|
"amar.room.mcrn.ar"
|
||||||
"amar.nest.mcrn.ar.conf"
|
"amar.room.mcrn.ar.conf"
|
||||||
"api.amar.nest.mcrn.ar"
|
"api.amar.room.mcrn.ar"
|
||||||
"api.amar.nest.mcrn.ar.conf"
|
"api.amar.room.mcrn.ar.conf"
|
||||||
"pawprint.mcrn.ar"
|
"soleprint.mcrn.ar"
|
||||||
"pawprint.mcrn.ar.conf"
|
"soleprint.mcrn.ar.conf"
|
||||||
"artery.mcrn.ar"
|
"artery.mcrn.ar"
|
||||||
"artery.mcrn.ar.conf"
|
"artery.mcrn.ar.conf"
|
||||||
"album.mcrn.ar"
|
"album.mcrn.ar"
|
||||||
@@ -118,24 +118,24 @@ echo "Step 4: Verifying preserved data..."
|
|||||||
|
|
||||||
# Check Docker volumes
|
# Check Docker volumes
|
||||||
if command -v docker &> /dev/null; then
|
if command -v docker &> /dev/null; then
|
||||||
VOLUMES=$(docker volume ls -q | grep -E "core_nest|amar|pawprint" 2>/dev/null || true)
|
VOLUMES=$(docker volume ls -q | grep -E "core_room|amar|soleprint" 2>/dev/null || true)
|
||||||
if [ -n "$VOLUMES" ]; then
|
if [ -n "$VOLUMES" ]; then
|
||||||
echo " ✓ Docker volumes preserved:"
|
echo " ✓ Docker volumes preserved:"
|
||||||
docker volume ls | grep -E "core_nest|amar|pawprint|DRIVER" || true
|
docker volume ls | grep -E "core_room|amar|soleprint|DRIVER" || true
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check .env files
|
# Check .env files
|
||||||
echo ""
|
echo ""
|
||||||
echo " .env files preserved:"
|
echo " .env files preserved:"
|
||||||
for envfile in ~/core_nest/amar/.env ~/core_nest/pawprint/.env ~/pawprint/.env; do
|
for envfile in ~/core_room/amar/.env ~/core_room/soleprint/.env ~/soleprint/.env; do
|
||||||
[ -f "$envfile" ] && echo " ✓ $envfile" || true
|
[ -f "$envfile" ] && echo " ✓ $envfile" || true
|
||||||
done
|
done
|
||||||
|
|
||||||
# Check SSL certs
|
# Check SSL certs
|
||||||
echo ""
|
echo ""
|
||||||
echo " SSL certificates preserved:"
|
echo " SSL certificates preserved:"
|
||||||
[ -d /etc/letsencrypt/live/nest.mcrn.ar ] && echo " ✓ *.nest.mcrn.ar" || echo " ✗ *.nest.mcrn.ar (missing)"
|
[ -d /etc/letsencrypt/live/room.mcrn.ar ] && echo " ✓ *.room.mcrn.ar" || echo " ✗ *.room.mcrn.ar (missing)"
|
||||||
[ -d /etc/letsencrypt/live/mcrn.ar ] && echo " ✓ *.mcrn.ar" || echo " ✗ *.mcrn.ar (missing)"
|
[ -d /etc/letsencrypt/live/mcrn.ar ] && echo " ✓ *.mcrn.ar" || echo " ✗ *.mcrn.ar (missing)"
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
@@ -149,8 +149,8 @@ echo " 1. Deploy from local:"
|
|||||||
echo " ./ctrl/deploy.sh"
|
echo " ./ctrl/deploy.sh"
|
||||||
echo ""
|
echo ""
|
||||||
echo " 2. Run server setup:"
|
echo " 2. Run server setup:"
|
||||||
echo " cd ~/core_nest/ctrl/server && ./setup.sh"
|
echo " cd ~/core_room/ctrl/server && ./setup.sh"
|
||||||
echo ""
|
echo ""
|
||||||
echo " 3. Build and start:"
|
echo " 3. Build and start:"
|
||||||
echo " cd ~/core_nest/ctrl && ./build.sh && ./start.sh -d"
|
echo " cd ~/core_room/ctrl && ./build.sh && ./start.sh -d"
|
||||||
echo ""
|
echo ""
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
# ./configure.sh
|
# ./configure.sh
|
||||||
#
|
#
|
||||||
# Generates:
|
# Generates:
|
||||||
# - Nginx configs for core_nest
|
# - Nginx configs for core_room
|
||||||
# - Validates .env files
|
# - Validates .env files
|
||||||
# - Outputs to .generated/ directory
|
# - Outputs to .generated/ directory
|
||||||
#
|
#
|
||||||
@@ -16,9 +16,9 @@ set -e
|
|||||||
|
|
||||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||||
GEN_DIR="$SCRIPT_DIR/.generated"
|
GEN_DIR="$SCRIPT_DIR/.generated"
|
||||||
CORE_NEST_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
CORE_ROOM_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||||
|
|
||||||
echo "=== Core Nest Configure ==="
|
echo "=== Core Room Configure ==="
|
||||||
echo ""
|
echo ""
|
||||||
echo "This script generates configuration files for deployment."
|
echo "This script generates configuration files for deployment."
|
||||||
echo "Run as appuser (no sudo required)."
|
echo "Run as appuser (no sudo required)."
|
||||||
@@ -44,19 +44,19 @@ echo " Output directory: $GEN_DIR"
|
|||||||
echo ""
|
echo ""
|
||||||
echo "Step 2: Loading environment..."
|
echo "Step 2: Loading environment..."
|
||||||
|
|
||||||
# Load core_nest/.env
|
# Load core_room/.env
|
||||||
if [ -f "$CORE_NEST_ROOT/.env" ]; then
|
if [ -f "$CORE_ROOM_ROOT/.env" ]; then
|
||||||
set -a
|
set -a
|
||||||
source "$CORE_NEST_ROOT/.env"
|
source "$CORE_ROOM_ROOT/.env"
|
||||||
set +a
|
set +a
|
||||||
echo " Loaded: core_nest/.env"
|
echo " Loaded: core_room/.env"
|
||||||
else
|
else
|
||||||
echo " ERROR: core_nest/.env not found"
|
echo " ERROR: core_room/.env not found"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Validate required vars
|
# Validate required vars
|
||||||
REQUIRED_VARS="NEST_NAME DEPLOYMENT_NAME NETWORK_NAME MANAGED_DOMAIN PAWPRINT_DOMAIN"
|
REQUIRED_VARS="ROOM_NAME DEPLOYMENT_NAME NETWORK_NAME MANAGED_DOMAIN SOLEPRINT_DOMAIN"
|
||||||
MISSING=""
|
MISSING=""
|
||||||
for var in $REQUIRED_VARS; do
|
for var in $REQUIRED_VARS; do
|
||||||
if [ -z "${!var}" ]; then
|
if [ -z "${!var}" ]; then
|
||||||
@@ -65,14 +65,14 @@ for var in $REQUIRED_VARS; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
if [ -n "$MISSING" ]; then
|
if [ -n "$MISSING" ]; then
|
||||||
echo " ERROR: Missing required vars in core_nest/.env:$MISSING"
|
echo " ERROR: Missing required vars in core_room/.env:$MISSING"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo " NEST_NAME: $NEST_NAME"
|
echo " ROOM_NAME: $ROOM_NAME"
|
||||||
echo " DEPLOYMENT_NAME: $DEPLOYMENT_NAME"
|
echo " DEPLOYMENT_NAME: $DEPLOYMENT_NAME"
|
||||||
echo " MANAGED_DOMAIN: $MANAGED_DOMAIN"
|
echo " MANAGED_DOMAIN: $MANAGED_DOMAIN"
|
||||||
echo " PAWPRINT_DOMAIN: $PAWPRINT_DOMAIN"
|
echo " SOLEPRINT_DOMAIN: $SOLEPRINT_DOMAIN"
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
# 3. Check .env files for services
|
# 3. Check .env files for services
|
||||||
@@ -80,8 +80,8 @@ echo " PAWPRINT_DOMAIN: $PAWPRINT_DOMAIN"
|
|||||||
echo ""
|
echo ""
|
||||||
echo "Step 3: Checking service .env files..."
|
echo "Step 3: Checking service .env files..."
|
||||||
|
|
||||||
for service in amar pawprint; do
|
for service in amar soleprint; do
|
||||||
SERVICE_DIR="$CORE_NEST_ROOT/$service"
|
SERVICE_DIR="$CORE_ROOM_ROOT/$service"
|
||||||
if [ ! -f "$SERVICE_DIR/.env" ]; then
|
if [ ! -f "$SERVICE_DIR/.env" ]; then
|
||||||
if [ -f "$SERVICE_DIR/.env.example" ]; then
|
if [ -f "$SERVICE_DIR/.env.example" ]; then
|
||||||
echo " Creating $service/.env from example..."
|
echo " Creating $service/.env from example..."
|
||||||
@@ -102,8 +102,8 @@ done
|
|||||||
echo ""
|
echo ""
|
||||||
echo "Step 4: Generating nginx configuration..."
|
echo "Step 4: Generating nginx configuration..."
|
||||||
|
|
||||||
TEMPLATE="$SCRIPT_DIR/nginx/core_nest.conf.template"
|
TEMPLATE="$SCRIPT_DIR/nginx/core_room.conf.template"
|
||||||
OUTPUT="$GEN_DIR/core_nest.nginx.conf"
|
OUTPUT="$GEN_DIR/core_room.nginx.conf"
|
||||||
|
|
||||||
if [ ! -f "$TEMPLATE" ]; then
|
if [ ! -f "$TEMPLATE" ]; then
|
||||||
echo " ERROR: Template not found: $TEMPLATE"
|
echo " ERROR: Template not found: $TEMPLATE"
|
||||||
@@ -111,13 +111,13 @@ if [ ! -f "$TEMPLATE" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Check for SSL certificates (just warn, don't fail)
|
# Check for SSL certificates (just warn, don't fail)
|
||||||
SSL_CERT_AMAR="/etc/letsencrypt/live/nest.mcrn.ar/fullchain.pem"
|
SSL_CERT_AMAR="/etc/letsencrypt/live/room.mcrn.ar/fullchain.pem"
|
||||||
SSL_KEY_AMAR="/etc/letsencrypt/live/nest.mcrn.ar/privkey.pem"
|
SSL_KEY_AMAR="/etc/letsencrypt/live/room.mcrn.ar/privkey.pem"
|
||||||
SSL_CERT_PAWPRINT="/etc/letsencrypt/live/mcrn.ar/fullchain.pem"
|
SSL_CERT_SOLEPRINT="/etc/letsencrypt/live/mcrn.ar/fullchain.pem"
|
||||||
SSL_KEY_PAWPRINT="/etc/letsencrypt/live/mcrn.ar/privkey.pem"
|
SSL_KEY_SOLEPRINT="/etc/letsencrypt/live/mcrn.ar/privkey.pem"
|
||||||
|
|
||||||
echo " Checking SSL certificates..."
|
echo " Checking SSL certificates..."
|
||||||
for cert in "$SSL_CERT_AMAR" "$SSL_KEY_AMAR" "$SSL_CERT_PAWPRINT" "$SSL_KEY_PAWPRINT"; do
|
for cert in "$SSL_CERT_AMAR" "$SSL_KEY_AMAR" "$SSL_CERT_SOLEPRINT" "$SSL_KEY_SOLEPRINT"; do
|
||||||
if [ -f "$cert" ]; then
|
if [ -f "$cert" ]; then
|
||||||
echo " ✓ $(basename $cert)"
|
echo " ✓ $(basename $cert)"
|
||||||
else
|
else
|
||||||
@@ -127,8 +127,8 @@ for cert in "$SSL_CERT_AMAR" "$SSL_KEY_AMAR" "$SSL_CERT_PAWPRINT" "$SSL_KEY_PAWP
|
|||||||
done
|
done
|
||||||
|
|
||||||
# Generate nginx config from template
|
# Generate nginx config from template
|
||||||
export NEST_NAME DEPLOYMENT_NAME MANAGED_DOMAIN PAWPRINT_DOMAIN
|
export ROOM_NAME DEPLOYMENT_NAME MANAGED_DOMAIN SOLEPRINT_DOMAIN
|
||||||
export SSL_CERT_AMAR SSL_KEY_AMAR SSL_CERT_PAWPRINT SSL_KEY_PAWPRINT
|
export SSL_CERT_AMAR SSL_KEY_AMAR SSL_CERT_SOLEPRINT SSL_KEY_SOLEPRINT
|
||||||
|
|
||||||
envsubst < "$TEMPLATE" > "$OUTPUT"
|
envsubst < "$TEMPLATE" > "$OUTPUT"
|
||||||
|
|
||||||
@@ -143,20 +143,20 @@ echo "Step 5: Generating deployment summary..."
|
|||||||
SUMMARY="$GEN_DIR/DEPLOYMENT.txt"
|
SUMMARY="$GEN_DIR/DEPLOYMENT.txt"
|
||||||
|
|
||||||
cat > "$SUMMARY" <<EOF
|
cat > "$SUMMARY" <<EOF
|
||||||
Core Nest Deployment Configuration
|
Core Room Deployment Configuration
|
||||||
Generated: $(date)
|
Generated: $(date)
|
||||||
User: $USER
|
User: $USER
|
||||||
Host: $(hostname)
|
Host: $(hostname)
|
||||||
|
|
||||||
=== Environment ===
|
=== Environment ===
|
||||||
NEST_NAME=$NEST_NAME
|
ROOM_NAME=$ROOM_NAME
|
||||||
DEPLOYMENT_NAME=$DEPLOYMENT_NAME
|
DEPLOYMENT_NAME=$DEPLOYMENT_NAME
|
||||||
NETWORK_NAME=$NETWORK_NAME
|
NETWORK_NAME=$NETWORK_NAME
|
||||||
MANAGED_DOMAIN=$MANAGED_DOMAIN
|
MANAGED_DOMAIN=$MANAGED_DOMAIN
|
||||||
PAWPRINT_DOMAIN=$PAWPRINT_DOMAIN
|
SOLEPRINT_DOMAIN=$SOLEPRINT_DOMAIN
|
||||||
|
|
||||||
=== Generated Files ===
|
=== Generated Files ===
|
||||||
- core_nest.nginx.conf → /etc/nginx/sites-available/core_nest.conf
|
- core_room.nginx.conf → /etc/nginx/sites-available/core_room.conf
|
||||||
|
|
||||||
=== Next Steps ===
|
=== Next Steps ===
|
||||||
1. Review generated files in: $GEN_DIR
|
1. Review generated files in: $GEN_DIR
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Install nginx config for core_nest
|
# Install nginx config for core_room
|
||||||
# Run with: sudo ./install-nginx.sh
|
# Run with: sudo ./install-nginx.sh
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
@@ -8,11 +8,11 @@ set -e
|
|||||||
APP_USER="${APP_USER:-mariano}"
|
APP_USER="${APP_USER:-mariano}"
|
||||||
APP_HOME="/home/${APP_USER}"
|
APP_HOME="/home/${APP_USER}"
|
||||||
|
|
||||||
NGINX_SOURCE="${APP_HOME}/core_nest/ctrl/server/nginx/core_nest.conf"
|
NGINX_SOURCE="${APP_HOME}/core_room/ctrl/server/nginx/core_room.conf"
|
||||||
NGINX_AVAILABLE="/etc/nginx/sites-available/core_nest.conf"
|
NGINX_AVAILABLE="/etc/nginx/sites-available/core_room.conf"
|
||||||
NGINX_ENABLED="/etc/nginx/sites-enabled/core_nest.conf"
|
NGINX_ENABLED="/etc/nginx/sites-enabled/core_room.conf"
|
||||||
|
|
||||||
echo "=== Installing nginx config for core_nest ==="
|
echo "=== Installing nginx config for core_room ==="
|
||||||
echo "App user: $APP_USER"
|
echo "App user: $APP_USER"
|
||||||
echo "App home: $APP_HOME"
|
echo "App home: $APP_HOME"
|
||||||
echo ""
|
echo ""
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
# Core Nest - All Services Nginx Config
|
# Core Room - All Services Nginx Config
|
||||||
# Single config for entire nest deployment
|
# Single config for entire room deployment
|
||||||
#
|
#
|
||||||
# Docker Services (primary):
|
# Docker Services (primary):
|
||||||
# - amar.nest.mcrn.ar (frontend:3000 + backend:8000)
|
# - amar.room.mcrn.ar (frontend:3000 + backend:8000)
|
||||||
# - pawprint.mcrn.ar (port 13000)
|
# - soleprint.mcrn.ar (port 13000)
|
||||||
# - artery.mcrn.ar (port 13001)
|
# - artery.mcrn.ar (port 13001)
|
||||||
# - album.mcrn.ar (port 13002)
|
# - album.mcrn.ar (port 13002)
|
||||||
# - ward.mcrn.ar (port 13003)
|
# - ward.mcrn.ar (port 13003)
|
||||||
#
|
#
|
||||||
# Bare Metal Services (fallback):
|
# Bare Metal Services (fallback):
|
||||||
# - pawprint.bare.mcrn.ar (port 12000)
|
# - soleprint.bare.mcrn.ar (port 12000)
|
||||||
# - artery.bare.mcrn.ar (port 12001)
|
# - artery.bare.mcrn.ar (port 12001)
|
||||||
# - album.bare.mcrn.ar (port 12002)
|
# - album.bare.mcrn.ar (port 12002)
|
||||||
# - ward.bare.mcrn.ar (port 12003)
|
# - ward.bare.mcrn.ar (port 12003)
|
||||||
@@ -19,16 +19,16 @@
|
|||||||
# =============================================================================
|
# =============================================================================
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name amar.nest.mcrn.ar;
|
server_name amar.room.mcrn.ar;
|
||||||
return 301 https://$host$request_uri;
|
return 301 https://$host$request_uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 443 ssl;
|
listen 443 ssl;
|
||||||
server_name amar.nest.mcrn.ar;
|
server_name amar.room.mcrn.ar;
|
||||||
|
|
||||||
ssl_certificate /etc/letsencrypt/live/nest.mcrn.ar/fullchain.pem;
|
ssl_certificate /etc/letsencrypt/live/room.mcrn.ar/fullchain.pem;
|
||||||
ssl_certificate_key /etc/letsencrypt/live/nest.mcrn.ar/privkey.pem;
|
ssl_certificate_key /etc/letsencrypt/live/room.mcrn.ar/privkey.pem;
|
||||||
include /etc/letsencrypt/options-ssl-nginx.conf;
|
include /etc/letsencrypt/options-ssl-nginx.conf;
|
||||||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
||||||
|
|
||||||
@@ -68,20 +68,20 @@ server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
# PAWPRINT - Main Service
|
# SOLEPRINT - Main Service
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name pawprint.mcrn.ar;
|
server_name soleprint.mcrn.ar;
|
||||||
return 301 https://$host$request_uri;
|
return 301 https://$host$request_uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 443 ssl;
|
listen 443 ssl;
|
||||||
server_name pawprint.mcrn.ar;
|
server_name soleprint.mcrn.ar;
|
||||||
|
|
||||||
ssl_certificate /etc/letsencrypt/live/pawprint.mcrn.ar/fullchain.pem;
|
ssl_certificate /etc/letsencrypt/live/soleprint.mcrn.ar/fullchain.pem;
|
||||||
ssl_certificate_key /etc/letsencrypt/live/pawprint.mcrn.ar/privkey.pem;
|
ssl_certificate_key /etc/letsencrypt/live/soleprint.mcrn.ar/privkey.pem;
|
||||||
include /etc/letsencrypt/options-ssl-nginx.conf;
|
include /etc/letsencrypt/options-ssl-nginx.conf;
|
||||||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
||||||
|
|
||||||
@@ -180,17 +180,17 @@ server {
|
|||||||
# =============================================================================
|
# =============================================================================
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
# PAWPRINT BARE - Main Service (Bare Metal)
|
# SOLEPRINT BARE - Main Service (Bare Metal)
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name pawprint.bare.mcrn.ar;
|
server_name soleprint.bare.mcrn.ar;
|
||||||
return 301 https://$host$request_uri;
|
return 301 https://$host$request_uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 443 ssl;
|
listen 443 ssl;
|
||||||
server_name pawprint.bare.mcrn.ar;
|
server_name soleprint.bare.mcrn.ar;
|
||||||
|
|
||||||
ssl_certificate /etc/letsencrypt/live/bare.mcrn.ar/fullchain.pem;
|
ssl_certificate /etc/letsencrypt/live/bare.mcrn.ar/fullchain.pem;
|
||||||
ssl_certificate_key /etc/letsencrypt/live/bare.mcrn.ar/privkey.pem;
|
ssl_certificate_key /etc/letsencrypt/live/bare.mcrn.ar/privkey.pem;
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
# Core Nest - Nginx Config Template
|
# Core Room - Nginx Config Template
|
||||||
# Generated from environment variables
|
# Generated from environment variables
|
||||||
#
|
#
|
||||||
# Environment variables:
|
# Environment variables:
|
||||||
# DOMAIN_AMAR - Amar domain (e.g., amarmascotas.local.com or amar.nest.mcrn.ar)
|
# DOMAIN_AMAR - Amar domain (e.g., amarmascotas.local.com or amar.room.mcrn.ar)
|
||||||
# DOMAIN_PAWPRINT - Pawprint domain (e.g., pawprint.local.com or pawprint.mcrn.ar)
|
# DOMAIN_SOLEPRINT - Soleprint domain (e.g., soleprint.local.com or soleprint.mcrn.ar)
|
||||||
# USE_SSL - true/false - whether to use SSL
|
# USE_SSL - true/false - whether to use SSL
|
||||||
# SSL_CERT_PATH - Path to SSL certificate (if USE_SSL=true)
|
# SSL_CERT_PATH - Path to SSL certificate (if USE_SSL=true)
|
||||||
# SSL_KEY_PATH - Path to SSL key (if USE_SSL=true)
|
# SSL_KEY_PATH - Path to SSL key (if USE_SSL=true)
|
||||||
# BACKEND_PORT - Backend port (default: 8000)
|
# BACKEND_PORT - Backend port (default: 8000)
|
||||||
# FRONTEND_PORT - Frontend port (default: 3000)
|
# FRONTEND_PORT - Frontend port (default: 3000)
|
||||||
# PAWPRINT_PORT - Pawprint port (default: 13000)
|
# SOLEPRINT_PORT - Soleprint port (default: 13000)
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
# AMAR - Frontend + Backend
|
# AMAR - Frontend + Backend
|
||||||
@@ -61,12 +61,12 @@ ${SSL_REDIRECT}
|
|||||||
${SSL_SERVER_BLOCK}
|
${SSL_SERVER_BLOCK}
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
# PAWPRINT - Main Service + Ecosystem
|
# SOLEPRINT - Main Service + Ecosystem
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name ${DOMAIN_PAWPRINT};
|
server_name ${DOMAIN_SOLEPRINT};
|
||||||
${PAWPRINT_SSL_REDIRECT}
|
${SOLEPRINT_SSL_REDIRECT}
|
||||||
# Artery - API Gateway
|
# Artery - API Gateway
|
||||||
location /artery/ {
|
location /artery/ {
|
||||||
proxy_pass http://127.0.0.1:${ARTERY_PORT}/;
|
proxy_pass http://127.0.0.1:${ARTERY_PORT}/;
|
||||||
@@ -94,9 +94,9 @@ ${PAWPRINT_SSL_REDIRECT}
|
|||||||
proxy_set_header X-Forwarded-Proto \$scheme;
|
proxy_set_header X-Forwarded-Proto \$scheme;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Pawprint - Main Service (default)
|
# Soleprint - Main Service (default)
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://127.0.0.1:${PAWPRINT_PORT};
|
proxy_pass http://127.0.0.1:${SOLEPRINT_PORT};
|
||||||
proxy_set_header Host \$host;
|
proxy_set_header Host \$host;
|
||||||
proxy_set_header X-Real-IP \$remote_addr;
|
proxy_set_header X-Real-IP \$remote_addr;
|
||||||
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
|
||||||
@@ -104,4 +104,4 @@ ${PAWPRINT_SSL_REDIRECT}
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
${PAWPRINT_SSL_SERVER_BLOCK}
|
${SOLEPRINT_SSL_SERVER_BLOCK}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
# Nginx Config Template for Docker Local Development
|
# Nginx Config Template for Docker Local Development
|
||||||
# Uses environment variables from .env files
|
# Uses environment variables from .env files
|
||||||
# Variables: DEPLOYMENT_NAME, NEST_NAME, MANAGED_DOMAIN, PAWPRINT_DOMAIN
|
# Variables: DEPLOYMENT_NAME, ROOM_NAME, MANAGED_DOMAIN, SOLEPRINT_DOMAIN
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
# MANAGED APP WITH WRAPPER - amar.nest.local.com
|
# MANAGED APP WITH WRAPPER - amar.room.local.com
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
@@ -108,15 +108,15 @@ server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
# PAWPRINT - Main Service + Ecosystem
|
# SOLEPRINT - Main Service + Ecosystem
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name ${PAWPRINT_DOMAIN};
|
server_name ${SOLEPRINT_DOMAIN};
|
||||||
|
|
||||||
# Artery - API Gateway
|
# Artery - API Gateway
|
||||||
location /artery/ {
|
location /artery/ {
|
||||||
proxy_pass http://${NEST_NAME}_artery:8000/;
|
proxy_pass http://${ROOM_NAME}_artery:8000/;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
@@ -125,7 +125,7 @@ server {
|
|||||||
|
|
||||||
# Album - Media Service
|
# Album - Media Service
|
||||||
location /album/ {
|
location /album/ {
|
||||||
proxy_pass http://${NEST_NAME}_album:8000/;
|
proxy_pass http://${ROOM_NAME}_album:8000/;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
@@ -134,16 +134,16 @@ server {
|
|||||||
|
|
||||||
# Ward - Admin Interface
|
# Ward - Admin Interface
|
||||||
location /ward/ {
|
location /ward/ {
|
||||||
proxy_pass http://${NEST_NAME}_ward:8000/;
|
proxy_pass http://${ROOM_NAME}_ward:8000/;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Pawprint - Main Service (default)
|
# Soleprint - Main Service (default)
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://${NEST_NAME}_pawprint:8000;
|
proxy_pass http://${ROOM_NAME}_soleprint:8000;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
# Nginx Config Template for Docker
|
# Nginx Config Template for Docker
|
||||||
# Uses environment variables from .env files
|
# Uses environment variables from .env files
|
||||||
# Variables: DEPLOYMENT_NAME, MANAGED_DOMAIN, PAWPRINT_DOMAIN, MANAGED_*
|
# Variables: DEPLOYMENT_NAME, MANAGED_DOMAIN, SOLEPRINT_DOMAIN, MANAGED_*
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
# MANAGED DOMAIN
|
# MANAGED DOMAIN
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
# Completely defined by the parent deployment (e.g., core_nest)
|
# Completely defined by the parent deployment (e.g., core_room)
|
||||||
# Pawprint doesn't know or care about the managed app's structure
|
# Soleprint doesn't know or care about the managed app's structure
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name ${MANAGED_DOMAIN};
|
server_name ${MANAGED_DOMAIN};
|
||||||
@@ -16,11 +16,11 @@ server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
# PAWPRINT - Main Service + Ecosystem
|
# SOLEPRINT - Main Service + Ecosystem
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name ${PAWPRINT_DOMAIN};
|
server_name ${SOLEPRINT_DOMAIN};
|
||||||
|
|
||||||
# Artery - API Gateway
|
# Artery - API Gateway
|
||||||
location /artery/ {
|
location /artery/ {
|
||||||
@@ -49,9 +49,9 @@ server {
|
|||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Pawprint - Main Service (default)
|
# Soleprint - Main Service (default)
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://${DEPLOYMENT_NAME}_pawprint:8000;
|
proxy_pass http://${DEPLOYMENT_NAME}_soleprint:8000;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ if [ "$ENABLE_WRAPPER" != "true" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Replace env vars
|
# Replace env vars
|
||||||
envsubst '${DEPLOYMENT_NAME} ${NEST_NAME} ${MANAGED_DOMAIN} ${PAWPRINT_DOMAIN}' < "$OUTPUT" > /tmp/nginx.conf
|
envsubst '${DEPLOYMENT_NAME} ${ROOM_NAME} ${MANAGED_DOMAIN} ${SOLEPRINT_DOMAIN}' < "$OUTPUT" > /tmp/nginx.conf
|
||||||
mv /tmp/nginx.conf "$OUTPUT"
|
mv /tmp/nginx.conf "$OUTPUT"
|
||||||
|
|
||||||
echo "Nginx config generated (ENABLE_WRAPPER=$ENABLE_WRAPPER)"
|
echo "Nginx config generated (ENABLE_WRAPPER=$ENABLE_WRAPPER)"
|
||||||
|
|||||||
@@ -19,13 +19,13 @@ echo "=== Setting up Test Directory Symlinks ==="
|
|||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# Check if we're on the server
|
# Check if we're on the server
|
||||||
if [ ! -d "$HOME/core_nest" ]; then
|
if [ ! -d "$HOME/core_room" ]; then
|
||||||
echo "Error: ~/core_nest directory not found"
|
echo "Error: ~/core_room directory not found"
|
||||||
echo "This script should run on the AWS server after deployment"
|
echo "This script should run on the AWS server after deployment"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd "$HOME/core_nest"
|
cd "$HOME/core_room"
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
# Test Directory Symlinks
|
# Test Directory Symlinks
|
||||||
@@ -34,7 +34,7 @@ echo "Step 1: Creating symlinks for test directories..."
|
|||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# Ward tester tests directory
|
# Ward tester tests directory
|
||||||
WARD_TESTS_DIR="pawprint/src/ward/tools/tester/tests"
|
WARD_TESTS_DIR="soleprint/src/ward/tools/tester/tests"
|
||||||
CONTRACTS_SOURCE="amar/src/back/tests/contracts"
|
CONTRACTS_SOURCE="amar/src/back/tests/contracts"
|
||||||
|
|
||||||
# Create ward tests directory if it doesn't exist
|
# Create ward tests directory if it doesn't exist
|
||||||
@@ -71,7 +71,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Create relative symlink
|
# Create relative symlink
|
||||||
# From: pawprint/src/ward/tools/tester/tests/
|
# From: soleprint/src/ward/tools/tester/tests/
|
||||||
# To: amar/src/back/tests/contracts/
|
# To: amar/src/back/tests/contracts/
|
||||||
# Relative path: ../../../../../amar/src/back/tests/contracts/
|
# Relative path: ../../../../../amar/src/back/tests/contracts/
|
||||||
$DRY_RUN ln -s "../../../../../$CONTRACTS_SOURCE/$domain_name" "$target_link"
|
$DRY_RUN ln -s "../../../../../$CONTRACTS_SOURCE/$domain_name" "$target_link"
|
||||||
@@ -102,11 +102,11 @@ echo ""
|
|||||||
# =============================================================================
|
# =============================================================================
|
||||||
# Bare Metal Symlinks (if bare metal path exists)
|
# Bare Metal Symlinks (if bare metal path exists)
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
if [ -d "$HOME/pawprint" ]; then
|
if [ -d "$HOME/soleprint" ]; then
|
||||||
echo "Step 2: Creating bare metal symlinks..."
|
echo "Step 2: Creating bare metal symlinks..."
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
BARE_WARD_TESTS="$HOME/pawprint/ward/tools/tester/tests"
|
BARE_WARD_TESTS="$HOME/soleprint/ward/tools/tester/tests"
|
||||||
|
|
||||||
if [ ! -d "$BARE_WARD_TESTS" ]; then
|
if [ ! -d "$BARE_WARD_TESTS" ]; then
|
||||||
$DRY_RUN mkdir -p "$BARE_WARD_TESTS"
|
$DRY_RUN mkdir -p "$BARE_WARD_TESTS"
|
||||||
@@ -116,7 +116,7 @@ if [ -d "$HOME/pawprint" ]; then
|
|||||||
# For bare metal, we can symlink to the docker contract source if it's synced
|
# For bare metal, we can symlink to the docker contract source if it's synced
|
||||||
# Or we can sync tests separately (handled by sync-tests.sh)
|
# Or we can sync tests separately (handled by sync-tests.sh)
|
||||||
echo " ℹ Bare metal tests managed by sync-tests.sh"
|
echo " ℹ Bare metal tests managed by sync-tests.sh"
|
||||||
echo " Run: $HOME/core_nest/ctrl/sync-tests.sh"
|
echo " Run: $HOME/core_room/ctrl/sync-tests.sh"
|
||||||
else
|
else
|
||||||
echo "Step 2: Bare metal path not found, skipping"
|
echo "Step 2: Bare metal path not found, skipping"
|
||||||
fi
|
fi
|
||||||
@@ -153,7 +153,7 @@ echo " 1. Verify symlinks are working:"
|
|||||||
echo " ls -lah $WARD_TESTS_DIR"
|
echo " ls -lah $WARD_TESTS_DIR"
|
||||||
echo ""
|
echo ""
|
||||||
echo " 2. Restart ward container to pick up changes:"
|
echo " 2. Restart ward container to pick up changes:"
|
||||||
echo " cd ~/core_nest/ctrl && docker compose restart ward"
|
echo " cd ~/core_room/ctrl && docker compose restart ward"
|
||||||
echo ""
|
echo ""
|
||||||
echo " 3. Test in browser:"
|
echo " 3. Test in browser:"
|
||||||
echo " https://ward.mcrn.ar/tools/tester/"
|
echo " https://ward.mcrn.ar/tools/tester/"
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ set -e
|
|||||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||||
GEN_DIR="$SCRIPT_DIR/.generated"
|
GEN_DIR="$SCRIPT_DIR/.generated"
|
||||||
|
|
||||||
echo "=== Core Nest Setup (System Configuration) ==="
|
echo "=== Core Room Setup (System Configuration) ==="
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# Must run as root
|
# Must run as root
|
||||||
@@ -44,7 +44,7 @@ echo "User home: $ACTUAL_HOME"
|
|||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# Check that configure was run first
|
# Check that configure was run first
|
||||||
if [ ! -d "$GEN_DIR" ] || [ ! -f "$GEN_DIR/core_nest.nginx.conf" ]; then
|
if [ ! -d "$GEN_DIR" ] || [ ! -f "$GEN_DIR/core_room.nginx.conf" ]; then
|
||||||
echo "ERROR: Configuration files not found"
|
echo "ERROR: Configuration files not found"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Run ./configure.sh first (as $ACTUAL_USER):"
|
echo "Run ./configure.sh first (as $ACTUAL_USER):"
|
||||||
@@ -120,9 +120,9 @@ fi
|
|||||||
echo ""
|
echo ""
|
||||||
echo "Step 2: Installing nginx configuration..."
|
echo "Step 2: Installing nginx configuration..."
|
||||||
|
|
||||||
NGINX_AVAILABLE="/etc/nginx/sites-available/core_nest.conf"
|
NGINX_AVAILABLE="/etc/nginx/sites-available/core_room.conf"
|
||||||
NGINX_ENABLED="/etc/nginx/sites-enabled/core_nest.conf"
|
NGINX_ENABLED="/etc/nginx/sites-enabled/core_room.conf"
|
||||||
SOURCE_CONFIG="$GEN_DIR/core_nest.nginx.conf"
|
SOURCE_CONFIG="$GEN_DIR/core_room.nginx.conf"
|
||||||
|
|
||||||
# Copy generated config
|
# Copy generated config
|
||||||
cp "$SOURCE_CONFIG" "$NGINX_AVAILABLE"
|
cp "$SOURCE_CONFIG" "$NGINX_AVAILABLE"
|
||||||
@@ -171,7 +171,7 @@ echo ""
|
|||||||
echo "Step 4: SSL certificates..."
|
echo "Step 4: SSL certificates..."
|
||||||
|
|
||||||
SSL_CERTS=(
|
SSL_CERTS=(
|
||||||
"/etc/letsencrypt/live/nest.mcrn.ar"
|
"/etc/letsencrypt/live/room.mcrn.ar"
|
||||||
"/etc/letsencrypt/live/mcrn.ar"
|
"/etc/letsencrypt/live/mcrn.ar"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -188,7 +188,7 @@ done
|
|||||||
if [ "$ALL_EXIST" = false ]; then
|
if [ "$ALL_EXIST" = false ]; then
|
||||||
echo ""
|
echo ""
|
||||||
echo " To generate missing certificates:"
|
echo " To generate missing certificates:"
|
||||||
echo " certbot certonly --manual --preferred-challenges dns -d '*.nest.mcrn.ar'"
|
echo " certbot certonly --manual --preferred-challenges dns -d '*.room.mcrn.ar'"
|
||||||
echo " certbot certonly --manual --preferred-challenges dns -d '*.mcrn.ar'"
|
echo " certbot certonly --manual --preferred-challenges dns -d '*.mcrn.ar'"
|
||||||
echo ""
|
echo ""
|
||||||
echo " After generating, reload nginx:"
|
echo " After generating, reload nginx:"
|
||||||
@@ -212,6 +212,6 @@ echo " 2. Generate SSL certificates if missing (see above)"
|
|||||||
echo ""
|
echo ""
|
||||||
echo " 3. Deploy application:"
|
echo " 3. Deploy application:"
|
||||||
echo " su - $ACTUAL_USER"
|
echo " su - $ACTUAL_USER"
|
||||||
echo " cd $ACTUAL_HOME/core_nest/ctrl"
|
echo " cd $ACTUAL_HOME/core_room/ctrl"
|
||||||
echo " ./deploy.sh"
|
echo " ./deploy.sh"
|
||||||
echo ""
|
echo ""
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# Local setup - prepare .env files
|
# Local setup - prepare .env files
|
||||||
#
|
#
|
||||||
# This script runs LOCALLY to create .env files from examples.
|
# This script runs LOCALLY to create .env files from examples.
|
||||||
# For server setup, use: ssh server 'cd ~/core_nest/server && ./setup.sh'
|
# For server setup, use: ssh server 'cd ~/core_room/server && ./setup.sh'
|
||||||
#
|
#
|
||||||
# Usage:
|
# Usage:
|
||||||
# ./setup.sh
|
# ./setup.sh
|
||||||
@@ -45,4 +45,4 @@ echo " - Run: ./start.sh"
|
|||||||
echo ""
|
echo ""
|
||||||
echo "Server deployment:"
|
echo "Server deployment:"
|
||||||
echo " 1. Deploy: ./deploy.sh"
|
echo " 1. Deploy: ./deploy.sh"
|
||||||
echo " 2. On server: ssh server 'cd ~/core_nest/server && ./setup.sh'"
|
echo " 2. On server: ssh server 'cd ~/core_room/server && ./setup.sh'"
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Start core_nest services
|
# Start core_room services
|
||||||
#
|
#
|
||||||
# Usage:
|
# Usage:
|
||||||
# ./start.sh # Start all (foreground, see logs)
|
# ./start.sh # Start all (foreground, see logs)
|
||||||
# ./start.sh <service> # Start specific service (e.g., amar, pawprint)
|
# ./start.sh <service> # Start specific service (e.g., amar, soleprint)
|
||||||
# ./start.sh -d # Start all (detached)
|
# ./start.sh -d # Start all (detached)
|
||||||
# ./start.sh --build # Start with rebuild
|
# ./start.sh --build # Start with rebuild
|
||||||
# ./start.sh -d --build # Start detached with rebuild
|
# ./start.sh -d --build # Start detached with rebuild
|
||||||
@@ -14,7 +14,7 @@ set -e
|
|||||||
# Change to parent directory (services are in ../service_name)
|
# Change to parent directory (services are in ../service_name)
|
||||||
cd "$(dirname "$0")/.."
|
cd "$(dirname "$0")/.."
|
||||||
|
|
||||||
# Export core_nest/.env vars so child docker-compose files can use them
|
# Export core_room/.env vars so child docker-compose files can use them
|
||||||
if [ -f ".env" ]; then
|
if [ -f ".env" ]; then
|
||||||
set -a
|
set -a
|
||||||
source .env
|
source .env
|
||||||
@@ -55,8 +55,8 @@ start_service() {
|
|||||||
echo "Starting $service..."
|
echo "Starting $service..."
|
||||||
cd "$service"
|
cd "$service"
|
||||||
|
|
||||||
# If --with-nginx and service is pawprint, include nginx compose
|
# If --with-nginx and service is soleprint, include nginx compose
|
||||||
if [ "$WITH_NGINX" = "true" ] && [ "$service" = "pawprint" ]; then
|
if [ "$WITH_NGINX" = "true" ] && [ "$service" = "soleprint" ]; then
|
||||||
echo " Including nginx container..."
|
echo " Including nginx container..."
|
||||||
DOCKER_BUILDKIT=0 COMPOSE_DOCKER_CLI_BUILD=0 docker compose -f docker-compose.yml -f docker-compose.nginx.yml up $DETACH $BUILD
|
DOCKER_BUILDKIT=0 COMPOSE_DOCKER_CLI_BUILD=0 docker compose -f docker-compose.yml -f docker-compose.nginx.yml up $DETACH $BUILD
|
||||||
else
|
else
|
||||||
@@ -98,5 +98,5 @@ if [ -n "$DETACH" ]; then
|
|||||||
echo ""
|
echo ""
|
||||||
echo "=== Services Started ==="
|
echo "=== Services Started ==="
|
||||||
echo ""
|
echo ""
|
||||||
docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}" | grep -E "(core_nest|NAMES)"
|
docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}" | grep -E "(core_room|NAMES)"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Show core_nest status
|
# Show core_room status
|
||||||
#
|
#
|
||||||
# Usage:
|
# Usage:
|
||||||
# ./status.sh
|
# ./status.sh
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
# Change to parent directory (services are in ../service_name)
|
# Change to parent directory (services are in ../service_name)
|
||||||
cd "$(dirname "$0")/.."
|
cd "$(dirname "$0")/.."
|
||||||
|
|
||||||
# Export core_nest/.env vars
|
# Export core_room/.env vars
|
||||||
if [ -f ".env" ]; then
|
if [ -f ".env" ]; then
|
||||||
export $(grep -v '^#' .env | grep -v '^$' | xargs)
|
export $(grep -v '^#' .env | grep -v '^$' | xargs)
|
||||||
fi
|
fi
|
||||||
@@ -22,21 +22,21 @@ for dir in */; do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# NEST_NAME comes from core_nest/.env
|
# ROOM_NAME comes from core_room/.env
|
||||||
NEST_NAME=${NEST_NAME:-core_nest}
|
ROOM_NAME=${ROOM_NAME:-core_room}
|
||||||
|
|
||||||
echo "=== Nest Status: $NEST_NAME ==="
|
echo "=== Room Status: $ROOM_NAME ==="
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
echo "Containers:"
|
echo "Containers:"
|
||||||
docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}" | grep -E "(${NEST_NAME}|NAMES)" || echo " No containers running"
|
docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}" | grep -E "(${ROOM_NAME}|NAMES)" || echo " No containers running"
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "Networks:"
|
echo "Networks:"
|
||||||
docker network ls | grep -E "(${NEST_NAME}|NETWORK)" || echo " No networks"
|
docker network ls | grep -E "(${ROOM_NAME}|NETWORK)" || echo " No networks"
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "Volumes:"
|
echo "Volumes:"
|
||||||
docker volume ls | grep -E "(${NEST_NAME}|VOLUME)" || echo " No volumes"
|
docker volume ls | grep -E "(${ROOM_NAME}|VOLUME)" || echo " No volumes"
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Stop core_nest services
|
# Stop core_room services
|
||||||
#
|
#
|
||||||
# Usage:
|
# Usage:
|
||||||
# ./stop.sh # Stop all
|
# ./stop.sh # Stop all
|
||||||
@@ -10,7 +10,7 @@ set -e
|
|||||||
# Change to parent directory (services are in ../service_name)
|
# Change to parent directory (services are in ../service_name)
|
||||||
cd "$(dirname "$0")/.."
|
cd "$(dirname "$0")/.."
|
||||||
|
|
||||||
# Export core_nest/.env vars so child docker-compose files can use them
|
# Export core_room/.env vars so child docker-compose files can use them
|
||||||
if [ -f ".env" ]; then
|
if [ -f ".env" ]; then
|
||||||
export $(grep -v '^#' .env | grep -v '^$' | xargs)
|
export $(grep -v '^#' .env | grep -v '^$' | xargs)
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
# Usage:
|
# Usage:
|
||||||
# # Set env vars
|
# # Set env vars
|
||||||
# export TEST_SOURCE_PATH=~/wdir/ama/amar_django_back/tests/contracts
|
# export TEST_SOURCE_PATH=~/wdir/ama/amar_django_back/tests/contracts
|
||||||
# export WARD_TESTS_PATH=~/wdir/ama/pawprint/ward/tools/tester/tests
|
# export WARD_TESTS_PATH=~/wdir/ama/soleprint/ward/tools/tester/tests
|
||||||
#
|
#
|
||||||
# # Run sync
|
# # Run sync
|
||||||
# ./sync-tests-local.sh
|
# ./sync-tests-local.sh
|
||||||
@@ -29,7 +29,7 @@ if [ -z "$TEST_SOURCE_PATH" ]; then
|
|||||||
echo ""
|
echo ""
|
||||||
echo "Set environment variables:"
|
echo "Set environment variables:"
|
||||||
echo " export TEST_SOURCE_PATH=~/wdir/ama/amar_django_back/tests/contracts"
|
echo " export TEST_SOURCE_PATH=~/wdir/ama/amar_django_back/tests/contracts"
|
||||||
echo " export WARD_TESTS_PATH=~/wdir/ama/pawprint/ward/tools/tester/tests"
|
echo " export WARD_TESTS_PATH=~/wdir/ama/soleprint/ward/tools/tester/tests"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Or create ctrl/.env.sync with these variables"
|
echo "Or create ctrl/.env.sync with these variables"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Pawprint Wrapper - Development Tools Sidebar
|
# Soleprint Wrapper - Development Tools Sidebar
|
||||||
|
|
||||||
A collapsible sidebar that provides development and testing tools for any pawprint-managed nest (like amar) without interfering with the managed application.
|
A collapsible sidebar that provides development and testing tools for any soleprint-managed room (like amar) without interfering with the managed application.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@ A collapsible sidebar that provides development and testing tools for any pawpri
|
|||||||
|
|
||||||
### 🌍 Environment Info
|
### 🌍 Environment Info
|
||||||
- Display backend and frontend URLs
|
- Display backend and frontend URLs
|
||||||
- Nest name and deployment info
|
- Room name and deployment info
|
||||||
- Quick reference during development
|
- Quick reference during development
|
||||||
|
|
||||||
### ⌨️ Keyboard Shortcuts
|
### ⌨️ Keyboard Shortcuts
|
||||||
@@ -40,7 +40,7 @@ wrapper/
|
|||||||
Open `index.html` in your browser to see the sidebar in action:
|
Open `index.html` in your browser to see the sidebar in action:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd core_nest/wrapper
|
cd core_room/wrapper
|
||||||
python3 -m http.server 8080
|
python3 -m http.server 8080
|
||||||
# Open http://localhost:8080
|
# Open http://localhost:8080
|
||||||
```
|
```
|
||||||
@@ -68,7 +68,7 @@ Edit `config.json` to customize:
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"nest_name": "amar",
|
"room_name": "amar",
|
||||||
"wrapper": {
|
"wrapper": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"environment": {
|
"environment": {
|
||||||
@@ -208,10 +208,10 @@ getSidebarHTML() {
|
|||||||
|
|
||||||
### Add New Features
|
### Add New Features
|
||||||
|
|
||||||
Extend the `PawprintSidebar` class in `sidebar.js`:
|
Extend the `SoleprintSidebar` class in `sidebar.js`:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
class PawprintSidebar {
|
class SoleprintSidebar {
|
||||||
async fetchJiraInfo() {
|
async fetchJiraInfo() {
|
||||||
const response = await fetch('https://artery.mcrn.ar/jira/VET-123');
|
const response = await fetch('https://artery.mcrn.ar/jira/VET-123');
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
@@ -294,8 +294,8 @@ Planned features (see `../WRAPPER_DESIGN.md`):
|
|||||||
## Related Documentation
|
## Related Documentation
|
||||||
|
|
||||||
- `../WRAPPER_DESIGN.md` - Complete architecture design
|
- `../WRAPPER_DESIGN.md` - Complete architecture design
|
||||||
- `../../../pawprint/CLAUDE.md` - Pawprint framework overview
|
- `../../../soleprint/CLAUDE.md` - Soleprint framework overview
|
||||||
- `../../README.md` - Core nest documentation
|
- `../../README.md` - Core room documentation
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
@@ -303,9 +303,9 @@ To add a new panel or feature:
|
|||||||
|
|
||||||
1. Add HTML in `getSidebarHTML()`
|
1. Add HTML in `getSidebarHTML()`
|
||||||
2. Add styling in `sidebar.css`
|
2. Add styling in `sidebar.css`
|
||||||
3. Add logic as methods on `PawprintSidebar` class
|
3. Add logic as methods on `SoleprintSidebar` class
|
||||||
4. Update this README with usage instructions
|
4. Update this README with usage instructions
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Part of the Pawprint development tools ecosystem.
|
Part of the Soleprint development tools ecosystem.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"nest_name": "amar",
|
"room_name": "amar",
|
||||||
"wrapper": {
|
"wrapper": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"environment": {
|
"environment": {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Pawprint Wrapper - Demo</title>
|
<title>Soleprint Wrapper - Demo</title>
|
||||||
<link rel="stylesheet" href="sidebar.css">
|
<link rel="stylesheet" href="sidebar.css">
|
||||||
<style>
|
<style>
|
||||||
/* Demo page styles */
|
/* Demo page styles */
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
transition: margin-right 0.3s ease;
|
transition: margin-right 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pawprint-sidebar.expanded ~ #demo-content {
|
#soleprint-sidebar.expanded ~ #demo-content {
|
||||||
margin-right: var(--sidebar-width);
|
margin-right: var(--sidebar-width);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,14 +105,14 @@
|
|||||||
|
|
||||||
<div id="demo-content">
|
<div id="demo-content">
|
||||||
<div class="demo-header">
|
<div class="demo-header">
|
||||||
<h1>🐾 Pawprint Wrapper</h1>
|
<h1>🐾 Soleprint Wrapper</h1>
|
||||||
<p>Development tools sidebar for any pawprint-managed nest</p>
|
<p>Development tools sidebar for any soleprint-managed room</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="demo-section">
|
<div class="demo-section">
|
||||||
<h2>👋 Quick Start</h2>
|
<h2>👋 Quick Start</h2>
|
||||||
<p>
|
<p>
|
||||||
This is a standalone demo of the Pawprint Wrapper sidebar.
|
This is a standalone demo of the Soleprint Wrapper sidebar.
|
||||||
Click the toggle button on the right edge of the screen, or press
|
Click the toggle button on the right edge of the screen, or press
|
||||||
<span class="kbd">Ctrl</span> + <span class="kbd">Shift</span> + <span class="kbd">P</span>
|
<span class="kbd">Ctrl</span> + <span class="kbd">Shift</span> + <span class="kbd">P</span>
|
||||||
to open the sidebar.
|
to open the sidebar.
|
||||||
@@ -156,7 +156,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li><code>sidebar.css</code> - Visual styling (dark theme, animations)</li>
|
<li><code>sidebar.css</code> - Visual styling (dark theme, animations)</li>
|
||||||
<li><code>sidebar.js</code> - Logic (login, logout, toggle, state management)</li>
|
<li><code>sidebar.js</code> - Logic (login, logout, toggle, state management)</li>
|
||||||
<li><code>config.json</code> - Configuration (users, URLs, nest info)</li>
|
<li><code>config.json</code> - Configuration (users, URLs, room info)</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p style="margin-top: 16px;">
|
<p style="margin-top: 16px;">
|
||||||
To integrate with your app, simply include these in your HTML:
|
To integrate with your app, simply include these in your HTML:
|
||||||
@@ -184,7 +184,7 @@
|
|||||||
<div class="demo-section">
|
<div class="demo-section">
|
||||||
<h2>📚 Documentation</h2>
|
<h2>📚 Documentation</h2>
|
||||||
<p>
|
<p>
|
||||||
See <code>WRAPPER_DESIGN.md</code> in <code>core_nest/</code> for the complete
|
See <code>WRAPPER_DESIGN.md</code> in <code>core_room/</code> for the complete
|
||||||
architecture design, including Docker integration patterns and alternative approaches.
|
architecture design, including Docker integration patterns and alternative approaches.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* Pawprint Wrapper - Sidebar Styles */
|
/* Soleprint Wrapper - Sidebar Styles */
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
--sidebar-width: 320px;
|
--sidebar-width: 320px;
|
||||||
@@ -26,7 +26,7 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Sidebar Container */
|
/* Sidebar Container */
|
||||||
#pawprint-sidebar {
|
#soleprint-sidebar {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
right: 0;
|
right: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
@@ -44,7 +44,7 @@ body {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pawprint-sidebar.expanded {
|
#soleprint-sidebar.expanded {
|
||||||
transform: translateX(0);
|
transform: translateX(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ body {
|
|||||||
transition: transform 0.3s;
|
transition: transform 0.3s;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pawprint-sidebar.expanded ~ #sidebar-toggle .icon {
|
#soleprint-sidebar.expanded ~ #sidebar-toggle .icon {
|
||||||
transform: scaleX(-1);
|
transform: scaleX(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ body {
|
|||||||
color: var(--sidebar-accent);
|
color: var(--sidebar-accent);
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-header .nest-name {
|
.sidebar-header .room-name {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
opacity: 0.7;
|
opacity: 0.7;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
@@ -262,20 +262,20 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Scrollbar */
|
/* Scrollbar */
|
||||||
#pawprint-sidebar::-webkit-scrollbar {
|
#soleprint-sidebar::-webkit-scrollbar {
|
||||||
width: 8px;
|
width: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pawprint-sidebar::-webkit-scrollbar-track {
|
#soleprint-sidebar::-webkit-scrollbar-track {
|
||||||
background: #1a1a1a;
|
background: #1a1a1a;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pawprint-sidebar::-webkit-scrollbar-thumb {
|
#soleprint-sidebar::-webkit-scrollbar-thumb {
|
||||||
background: #444;
|
background: #444;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pawprint-sidebar::-webkit-scrollbar-thumb:hover {
|
#soleprint-sidebar::-webkit-scrollbar-thumb:hover {
|
||||||
background: #555;
|
background: #555;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -290,7 +290,7 @@ body {
|
|||||||
|
|
||||||
/* Responsive */
|
/* Responsive */
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
#pawprint-sidebar {
|
#soleprint-sidebar {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Pawprint Wrapper - Sidebar Logic
|
// Soleprint Wrapper - Sidebar Logic
|
||||||
|
|
||||||
class PawprintSidebar {
|
class SoleprintSidebar {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.config = null;
|
this.config = null;
|
||||||
this.currentUser = null;
|
this.currentUser = null;
|
||||||
@@ -30,12 +30,12 @@ class PawprintSidebar {
|
|||||||
try {
|
try {
|
||||||
const response = await fetch('/wrapper/config.json');
|
const response = await fetch('/wrapper/config.json');
|
||||||
this.config = await response.json();
|
this.config = await response.json();
|
||||||
console.log('[Pawprint] Config loaded:', this.config.nest_name);
|
console.log('[Soleprint] Config loaded:', this.config.room_name);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('[Pawprint] Failed to load config:', error);
|
console.error('[Soleprint] Failed to load config:', error);
|
||||||
// Use default config
|
// Use default config
|
||||||
this.config = {
|
this.config = {
|
||||||
nest_name: 'default',
|
room_name: 'default',
|
||||||
wrapper: {
|
wrapper: {
|
||||||
environment: {
|
environment: {
|
||||||
backend_url: 'http://localhost:8000',
|
backend_url: 'http://localhost:8000',
|
||||||
@@ -49,7 +49,7 @@ class PawprintSidebar {
|
|||||||
|
|
||||||
createSidebar() {
|
createSidebar() {
|
||||||
const sidebar = document.createElement('div');
|
const sidebar = document.createElement('div');
|
||||||
sidebar.id = 'pawprint-sidebar';
|
sidebar.id = 'soleprint-sidebar';
|
||||||
sidebar.innerHTML = this.getSidebarHTML();
|
sidebar.innerHTML = this.getSidebarHTML();
|
||||||
document.body.appendChild(sidebar);
|
document.body.appendChild(sidebar);
|
||||||
this.sidebar = sidebar;
|
this.sidebar = sidebar;
|
||||||
@@ -59,7 +59,7 @@ class PawprintSidebar {
|
|||||||
const button = document.createElement('button');
|
const button = document.createElement('button');
|
||||||
button.id = 'sidebar-toggle';
|
button.id = 'sidebar-toggle';
|
||||||
button.innerHTML = '<span class="icon">◀</span>';
|
button.innerHTML = '<span class="icon">◀</span>';
|
||||||
button.title = 'Toggle Pawprint Sidebar (Ctrl+Shift+P)';
|
button.title = 'Toggle Soleprint Sidebar (Ctrl+Shift+P)';
|
||||||
document.body.appendChild(button);
|
document.body.appendChild(button);
|
||||||
this.toggleBtn = button;
|
this.toggleBtn = button;
|
||||||
}
|
}
|
||||||
@@ -69,8 +69,8 @@ class PawprintSidebar {
|
|||||||
|
|
||||||
return `
|
return `
|
||||||
<div class="sidebar-header">
|
<div class="sidebar-header">
|
||||||
<h2>🐾 Pawprint</h2>
|
<h2>🐾 Soleprint</h2>
|
||||||
<div class="nest-name">${this.config.nest_name}</div>
|
<div class="room-name">${this.config.room_name}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="sidebar-content">
|
<div class="sidebar-content">
|
||||||
@@ -83,7 +83,7 @@ class PawprintSidebar {
|
|||||||
<div id="current-user-display" style="display: none;">
|
<div id="current-user-display" style="display: none;">
|
||||||
<div class="current-user">
|
<div class="current-user">
|
||||||
Logged in as: <strong id="current-username"></strong>
|
Logged in as: <strong id="current-username"></strong>
|
||||||
<button class="logout-btn" onclick="pawprintSidebar.logout()">
|
<button class="logout-btn" onclick="soleprintSidebar.logout()">
|
||||||
Logout
|
Logout
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -91,7 +91,7 @@ class PawprintSidebar {
|
|||||||
|
|
||||||
<div class="user-cards">
|
<div class="user-cards">
|
||||||
${users.map(user => `
|
${users.map(user => `
|
||||||
<div class="user-card" data-user-id="${user.id}" onclick="pawprintSidebar.loginAs('${user.id}')">
|
<div class="user-card" data-user-id="${user.id}" onclick="soleprintSidebar.loginAs('${user.id}')">
|
||||||
<div class="icon">${user.icon}</div>
|
<div class="icon">${user.icon}</div>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<span class="label">${user.label}</span>
|
<span class="label">${user.label}</span>
|
||||||
@@ -119,7 +119,7 @@ class PawprintSidebar {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="sidebar-footer">
|
<div class="sidebar-footer">
|
||||||
Pawprint Dev Tools
|
Soleprint Dev Tools
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
@@ -144,11 +144,11 @@ class PawprintSidebar {
|
|||||||
|
|
||||||
saveSidebarState() {
|
saveSidebarState() {
|
||||||
const isExpanded = this.sidebar.classList.contains('expanded');
|
const isExpanded = this.sidebar.classList.contains('expanded');
|
||||||
localStorage.setItem('pawprint_sidebar_expanded', isExpanded);
|
localStorage.setItem('soleprint_sidebar_expanded', isExpanded);
|
||||||
}
|
}
|
||||||
|
|
||||||
loadSidebarState() {
|
loadSidebarState() {
|
||||||
const isExpanded = localStorage.getItem('pawprint_sidebar_expanded') === 'true';
|
const isExpanded = localStorage.getItem('soleprint_sidebar_expanded') === 'true';
|
||||||
if (isExpanded) {
|
if (isExpanded) {
|
||||||
this.sidebar.classList.add('expanded');
|
this.sidebar.classList.add('expanded');
|
||||||
}
|
}
|
||||||
@@ -214,7 +214,7 @@ class PawprintSidebar {
|
|||||||
}, 1000);
|
}, 1000);
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('[Pawprint] Login error:', error);
|
console.error('[Soleprint] Login error:', error);
|
||||||
this.showStatus(`✗ Login failed: ${error.message}`, 'error');
|
this.showStatus(`✗ Login failed: ${error.message}`, 'error');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -241,7 +241,7 @@ class PawprintSidebar {
|
|||||||
this.currentUser = JSON.parse(userInfo);
|
this.currentUser = JSON.parse(userInfo);
|
||||||
this.updateCurrentUserDisplay();
|
this.updateCurrentUserDisplay();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('[Pawprint] Failed to parse user info:', error);
|
console.error('[Soleprint] Failed to parse user info:', error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -275,12 +275,12 @@ class PawprintSidebar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Initialize sidebar when DOM is ready
|
// Initialize sidebar when DOM is ready
|
||||||
const pawprintSidebar = new PawprintSidebar();
|
const soleprintSidebar = new SoleprintSidebar();
|
||||||
|
|
||||||
if (document.readyState === 'loading') {
|
if (document.readyState === 'loading') {
|
||||||
document.addEventListener('DOMContentLoaded', () => pawprintSidebar.init());
|
document.addEventListener('DOMContentLoaded', () => soleprintSidebar.init());
|
||||||
} else {
|
} else {
|
||||||
pawprintSidebar.init();
|
soleprintSidebar.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('[Pawprint] Sidebar script loaded');
|
console.log('[Soleprint] Sidebar script loaded');
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ The `docker-compose.nginx.yml` file provides an **optional** nginx container for
|
|||||||
|
|
||||||
Use nginx container when you want to access services via friendly domains locally:
|
Use nginx container when you want to access services via friendly domains locally:
|
||||||
- `http://amarmascotas.local.com` → amar
|
- `http://amarmascotas.local.com` → amar
|
||||||
- `http://pawprint.local.com` → pawprint + services
|
- `http://soleprint.local.com` → soleprint + services
|
||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
@@ -19,14 +19,14 @@ cd ../ctrl/server
|
|||||||
./setup.sh --local
|
./setup.sh --local
|
||||||
```
|
```
|
||||||
|
|
||||||
This creates `/tmp/core_nest.conf` with your local domain routing.
|
This creates `/tmp/core_room.conf` with your local domain routing.
|
||||||
|
|
||||||
### 2. Ensure /etc/hosts is configured
|
### 2. Ensure /etc/hosts is configured
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Should already be there, but verify:
|
# Should already be there, but verify:
|
||||||
grep "127.0.0.1.*amarmascotas.local.com" /etc/hosts
|
grep "127.0.0.1.*amarmascotas.local.com" /etc/hosts
|
||||||
grep "127.0.0.1.*pawprint.local.com" /etc/hosts
|
grep "127.0.0.1.*soleprint.local.com" /etc/hosts
|
||||||
```
|
```
|
||||||
|
|
||||||
### 3. Stop bare metal nginx (if running)
|
### 3. Stop bare metal nginx (if running)
|
||||||
@@ -43,7 +43,7 @@ sudo systemctl disable nginx
|
|||||||
cd ../ctrl
|
cd ../ctrl
|
||||||
./start.sh --with-nginx
|
./start.sh --with-nginx
|
||||||
# OR manually:
|
# OR manually:
|
||||||
cd ../pawprint
|
cd ../soleprint
|
||||||
docker compose -f docker-compose.yml -f docker-compose.nginx.yml up -d
|
docker compose -f docker-compose.yml -f docker-compose.nginx.yml up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ docker compose -f docker-compose.yml -f docker-compose.nginx.yml up -d
|
|||||||
If you don't use nginx, services are accessed via ports:
|
If you don't use nginx, services are accessed via ports:
|
||||||
- `http://localhost:3000` → amar frontend
|
- `http://localhost:3000` → amar frontend
|
||||||
- `http://localhost:8000` → amar backend
|
- `http://localhost:8000` → amar backend
|
||||||
- `http://localhost:13000` → pawprint
|
- `http://localhost:13000` → soleprint
|
||||||
- `http://localhost:13001` → artery
|
- `http://localhost:13001` → artery
|
||||||
- `http://localhost:13002` → album
|
- `http://localhost:13002` → album
|
||||||
- `http://localhost:13003` → ward
|
- `http://localhost:13003` → ward
|
||||||
@@ -73,7 +73,7 @@ cd ../ctrl && ./stop.sh
|
|||||||
**To go back to direct ports:**
|
**To go back to direct ports:**
|
||||||
```bash
|
```bash
|
||||||
# Stop nginx version
|
# Stop nginx version
|
||||||
cd ../pawprint
|
cd ../soleprint
|
||||||
docker compose -f docker-compose.yml -f docker-compose.nginx.yml down
|
docker compose -f docker-compose.yml -f docker-compose.nginx.yml down
|
||||||
|
|
||||||
# Start without nginx
|
# Start without nginx
|
||||||
@@ -105,7 +105,7 @@ docker stop <container_name>
|
|||||||
cd ../ctrl/server && ./setup.sh --local
|
cd ../ctrl/server && ./setup.sh --local
|
||||||
|
|
||||||
# Verify config exists
|
# Verify config exists
|
||||||
ls -la /tmp/core_nest.conf
|
ls -la /tmp/core_room.conf
|
||||||
```
|
```
|
||||||
|
|
||||||
**DNS not resolving:**
|
**DNS not resolving:**
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
# Pawprint Control Scripts
|
# Soleprint Control Scripts
|
||||||
|
|
||||||
Control scripts for managing pawprint services via systemd (alternative to Docker deployment).
|
Control scripts for managing soleprint services via systemd (alternative to Docker deployment).
|
||||||
|
|
||||||
## Structure
|
## Structure
|
||||||
|
|
||||||
```
|
```
|
||||||
ctrl/
|
ctrl/
|
||||||
├── .env.pawprint # Shared configuration
|
├── .env.soleprint # Shared configuration
|
||||||
├── local/ # Scripts run from developer machine
|
├── local/ # Scripts run from developer machine
|
||||||
│ ├── commit.sh # Commit changes across all repos
|
│ ├── commit.sh # Commit changes across all repos
|
||||||
│ ├── deploy.sh # Full deployment workflow
|
│ ├── deploy.sh # Full deployment workflow
|
||||||
@@ -23,19 +23,19 @@ ctrl/
|
|||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
Edit `.env.pawprint` to configure:
|
Edit `.env.soleprint` to configure:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Deployment
|
# Deployment
|
||||||
DEPLOY_SERVER=mariano@mcrn.ar
|
DEPLOY_SERVER=mariano@mcrn.ar
|
||||||
DEPLOY_REMOTE_PATH=~/pawprint
|
DEPLOY_REMOTE_PATH=~/soleprint
|
||||||
|
|
||||||
# Local paths
|
# Local paths
|
||||||
PAWPRINT_BARE_PATH=/home/mariano/pawprint
|
SOLEPRINT_BARE_PATH=/home/mariano/soleprint
|
||||||
|
|
||||||
# Server paths
|
# Server paths
|
||||||
SERVER_USER=mariano
|
SERVER_USER=mariano
|
||||||
SERVER_PAWPRINT_PATH=/home/mariano/pawprint
|
SERVER_SOLEPRINT_PATH=/home/mariano/soleprint
|
||||||
SERVER_VENV_BASE=/home/mariano/venvs
|
SERVER_VENV_BASE=/home/mariano/venvs
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ SERVER_VENV_BASE=/home/mariano/venvs
|
|||||||
./push.sh artery # Deploy only artery (when needed)
|
./push.sh artery # Deploy only artery (when needed)
|
||||||
```
|
```
|
||||||
|
|
||||||
See `DESIGN_PAWPRINT.md` for detailed philosophy.
|
See `DESIGN_SOLEPRINT.md` for detailed philosophy.
|
||||||
|
|
||||||
## Local Scripts
|
## Local Scripts
|
||||||
|
|
||||||
@@ -72,7 +72,7 @@ See `DESIGN_PAWPRINT.md` for detailed philosophy.
|
|||||||
```bash
|
```bash
|
||||||
./local/deploy.sh
|
./local/deploy.sh
|
||||||
# Then restart on server:
|
# Then restart on server:
|
||||||
# ssh mariano@mcrn.ar 'bash ~/pawprint/ctrl/server/restart.sh'
|
# ssh mariano@mcrn.ar 'bash ~/soleprint/ctrl/server/restart.sh'
|
||||||
```
|
```
|
||||||
|
|
||||||
### init.sh
|
### init.sh
|
||||||
@@ -96,7 +96,7 @@ sudo ./server/restart.sh artery # Restart only artery
|
|||||||
|
|
||||||
### setup-service.sh
|
### setup-service.sh
|
||||||
```bash
|
```bash
|
||||||
sudo ./server/setup-service.sh pawprint 12000 main:app
|
sudo ./server/setup-service.sh soleprint 12000 main:app
|
||||||
sudo ./server/setup-service.sh artery 12001 main:app
|
sudo ./server/setup-service.sh artery 12001 main:app
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -122,13 +122,13 @@ cd ctrl/local
|
|||||||
|
|
||||||
Server:
|
Server:
|
||||||
```bash
|
```bash
|
||||||
cd ~/pawprint/ctrl/server
|
cd ~/soleprint/ctrl/server
|
||||||
./install-deps.sh
|
./install-deps.sh
|
||||||
sudo ./setup-service.sh pawprint 12000 main:app
|
sudo ./setup-service.sh soleprint 12000 main:app
|
||||||
sudo ./setup-service.sh artery 12001 main:app
|
sudo ./setup-service.sh artery 12001 main:app
|
||||||
sudo ./setup-service.sh album 12002 main:app
|
sudo ./setup-service.sh album 12002 main:app
|
||||||
sudo ./setup-service.sh ward 12003 main:app
|
sudo ./setup-service.sh ward 12003 main:app
|
||||||
sudo ./setup-nginx.sh pawprint pawprint.mcrn.ar 12000
|
sudo ./setup-nginx.sh soleprint soleprint.mcrn.ar 12000
|
||||||
sudo ./setup-nginx.sh artery artery.mcrn.ar 12001
|
sudo ./setup-nginx.sh artery artery.mcrn.ar 12001
|
||||||
sudo ./setup-nginx.sh album album.mcrn.ar 12002
|
sudo ./setup-nginx.sh album album.mcrn.ar 12002
|
||||||
sudo ./setup-nginx.sh ward ward.mcrn.ar 12003
|
sudo ./setup-nginx.sh ward ward.mcrn.ar 12003
|
||||||
@@ -145,13 +145,13 @@ cd ctrl/local
|
|||||||
|
|
||||||
Server:
|
Server:
|
||||||
```bash
|
```bash
|
||||||
sudo ~/pawprint/ctrl/server/restart.sh
|
sudo ~/soleprint/ctrl/server/restart.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
## Nest vs Pawprint Control
|
## Room vs Soleprint Control
|
||||||
|
|
||||||
- **core_nest/ctrl/** - Manages full nest (amar + pawprint) via Docker
|
- **core_room/ctrl/** - Manages full room (amar + soleprint) via Docker
|
||||||
- **pawprint/ctrl/** - Manages pawprint services via systemd
|
- **soleprint/ctrl/** - Manages soleprint services via systemd
|
||||||
|
|
||||||
This directory provides systemd-based deployment as an alternative to Docker.
|
This directory provides systemd-based deployment as an alternative to Docker.
|
||||||
For full nest orchestration with Docker, use `core_nest/ctrl/`.
|
For full room orchestration with Docker, use `core_room/ctrl/`.
|
||||||
|
|||||||
@@ -6,13 +6,13 @@ set -e
|
|||||||
|
|
||||||
MSG="${1:?Usage: $0 \"commit message\"}"
|
MSG="${1:?Usage: $0 \"commit message\"}"
|
||||||
|
|
||||||
# Find pawprint bare metal directory from PAWPRINT_BARE_PATH or default
|
# Find soleprint bare metal directory from SOLEPRINT_BARE_PATH or default
|
||||||
PAWPRINT_DIR="${PAWPRINT_BARE_PATH:-/home/mariano/pawprint}"
|
SOLEPRINT_DIR="${SOLEPRINT_BARE_PATH:-/home/mariano/soleprint}"
|
||||||
REPOS=("$PAWPRINT_DIR" "$PAWPRINT_DIR/artery" "$PAWPRINT_DIR/album" "$PAWPRINT_DIR/ward")
|
REPOS=("$SOLEPRINT_DIR" "$SOLEPRINT_DIR/artery" "$SOLEPRINT_DIR/album" "$SOLEPRINT_DIR/ward")
|
||||||
|
|
||||||
for repo in "${REPOS[@]}"; do
|
for repo in "${REPOS[@]}"; do
|
||||||
name=$(basename "$repo")
|
name=$(basename "$repo")
|
||||||
[ "$repo" = "$PAWPRINT_DIR" ] && name="pawprint"
|
[ "$repo" = "$SOLEPRINT_DIR" ] && name="soleprint"
|
||||||
|
|
||||||
if [ ! -d "$repo/.git" ]; then
|
if [ ! -d "$repo/.git" ]; then
|
||||||
echo "=== $name: not a git repo, skipping ==="
|
echo "=== $name: not a git repo, skipping ==="
|
||||||
|
|||||||
@@ -1,28 +1,28 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Initial full sync of pawprint to server
|
# Initial full sync of soleprint to server
|
||||||
# Run once to setup, then use push.sh for updates
|
# Run once to setup, then use push.sh for updates
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Load configuration
|
# Load configuration
|
||||||
CTRL_DIR="$(cd "$(dirname "$0")/../.." SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" pwd)"
|
CTRL_DIR="$(cd "$(dirname "$0")/../.." SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" pwd)"
|
||||||
source "$CTRL_DIR/.env.pawprint" 2>/dev/null || true
|
source "$CTRL_DIR/.env.soleprint" 2>/dev/null || true
|
||||||
|
|
||||||
PAWPRINT_DIR="${PAWPRINT_BARE_PATH:-/home/mariano/pawprint}"
|
SOLEPRINT_DIR="${SOLEPRINT_BARE_PATH:-/home/mariano/soleprint}"
|
||||||
REMOTE="${DEPLOY_SERVER:-mariano@mcrn.ar}"
|
REMOTE="${DEPLOY_SERVER:-mariano@mcrn.ar}"
|
||||||
REMOTE_DIR="${DEPLOY_REMOTE_PATH:-~/pawprint}"
|
REMOTE_DIR="${DEPLOY_REMOTE_PATH:-~/soleprint}"
|
||||||
|
|
||||||
echo "=== Initial sync of pawprint ==="
|
echo "=== Initial sync of soleprint ==="
|
||||||
echo "From: $PAWPRINT_DIR"
|
echo "From: $SOLEPRINT_DIR"
|
||||||
echo "To: $REMOTE:$REMOTE_DIR"
|
echo "To: $REMOTE:$REMOTE_DIR"
|
||||||
|
|
||||||
rsync -avz \
|
rsync -avz \
|
||||||
--filter=':- .gitignore' \
|
--filter=':- .gitignore' \
|
||||||
--exclude '.git' \
|
--exclude '.git' \
|
||||||
--exclude '.env' \
|
--exclude '.env' \
|
||||||
"$PAWPRINT_DIR/" "$REMOTE:$REMOTE_DIR/"
|
"$SOLEPRINT_DIR/" "$REMOTE:$REMOTE_DIR/"
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "Done! Now on server run:"
|
echo "Done! Now on server run:"
|
||||||
echo " cd ~/pawprint"
|
echo " cd ~/soleprint"
|
||||||
echo " # Use core_nest/pawprint/tools/server/setup-*.sh scripts for initial setup"
|
echo " # Use core_room/soleprint/tools/server/setup-*.sh scripts for initial setup"
|
||||||
|
|||||||
@@ -2,13 +2,13 @@
|
|||||||
# Show git status of all repos
|
# Show git status of all repos
|
||||||
# Usage: ./status.sh
|
# Usage: ./status.sh
|
||||||
|
|
||||||
# Find pawprint bare metal directory from PAWPRINT_BARE_PATH or default
|
# Find soleprint bare metal directory from SOLEPRINT_BARE_PATH or default
|
||||||
PAWPRINT_DIR="${PAWPRINT_BARE_PATH:-/home/mariano/pawprint}"
|
SOLEPRINT_DIR="${SOLEPRINT_BARE_PATH:-/home/mariano/soleprint}"
|
||||||
REPOS=("$PAWPRINT_DIR" "$PAWPRINT_DIR/artery" "$PAWPRINT_DIR/album" "$PAWPRINT_DIR/ward")
|
REPOS=("$SOLEPRINT_DIR" "$SOLEPRINT_DIR/artery" "$SOLEPRINT_DIR/album" "$SOLEPRINT_DIR/ward")
|
||||||
|
|
||||||
for repo in "${REPOS[@]}"; do
|
for repo in "${REPOS[@]}"; do
|
||||||
name=$(basename "$repo")
|
name=$(basename "$repo")
|
||||||
[ "$repo" = "$PAWPRINT_DIR" ] && name="pawprint"
|
[ "$repo" = "$SOLEPRINT_DIR" ] && name="soleprint"
|
||||||
|
|
||||||
if [ ! -d "$repo/.git" ]; then
|
if [ ! -d "$repo/.git" ]; then
|
||||||
echo "=== $name: not a git repo ==="
|
echo "=== $name: not a git repo ==="
|
||||||
|
|||||||
@@ -10,16 +10,16 @@ APP_NAME="${1:-all}"
|
|||||||
|
|
||||||
# Load configuration
|
# Load configuration
|
||||||
CTRL_DIR="$(cd "$(dirname "$0")/../.." SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" pwd)"
|
CTRL_DIR="$(cd "$(dirname "$0")/../.." SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" pwd)"
|
||||||
source "$CTRL_DIR/.env.pawprint" 2>/dev/null || true
|
source "$CTRL_DIR/.env.soleprint" 2>/dev/null || true
|
||||||
|
|
||||||
APP_USER="${SERVER_USER:-mariano}"
|
APP_USER="${SERVER_USER:-mariano}"
|
||||||
PAWPRINT_PATH="${SERVER_PAWPRINT_PATH:-/home/mariano/pawprint}"
|
SOLEPRINT_PATH="${SERVER_SOLEPRINT_PATH:-/home/mariano/soleprint}"
|
||||||
VENV_BASE="${SERVER_VENV_BASE:-/home/mariano/venvs}"
|
VENV_BASE="${SERVER_VENV_BASE:-/home/mariano/venvs}"
|
||||||
|
|
||||||
# Handle all (default)
|
# Handle all (default)
|
||||||
if [ "$APP_NAME" = "all" ]; then
|
if [ "$APP_NAME" = "all" ]; then
|
||||||
echo "=== Installing deps for all services ==="
|
echo "=== Installing deps for all services ==="
|
||||||
for app in pawprint artery album ward; do
|
for app in soleprint artery album ward; do
|
||||||
echo ""
|
echo ""
|
||||||
echo "--- $app ---"
|
echo "--- $app ---"
|
||||||
"$0" "$app"
|
"$0" "$app"
|
||||||
@@ -31,10 +31,10 @@ fi
|
|||||||
|
|
||||||
VENV_DIR="$VENV_BASE/$APP_NAME"
|
VENV_DIR="$VENV_BASE/$APP_NAME"
|
||||||
|
|
||||||
if [ "$APP_NAME" = "pawprint" ]; then
|
if [ "$APP_NAME" = "soleprint" ]; then
|
||||||
REQ_FILE="$PAWPRINT_PATH/requirements.txt"
|
REQ_FILE="$SOLEPRINT_PATH/requirements.txt"
|
||||||
else
|
else
|
||||||
REQ_FILE="$PAWPRINT_PATH/$APP_NAME/requirements.txt"
|
REQ_FILE="$SOLEPRINT_PATH/$APP_NAME/requirements.txt"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f "$REQ_FILE" ]; then
|
if [ ! -f "$REQ_FILE" ]; then
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Restart pawprint services
|
# Restart soleprint services
|
||||||
# Usage: ./restart.sh [service]
|
# Usage: ./restart.sh [service]
|
||||||
# Example: ./restart.sh (restarts all services)
|
# Example: ./restart.sh (restarts all services)
|
||||||
# ./restart.sh artery (restarts only artery)
|
# ./restart.sh artery (restarts only artery)
|
||||||
@@ -11,9 +11,9 @@ TARGET="${1:-all}"
|
|||||||
# Handle all (default)
|
# Handle all (default)
|
||||||
if [ "$TARGET" = "all" ]; then
|
if [ "$TARGET" = "all" ]; then
|
||||||
echo "Restarting all services..."
|
echo "Restarting all services..."
|
||||||
systemctl restart pawprint artery album ward
|
systemctl restart soleprint artery album ward
|
||||||
echo "Status:"
|
echo "Status:"
|
||||||
systemctl status pawprint artery album ward --no-pager | grep -E "●|Active:"
|
systemctl status soleprint artery album ward --no-pager | grep -E "●|Active:"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Install/update SSL certificate for a subdomain
|
# Install/update SSL certificate for a subdomain
|
||||||
# Usage: ./setup-cert.sh <subdomain>
|
# Usage: ./setup-cert.sh <subdomain>
|
||||||
# Example: ./setup-cert.sh pawprint.mcrn.ar
|
# Example: ./setup-cert.sh soleprint.mcrn.ar
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
|||||||
@@ -12,11 +12,11 @@ APP_MODULE="${3:-main:app}"
|
|||||||
APP_USER="mariano"
|
APP_USER="mariano"
|
||||||
VENV_DIR="/home/$APP_USER/venvs/$APP_NAME"
|
VENV_DIR="/home/$APP_USER/venvs/$APP_NAME"
|
||||||
|
|
||||||
# pawprint root is special case
|
# soleprint root is special case
|
||||||
if [ "$APP_NAME" = "pawprint" ]; then
|
if [ "$APP_NAME" = "soleprint" ]; then
|
||||||
WORK_DIR="/home/$APP_USER/pawprint"
|
WORK_DIR="/home/$APP_USER/soleprint"
|
||||||
else
|
else
|
||||||
WORK_DIR="/home/$APP_USER/pawprint/$APP_NAME"
|
WORK_DIR="/home/$APP_USER/soleprint/$APP_NAME"
|
||||||
fi
|
fi
|
||||||
SERVICE_FILE="/etc/systemd/system/${APP_NAME}.service"
|
SERVICE_FILE="/etc/systemd/system/${APP_NAME}.service"
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ User=$APP_USER
|
|||||||
Group=$APP_USER
|
Group=$APP_USER
|
||||||
WorkingDirectory=$WORK_DIR
|
WorkingDirectory=$WORK_DIR
|
||||||
Environment="PATH=$VENV_DIR/bin"
|
Environment="PATH=$VENV_DIR/bin"
|
||||||
EnvironmentFile=$PAWPRINT_PATH/.env
|
EnvironmentFile=$SOLEPRINT_PATH/.env
|
||||||
ExecStart=$VENV_DIR/bin/uvicorn $APP_MODULE --host 127.0.0.1 --port $PORT
|
ExecStart=$VENV_DIR/bin/uvicorn $APP_MODULE --host 127.0.0.1 --port $PORT
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ set -e
|
|||||||
|
|
||||||
# Paths
|
# Paths
|
||||||
SOURCE_REPO="/home/mariano/wdir/ama/amar_django_back_contracts"
|
SOURCE_REPO="/home/mariano/wdir/ama/amar_django_back_contracts"
|
||||||
DEST_DIR="/home/mariano/wdir/ama/pawprint/ward/tools/tester/tests"
|
DEST_DIR="/home/mariano/wdir/ama/soleprint/ward/tools/tester/tests"
|
||||||
|
|
||||||
# Colors
|
# Colors
|
||||||
GREEN='\033[0;32m'
|
GREEN='\033[0;32m'
|
||||||
@@ -78,5 +78,5 @@ find "$DEST_DIR" -name "test_*.py" -type f | sed 's|'"$DEST_DIR"'||' | sort
|
|||||||
|
|
||||||
echo
|
echo
|
||||||
echo -e "${BLUE}Next steps:${NC}"
|
echo -e "${BLUE}Next steps:${NC}"
|
||||||
echo "1. Run tester locally: cd /home/mariano/wdir/ama/pawprint/ward && python -m tools.tester"
|
echo "1. Run tester locally: cd /home/mariano/wdir/ama/soleprint/ward && python -m tools.tester"
|
||||||
echo "2. Deploy to server: cd /home/mariano/wdir/ama/pawprint/deploy && ./deploy.sh"
|
echo "2. Deploy to server: cd /home/mariano/wdir/ama/soleprint/deploy && ./deploy.sh"
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
# This nginx container will:
|
# This nginx container will:
|
||||||
# - Listen on port 80
|
# - Listen on port 80
|
||||||
# - Route amarmascotas.local.com to amar frontend/backend
|
# - Route amarmascotas.local.com to amar frontend/backend
|
||||||
# - Route pawprint.local.com to pawprint services
|
# - Route soleprint.local.com to soleprint services
|
||||||
|
|
||||||
services:
|
services:
|
||||||
nginx:
|
nginx:
|
||||||
@@ -30,13 +30,13 @@ services:
|
|||||||
- .env
|
- .env
|
||||||
environment:
|
environment:
|
||||||
- DEPLOYMENT_NAME=${DEPLOYMENT_NAME}
|
- DEPLOYMENT_NAME=${DEPLOYMENT_NAME}
|
||||||
- NEST_NAME=${NEST_NAME}
|
- ROOM_NAME=${ROOM_NAME}
|
||||||
- MANAGED_DOMAIN=${MANAGED_DOMAIN}
|
- MANAGED_DOMAIN=${MANAGED_DOMAIN}
|
||||||
- PAWPRINT_DOMAIN=${PAWPRINT_DOMAIN}
|
- SOLEPRINT_DOMAIN=${SOLEPRINT_DOMAIN}
|
||||||
networks:
|
networks:
|
||||||
- default
|
- default
|
||||||
depends_on:
|
depends_on:
|
||||||
- pawprint
|
- soleprint
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
@@ -99,30 +99,21 @@ def index(request: Request):
|
|||||||
@app.get("/artery/{path:path}")
|
@app.get("/artery/{path:path}")
|
||||||
def artery_redirect(path: str = ""):
|
def artery_redirect(path: str = ""):
|
||||||
"""Redirect to artery service."""
|
"""Redirect to artery service."""
|
||||||
target = os.getenv("ARTERY_URL")
|
return RedirectResponse(url=f"{ARTERY_EXTERNAL_URL}/{path}")
|
||||||
if target:
|
|
||||||
return RedirectResponse(url=f"{target}/{path}")
|
|
||||||
return {"error": "ARTERY_URL not configured"}
|
|
||||||
|
|
||||||
|
|
||||||
@app.get("/atlas")
|
@app.get("/atlas")
|
||||||
@app.get("/atlas/{path:path}")
|
@app.get("/atlas/{path:path}")
|
||||||
def atlas_redirect(path: str = ""):
|
def atlas_redirect(path: str = ""):
|
||||||
"""Redirect to atlas service."""
|
"""Redirect to atlas service."""
|
||||||
target = os.getenv("ATLAS_URL")
|
return RedirectResponse(url=f"{ATLAS_EXTERNAL_URL}/{path}")
|
||||||
if target:
|
|
||||||
return RedirectResponse(url=f"{target}/{path}")
|
|
||||||
return {"error": "ATLAS_URL not configured"}
|
|
||||||
|
|
||||||
|
|
||||||
@app.get("/station")
|
@app.get("/station")
|
||||||
@app.get("/station/{path:path}")
|
@app.get("/station/{path:path}")
|
||||||
def station_redirect(path: str = ""):
|
def station_redirect(path: str = ""):
|
||||||
"""Redirect to station service."""
|
"""Redirect to station service."""
|
||||||
target = os.getenv("STATION_URL")
|
return RedirectResponse(url=f"{STATION_EXTERNAL_URL}/{path}")
|
||||||
if target:
|
|
||||||
return RedirectResponse(url=f"{target}/{path}")
|
|
||||||
return {"error": "STATION_URL not configured"}
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
@@ -2,3 +2,4 @@ fastapi>=0.104.0
|
|||||||
uvicorn[standard]>=0.24.0
|
uvicorn[standard]>=0.24.0
|
||||||
pydantic>=2.5.0
|
pydantic>=2.5.0
|
||||||
httpx>=0.25.0
|
httpx>=0.25.0
|
||||||
|
jinja2>=3.1.0
|
||||||
164
soleprint/run.py
Normal file
164
soleprint/run.py
Normal file
@@ -0,0 +1,164 @@
|
|||||||
|
"""
|
||||||
|
Soleprint - Bare-metal single-port development server.
|
||||||
|
|
||||||
|
Serves everything on a single port for basic testing without docker/nginx.
|
||||||
|
Routes /artery/*, /atlas/*, /station/* internally instead of redirecting.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
python run.py # Serves on :12000 with all subsystems
|
||||||
|
PORT=8080 python run.py # Custom port
|
||||||
|
|
||||||
|
This is for soleprint development only, not for managed rooms (use docker for those).
|
||||||
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
# Add parent directory to path for imports
|
||||||
|
sys.path.insert(0, str(Path(__file__).parent.parent))
|
||||||
|
|
||||||
|
from fastapi import FastAPI, Request
|
||||||
|
from fastapi.responses import HTMLResponse, JSONResponse
|
||||||
|
from fastapi.staticfiles import StaticFiles
|
||||||
|
from fastapi.templating import Jinja2Templates
|
||||||
|
|
||||||
|
app = FastAPI(title="Soleprint (dev)", version="0.1.0")
|
||||||
|
|
||||||
|
templates = Jinja2Templates(directory=Path(__file__).parent)
|
||||||
|
|
||||||
|
# Base path for systems
|
||||||
|
SPR_ROOT = Path(__file__).parent.parent
|
||||||
|
|
||||||
|
|
||||||
|
def scan_directory(base_path: Path, pattern: str = "*") -> list[dict]:
|
||||||
|
"""Scan a directory and return list of items with metadata."""
|
||||||
|
items = []
|
||||||
|
if base_path.exists():
|
||||||
|
for item in sorted(base_path.iterdir()):
|
||||||
|
if item.is_dir() and not item.name.startswith(("_", ".")):
|
||||||
|
readme = item / "README.md"
|
||||||
|
description = ""
|
||||||
|
if readme.exists():
|
||||||
|
# Get first non-empty, non-header line
|
||||||
|
for line in readme.read_text().split("\n"):
|
||||||
|
line = line.strip()
|
||||||
|
if line and not line.startswith("#"):
|
||||||
|
description = line[:100]
|
||||||
|
break
|
||||||
|
items.append(
|
||||||
|
{
|
||||||
|
"name": item.name,
|
||||||
|
"path": str(item.relative_to(SPR_ROOT)),
|
||||||
|
"description": description,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
return items
|
||||||
|
|
||||||
|
|
||||||
|
@app.get("/health")
|
||||||
|
def health():
|
||||||
|
return {
|
||||||
|
"status": "ok",
|
||||||
|
"service": "soleprint-dev",
|
||||||
|
"mode": "bare-metal",
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# === Artery ===
|
||||||
|
|
||||||
|
|
||||||
|
@app.get("/artery")
|
||||||
|
def artery_index():
|
||||||
|
"""List installed veins."""
|
||||||
|
veins_path = SPR_ROOT / "artery" / "veins"
|
||||||
|
veins = scan_directory(veins_path)
|
||||||
|
return {
|
||||||
|
"system": "artery",
|
||||||
|
"tagline": "Todo lo vital",
|
||||||
|
"veins": veins,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@app.get("/artery/{path:path}")
|
||||||
|
def artery_route(path: str):
|
||||||
|
"""Artery sub-routes."""
|
||||||
|
return {"system": "artery", "path": path, "message": "Artery route placeholder"}
|
||||||
|
|
||||||
|
|
||||||
|
# === Atlas ===
|
||||||
|
|
||||||
|
|
||||||
|
@app.get("/atlas")
|
||||||
|
def atlas_index():
|
||||||
|
"""List installed templates."""
|
||||||
|
templates_path = SPR_ROOT / "atlas" / "templates"
|
||||||
|
tpls = scan_directory(templates_path)
|
||||||
|
return {
|
||||||
|
"system": "atlas",
|
||||||
|
"tagline": "Documentacion accionable",
|
||||||
|
"templates": tpls,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@app.get("/atlas/{path:path}")
|
||||||
|
def atlas_route(path: str):
|
||||||
|
"""Atlas sub-routes."""
|
||||||
|
return {"system": "atlas", "path": path, "message": "Atlas route placeholder"}
|
||||||
|
|
||||||
|
|
||||||
|
# === Station ===
|
||||||
|
|
||||||
|
|
||||||
|
@app.get("/station")
|
||||||
|
def station_index():
|
||||||
|
"""List installed tools."""
|
||||||
|
tools_path = SPR_ROOT / "station" / "tools"
|
||||||
|
tools = scan_directory(tools_path)
|
||||||
|
return {
|
||||||
|
"system": "station",
|
||||||
|
"tagline": "Monitores, Entornos y Herramientas",
|
||||||
|
"tools": tools,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@app.get("/station/{path:path}")
|
||||||
|
def station_route(path: str):
|
||||||
|
"""Station sub-routes."""
|
||||||
|
return {"system": "station", "path": path, "message": "Station route placeholder"}
|
||||||
|
|
||||||
|
|
||||||
|
# === Main ===
|
||||||
|
|
||||||
|
|
||||||
|
@app.get("/")
|
||||||
|
def index(request: Request):
|
||||||
|
"""Landing page with links to subsystems."""
|
||||||
|
return templates.TemplateResponse(
|
||||||
|
"index.html",
|
||||||
|
{
|
||||||
|
"request": request,
|
||||||
|
# In bare-metal mode, all routes are internal
|
||||||
|
"artery": "/artery",
|
||||||
|
"atlas": "/atlas",
|
||||||
|
"station": "/station",
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
import uvicorn
|
||||||
|
|
||||||
|
port = int(os.getenv("PORT", "12000"))
|
||||||
|
print(f"Soleprint bare-metal dev server starting on http://localhost:{port}")
|
||||||
|
print(" /artery - Connectors (veins)")
|
||||||
|
print(" /atlas - Documentation (templates)")
|
||||||
|
print(" /station - Tools")
|
||||||
|
print()
|
||||||
|
|
||||||
|
uvicorn.run(
|
||||||
|
"run:app",
|
||||||
|
host="0.0.0.0",
|
||||||
|
port=port,
|
||||||
|
reload=True,
|
||||||
|
)
|
||||||
Reference in New Issue
Block a user