devmatrix-scripts/DEVMATRIX_TOMORROW_CHECKLIS...

13 KiB

DevMatrix Setup Checklist - TOMORROW'S TASKS

📋 Complete Setup Guide for Tomorrow


PHASE 1: Gitea Setup (First Priority)

Step 1.1: Create Gitea Repository for Scripts

On your Gitea server (git.lemonlink.eu):

  1. Log into Gitea web UI

    • URL: https://git.lemonlink.eu
    • Login with your admin account
  2. Create New Repository

    • Click +New Repository
    • Owner: impulsivefps (or your username)
    • Repository Name: devmatrix-scripts
    • Description: DevMatrix Proxmox/OpenClaw setup scripts
    • Visibility: ☑️ Private (recommended)
    • Initialize: ☑️ Add README
    • Click Create Repository
  3. Upload Scripts

    Option A: Web Upload (Easiest)

    • Go to repository → Upload File
    • Drag and drop these files:
      • setup_devmatrix_proxmox_custom.sh
      • setup_openclaw_dev.sh
      • setup_windows_vm.ps1
      • setup_truenas.sh
      • setup_truenas_shares.sh
    • Commit message: "Initial DevMatrix setup scripts"
    • Click Commit

    Option B: Command Line

    # On your local machine where scripts are saved
    mkdir devmatrix-scripts
    cd devmatrix-scripts
    
    # Copy scripts here
    cp /path/to/scripts/*.sh .
    cp /path/to/scripts/*.ps1 .
    
    # Initialize and push
    git init
    git add .
    git commit -m "Initial DevMatrix setup scripts"
    git remote add origin https://git.lemonlink.eu/impulsivefps/devmatrix-scripts.git
    git push -u origin main
    

Step 1.2: Create Gitea User for OpenClaw

Purpose: This user will be dedicated to the DevMatrix environment for automated git operations.

  1. Create New User

    • Gitea: Site AdministrationUser AccountsCreate New Account
    • Username: devmatrix-bot
    • Email: devmatrix@yourdomain.com
    • Password: Generate strong password (save in password manager)
    • ☑️ Send user registration notification (optional)
    • Click Create User
  2. Generate Access Token

    • Log in AS the new devmatrix-bot user
    • Go to SettingsApplicationsGenerate New Token
    • Token Name: devmatrix-access
    • Scopes: ☑️ repo, ☑️ write:packages
    • Click Generate Token
    • COPY THE TOKEN IMMEDIATELY (you can't see it again!)
    • Save as: GITEA_TOKEN=your_token_here
  3. Add Bot User to Repository

    • Go to devmatrix-scripts repository
    • SettingsCollaboratorsAdd Collaborator
    • Username: devmatrix-bot
    • Permission: Write (not Admin)
    • Click Add
  4. Test Access

    # From DevMatrix VM (once it's running)
    curl -H "Authorization: token YOUR_GITEA_TOKEN" \
         https://git.lemonlink.eu/api/v1/user
    

PHASE 2: TrueNAS Share Setup

Step 2.1: SSH into TrueNAS

# From any machine on your network
ssh admin@192.168.5.195

# Switch to root
sudo -i

Step 2.2: Run the Share Setup Script

Copy and paste this entire script:

#!/bin/bash
# TrueNAS Share Setup Script for DevMatrix

set -e

DATASET_NAME="NAS2"
SHARE_PREFIX="devmatrix"
NETWORK_ALLOW="192.168.5.0/24"

echo "☁️ Setting up TrueNAS shares for DevMatrix..."

# Create dataset structure
echo "📁 Creating datasets..."
if ! zfs list "$DATASET_NAME/$SHARE_PREFIX" >/dev/null 2>&1; then
    zfs create "$DATASET_NAME/$SHARE_PREFIX"
fi

for subdir in projects backups iso-archive shared; do
    dataset_path="$DATASET_NAME/$SHARE_PREFIX/$subdir"
    if ! zfs list "$dataset_path" >/dev/null 2>&1; then
        zfs create "$dataset_path"
        echo "✓ Created: $dataset_path"
    fi
done

# Set permissions
echo "🔐 Setting permissions..."
for subdir in projects backups iso-archive shared; do
    mountpoint=$(zfs get -H -o value mountpoint "$DATASET_NAME/$SHARE_PREFIX/$subdir")
    chown -R nobody:nogroup "$mountpoint"
    chmod -R 777 "$mountpoint"
done

# Create NFS shares
echo "🔗 Creating NFS shares..."
mountpoint_base=$(zfs get -H -o value mountpoint "$DATASET_NAME")

for share in projects backups iso-archive shared; do
    path="$mountpoint_base/$SHARE_PREFIX/$share"
    if ! midclt call sharing.nfs.query "[[\"path\",\"=\",\"$path\"]]" | grep -q "$path"; then
        midclt call sharing.nfs.create "{
            \"path\": \"$path\",
            \"comment\": \"DevMatrix $share\",
            \"hosts\": [\"$NETWORK_ALLOW\"],
            \"ro\": false,
            \"maproot_user\": \"root\",
            \"maproot_group\": \"root\",
            \"security\": [\"sys\"]
        }" > /dev/null
        echo "✓ NFS share: $share"
    fi
done

# Enable NFS service
if ! midclt call service.query "[[\"service\",\"=\",\"nfs\"]]" | grep -q '"state": "RUNNING"'; then
    midclt call service.start "nfs" > /dev/null
    midclt call service.update "nfs" '{"enable": true}' > /dev/null
    echo "✓ NFS service enabled"
fi

# Create SMB shares
echo "🖥️ Creating SMB shares..."
if ! midclt call service.query "[[\"service\",\"=\",\"cifs\"]]" | grep -q '"state": "RUNNING"'; then
    midclt call service.start "cifs" > /dev/null
    midclt call service.update "cifs" '{"enable": true}' > /dev/null
fi

for share in projects backups shared; do
    path="$mountpoint_base/$SHARE_PREFIX/$share"
    if ! midclt call sharing.smb.query "[[\"path\",\"=\",\"$path\"]]" | grep -q "$path"; then
        midclt call sharing.smb.create "{
            \"path\": \"$path\",
            \"name\": \"devmatrix-$share\",
            \"comment\": \"DevMatrix $share\",
            \"browseable\": true,
            \"readonly\": false,
            \"guestok\": true
        }" > /dev/null
        echo "✓ SMB share: devmatrix-$share"
    fi
done

echo ""
echo "🎉 TrueNAS shares setup complete!"
echo "NFS: $mountpoint_base/$SHARE_PREFIX/{projects,backups,iso-archive,shared}"
echo "SMB: \\\\$(hostname)\\devmatrix-{projects,backups,shared}"

After running, verify:

# List datasets
zfs list | grep devmatrix

# List NFS shares
midclt call sharing.nfs.query | grep path

# List SMB shares
midclt call sharing.smb.query | grep name

PHASE 3: Proxmox VM Creation

Step 3.1: Download Scripts from Gitea

# SSH into Proxmox
ssh root@192.168.5.200

# Create directory
mkdir -p /root/devmatrix-setup
cd /root/devmatrix-setup

# Download scripts from Gitea
wget https://git.lemonlink.eu/impulsivefps/devmatrix-scripts/raw/main/setup_devmatrix_proxmox_custom.sh
wget https://git.lemonlink.eu/impulsivefps/devmatrix-scripts/raw/main/setup_openclaw_dev.sh
wget https://git.lemonlink.eu/impulsivefps/devmatrix-scripts/raw/main/setup_truenas.sh

# Make executable
chmod +x *.sh

Step 3.2: Run Proxmox Setup

cd /root/devmatrix-setup
./setup_devmatrix_proxmox_custom.sh

What this does:

  • Checks storage (pve-main2)
  • Downloads Ubuntu ISO
  • Creates VM 300 (32GB RAM, 16 cores, 400GB)
  • Creates VM 301 (16GB RAM, 8 cores, 100GB)
  • Creates VM 302 (8GB RAM, 4 cores, 50GB)
  • Sets static IPs (210, 211, 212)
  • Generates SSH keys

PHASE 4: Install Ubuntu on VM 300

Step 4.1: Start VM and Install

# On Proxmox
qm start 300

# Open console (via web UI or CLI)
qm console 300

Installation Steps:

  1. Select "Try or Install Ubuntu Server"
  2. Language: English
  3. Keyboard: Your layout
  4. Network: ☑️ DHCP (will get 192.168.5.210)
  5. Proxy: Leave blank
  6. Mirror: Default (Ubuntu archive)
  7. Storage: Use entire disk
  8. Profile:
    • Your name: DevMatrix
    • Server name: devmatrix
    • Username: devmatrix
    • Password: [Choose strong password]
    • ☑️ Import SSH key: Paste contents of ~/.ssh/devmatrix_id_rsa.pub from Proxmox
  9. Featured Server Snaps: None
  10. Wait for install → Reboot

Step 4.2: Verify Network

# After VM reboots, from Proxmox check IP
qm guest exec 300 -- ip addr show

# Should show 192.168.5.210

PHASE 5: Setup Dev Environment (Inside VM 300)

Step 5.1: SSH and Run Setup

# From Proxmox or your machine
ssh -i ~/.ssh/devmatrix_id_rsa devmatrix@192.168.5.210

# Download script from Gitea
wget https://git.lemonlink.eu/impulsivefps/devmatrix-scripts/raw/main/setup_openclaw_dev.sh
chmod +x setup_openclaw_dev.sh

# Run setup (takes 20-30 minutes)
./setup_openclaw_dev.sh

Step 5.2: Configure TrueNAS Mounts

# Still inside VM 300
wget https://git.lemonlink.eu/impulsivefps/devmatrix-scripts/raw/main/setup_truenas.sh
chmod +x setup_truenas.sh
./setup_truenas.sh

# Verify mounts
ls -la /mnt/truenas/
df -h | grep truenas

Step 5.3: Configure API Keys (YOU DO THIS)

# Inside VM 300
~/scripts/configure_api_keys.sh

# Enter when prompted:
# - Kimi API Key: [from kimi.moonshot.cn]
# - Antigravity API Key: [from your provider]

Step 5.4: Configure Gitea Access

# Inside VM 300, configure git
mkdir -p ~/.config/openclaw
cat > ~/.config/openclaw/gitea.conf << 'EOF'
GITEA_URL=https://git.lemonlink.eu
GITEA_USER=devmatrix-bot
GITEA_TOKEN=your_token_here
EOF
chmod 600 ~/.config/openclaw/gitea.conf

# Test access
curl -H "Authorization: token your_token_here" \
     https://git.lemonlink.eu/api/v1/user

PHASE 6: Install Windows on VM 301

Step 6.1: Start and Install Windows

# On Proxmox
qm start 301
qm console 301

Installation:

  1. Standard Windows 11 LTSC IoT install
  2. Network: Let it get IP (should be 192.168.5.211)
  3. Account: Create testuser with password
  4. Complete installation

Step 6.2: Run Windows Setup Script

Inside Windows VM (as Administrator in PowerShell):

# Download script
Invoke-WebRequest -Uri "https://git.lemonlink.eu/impulsivefps/devmatrix-scripts/raw/main/setup_windows_vm.ps1" -OutFile "C:\Scripts\setup_windows_vm.ps1"

# Run script
C:\Scripts\setup_windows_vm.ps1

Reboot when complete.


PHASE 7: Verification & Testing

Step 7.1: Test VM Communication

# From VM 300 (Ubuntu)
ping 192.168.5.211    # Windows VM
ping 192.168.5.195    # TrueNAS
ping 192.168.5.200    # Proxmox
ping git.lemonlink.eu # Gitea

Step 7.2: Test TrueNAS Mounts

# On VM 300
echo "test" > /mnt/truenas/projects/test.txt
cat /mnt/truenas/projects/test.txt
rm /mnt/truenas/projects/test.txt

Step 7.3: Test OpenClaw

# On VM 300
openclaw models list
openclaw status

Step 7.4: Test Windows VM Control

# On VM 300
~/scripts/vm_control.sh win-start
# Wait 60 seconds
~/scripts/vm_control.sh win-status
~/scripts/vm_control.sh win-stop

PHASE 8: Documentation & Backup

Step 8.1: Save Configuration

# On Proxmox
cat > ~/devmatrix_config_summary.txt << 'EOF'
DevMatrix Configuration Summary
================================
Date: $(date)

PROXMOX
-------
IP: 192.168.5.200
Storage HDD: pve-main2
Storage NVMe: pve-main (future)

VMS
---
VM 300: OpenClaw-DevMatrix
  - IP: 192.168.5.210
  - RAM: 32GB
  - Disk: 400GB (200 OS + 200 data)
  - User: devmatrix

VM 301: Windows-LTSC-Test
  - IP: 192.168.5.211
  - RAM: 16GB
  - Disk: 100GB
  - User: testuser

VM 302: Android-Emulator
  - IP: 192.168.5.212
  - RAM: 8GB
  - Disk: 50GB

TRUENAS
-------
IP: 192.168.5.195
Dataset: NAS2/devmatrix
Shares: projects, backups, iso-archive, shared

GITEA
-----
URL: https://git.lemonlink.eu
Bot User: devmatrix-bot
Repo: devmatrix-scripts

ACCESS
------
SSH Key: ~/.ssh/devmatrix_id_rsa
VS Code: http://192.168.5.210:8080
EOF

Step 8.2: Create VM Snapshots

# On Proxmox
qm snapshot 300 clean-install
qm snapshot 301 clean-install
qm snapshot 302 clean-install

🎯 SUMMARY CHECKLIST

Copy this and check off as you go:

□ PHASE 1: Gitea
  □ Create repository: devmatrix-scripts
  □ Upload all 5 scripts
  □ Create user: devmatrix-bot
  □ Generate API token
  □ Add bot to repository

□ PHASE 2: TrueNAS
  □ SSH into TrueNAS
  □ Run share setup script
  □ Verify datasets created
  □ Verify NFS/SMB shares

□ PHASE 3: Proxmox
  □ Download scripts from Gitea
  □ Run setup_devmatrix_proxmox_custom.sh
  □ Verify VMs created (300, 301, 302)

□ PHASE 4: Ubuntu Install
  □ Start VM 300
  □ Install Ubuntu 22.04
  □ Verify IP 192.168.5.210

□ PHASE 5: Dev Environment
  □ SSH into VM 300
  □ Run setup_openclaw_dev.sh
  □ Run setup_truenas.sh
  □ Configure API keys
  □ Configure Gitea access

□ PHASE 6: Windows
  □ Install Windows on VM 301
  □ Run setup_windows_vm.ps1
  □ Verify IP 192.168.5.211

□ PHASE 7: Testing
  □ Test VM communication
  □ Test TrueNAS mounts
  □ Test OpenClaw
  □ Test Windows control

□ PHASE 8: Documentation
  □ Save config summary
  □ Create VM snapshots
  □ Celebrate! 🎉

🆘 TROUBLESHOOTING

Can't SSH to VM 300

# From Proxmox
qm guest exec 300 -- systemctl status ssh
qm guest exec 300 -- ip addr show

TrueNAS Mounts Fail

# On VM 300
showmount -e 192.168.5.195
sudo mount -a

Windows VM Won't Start

# Check Proxmox logs
qm log 301
qm status 301

OpenClaw Won't Start

# On VM 300
openclaw status
openclaw logs

🚀 YOU'RE READY!

Everything is prepared. Tomorrow just work through the checklist in order!

Estimated time: 2-3 hours (mostly automated)

Questions? Just ask - I'm here to help! 🦞