mirror of
https://github.com/myronblair/infra
synced 2026-06-30 17:50:10 -05:00
Initial infra: cron, systemd units, agent config template, README
This commit is contained in:
@@ -0,0 +1,20 @@
|
|||||||
|
# DO Server Infrastructure
|
||||||
|
|
||||||
|
DigitalOcean server at 165.22.1.228 (CyberPanel / OpenLiteSpeed).
|
||||||
|
|
||||||
|
## Directory Structure
|
||||||
|
- `cron/` — Root crontab (CyberPanel + JARVIS entries)
|
||||||
|
- `systemd/` — Custom systemd service units
|
||||||
|
- `agent/` — JARVIS agent config template
|
||||||
|
|
||||||
|
## Deploy workflow
|
||||||
|
1. Edit code in site repos (myronblair/*)
|
||||||
|
2. `git push origin main`
|
||||||
|
3. On server: `cd /home/<site>/public_html && git pull origin main`
|
||||||
|
|
||||||
|
## JARVIS agent install
|
||||||
|
```bash
|
||||||
|
cp agent/config.json /opt/jarvis-agent/config.json
|
||||||
|
systemctl enable jarvis-agent
|
||||||
|
systemctl start jarvis-agent
|
||||||
|
```
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"server_url": "https://165.22.1.228",
|
||||||
|
"host_header": "jarvis.orbishosting.com",
|
||||||
|
"registration_key": "REPLACE_WITH_AGENT_REGISTRATION_KEY",
|
||||||
|
"agent_type": "linux",
|
||||||
|
"heartbeat_interval": 10,
|
||||||
|
"metrics_interval": 30
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
|
||||||
|
0 * * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/findBWUsage.py >/dev/null 2>&1
|
||||||
|
0 * * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/postfixSenderPolicy/client.py hourlyCleanup >/dev/null 2>&1
|
||||||
|
0 0 1 * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/postfixSenderPolicy/client.py monthlyCleanup >/dev/null 2>&1
|
||||||
|
0 2 * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/upgradeCritical.py >/dev/null 2>&1
|
||||||
|
0 0 * * 4 /usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/renew.py >/dev/null 2>&1
|
||||||
|
7 0 * * * "/root/.acme.sh"/acme.sh --cron --home "/root/.acme.sh" > /dev/null
|
||||||
|
0 0 * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/IncBackups/IncScheduler.py Daily
|
||||||
|
0 0 * * 0 /usr/local/CyberCP/bin/python /usr/local/CyberCP/IncBackups/IncScheduler.py Weekly
|
||||||
|
|
||||||
|
*/30 * * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/IncBackups/IncScheduler.py '30 Minutes'
|
||||||
|
0 * * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/IncBackups/IncScheduler.py '1 Hour'
|
||||||
|
0 */6 * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/IncBackups/IncScheduler.py '6 Hours'
|
||||||
|
0 */12 * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/IncBackups/IncScheduler.py '12 Hours'
|
||||||
|
0 1 * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/IncBackups/IncScheduler.py '1 Day'
|
||||||
|
0 0 */3 * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/IncBackups/IncScheduler.py '3 Days'
|
||||||
|
0 0 * * 0 /usr/local/CyberCP/bin/python /usr/local/CyberCP/IncBackups/IncScheduler.py '1 Week'
|
||||||
|
|
||||||
|
*/3 * * * * if ! find /home/*/public_html/ -maxdepth 2 -type f -newer /usr/local/lsws/cgid -name '.htaccess' -exec false {} +; then systemctl restart lsws; fi
|
||||||
|
09,39 * * * * /usr/local/CyberCP/bin/cleansessions >/dev/null 2>&1
|
||||||
|
|
||||||
|
* * * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/manage.py run_scheduled_scans >/usr/local/lscp/logs/scheduled_scans.log 2>&1
|
||||||
|
|
||||||
|
*/5 * * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/pdnsHealthCheck.py >/dev/null 2>&1
|
||||||
|
*/3 * * * * /usr/local/lsws/lsphp85/bin/lsphp /home/jarvis.orbishosting.com/api/endpoints/facts_collector.php >> /home/jarvis.orbishosting.com/logs/cron.log 2>&1
|
||||||
|
*/5 * * * * /usr/local/lsws/lsphp85/bin/lsphp /home/jarvis.orbishosting.com/api/endpoints/stats_cache.php >> /home/jarvis.orbishosting.com/logs/cron.log 2>&1
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=The DigitalOcean Monitoring Agent
|
||||||
|
After=network-online.target
|
||||||
|
Wants=network-online.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=do-agent
|
||||||
|
ExecStart=/opt/digitalocean/bin/do-agent --syslog
|
||||||
|
Restart=always
|
||||||
|
|
||||||
|
OOMScoreAdjust=-900
|
||||||
|
SyslogIdentifier=DigitalOceanAgent
|
||||||
|
PrivateTmp=yes
|
||||||
|
ProtectSystem=full
|
||||||
|
ProtectHome=yes
|
||||||
|
NoNewPrivileges=yes
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=The DigitalOcean Droplet Agent
|
||||||
|
After=network-online.target
|
||||||
|
Wants=network-online.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=root
|
||||||
|
Environment=TERM=xterm-256color
|
||||||
|
ExecStart=/opt/digitalocean/bin/droplet-agent
|
||||||
|
Restart=always
|
||||||
|
RestartSec=10
|
||||||
|
TimeoutStopSec=90
|
||||||
|
KillMode=process
|
||||||
|
|
||||||
|
OOMScoreAdjust=-900
|
||||||
|
SyslogIdentifier=DropletAgent
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=FastAPI SSH Web Terminal Server
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
WorkingDirectory=/usr/local/CyberCP
|
||||||
|
ExecStart=/usr/local/CyberCP/bin/python3 -m uvicorn fastapi_ssh_server:app --host 0.0.0.0 --port 8888 --ssl-keyfile=/usr/local/lscp/conf/key.pem --ssl-certfile=/usr/local/lscp/conf/cert.pem
|
||||||
|
Restart=on-failure
|
||||||
|
User=root
|
||||||
|
Group=root
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=JARVIS Agent
|
||||||
|
After=network-online.target
|
||||||
|
Wants=network-online.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
ExecStart=/usr/bin/python3 /usr/local/bin/jarvis-agent.py
|
||||||
|
Restart=always
|
||||||
|
RestartSec=30
|
||||||
|
User=root
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
Reference in New Issue
Block a user