mirror of
https://github.com/DeNNiiInc/Advanced-Smtp-Tester.git
synced 2026-04-17 17:35:59 +00:00
1.9 KiB
1.9 KiB
🚀 Proxmox Deployment Automation (TurnKey Node.js)
Use this guide to deploy your project to a TurnKey Linux LXC Container.
This project uses an automated deployment system that handles:
- Initial server setup (Dependencies, Nginx, PM2, Cron).
- Automatic updates via Git (Every 5 minutes).
- Seamess updates using PM2.
📋 Prerequisites
- Server: A Proxmox TurnKey Node.js Container.
- Access: Root SSH password for the container.
- Local Files: Ensure you have
deploy-secrets.jsoncreated (see below).
🛠️ Step 1: Configure Secrets
Create a file named deploy-secrets.json in the project root. This file is gitignored and safe to store locally.
{
"host": "172.16.69.217",
"username": "root",
"password": "YOUR_SSH_PASSWORD",
"gitUser": "YOUR_GITHUB_EMAIL",
"gitToken": "YOUR_GITHUB_TOKEN",
"repoUrl": "https://github.com/YOUR_ORG/YOUR_REPO.git"
}
🚀 Step 2: Run Deployment
Open PowerShell in the project root and run:
./deploy-to-proxmox.ps1
That's it! The script will:
- Connect to your server.
- Clone the repository using your token.
- Install all dependencies (Git, Nginx, PM2).
- Configure Nginx as a reverse proxy (Port 80 -> 4001).
- Set up a Cron job to auto-sync changes every 5 minutes.
🔄 How Updates Work
The server runs a cron job (scripts/sync-and-restart.sh) every 5 minutes that:
- Checks GitHub for changes.
- If changes are found:
- Pulls the new code.
- Installs dependencies (if
package.jsonchanged). - Restarts the application via PM2.
To update your live site, simply Push to GitHub and wait ~5 minutes.
<EFBFBD> Troubleshooting
View Logs:
ssh root@<SERVER_IP> "cat /var/log/smtp-tester-sync.log"
Manual Update:
ssh root@<SERVER_IP> "/var/www/Advanced-Smtp-Tester/scripts/sync-and-restart.sh"