Add VM configs, WireGuard, and MSP360 setup

- vm-configs/fstab/: fstab snapshots for JARVIS, NPM, NovaCPX, Jellyfin, MediaStack
- vm-configs/network-reference.md: full IP/service/NAS/WireGuard reference
- wireguard/: MediaStack wg0/wg1 and WireGuard CT nord0/wg-clients configs
- msp360/: install and setup scripts + staggered backup schedule

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X8tDRrQqgLjqXebMCBNcP3
This commit is contained in:
2026-06-30 07:53:48 -05:00
parent 468d8c9ba5
commit d45f88b604
13 changed files with 336 additions and 0 deletions
+84
View File
@@ -0,0 +1,84 @@
#!/bin/bash
# MSP360 Backup - Complete Linux Install & Configure
# Run as root from the directory containing this script and the .deb file.
#
# Credentials are fetched from private Gitea repo (myron/msp360-config).
# Requires /etc/msp360-gitea-token on the target machine.
# OR place a filled-in msp360.conf in the same directory as this script.
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
CONF="$SCRIPT_DIR/msp360.conf"
TOKEN_FILE="/etc/msp360-gitea-token"
GITEA_RAW="https://gitea.orbishosting.com/myron/msp360-config/raw/branch/main/msp360.conf"
CBB="/opt/local/MSP360 Backup/bin/cbbCommandLine"
if [ -f "$CONF" ]; then
echo "Using local msp360.conf"
source "$CONF"
elif [ -f "$TOKEN_FILE" ]; then
echo "Fetching config from Gitea..."
GITEA_TOKEN=$(cat "$TOKEN_FILE")
curl -sf -H "Authorization: token $GITEA_TOKEN" "$GITEA_RAW" -o /tmp/msp360.conf
source /tmp/msp360.conf
rm -f /tmp/msp360.conf
else
echo "ERROR: No msp360.conf found and no /etc/msp360-gitea-token present."
echo " Option A: Place a filled-in msp360.conf in $SCRIPT_DIR"
echo " Option B: Put your Gitea token in /etc/msp360-gitea-token (chmod 600)"
exit 1
fi
BACKUP_PATH="${MOUNT_POINT}/${BACKUP_SUBDIR}"
CBB_DEB=$(ls "$SCRIPT_DIR"/ubuntu14_MSP360_*.deb 2>/dev/null | head -1)
echo "=== Step 1: Install MSP360 ==="
if [ -f "$CBB_DEB" ]; then
dpkg -i "$CBB_DEB"
sleep 5
else
echo "WARNING: No .deb found — assuming already installed"
fi
echo "=== Step 2: Activate license ==="
"$CBB" activateLicense -e "$LICENSE_EMAIL" -free
echo "=== Step 3: Install cifs-utils ==="
apt-get install -y cifs-utils
echo "=== Step 4: Mount NAS ==="
mkdir -p "$MOUNT_POINT" /etc/nas-creds
printf "username=%s\npassword=%s\n" "$NAS_USER" "$NAS_PASS" > /etc/nas-creds/msp360
chmod 600 /etc/nas-creds/msp360
if ! mountpoint -q "$MOUNT_POINT"; then
mount -t cifs "//${NAS_HOST}/${NAS_SHARE}" "$MOUNT_POINT" \
-o credentials=/etc/nas-creds/msp360,uid=0,gid=0,noperm,_netdev
fi
df -h "$MOUNT_POINT"
echo "=== Step 5: Create backup directory ==="
mkdir -p "$BACKUP_PATH"
echo "=== Step 6: Add fstab entry ==="
FSTAB_LINE="//${NAS_HOST}/${NAS_SHARE} ${MOUNT_POINT} cifs credentials=/etc/nas-creds/msp360,uid=0,gid=0,noperm,_netdev 0 0"
grep -q "$MOUNT_POINT" /etc/fstab || echo "$FSTAB_LINE" >> /etc/fstab
echo "=== Step 7: Register storage account ==="
"$CBB" addAccount -st FileSystem -d "NAS-MSPBackups" -c "$BACKUP_PATH"
echo "=== Step 8: Create backup plan ==="
"$CBB" addBackupPlan \
-n "$PLAN_NAME" \
-a "NAS-MSPBackups" \
-f "/" \
-ef "/proc" -ef "/sys" -ef "/dev" -ef "/run" -ef "/tmp" -ef "/mnt" \
-es no \
-purge 1m -purgeBy backupDate -keepLastVersion yes \
-runMissed yes \
-en yes -every day -at "$INC_TIME" \
-enFull yes -everyFull week -atFull "$FULL_TIME" -weekdayFull "su"
echo ""
echo "=== Done! Plan list: ==="
"$CBB" plan -l
+35
View File
@@ -0,0 +1,35 @@
# MSP360 Backup Schedule
License: myronblair@outlook.com (free)
NAS: //10.48.200.249/Storage → /mnt/nas-backups
Backup path: /mnt/nas-backups/MSPBackups/CBB_<hostname>/
Credentials: fetched from Gitea private repo myron/msp360-config via /etc/msp360-gitea-token
## Plan: All files, weekly full + daily incremental, 1 month retention
| Host | IP | Plan Name | Full (Sun) | Incremental (daily) | Status |
|--------------|-----------------|--------------------|------------|---------------------|----------|
| JARVIS | 10.48.200.211 | JARVIS-Backup | 01:00 | 02:00 | Stopped |
| NPM | 10.48.200.200 | NPM-Backup | 01:15 | 02:15 | Stopped |
| NovaCPX | 10.48.200.110 | NovaCPX-Backup | 01:30 | 02:30 | Stopped |
| Jellyfin | 10.48.200.33 | Jellyfin-Backup | 01:45 | 02:45 | Stopped |
| Homebridge | 10.48.200.18 | Homebridge-Backup | 02:00 | 03:00 | Unknown |
| MediaStack | 10.48.200.35 | MediaStack-Backup | 02:15 | 03:15 | Running |
| PVE1 | 10.48.200.90 | PVE1-Backup | 02:30 | 03:30 | Stopped |
| PVE2 | 10.48.200.91 | PVE2-Backup | 02:45 | 03:45 | Pending |
| Ollama | 10.48.200.210 | Ollama-Backup | 03:00 | 04:00 | Pending |
| NetworkBak | 10.48.200.99 | NetworkBak-Backup | 03:15 | 04:15 | Pending |
Pending = offline, needs install when back up.
DO server (165.22.1.228) and FusionPBX (134.209.72.226) cannot reach internal NAS.
## Install on new host
```bash
# 1. Place Gitea token
echo "<token>" > /etc/msp360-gitea-token && chmod 600 /etc/msp360-gitea-token
# 2. Run setup (MSP360 already installed)
curl -sk https://web.orbishosting.com/downloads/msp360-linux-installer.zip -o /tmp/msp360.zip
unzip /tmp/msp360.zip -d /tmp/msp360 && cd /tmp/msp360
bash msp360-setup.sh "HOSTNAME-Backup" "HH:MM" "HH:MM"
```
+61
View File
@@ -0,0 +1,61 @@
#!/bin/bash
# MSP360 Backup - Configure only (MSP360 already installed)
# Usage: bash msp360-setup.sh <plan_name> <full_time> <inc_time>
# Credentials: fetched from Gitea (/etc/msp360-gitea-token) or local msp360.conf
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
CONF="$SCRIPT_DIR/msp360.conf"
TOKEN_FILE="/etc/msp360-gitea-token"
GITEA_RAW="https://gitea.orbishosting.com/myron/msp360-config/raw/branch/main/msp360.conf"
CBB="/opt/local/MSP360 Backup/bin/cbbCommandLine"
if [ -f "$CONF" ]; then
source "$CONF"
elif [ -f "$TOKEN_FILE" ]; then
GITEA_TOKEN=$(cat "$TOKEN_FILE")
curl -sf -H "Authorization: token $GITEA_TOKEN" "$GITEA_RAW" -o /tmp/msp360.conf
source /tmp/msp360.conf
rm -f /tmp/msp360.conf
else
echo "ERROR: No msp360.conf and no /etc/msp360-gitea-token"
exit 1
fi
PLAN_NAME="${1:-${PLAN_NAME:-MyHost-Backup}}"
FULL_TIME="${2:-${FULL_TIME:-01:00}}"
INC_TIME="${3:-${INC_TIME:-02:00}}"
BACKUP_PATH="${MOUNT_POINT:-/mnt/nas-backups}/${BACKUP_SUBDIR:-MSPBackups}"
"$CBB" activateLicense -e "$LICENSE_EMAIL" -free
apt-get install -y cifs-utils 2>/dev/null | tail -1
mkdir -p "${MOUNT_POINT}" /etc/nas-creds
[ -f /etc/nas-creds/msp360 ] || \
printf "username=%s\npassword=%s\n" "$NAS_USER" "$NAS_PASS" > /etc/nas-creds/msp360
chmod 600 /etc/nas-creds/msp360
mountpoint -q "${MOUNT_POINT}" || \
mount -t cifs "//${NAS_HOST}/${NAS_SHARE}" "${MOUNT_POINT}" \
-o credentials=/etc/nas-creds/msp360,uid=0,gid=0,noperm,_netdev
mkdir -p "$BACKUP_PATH"
grep -q "${MOUNT_POINT}" /etc/fstab || \
echo "//${NAS_HOST}/${NAS_SHARE} ${MOUNT_POINT} cifs credentials=/etc/nas-creds/msp360,uid=0,gid=0,noperm,_netdev 0 0" >> /etc/fstab
"$CBB" addAccount -st FileSystem -d "NAS-MSPBackups" -c "$BACKUP_PATH" 2>&1
"$CBB" addBackupPlan \
-n "$PLAN_NAME" \
-a "NAS-MSPBackups" \
-f "/" \
-ef "/proc" -ef "/sys" -ef "/dev" -ef "/run" -ef "/tmp" -ef "/mnt" \
-es no \
-purge 1m -purgeBy backupDate -keepLastVersion yes \
-runMissed yes \
-en yes -every day -at "$INC_TIME" \
-enFull yes -everyFull week -atFull "$FULL_TIME" -weekdayFull "su" 2>&1
echo "Done. Plans:"
"$CBB" plan -l