refactor: merge setup.sh into update.sh for seamless first-run

- update.sh now auto-generates .env from .env.example if missing
- Generates random JWT/SALT keys on first run
- Existing .env is never overwritten
- Deleted redundant setup.sh
- Updated all documentation references
This commit is contained in:
datadunia
2026-06-26 17:23:52 +07:00
parent fcb1de2cac
commit 4eea268ec5
8 changed files with 31 additions and 73 deletions
+6 -6
View File
@@ -19,16 +19,17 @@ Clone this repository and start all services:
```bash
git clone https://git.datadunia.com/nexusguard/Nexus-Guard-Suite.git
cd Nexus-Guard-Suite
./setup.sh # Generate .env file automatically
# Edit .env with your configuration
bash update.sh # Pull, build, migrate, and start
bash update.sh # Auto-generates .env + pulls, builds, migrates, starts
```
The first run will automatically:
- Pull the latest code and build the Docker containers (via `update.sh`).
- Generate `.env` from `.env.example` with auto-generated JWT/SALT keys.
- Pull the latest code and build the Docker containers.
- Auto-generate the **Local Primary Node** WireGuard keys on the first boot.
- Create the database schema via automated migration.
Edit `.env` afterward to customize `DB_PASSWORD`, `API_PORT`, `VITE_API_BASE_URL`.
**Update Options:**
```bash
bash update.sh # Smart update (only rebuild if changes detected)
@@ -268,8 +269,7 @@ NexusGuard/
├── bin/ # Built binaries (gitignored)
├── docker-compose.yml # Docker orchestration
├── docker-compose.dev.yml # Docker dev (hot-reload)
├── update.sh # Docker update script
├── setup.sh # Docker initial setup
├── update.sh # Docker update + auto-setup script
├── nexusguard-install.sh # Native install script
├── nexusguard-uninstall.sh # Native uninstall script
├── .env.example # Environment template