README.md > Update o2switch

This commit is contained in:
2026-07-31 01:47:18 +02:00
parent 40006e1719
commit 9a49edce52
+5 -6
View File
@@ -13,11 +13,10 @@
1. Upload the project (excluding `node_modules/`) via SSH/Git. 1. Upload the project (excluding `node_modules/`) via SSH/Git.
2. Create/adjust `.env` on the server with production values (`STORAGE_DIR` pointing to a writable path under your account, MariaDB credentials from cPanel). 2. Create/adjust `.env` on the server with production values (`STORAGE_DIR` pointing to a writable path under your account, MariaDB credentials from cPanel).
3. Apply `db/schema.sql` to the MariaDB database created in cPanel. 3. `npm install --include=dev` (never with `--ignore-scripts` — Puppeteer needs its postinstall step to download Chromium).
4. `npm install` (never with `--ignore-scripts` — Puppeteer needs its postinstall step to download Chromium). 4. Configure the app in cPanel "Setup Node.js App", pointing its entry point at `src/server.js`. Passenger manages this process (start/stop/restart).
5. Configure the app in cPanel "Setup Node.js App", pointing its entry point at `src/server.js`. Passenger manages this process (start/stop/restart). 5. Start the worker independently of Passenger, over SSH: `./node_modules/.bin/pm2 start ecosystem.config.cjs`, then `pm2 save`. Try `pm2 startup` to survive a server reboot; if that's not permitted without root on this account, fall back to a cPanel cron job every 5 minutes that runs `pm2 resurrect` (or checks `pm2 list` and restarts the app if absent) — validate which option this hosting plan actually allows once connected over SSH.
6. Start the worker independently of Passenger, over SSH: `./node_modules/.bin/pm2 start ecosystem.config.cjs`, then `pm2 save`. Try `pm2 startup` to survive a server reboot; if that's not permitted without root on this account, fall back to a cPanel cron job every 5 minutes that runs `pm2 resurrect` (or checks `pm2 list` and restarts the app if absent) — validate which option this hosting plan actually allows once connected over SSH. 6. Add a cPanel cron job to run the cleanup script periodically, e.g. every 15 minutes:
7. Add a cPanel cron job to run the cleanup script periodically, e.g. every 15 minutes:
`*/15 * * * * cd /home/gaan6043/convert.ombrora.com-node && /home/gaan6043/nodevenv/convert.ombrora.com-node/24/bin/node src/cleanup.js > /dev/null` `*/15 * * * * cd /home/gaan6043/convert.ombrora.com-node && /home/gaan6043/nodevenv/convert.ombrora.com-node/24/bin/node src/cleanup.js > /dev/null`
(adjust the path and node binary location to match your actual account — check with `which node` over SSH). (adjust the path and node binary location to match your actual account — check with `which node` over SSH).
8. On every subsequent deployment: pull changes, `npm install`, `npm run build` (frontend), then restart the Passenger app from cPanel and `pm2 restart convert-worker`. 7. On every subsequent deployment: pull changes, `npm install`, `npm run build` (frontend), then restart the Passenger app from cPanel and `pm2 restart convert-worker`.