godcrm/scripts/opi-setup
Holetron 15a57faa8b sync: land agent-tools principal identity, tool audit, mailbox provisioning, type ratchet
Snapshot of private main @ 10300fb6 through the extended publish excision
(SC-SIM module, internal infra/ops scripts, personal material, debug cruft)
plus the IP/e-mail scrub.

Notable:
- backend/services/agent-tools/principal.js — principal identity +
  owner-only naturalization (ADR-165 WP-4), with its two consumers.
- backend/services/audit/toolAudit.js — hash-chained tool audit.
- backend/services/mail/provisionMailbox.js + migration 089 — ADR-198
  mailbox provisioning.
- shared/column-types.js + migration 088 — ADR-0041R type ratchet.
- migration 090 — ADR-0066-B agent provenance.
- docs/MANIFESTO.md, docs/MCP.md — the two README links that were dangling.
- LICENSE now also lives in the source tree; package.json declares MIT.
- run-pes.js / deploy-package.cjs no longer carry credential fallbacks.
2026-09-03 17:16:42 +03:00
..
keys GOD CRM — public scrubbed snapshot 2026-08-10 04:01:45 +03:00
prepare-microsd.sh sync: land agent-tools principal identity, tool audit, mailbox provisioning, type ratchet 2026-09-03 17:16:42 +03:00
README.txt GOD CRM — public scrubbed snapshot 2026-08-10 04:01:45 +03:00

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

=============================================
  Orange Pi Setup USB — Quick Start
=============================================

ПОДГОТОВКА ФЛЕШКИ:
  1. Отформатируй USB в FAT32 или ext4
  2. Скопируй всю папку opi-setup/ на флешку

СТРУКТУРА:
  /setup-orangepi.sh        — главный скрипт
  /keys/                    — SSH публичные ключи (.pub)
  /awg-keys/                — AWG приватные ключи (по hostname)
  /README.txt               — эта инструкция

ИСПОЛЬЗОВАНИЕ:
  1. Загрузи Orange Pi с microSD (любая рабочая Ubuntu/Armbian)
  2. Вставь USB-флешку
  3. Примонтируй:
       sudo mount /dev/sda1 /mnt/usb
     (или /dev/sdb1 — зависит от устройства, проверь: lsblk)
  4. Запусти:
       sudo bash /mnt/usb/opi-setup/setup-orangepi.sh <hostname> <awg-ip>

ПРИМЕРЫ:
  sudo bash /mnt/usb/opi-setup/setup-orangepi.sh opi1-office 10.66.66.6
  sudo bash /mnt/usb/opi-setup/setup-orangepi.sh opi2-office 10.66.66.10
  sudo bash /mnt/usb/opi-setup/setup-orangepi.sh opi3-hq 10.66.66.16

ЧТО ДЕЛАЕТ СКРИПТ:
  ✓ Ставит hostname и timezone (Moscow)
  ✓ Прописывает SSH ключи (root доступ)
  ✓ Устанавливает AmneziaWG + создаёт конфиг
  ✓ ВАЖНО: AllowedIPs = 10.66.66.0/24 (не 0.0.0.0/0!)
    → Интернет НЕ пропадёт если VPN упадёт
  ✓ Отключает старый WireGuard
  ✓ Создаёт swap 4GB
  ✓ Ставит fail2ban
  ✓ Включает IP forwarding
  ✓ Ставит htop, tmux, curl, rsync
  ✓ Опционально: клонирует систему на SSD/NVMe

ПОСЛЕ УСТАНОВКИ:
  1. Скрипт покажет AWG Public Key
  2. Добавь пир на VPS:
       ssh root@<HOST_IP>
       awg set awg0 peer <PUBLIC_KEY> allowed-ips <AWG_IP>/32
       awg-quick save awg0
  3. Проверь подключение:
       ping 10.66.66.1
  4. Перезагрузись: sudo reboot