1.1 changes
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
# Core Nest - Environment Configuration
|
||||
# This configuration is shared across all services in the nest
|
||||
# Core Room - Environment Configuration
|
||||
# This configuration is shared across all services in the room
|
||||
|
||||
# =============================================================================
|
||||
# DEPLOYMENT CONFIG
|
||||
# =============================================================================
|
||||
# Unique identifier for this deployment (used for container/network names)
|
||||
DEPLOYMENT_NAME=core_nest
|
||||
DEPLOYMENT_NAME=core_room
|
||||
|
||||
# Nest identifier (logical grouping of services)
|
||||
NEST_NAME=core_nest
|
||||
# Room identifier (logical grouping of services)
|
||||
ROOM_NAME=core_room
|
||||
|
||||
# Network name for Docker services
|
||||
NETWORK_NAME=core_nest_network
|
||||
NETWORK_NAME=core_room_network
|
||||
|
||||
# =============================================================================
|
||||
# DOMAINS (Local Development)
|
||||
@@ -19,8 +19,8 @@ NETWORK_NAME=core_nest_network
|
||||
# Domain for the managed application (e.g., amar)
|
||||
MANAGED_DOMAIN=amar.local.com
|
||||
|
||||
# Domain for pawprint management interface
|
||||
PAWPRINT_DOMAIN=pawprint.local.com
|
||||
# Domain for soleprint management interface
|
||||
SOLEPRINT_DOMAIN=soleprint.local.com
|
||||
|
||||
# =============================================================================
|
||||
# PORTS (Local Development)
|
||||
@@ -29,8 +29,8 @@ PAWPRINT_DOMAIN=pawprint.local.com
|
||||
BACKEND_PORT=8000
|
||||
FRONTEND_PORT=3000
|
||||
|
||||
# Pawprint ecosystem ports
|
||||
PAWPRINT_PORT=13000
|
||||
# Soleprint ecosystem ports
|
||||
SOLEPRINT_PORT=13000
|
||||
ARTERY_PORT=13001
|
||||
ALBUM_PORT=13002
|
||||
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
|
||||
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
|
||||
FRONTEND_PATH=../../amar_frontend
|
||||
DOCKERFILE_BACKEND=../def/core_nest/amar/Dockerfile.backend
|
||||
DOCKERFILE_FRONTEND=../def/core_nest/amar/Dockerfile.frontend
|
||||
DOCKERFILE_BACKEND=../def/core_room/amar/Dockerfile.backend
|
||||
DOCKERFILE_FRONTEND=../def/core_room/amar/Dockerfile.frontend
|
||||
|
||||
# Database seed data
|
||||
INIT_DB_SEED=test
|
||||
|
||||
@@ -13,7 +13,7 @@ Separate from `ctrl/` which contains **local** orchestration scripts.
|
||||
server/
|
||||
├── setup.sh # Idempotent server setup (run on AWS)
|
||||
├── 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
|
||||
```
|
||||
|
||||
@@ -22,7 +22,7 @@ server/
|
||||
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
|
||||
│ ├── setup.sh # Run this first
|
||||
│ └── nginx/
|
||||
@@ -37,7 +37,7 @@ When deployed, the AWS instance should look like:
|
||||
│ └── src/ # Synced from local via manual_sync/
|
||||
│ ├── back/ # Django source
|
||||
│ └── front/ # Next.js source
|
||||
└── pawprint/
|
||||
└── soleprint/
|
||||
├── docker-compose.yml
|
||||
├── .env # Production values
|
||||
└── (bare metal or src/ depending on deployment)
|
||||
@@ -49,14 +49,14 @@ When deployed, the AWS instance should look like:
|
||||
|
||||
```bash
|
||||
# 1. From local machine: Deploy files
|
||||
cd ~/wdir/ama/core_nest/ctrl
|
||||
cd ~/wdir/ama/core_room/ctrl
|
||||
./deploy.sh
|
||||
|
||||
# 2. SSH to server
|
||||
ssh mariano@mcrn.ar
|
||||
|
||||
# 3. Run server setup (idempotent - safe to re-run)
|
||||
cd ~/core_nest/server
|
||||
cd ~/core_room/server
|
||||
./setup.sh
|
||||
```
|
||||
|
||||
@@ -70,19 +70,19 @@ This will:
|
||||
### Updates/Changes
|
||||
|
||||
```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:
|
||||
./deploy.sh
|
||||
|
||||
# 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
|
||||
|
||||
```bash
|
||||
# On server (or via SSH):
|
||||
cd ~/core_nest/ctrl
|
||||
cd ~/core_room/ctrl
|
||||
./build.sh # Build all images
|
||||
./start.sh -d # Start detached
|
||||
./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.
|
||||
|
||||
### server/nginx/core_nest.conf
|
||||
### server/nginx/core_room.conf
|
||||
|
||||
Single nginx config file for all services:
|
||||
- amar.nest.mcrn.ar (frontend + backend)
|
||||
- pawprint.mcrn.ar
|
||||
- amar.room.mcrn.ar (frontend + backend)
|
||||
- soleprint.mcrn.ar
|
||||
- artery.mcrn.ar
|
||||
- album.mcrn.ar
|
||||
- ward.mcrn.ar
|
||||
@@ -117,8 +117,8 @@ Create production `.env` files:
|
||||
|
||||
```bash
|
||||
# On server:
|
||||
nano ~/core_nest/amar/.env # Set INIT_DB_SEED=test or prod
|
||||
nano ~/core_nest/pawprint/.env # Set NEST_NAME, ports, etc.
|
||||
nano ~/core_room/amar/.env # Set INIT_DB_SEED=test or prod
|
||||
nano ~/core_room/soleprint/.env # Set ROOM_NAME, ports, etc.
|
||||
```
|
||||
|
||||
## SSL Certificates
|
||||
@@ -126,10 +126,10 @@ nano ~/core_nest/pawprint/.env # Set NEST_NAME, ports, etc.
|
||||
Certificates are managed via Let's Encrypt:
|
||||
|
||||
```bash
|
||||
# Wildcard for *.nest.mcrn.ar (for amar)
|
||||
sudo certbot certonly --manual --preferred-challenges dns -d '*.nest.mcrn.ar'
|
||||
# Wildcard for *.room.mcrn.ar (for amar)
|
||||
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'
|
||||
```
|
||||
|
||||
@@ -140,12 +140,12 @@ Auto-renewal is handled by certbot systemd timer.
|
||||
### Nginx config test fails
|
||||
```bash
|
||||
sudo nginx -t
|
||||
# Fix errors in server/nginx/core_nest.conf
|
||||
# Fix errors in server/nginx/core_room.conf
|
||||
```
|
||||
|
||||
### Services won't start
|
||||
```bash
|
||||
cd ~/core_nest/ctrl
|
||||
cd ~/core_room/ctrl
|
||||
./logs.sh # Check all logs
|
||||
./logs.sh amar # Check specific service
|
||||
docker ps -a # See all containers
|
||||
@@ -154,10 +154,10 @@ docker ps -a # See all containers
|
||||
### Database issues
|
||||
```bash
|
||||
# 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)
|
||||
cd ~/core_nest
|
||||
cd ~/core_room
|
||||
docker compose -f amar/docker-compose.yml down -v
|
||||
./ctrl/start.sh amar -d
|
||||
```
|
||||
@@ -172,14 +172,14 @@ This allows ward/tester to access tests from amar_django_back_contracts without
|
||||
|
||||
```bash
|
||||
# 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
|
||||
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:**
|
||||
- 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 shared utilities (endpoints.py, helpers.py, base.py, conftest.py)
|
||||
|
||||
@@ -214,10 +214,10 @@ After setup, verify symlinks are working:
|
||||
|
||||
```bash
|
||||
# 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
|
||||
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
|
||||
open https://ward.mcrn.ar/tools/tester/
|
||||
@@ -230,5 +230,5 @@ open https://ward.mcrn.ar/tools/tester/
|
||||
- Database volumes persist in Docker volumes
|
||||
- Backup database regularly:
|
||||
```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 ~/
|
||||
echo ""
|
||||
|
||||
echo "core_nest structure (if exists):"
|
||||
if [ -d ~/core_nest ]; then
|
||||
tree ~/core_nest -L 2 -I ".git" 2>/dev/null || find ~/core_nest -maxdepth 2 -type d | sort
|
||||
echo "core_room structure (if exists):"
|
||||
if [ -d ~/core_room ]; then
|
||||
tree ~/core_room -L 2 -I ".git" 2>/dev/null || find ~/core_room -maxdepth 2 -type d | sort
|
||||
else
|
||||
echo " ~/core_nest does NOT exist"
|
||||
echo " ~/core_room does NOT exist"
|
||||
fi
|
||||
echo ""
|
||||
|
||||
echo "pawprint location:"
|
||||
if [ -d ~/pawprint ]; then
|
||||
ls -lah ~/pawprint/ | head -10
|
||||
echo "soleprint location:"
|
||||
if [ -d ~/soleprint ]; then
|
||||
ls -lah ~/soleprint/ | head -10
|
||||
echo " ..."
|
||||
else
|
||||
echo " ~/pawprint does NOT exist"
|
||||
echo " ~/soleprint does NOT exist"
|
||||
fi
|
||||
echo ""
|
||||
|
||||
@@ -60,7 +60,7 @@ docker network ls 2>/dev/null || echo " None"
|
||||
echo ""
|
||||
|
||||
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 ""
|
||||
|
||||
# =============================================================================
|
||||
@@ -80,8 +80,8 @@ echo "Sites enabled:"
|
||||
ls -lah /etc/nginx/sites-enabled/ 2>/dev/null || echo " Directory does not exist"
|
||||
echo ""
|
||||
|
||||
echo "Sites available (core_nest related):"
|
||||
ls -lah /etc/nginx/sites-available/ 2>/dev/null | grep -E "nest|amar|pawprint|artery|album|ward" || echo " None found"
|
||||
echo "Sites available (core_room related):"
|
||||
ls -lah /etc/nginx/sites-available/ 2>/dev/null | grep -E "room|amar|soleprint|artery|album|ward" || echo " None found"
|
||||
echo ""
|
||||
|
||||
# =============================================================================
|
||||
@@ -106,13 +106,13 @@ echo ""
|
||||
# =============================================================================
|
||||
echo "=== ENVIRONMENT FILES ==="
|
||||
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
|
||||
echo "$location/.env:"
|
||||
if [ -f "$location/.env" ]; then
|
||||
echo " EXISTS"
|
||||
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")"
|
||||
else
|
||||
echo " does NOT exist"
|
||||
@@ -138,8 +138,8 @@ echo ""
|
||||
# =============================================================================
|
||||
echo "=== SYSTEMD SERVICES ==="
|
||||
echo ""
|
||||
echo "Pawprint-related services:"
|
||||
systemctl list-units --type=service --all 2>/dev/null | grep -E "pawprint|artery|album|ward" || echo " None found"
|
||||
echo "Soleprint-related services:"
|
||||
systemctl list-units --type=service --all 2>/dev/null | grep -E "soleprint|artery|album|ward" || echo " None found"
|
||||
echo ""
|
||||
|
||||
# =============================================================================
|
||||
@@ -162,24 +162,24 @@ echo "=== SUMMARY ==="
|
||||
echo ""
|
||||
echo "Key Questions:"
|
||||
echo ""
|
||||
echo "1. Is there an existing core_nest deployment?"
|
||||
[ -d ~/core_nest ] && echo " YES - ~/core_nest exists" || echo " NO"
|
||||
echo "1. Is there an existing core_room deployment?"
|
||||
[ -d ~/core_room ] && echo " YES - ~/core_room exists" || echo " NO"
|
||||
echo ""
|
||||
|
||||
echo "2. Are Docker containers running?"
|
||||
docker ps -q 2>/dev/null | wc -l | xargs -I {} echo " {} containers running"
|
||||
echo ""
|
||||
|
||||
echo "3. Is nginx configured for core_nest?"
|
||||
[ -f /etc/nginx/sites-enabled/core_nest.conf ] && echo " YES - core_nest.conf installed" || echo " NO"
|
||||
echo "3. Is nginx configured for core_room?"
|
||||
[ -f /etc/nginx/sites-enabled/core_room.conf ] && echo " YES - core_room.conf installed" || echo " NO"
|
||||
echo ""
|
||||
|
||||
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 "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"
|
||||
echo ""
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Server Cleanup - Run on AWS to prepare for fresh deployment
|
||||
# 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
|
||||
|
||||
@@ -29,8 +29,8 @@ echo "Step 1: Stopping Docker containers..."
|
||||
|
||||
# Stop containers if Docker is available
|
||||
if command -v docker &> /dev/null; then
|
||||
# Stop all core_nest/amar/pawprint containers
|
||||
CONTAINERS=$(docker ps -q --filter "name=core_nest" --filter "name=amar" --filter "name=pawprint" 2>/dev/null || true)
|
||||
# Stop all core_room/amar/soleprint containers
|
||||
CONTAINERS=$(docker ps -q --filter "name=core_room" --filter "name=amar" --filter "name=soleprint" 2>/dev/null || true)
|
||||
|
||||
if [ -n "$CONTAINERS" ]; then
|
||||
echo " Stopping containers..."
|
||||
@@ -49,7 +49,7 @@ fi
|
||||
echo ""
|
||||
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
|
||||
echo " Found services: $SERVICES"
|
||||
@@ -72,12 +72,12 @@ echo "Step 3: Cleaning up old nginx configs..."
|
||||
if [ -d /etc/nginx/sites-enabled ]; then
|
||||
# Remove old individual configs
|
||||
OLD_CONFIGS=(
|
||||
"amar.nest.mcrn.ar"
|
||||
"amar.nest.mcrn.ar.conf"
|
||||
"api.amar.nest.mcrn.ar"
|
||||
"api.amar.nest.mcrn.ar.conf"
|
||||
"pawprint.mcrn.ar"
|
||||
"pawprint.mcrn.ar.conf"
|
||||
"amar.room.mcrn.ar"
|
||||
"amar.room.mcrn.ar.conf"
|
||||
"api.amar.room.mcrn.ar"
|
||||
"api.amar.room.mcrn.ar.conf"
|
||||
"soleprint.mcrn.ar"
|
||||
"soleprint.mcrn.ar.conf"
|
||||
"artery.mcrn.ar"
|
||||
"artery.mcrn.ar.conf"
|
||||
"album.mcrn.ar"
|
||||
@@ -118,24 +118,24 @@ echo "Step 4: Verifying preserved data..."
|
||||
|
||||
# Check Docker volumes
|
||||
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
|
||||
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
|
||||
|
||||
# Check .env files
|
||||
echo ""
|
||||
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
|
||||
done
|
||||
|
||||
# Check SSL certs
|
||||
echo ""
|
||||
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)"
|
||||
|
||||
# =============================================================================
|
||||
@@ -149,8 +149,8 @@ echo " 1. Deploy from local:"
|
||||
echo " ./ctrl/deploy.sh"
|
||||
echo ""
|
||||
echo " 2. Run server setup:"
|
||||
echo " cd ~/core_nest/ctrl/server && ./setup.sh"
|
||||
echo " cd ~/core_room/ctrl/server && ./setup.sh"
|
||||
echo ""
|
||||
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 ""
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# ./configure.sh
|
||||
#
|
||||
# Generates:
|
||||
# - Nginx configs for core_nest
|
||||
# - Nginx configs for core_room
|
||||
# - Validates .env files
|
||||
# - Outputs to .generated/ directory
|
||||
#
|
||||
@@ -16,9 +16,9 @@ set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
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 "This script generates configuration files for deployment."
|
||||
echo "Run as appuser (no sudo required)."
|
||||
@@ -44,19 +44,19 @@ echo " Output directory: $GEN_DIR"
|
||||
echo ""
|
||||
echo "Step 2: Loading environment..."
|
||||
|
||||
# Load core_nest/.env
|
||||
if [ -f "$CORE_NEST_ROOT/.env" ]; then
|
||||
# Load core_room/.env
|
||||
if [ -f "$CORE_ROOM_ROOT/.env" ]; then
|
||||
set -a
|
||||
source "$CORE_NEST_ROOT/.env"
|
||||
source "$CORE_ROOM_ROOT/.env"
|
||||
set +a
|
||||
echo " Loaded: core_nest/.env"
|
||||
echo " Loaded: core_room/.env"
|
||||
else
|
||||
echo " ERROR: core_nest/.env not found"
|
||||
echo " ERROR: core_room/.env not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 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=""
|
||||
for var in $REQUIRED_VARS; do
|
||||
if [ -z "${!var}" ]; then
|
||||
@@ -65,14 +65,14 @@ for var in $REQUIRED_VARS; do
|
||||
done
|
||||
|
||||
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
|
||||
fi
|
||||
|
||||
echo " NEST_NAME: $NEST_NAME"
|
||||
echo " ROOM_NAME: $ROOM_NAME"
|
||||
echo " DEPLOYMENT_NAME: $DEPLOYMENT_NAME"
|
||||
echo " MANAGED_DOMAIN: $MANAGED_DOMAIN"
|
||||
echo " PAWPRINT_DOMAIN: $PAWPRINT_DOMAIN"
|
||||
echo " SOLEPRINT_DOMAIN: $SOLEPRINT_DOMAIN"
|
||||
|
||||
# =============================================================================
|
||||
# 3. Check .env files for services
|
||||
@@ -80,8 +80,8 @@ echo " PAWPRINT_DOMAIN: $PAWPRINT_DOMAIN"
|
||||
echo ""
|
||||
echo "Step 3: Checking service .env files..."
|
||||
|
||||
for service in amar pawprint; do
|
||||
SERVICE_DIR="$CORE_NEST_ROOT/$service"
|
||||
for service in amar soleprint; do
|
||||
SERVICE_DIR="$CORE_ROOM_ROOT/$service"
|
||||
if [ ! -f "$SERVICE_DIR/.env" ]; then
|
||||
if [ -f "$SERVICE_DIR/.env.example" ]; then
|
||||
echo " Creating $service/.env from example..."
|
||||
@@ -102,8 +102,8 @@ done
|
||||
echo ""
|
||||
echo "Step 4: Generating nginx configuration..."
|
||||
|
||||
TEMPLATE="$SCRIPT_DIR/nginx/core_nest.conf.template"
|
||||
OUTPUT="$GEN_DIR/core_nest.nginx.conf"
|
||||
TEMPLATE="$SCRIPT_DIR/nginx/core_room.conf.template"
|
||||
OUTPUT="$GEN_DIR/core_room.nginx.conf"
|
||||
|
||||
if [ ! -f "$TEMPLATE" ]; then
|
||||
echo " ERROR: Template not found: $TEMPLATE"
|
||||
@@ -111,13 +111,13 @@ if [ ! -f "$TEMPLATE" ]; then
|
||||
fi
|
||||
|
||||
# Check for SSL certificates (just warn, don't fail)
|
||||
SSL_CERT_AMAR="/etc/letsencrypt/live/nest.mcrn.ar/fullchain.pem"
|
||||
SSL_KEY_AMAR="/etc/letsencrypt/live/nest.mcrn.ar/privkey.pem"
|
||||
SSL_CERT_PAWPRINT="/etc/letsencrypt/live/mcrn.ar/fullchain.pem"
|
||||
SSL_KEY_PAWPRINT="/etc/letsencrypt/live/mcrn.ar/privkey.pem"
|
||||
SSL_CERT_AMAR="/etc/letsencrypt/live/room.mcrn.ar/fullchain.pem"
|
||||
SSL_KEY_AMAR="/etc/letsencrypt/live/room.mcrn.ar/privkey.pem"
|
||||
SSL_CERT_SOLEPRINT="/etc/letsencrypt/live/mcrn.ar/fullchain.pem"
|
||||
SSL_KEY_SOLEPRINT="/etc/letsencrypt/live/mcrn.ar/privkey.pem"
|
||||
|
||||
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
|
||||
echo " ✓ $(basename $cert)"
|
||||
else
|
||||
@@ -127,8 +127,8 @@ for cert in "$SSL_CERT_AMAR" "$SSL_KEY_AMAR" "$SSL_CERT_PAWPRINT" "$SSL_KEY_PAWP
|
||||
done
|
||||
|
||||
# Generate nginx config from template
|
||||
export NEST_NAME DEPLOYMENT_NAME MANAGED_DOMAIN PAWPRINT_DOMAIN
|
||||
export SSL_CERT_AMAR SSL_KEY_AMAR SSL_CERT_PAWPRINT SSL_KEY_PAWPRINT
|
||||
export ROOM_NAME DEPLOYMENT_NAME MANAGED_DOMAIN SOLEPRINT_DOMAIN
|
||||
export SSL_CERT_AMAR SSL_KEY_AMAR SSL_CERT_SOLEPRINT SSL_KEY_SOLEPRINT
|
||||
|
||||
envsubst < "$TEMPLATE" > "$OUTPUT"
|
||||
|
||||
@@ -143,20 +143,20 @@ echo "Step 5: Generating deployment summary..."
|
||||
SUMMARY="$GEN_DIR/DEPLOYMENT.txt"
|
||||
|
||||
cat > "$SUMMARY" <<EOF
|
||||
Core Nest Deployment Configuration
|
||||
Core Room Deployment Configuration
|
||||
Generated: $(date)
|
||||
User: $USER
|
||||
Host: $(hostname)
|
||||
|
||||
=== Environment ===
|
||||
NEST_NAME=$NEST_NAME
|
||||
ROOM_NAME=$ROOM_NAME
|
||||
DEPLOYMENT_NAME=$DEPLOYMENT_NAME
|
||||
NETWORK_NAME=$NETWORK_NAME
|
||||
MANAGED_DOMAIN=$MANAGED_DOMAIN
|
||||
PAWPRINT_DOMAIN=$PAWPRINT_DOMAIN
|
||||
SOLEPRINT_DOMAIN=$SOLEPRINT_DOMAIN
|
||||
|
||||
=== 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 ===
|
||||
1. Review generated files in: $GEN_DIR
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
# Install nginx config for core_nest
|
||||
# Install nginx config for core_room
|
||||
# Run with: sudo ./install-nginx.sh
|
||||
|
||||
set -e
|
||||
@@ -8,11 +8,11 @@ set -e
|
||||
APP_USER="${APP_USER:-mariano}"
|
||||
APP_HOME="/home/${APP_USER}"
|
||||
|
||||
NGINX_SOURCE="${APP_HOME}/core_nest/ctrl/server/nginx/core_nest.conf"
|
||||
NGINX_AVAILABLE="/etc/nginx/sites-available/core_nest.conf"
|
||||
NGINX_ENABLED="/etc/nginx/sites-enabled/core_nest.conf"
|
||||
NGINX_SOURCE="${APP_HOME}/core_room/ctrl/server/nginx/core_room.conf"
|
||||
NGINX_AVAILABLE="/etc/nginx/sites-available/core_room.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 home: $APP_HOME"
|
||||
echo ""
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
# Core Nest - All Services Nginx Config
|
||||
# Single config for entire nest deployment
|
||||
# Core Room - All Services Nginx Config
|
||||
# Single config for entire room deployment
|
||||
#
|
||||
# Docker Services (primary):
|
||||
# - amar.nest.mcrn.ar (frontend:3000 + backend:8000)
|
||||
# - pawprint.mcrn.ar (port 13000)
|
||||
# - amar.room.mcrn.ar (frontend:3000 + backend:8000)
|
||||
# - soleprint.mcrn.ar (port 13000)
|
||||
# - artery.mcrn.ar (port 13001)
|
||||
# - album.mcrn.ar (port 13002)
|
||||
# - ward.mcrn.ar (port 13003)
|
||||
#
|
||||
# Bare Metal Services (fallback):
|
||||
# - pawprint.bare.mcrn.ar (port 12000)
|
||||
# - soleprint.bare.mcrn.ar (port 12000)
|
||||
# - artery.bare.mcrn.ar (port 12001)
|
||||
# - album.bare.mcrn.ar (port 12002)
|
||||
# - ward.bare.mcrn.ar (port 12003)
|
||||
@@ -19,16 +19,16 @@
|
||||
# =============================================================================
|
||||
server {
|
||||
listen 80;
|
||||
server_name amar.nest.mcrn.ar;
|
||||
server_name amar.room.mcrn.ar;
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
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_key /etc/letsencrypt/live/nest.mcrn.ar/privkey.pem;
|
||||
ssl_certificate /etc/letsencrypt/live/room.mcrn.ar/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/room.mcrn.ar/privkey.pem;
|
||||
include /etc/letsencrypt/options-ssl-nginx.conf;
|
||||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
||||
|
||||
@@ -68,20 +68,20 @@ server {
|
||||
}
|
||||
|
||||
# =============================================================================
|
||||
# PAWPRINT - Main Service
|
||||
# SOLEPRINT - Main Service
|
||||
# =============================================================================
|
||||
server {
|
||||
listen 80;
|
||||
server_name pawprint.mcrn.ar;
|
||||
server_name soleprint.mcrn.ar;
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
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_key /etc/letsencrypt/live/pawprint.mcrn.ar/privkey.pem;
|
||||
ssl_certificate /etc/letsencrypt/live/soleprint.mcrn.ar/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/soleprint.mcrn.ar/privkey.pem;
|
||||
include /etc/letsencrypt/options-ssl-nginx.conf;
|
||||
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 {
|
||||
listen 80;
|
||||
server_name pawprint.bare.mcrn.ar;
|
||||
server_name soleprint.bare.mcrn.ar;
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
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_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
|
||||
#
|
||||
# Environment variables:
|
||||
# DOMAIN_AMAR - Amar domain (e.g., amarmascotas.local.com or amar.nest.mcrn.ar)
|
||||
# DOMAIN_PAWPRINT - Pawprint domain (e.g., pawprint.local.com or pawprint.mcrn.ar)
|
||||
# DOMAIN_AMAR - Amar domain (e.g., amarmascotas.local.com or amar.room.mcrn.ar)
|
||||
# DOMAIN_SOLEPRINT - Soleprint domain (e.g., soleprint.local.com or soleprint.mcrn.ar)
|
||||
# USE_SSL - true/false - whether to use SSL
|
||||
# SSL_CERT_PATH - Path to SSL certificate (if USE_SSL=true)
|
||||
# SSL_KEY_PATH - Path to SSL key (if USE_SSL=true)
|
||||
# BACKEND_PORT - Backend port (default: 8000)
|
||||
# FRONTEND_PORT - Frontend port (default: 3000)
|
||||
# PAWPRINT_PORT - Pawprint port (default: 13000)
|
||||
# SOLEPRINT_PORT - Soleprint port (default: 13000)
|
||||
|
||||
# =============================================================================
|
||||
# AMAR - Frontend + Backend
|
||||
@@ -61,12 +61,12 @@ ${SSL_REDIRECT}
|
||||
${SSL_SERVER_BLOCK}
|
||||
|
||||
# =============================================================================
|
||||
# PAWPRINT - Main Service + Ecosystem
|
||||
# SOLEPRINT - Main Service + Ecosystem
|
||||
# =============================================================================
|
||||
server {
|
||||
listen 80;
|
||||
server_name ${DOMAIN_PAWPRINT};
|
||||
${PAWPRINT_SSL_REDIRECT}
|
||||
server_name ${DOMAIN_SOLEPRINT};
|
||||
${SOLEPRINT_SSL_REDIRECT}
|
||||
# Artery - API Gateway
|
||||
location /artery/ {
|
||||
proxy_pass http://127.0.0.1:${ARTERY_PORT}/;
|
||||
@@ -94,9 +94,9 @@ ${PAWPRINT_SSL_REDIRECT}
|
||||
proxy_set_header X-Forwarded-Proto \$scheme;
|
||||
}
|
||||
|
||||
# Pawprint - Main Service (default)
|
||||
# Soleprint - Main Service (default)
|
||||
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 X-Real-IP \$remote_addr;
|
||||
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
|
||||
# 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 {
|
||||
listen 80;
|
||||
@@ -108,15 +108,15 @@ server {
|
||||
}
|
||||
|
||||
# =============================================================================
|
||||
# PAWPRINT - Main Service + Ecosystem
|
||||
# SOLEPRINT - Main Service + Ecosystem
|
||||
# =============================================================================
|
||||
server {
|
||||
listen 80;
|
||||
server_name ${PAWPRINT_DOMAIN};
|
||||
server_name ${SOLEPRINT_DOMAIN};
|
||||
|
||||
# Artery - API Gateway
|
||||
location /artery/ {
|
||||
proxy_pass http://${NEST_NAME}_artery:8000/;
|
||||
proxy_pass http://${ROOM_NAME}_artery:8000/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
@@ -125,7 +125,7 @@ server {
|
||||
|
||||
# Album - Media Service
|
||||
location /album/ {
|
||||
proxy_pass http://${NEST_NAME}_album:8000/;
|
||||
proxy_pass http://${ROOM_NAME}_album:8000/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
@@ -134,16 +134,16 @@ server {
|
||||
|
||||
# Ward - Admin Interface
|
||||
location /ward/ {
|
||||
proxy_pass http://${NEST_NAME}_ward:8000/;
|
||||
proxy_pass http://${ROOM_NAME}_ward:8000/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
# Pawprint - Main Service (default)
|
||||
# Soleprint - Main Service (default)
|
||||
location / {
|
||||
proxy_pass http://${NEST_NAME}_pawprint:8000;
|
||||
proxy_pass http://${ROOM_NAME}_soleprint:8000;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
# Nginx Config Template for Docker
|
||||
# Uses environment variables from .env files
|
||||
# Variables: DEPLOYMENT_NAME, MANAGED_DOMAIN, PAWPRINT_DOMAIN, MANAGED_*
|
||||
# Variables: DEPLOYMENT_NAME, MANAGED_DOMAIN, SOLEPRINT_DOMAIN, MANAGED_*
|
||||
|
||||
# =============================================================================
|
||||
# MANAGED DOMAIN
|
||||
# =============================================================================
|
||||
# Completely defined by the parent deployment (e.g., core_nest)
|
||||
# Pawprint doesn't know or care about the managed app's structure
|
||||
# Completely defined by the parent deployment (e.g., core_room)
|
||||
# Soleprint doesn't know or care about the managed app's structure
|
||||
server {
|
||||
listen 80;
|
||||
server_name ${MANAGED_DOMAIN};
|
||||
@@ -16,11 +16,11 @@ server {
|
||||
}
|
||||
|
||||
# =============================================================================
|
||||
# PAWPRINT - Main Service + Ecosystem
|
||||
# SOLEPRINT - Main Service + Ecosystem
|
||||
# =============================================================================
|
||||
server {
|
||||
listen 80;
|
||||
server_name ${PAWPRINT_DOMAIN};
|
||||
server_name ${SOLEPRINT_DOMAIN};
|
||||
|
||||
# Artery - API Gateway
|
||||
location /artery/ {
|
||||
@@ -49,9 +49,9 @@ server {
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
# Pawprint - Main Service (default)
|
||||
# Soleprint - Main Service (default)
|
||||
location / {
|
||||
proxy_pass http://${DEPLOYMENT_NAME}_pawprint:8000;
|
||||
proxy_pass http://${DEPLOYMENT_NAME}_soleprint:8000;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
||||
@@ -16,7 +16,7 @@ if [ "$ENABLE_WRAPPER" != "true" ]; then
|
||||
fi
|
||||
|
||||
# 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"
|
||||
|
||||
echo "Nginx config generated (ENABLE_WRAPPER=$ENABLE_WRAPPER)"
|
||||
|
||||
@@ -19,13 +19,13 @@ echo "=== Setting up Test Directory Symlinks ==="
|
||||
echo ""
|
||||
|
||||
# Check if we're on the server
|
||||
if [ ! -d "$HOME/core_nest" ]; then
|
||||
echo "Error: ~/core_nest directory not found"
|
||||
if [ ! -d "$HOME/core_room" ]; then
|
||||
echo "Error: ~/core_room directory not found"
|
||||
echo "This script should run on the AWS server after deployment"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd "$HOME/core_nest"
|
||||
cd "$HOME/core_room"
|
||||
|
||||
# =============================================================================
|
||||
# Test Directory Symlinks
|
||||
@@ -34,7 +34,7 @@ echo "Step 1: Creating symlinks for test directories..."
|
||||
echo ""
|
||||
|
||||
# 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"
|
||||
|
||||
# Create ward tests directory if it doesn't exist
|
||||
@@ -71,7 +71,7 @@ else
|
||||
fi
|
||||
|
||||
# Create relative symlink
|
||||
# From: pawprint/src/ward/tools/tester/tests/
|
||||
# From: soleprint/src/ward/tools/tester/tests/
|
||||
# To: amar/src/back/tests/contracts/
|
||||
# Relative path: ../../../../../amar/src/back/tests/contracts/
|
||||
$DRY_RUN ln -s "../../../../../$CONTRACTS_SOURCE/$domain_name" "$target_link"
|
||||
@@ -102,11 +102,11 @@ echo ""
|
||||
# =============================================================================
|
||||
# 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 ""
|
||||
|
||||
BARE_WARD_TESTS="$HOME/pawprint/ward/tools/tester/tests"
|
||||
BARE_WARD_TESTS="$HOME/soleprint/ward/tools/tester/tests"
|
||||
|
||||
if [ ! -d "$BARE_WARD_TESTS" ]; then
|
||||
$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
|
||||
# Or we can sync tests separately (handled 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
|
||||
echo "Step 2: Bare metal path not found, skipping"
|
||||
fi
|
||||
@@ -153,7 +153,7 @@ echo " 1. Verify symlinks are working:"
|
||||
echo " ls -lah $WARD_TESTS_DIR"
|
||||
echo ""
|
||||
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 " 3. Test in browser:"
|
||||
echo " https://ward.mcrn.ar/tools/tester/"
|
||||
|
||||
@@ -18,7 +18,7 @@ set -e
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
GEN_DIR="$SCRIPT_DIR/.generated"
|
||||
|
||||
echo "=== Core Nest Setup (System Configuration) ==="
|
||||
echo "=== Core Room Setup (System Configuration) ==="
|
||||
echo ""
|
||||
|
||||
# Must run as root
|
||||
@@ -44,7 +44,7 @@ echo "User home: $ACTUAL_HOME"
|
||||
echo ""
|
||||
|
||||
# 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 ""
|
||||
echo "Run ./configure.sh first (as $ACTUAL_USER):"
|
||||
@@ -120,9 +120,9 @@ fi
|
||||
echo ""
|
||||
echo "Step 2: Installing nginx configuration..."
|
||||
|
||||
NGINX_AVAILABLE="/etc/nginx/sites-available/core_nest.conf"
|
||||
NGINX_ENABLED="/etc/nginx/sites-enabled/core_nest.conf"
|
||||
SOURCE_CONFIG="$GEN_DIR/core_nest.nginx.conf"
|
||||
NGINX_AVAILABLE="/etc/nginx/sites-available/core_room.conf"
|
||||
NGINX_ENABLED="/etc/nginx/sites-enabled/core_room.conf"
|
||||
SOURCE_CONFIG="$GEN_DIR/core_room.nginx.conf"
|
||||
|
||||
# Copy generated config
|
||||
cp "$SOURCE_CONFIG" "$NGINX_AVAILABLE"
|
||||
@@ -171,7 +171,7 @@ echo ""
|
||||
echo "Step 4: SSL certificates..."
|
||||
|
||||
SSL_CERTS=(
|
||||
"/etc/letsencrypt/live/nest.mcrn.ar"
|
||||
"/etc/letsencrypt/live/room.mcrn.ar"
|
||||
"/etc/letsencrypt/live/mcrn.ar"
|
||||
)
|
||||
|
||||
@@ -188,7 +188,7 @@ done
|
||||
if [ "$ALL_EXIST" = false ]; then
|
||||
echo ""
|
||||
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 ""
|
||||
echo " After generating, reload nginx:"
|
||||
@@ -212,6 +212,6 @@ echo " 2. Generate SSL certificates if missing (see above)"
|
||||
echo ""
|
||||
echo " 3. Deploy application:"
|
||||
echo " su - $ACTUAL_USER"
|
||||
echo " cd $ACTUAL_HOME/core_nest/ctrl"
|
||||
echo " cd $ACTUAL_HOME/core_room/ctrl"
|
||||
echo " ./deploy.sh"
|
||||
echo ""
|
||||
|
||||
Reference in New Issue
Block a user