CICD Mothership¶
The TAPPaaS CICD "mothership" is the central control VM that manages your entire TAPPaaS infrastructure through automation and configuration management.
Overview¶
The implementation involves three phases:
- VM Creation - Deploy from the NixOS template
- System Configuration - Configure git repository and NixOS settings
- Tool Installation - Set up CI/CD pipelines and utilities
Prerequisites¶
- NixOS Template created
- Firewall accessible
- Git repository access configured
Deploy the VM¶
Download Configuration¶
On a Proxmox host:
mkdir -p ~/tappaas
REPO="https://raw.githubusercontent.com/TAPPaaS/TAPPaaS/"
BRANCH="main"
curl -fsSL ${REPO}${BRANCH}/src/foundation/30-tappaas-cicd/tappaas-cicd.json \
> ~/tappaas/tappaas-cicd.json
Clone from Template¶
Get VM IP¶
Once the VM boots, find its IP address:
- Check DHCP leases in OPNsense, or
- View the VM console in Proxmox
Connect via SSH¶
Initial Configuration¶
Run Setup Script¶
REPO="https://raw.githubusercontent.com/TAPPaaS/TAPPaaS/"
REPOTOCLONE="https://github.com/TAPPaaS/TAPPaaS.git"
BRANCH="main"
curl -fsSL "${REPO}${BRANCH}/src/foundation/30-tappaas-cicd/install1.sh" \
-o /tmp/install1.sh
bash /tmp/install1.sh "$REPOTOCLONE" "$BRANCH"
This script:
- Sets the hostname
- Clones the TAPPaaS repository
- Configures NixOS integration
Reboot¶
After reboot, verify connectivity using the FQDN:
Firewall Integration¶
SSH Authentication¶
Set up SSH key authentication to OPNsense:
- Enable SSH in OPNsense:
- Navigate to System → Settings → Administration
- Enable "Secure Shell"
-
Disable password authentication
-
Install Public Key:
-
Add the tappaas-cicd public key to root's authorized_keys in OPNsense
-
Test Connection:
ssh [email protected] "echo 'SSH working'"
API Access¶
Create API credentials for automation:
- In OPNsense, navigate to System → Access → Users
- Create user
tappaaswith admin privileges - Generate API key and secret
- Store credentials on the CICD VM:
cat > ~/.opnsense-credentials.txt << EOF
key=your-api-key
secret=your-api-secret
EOF
chmod 600 ~/.opnsense-credentials.txt
Program Installation¶
Run Main Deployment¶
cd TAPPaaS/src/foundation/30-tappaas-cicd
# Set your environment variables
UPSTREAMGIT="github.com/TAPPaaS/TAPPaaS"
BRANCH="main"
DOMAIN="yourdomain.com"
EMAIL="[email protected]"
SCHEDULE="weekly"
./install2.sh $UPSTREAMGIT $BRANCH $DOMAIN $EMAIL $SCHEDULE
This script installs and configures:
- Caddy reverse proxy
- Automation pipelines
- Scheduled maintenance tasks
Reverse Proxy Configuration¶
Reassign OPNsense Port¶
Move OPNsense web interface off port 443:
- Navigate to System → Settings → Administration
- Change "TCP Port" to
8443 - Save and apply
Configure Caddy¶
Access OPNsense and configure Caddy:
- Navigate to Services → Caddy Web Server → General Settings
- Enable Caddy
- Set ACME email address
Add Domain Handlers¶
Configure reverse proxy for your services in Caddy's domain configuration.
Verification¶
Verify the CICD system is operational:
# Check services
systemctl status
# Verify git repository
cd ~/TAPPaaS && git status
# Test automation
./test-automation.sh
Next Steps¶
Continue to Backup configuration.