Skip to content

A self-hosted UPI & COD payment gateway with zero per-transaction platform fees, universal JavaScript checkout integration, dynamic QR payments, WhatsApp OTP authentication, and automated payment verification.

JavaScript
4.1 KB
Raw Blame

Mitto Pay — Controlled Staging Deployment Runbook

Target Host: Oracle VM 130.210.28.51 ([email protected])
Service: youpi-staging.service (/etc/systemd/system/youpi-staging.service)
Environment File: /etc/youpi/staging.env
Deploy Path: /opt/youpi-pg
Release Artifact: reports/mitto-pay-rc1.tar.gz
Artifact SHA-256: 9fd6ed79082c25430d55f89590bfc09f515b54fd782bb2e97d8c4be1de18c07b
Authorization Status: PENDING EXPLICIT DEPLOYMENT APPROVAL (DO NOT EXECUTE WITHOUT AUTHORIZATION)


1. Pre-Deployment Readiness Verification

Before copying any files or modifying configuration:

  1. Verify SSH Access & Health:
    ssh -i ~/.ssh/id_ed25519_oracle_staging [email protected] "uptime && df -h / && systemctl status youpi-staging.service --no-pager"
    
  2. Verify Backup Integrity: Confirm /opt/youpi-pg-backup-pre-gate4 exists and is intact:
    ssh -i ~/.ssh/id_ed25519_oracle_staging [email protected] "ls -la /opt/youpi-pg-backup-pre-gate4/DEPLOYED_COMMIT"
    

2. Staging Environment Configuration Patch

Prepare /etc/youpi/staging.env to enforce canary isolation before starting the new release.

  1. Add Canary Variables to /etc/youpi/staging.env:
    # Add without displaying or printing existing secrets:
    sudo sed -i '/CANARY_/d' /etc/youpi/staging.env
    echo "CANARY_MODE=true" | sudo tee -a /etc/youpi/staging.env > /dev/null
    echo "CANARY_MERCHANT_ALLOWLIST=VVANFTTKRA" | sudo tee -a /etc/youpi/staging.env > /dev/null
    echo "YOUPI_VERIFICATION_POLICY=REQUIRE_DUAL_CHANNEL" | sudo tee -a /etc/youpi/staging.env > /dev/null
    
  2. Validate Configuration Flags:
    sudo grep -E 'CANARY_|VERIFICATION_POLICY' /etc/youpi/staging.env
    
    Expected output:
    CANARY_MODE=true
    CANARY_MERCHANT_ALLOWLIST=VVANFTTKRA
    YOUPI_VERIFICATION_POLICY=REQUIRE_DUAL_CHANNEL
    

3. Atomic Deployment Procedure

  1. Upload Artifact to VM Staging Directory:

    scp -i ~/.ssh/id_ed25519_oracle_staging reports/mitto-pay-rc1.tar.gz [email protected]:/tmp/mitto-pay-rc1.tar.gz
    scp -i ~/.ssh/id_ed25519_oracle_staging reports/mitto-pay-rc1.tar.gz.sha256 [email protected]:/tmp/mitto-pay-rc1.tar.gz.sha256
    
  2. Verify Checksum on VM:

    ssh -i ~/.ssh/id_ed25519_oracle_staging [email protected] "cd /tmp && sha256sum -c mitto-pay-rc1.tar.gz.sha256"
    

    Must output: mitto-pay-rc1.tar.gz: OK. If checksum fails, abort immediately.

  3. Create Pre-Canary Snapshot Backup:

    ssh -i ~/.ssh/id_ed25519_oracle_staging [email protected] "sudo cp -r /opt/youpi-pg /opt/youpi-pg-backup-pre-mitto-canary"
    
  4. Stop Service & Extract Release:

    ssh -i ~/.ssh/id_ed25519_oracle_staging [email protected] "
      sudo systemctl stop youpi-staging.service
      sudo tar -xzf /tmp/mitto-pay-rc1.tar.gz -C /opt/youpi-pg
      sudo chown -R ubuntu:ubuntu /opt/youpi-pg
      echo 'mitto-pay-rc1-9fd6ed79' | sudo tee /opt/youpi-pg/DEPLOYED_COMMIT > /dev/null
      sudo systemctl start youpi-staging.service
    "
    

4. Post-Deployment Verification & Health Checks

  1. Service Readiness & Logs:
    ssh -i ~/.ssh/id_ed25519_oracle_staging [email protected] "
      systemctl is-active youpi-staging.service
      sudo journalctl -u youpi-staging.service -n 30 --no-pager
    "
    
  2. API Health Endpoint Check:
    ssh -i ~/.ssh/id_ed25519_oracle_staging [email protected] "curl -sSf http://127.0.0.1:6100/api/v1/health"
    
  3. Canary Isolation Synthetic Verification (Non-Production Traffic):
    • Attempt creating payment for unauthorized merchant -> Expect HTTP 403 CANARY_MERCHANT_UNAUTHORIZED.
    • Attempt creating payment for VVANFTTKRA -> Expect HTTP 201.
    • Simulate single SMS alert -> Expect session status remains PROCESSING (Level 1).
    • Simulate secondary Gmail confirmation -> Expect session status advances to SUCCESS (Level 2).
  4. V-Visa Gateway Check:
    • Confirm V-Visa order endpoint still defaults to Zoho Payments.