2026-02-01 13:24:03 +00:00
---
description: Development workflow and deployment practices for Archipelago
alwaysApply: true
---
2026-02-01 05:42:05 +00:00
# Archipelago Development Workflow
2026-02-01 13:24:03 +00:00
## Deployment Strategy
2026-02-01 05:42:05 +00:00
2026-02-01 13:24:03 +00:00
**Always deploy to live system for testing** - The target device (192.168.1.228) is a development machine, so deploy changes directly to the live system rather than using dev servers.
2026-02-01 05:42:05 +00:00
2026-02-01 13:24:03 +00:00
### Standard Deployment Command
2026-02-01 05:42:05 +00:00
2026-02-01 13:24:03 +00:00
```bash
./scripts/deploy-to-target.sh --live
2026-02-01 05:42:05 +00:00
```
2026-02-01 13:24:03 +00:00
This command:
1. Syncs code from local Mac to remote target
2. Builds frontend (Vue.js) and backend (Rust)
3. Deploys to live paths:
- Frontend: `/opt/archipelago/web-ui/`
- Backend: `/usr/local/bin/archipelago`
4. Restarts services (systemd + nginx)
2026-02-01 05:42:05 +00:00
2026-02-01 13:24:03 +00:00
### Target Environment
2026-02-01 05:42:05 +00:00
2026-02-01 13:24:03 +00:00
- **Host**: archipelago@192.168.1.228
- **OS**: Debian-based server
- **Container Runtime**: Podman (root context for system services)
- **Web Server**: Nginx
- **Backend**: Systemd service (`archipelago.service`) running as root
2026-02-01 05:42:05 +00:00
2026-02-01 13:24:03 +00:00
## SSH Key Management
2026-02-01 05:42:05 +00:00
2026-02-01 13:24:03 +00:00
The deployment scripts require SSH key authentication. If you encounter `Permission denied` errors:
2026-02-01 05:42:05 +00:00
2026-02-01 13:24:03 +00:00
1. Ensure SSH key is loaded: `ssh-add -l`
2. Add key if needed: `ssh-add ~/.ssh/id_ed25519`
3. Enter passphrase when prompted
2026-02-01 05:42:05 +00:00
2026-02-01 13:24:03 +00:00
## Development Paths
2026-02-01 05:42:05 +00:00
2026-02-01 13:24:03 +00:00
### Local (Mac)
- Project root: `/Users/dorian/Projects/archy`
- Frontend: `neode-ui/`
- Backend: `core/`
- Scripts: `scripts/`
- ISO Build: `image-recipe/`
2026-02-01 05:42:05 +00:00
2026-02-01 13:24:03 +00:00
### Remote (Target)
- Dev directory: `~/archy/`
- Live frontend: `/opt/archipelago/web-ui/`
- Live backend: `/usr/local/bin/archipelago`
- Data: `/var/lib/archipelago/`
- Systemd service: `/etc/systemd/system/archipelago.service`
- Nginx config: `/etc/nginx/sites-available/archipelago`
## Testing Workflow
1. Make changes locally
2. Deploy with `--live` flag
3. Test at http://192.168.1.228
4. Check logs if needed:
- Backend: `ssh archipelago@192.168.1.228 'sudo journalctl -u archipelago -f'`
- Nginx: `ssh archipelago@192.168.1.228 'sudo tail -f /var/log/nginx/error.log'`
5. **Sync changes back to ISO build** (see below)
2026-02-01 05:42:05 +00:00
2026-02-01 13:24:03 +00:00
## Running Containers
Check container status:
2026-02-01 05:42:05 +00:00
```bash
2026-02-01 13:24:03 +00:00
ssh archipelago@192.168.1.228 'sudo podman ps'
```
2026-02-01 05:42:05 +00:00
2026-02-01 13:24:03 +00:00
Common containers:
- Home Assistant (port 8123)
- Bitcoin Knots (ports 8332, 8333)
- LND (ports 9735, 10009)
2026-02-01 05:42:05 +00:00
2026-02-01 13:24:03 +00:00
## ISO Build Integration
2026-02-01 05:42:05 +00:00
2026-02-01 13:24:03 +00:00
**CRITICAL**: After testing on the live server, always update the ISO build to include your changes.
2026-02-01 05:42:05 +00:00
2026-02-01 13:24:03 +00:00
### System Configuration Files to Sync
2026-02-01 05:42:05 +00:00
2026-02-01 13:24:03 +00:00
When you make system-level changes on the live server, capture them for the ISO build:
2026-02-01 05:42:05 +00:00
2026-02-01 13:24:03 +00:00
1. **Systemd Service** (`/etc/systemd/system/archipelago.service`)
- Location in repo: `image-recipe/configs/archipelago.service`
- Capture command: `ssh archipelago@192.168.1.228 'sudo cat /etc/systemd/system/archipelago.service' > image-recipe/configs/archipelago.service`
2026-02-01 05:42:05 +00:00
2026-02-01 13:24:03 +00:00
2. **Nginx Configuration** (`/etc/nginx/sites-available/archipelago`)
- Location in repo: `image-recipe/configs/nginx-archipelago.conf`
- Capture command: `ssh archipelago@192.168.1.228 'sudo cat /etc/nginx/sites-available/archipelago' > image-recipe/configs/nginx-archipelago.conf`
3. **Other System Files**
- Logrotate: `image-recipe/configs/logrotate.conf`
- Any new scripts in `/opt/archipelago/scripts/`
### Build Process Checklist
Before building a new ISO, ensure:
- [ ] Latest backend built: `cd image-recipe && ./scripts/build-backend.sh`
- [ ] Latest frontend built: `cd image-recipe && ./scripts/build-frontend.sh`
- [ ] System configs synced from live server
- [ ] Integration script updated: `./integrate-archipelago.sh`
- [ ] ISO built: `./build-debian-iso.sh`
- [ ] ISO tested in QEMU: `./test-iso-qemu.sh`
2026-02-01 05:42:05 +00:00
2026-02-01 13:24:03 +00:00
### Key Configuration Values
2026-02-01 05:42:05 +00:00
2026-02-01 13:24:03 +00:00
**Backend Service (archipelago.service)**:
- **User**: `root` (required to access root Podman containers)
- **Environment**:
- `ARCHIPELAGO_BIND=0.0.0.0:5678`
- `ARCHIPELAGO_DEV_MODE=true` (for container auto-detection)
2026-02-01 05:42:05 +00:00
2026-02-01 13:24:03 +00:00
**Nginx Configuration**:
- Serves frontend from `/opt/archipelago/web-ui`
- Proxies `/rpc/` to backend at `127.0.0.1:5678`
- Proxies `/ws` for WebSocket connections
2026-02-01 05:42:05 +00:00
2026-02-01 13:24:03 +00:00
### Deployment Paths in ISO
2026-02-01 05:42:05 +00:00
2026-02-01 13:24:03 +00:00
The ISO build must install files to:
- `/usr/local/bin/archipelago` - Backend binary
- `/opt/archipelago/web-ui/` - Frontend files
- `/etc/systemd/system/archipelago.service` - Service definition
- `/etc/nginx/sites-available/archipelago` - Nginx config
- `/opt/archipelago/` - Base directory for scripts and data
2026-02-01 05:42:05 +00:00
2026-02-01 13:24:03 +00:00
## Common Issues
2026-02-01 05:42:05 +00:00
2026-02-01 13:24:03 +00:00
### Container Detection
- Containers must be in **root Podman context** (started with `sudo podman`)
- Backend must run as **root** to see root containers
- Check: `sudo podman ps` (should show containers)
- Check: `podman ps` (should be empty if using root containers)
2026-02-01 05:42:05 +00:00
2026-02-01 13:24:03 +00:00
### Service Not Starting
- Check systemd status: `sudo systemctl status archipelago`
- Check logs: `sudo journalctl -u archipelago -n 50`
- Verify binary: `ls -lh /usr/local/bin/archipelago`
- Test manually: `sudo /usr/local/bin/archipelago`