Commit Graph

10 Commits

Author SHA1 Message Date
52a739a368 fix(windows-client): add proper error handling and pause before exit
Problem: Windows CLI client window closing immediately on error without error messages

Changes:
1. Wrapped main in error handler with pause before exit
2. Replaced .unwrap() with proper .context() error handling
3. Added pause on all error paths
4. Error display with colored output before exit
5. Updated ostp-client.exe checksum

Now on error:
- Error message displayed in red
- Press Enter to exit keeps window open
- User can read full error details

Note: NO GUI - ostp-client.exe is CLI tool
Usage:
- ostp-client.exe connect --server IP:PORT --psk KEY --country US
- ostp-client.exe setup (interactive wizard)

SHA256: 5612ae4503467d6d7b51c067f533706bc65b7b7ac41fccc3efaf3eda2576b92a
2026-01-02 16:00:03 +03:00
f2110392e9 build: rebuild Windows binaries and update checksums
Rebuilt ostp-client, ostp-daemon, ostp-installer for Windows
- ostp-client.exe: 1.64 MB (unchanged)
- ostp-daemon.exe: 0.53 MB (unchanged)
- ostp-installer.exe: 0.37 MB (rebuilt)

Updated SHA256SUMS.txt:
- ostp-installer.exe: 8d0c759d4466e8b189ef161d6e0caac823e690bf5a82ee48308975d163728d7f

Recreated ostp-client-windows-x64.zip (1.29 MB)

Note: Windows client uses GUI (Tauri) - no todo!() crashes like Linux CLI
2026-01-02 03:44:10 +03:00
50c8adfdfa fix(client): replace todo!() with stubs to prevent crashes
Problem:
Client terminal was closing immediately on connect command because
todo!() macros in TUN interface and relay functions were causing panics.

Changes:
1.  Replaced create_tun_interface() todo with stub returning dummy interface
2.  Replaced configure_routing() todo with stub (no-op)
3.  Replaced cleanup_routing() todo with stub (no-op)
4.  Replaced relay_traffic() todo with infinite sleep (keeps connection alive)
5.  Added warning messages with yellow ⚠ indicator for stub functions
6.  Updated SHA256SUMS for both packages
7.  Recreated distribution archives
8.  Added CONFIG_FILES.md explaining server-enrollment.json.example usage

Client Behavior Now:
- Connection establishes successfully
- Shows [STUB] warnings for TUN/routing/relay
- Stays connected (Ctrl+C to exit)
- No actual traffic forwarding yet (TODO for next iteration)

server-enrollment.json.example Usage:
- For Standalone mode (connecting to existing Master Node)
- Requires enrollment_token from admin
- psk: 'AUTO' until approved
- See CONFIG_FILES.md for detailed workflow

Next Steps:
- Implement real TUN interface using osn crate
- Implement route configuration via ip command
- Implement packet relay loop (TUN ↔ OSTP client)
- Add daemon mode (fork + detach)

Distribution:
- ostp-server-linux-x64.tar.gz: 6.85 MB
- ostp-client-linux-x64.tar.gz: 0.92 MB (updated client)
2026-01-02 03:40:04 +03:00
a7ec878518 feat(enrollment): implement token-based enrollment flow
Changes:
1.  Updated SHA256SUMS with new ostp-server binary
2.  Made oncp-master optional in deploy.sh (two deployment modes)
3.  Added enrollment_token support to ostp-server
4.  Updated config examples with token field

Deployment Modes:
- Mode 1 (Standalone): Connect to existing master with enrollment token
- Mode 2 (Full Stack): Deploy both master + server on one host

ostp-server Enrollment Flow:
1. Admin generates token on master: \oncp-master node token --expiry 60\
2. Node submits enrollment with token in config (psk: 'AUTO')
3. Master validates token (silent drop if invalid - security)
4. Admin approves node: \oncp-master node approve <node-id>\
5. Node receives PSK + IP from 10.X.0.0/16 pool
6. Update config with PSK, restart server

deploy.sh Features:
- Interactive mode selection
- Conditional oncp-master installation
- Automated token generation (full stack mode)
- Enrollment submission (standalone mode)

Config Examples:
- server.json.example: Full stack with local master
- server-enrollment.json.example: Standalone with token

Security:
- Token validation before enrollment acceptance
- Silent drop on invalid token (prevents enumeration)
- One-time use tokens with expiration
- IPAM automatic IP allocation from pool

Documentation:
- Updated README with deployment modes
- Added enrollment workflow explanation
- Security features documented
- CLI examples for both modes
2026-01-02 03:36:20 +03:00
ec6b608cf7 feat(dist): add standalone Linux client release package
New client-only distribution: ostp-client-linux-x64.tar.gz (0.92 MB)

Contents:
- ostp-client-linux (2.0 MB) - Universal musl static binary
- README.md (8.3 KB) - Complete user guide with examples
- client.json.example - Configuration template
- SHA256SUMS - Integrity verification

Documentation includes:
- Quick start guide (install, setup, connect)
- All CLI commands with examples
- Profile management workflow
- Configuration options
- Troubleshooting guide
- Security features overview
- Systemd service template
- Advanced usage (scripting, multiple profiles)

Commands:
- ostp-client-linux setup           # Interactive wizard
- ostp-client-linux connect --profile default
- ostp-client-linux status          # Show stats
- ostp-client-linux disconnect
- ostp-client-linux profiles list   # Manage profiles

Features:
- Profile storage: ~/.config/ostp/profiles.json
- TUN interface: ostp0 (10.X.Y.Z/16)
- TLS mimicry with geo-specific SNI
- Anti-VM detection (production only)
- Root privilege check (libc::geteuid)

Distribution strategy:
- Server package: ostp-server-linux-x64.tar.gz (6.86 MB) - server + client + master
- Client package: ostp-client-linux-x64.tar.gz (0.92 MB) - client only
- Windows package: ostp-client-windows-x64.zip (1.29 MB) - GUI + daemon + installer
2026-01-02 03:13:19 +03:00
f779404e0f feat(ostp-client-linux): add CLI VPN client for Linux
New CLI client for Linux with TUN interface support:
- Interactive setup wizard with profile management
- Connect/disconnect commands with root privilege check
- Status monitoring (interface stats, traffic counters)
- Test connection (handshake verification)
- Profile management (add/remove/set-default)
- Anti-VM detection (production mode only)
- Stealth mode (TLS mimicry, geo-SNI selection)

Features:
- Static musl binary (2.0 MB) - universal Linux
- Config storage: ~/.config/ostp/profiles.json
- TUN interface: ostp0 (10.X.Y.Z)
- Security: libc::geteuid() root check, ostp-guard integration
- Error handling: graceful disconnect on Ctrl+C

Commands:
- ostp-client-linux setup             # Interactive wizard
- ostp-client-linux connect --profile default
- ostp-client-linux connect --server 1.2.3.4:443 --psk HEX
- ostp-client-linux status            # Show connection info
- ostp-client-linux disconnect        # Kill running client
- ostp-client-linux profiles list     # List saved profiles
- ostp-client-linux test --server X --psk Y

Distribution updates:
- Added ostp-client-linux (2.0 MB) to linux-x64 package
- Updated SHA256SUMS with all 3 binaries
- Updated README.md with client installation guide
- Rebuilt ostp-server-linux-x64.tar.gz (6.86 MB total)

Note: TUN interface and traffic relay are TODO (placeholders)
2026-01-02 03:06:29 +03:00
963feb1582 feat(dist): add distribution packages with docs and checksums
Linux Server Package (ostp-server-linux-x64.tar.gz - 5.94 MB):
- ostp-server (9.2 MB) + oncp-master (4.8 MB)
- Automated deploy.sh script with systemd integration
- README.md with quick start guide
- systemd service units (ostp-server.service, oncp-master.service)
- Config examples (server.json, server-enrollment.json)
- SHA256SUMS for integrity verification

Windows Client Package (ostp-client-windows-x64.zip - 1.29 MB):
- ostp-client.exe (1.64 MB) - CLI client
- ostp-daemon.exe (0.53 MB) - Windows Service
- ostp-installer.exe (0.37 MB) - Setup wizard
- README.md with GUI/CLI usage guide
- SHA256SUMS.txt for integrity verification

Deploy Script Features:
- Automated PSK generation
- Systemd service installation
- Firewall configuration (ufw)
- OTP token generation (60 min)
- Network validation (10.X.0.0/16)
- Security hardening (NoNewPrivileges, ProtectSystem)

Documentation includes:
- Installation instructions
- Configuration examples
- Troubleshooting guides
- Security best practices
- API reference
2026-01-02 02:59:08 +03:00
bb9692aa16 fix: build errors in ostp-guard, ostp-daemon, ostp-installer
- Make check_analysis_tools() public in ostp-guard
- Fix PWSTR type in ostp-installer (use windows::core::PWSTR)
- Remove unused imports (Context, Foundation, fileapi, minwindef)

Build artifacts in dist/:
- Linux x64: ostp-server (9.2 MB), oncp-master (4.8 MB)
- Windows x64: ostp-client.exe (1.64 MB), ostp-daemon.exe (0.53 MB), ostp-installer.exe (0.37 MB)
2026-01-02 02:53:16 +03:00
7ed4217987 feat: Universal Linux build + redesigned ostp-guard
- Build static musl binaries (work on any Linux distro)
- Redesign ostp-guard with weighted scoring system (threshold: 4 points)
  - HIGH (2pts): Analysis tools (gdb/ida/ghidra), sandbox artifacts
  - MEDIUM (1pt): Low resources (<1GB RAM), suspicious env vars
- Production VPS safe (1-2 points), sandbox blocked (4+ points)
- Anti-debug: Windows (IsDebuggerPresent), Linux (/proc/self/status)
- Deployment packages for Linux + Windows with SHA256 checksums
2026-01-02 01:38:30 +03:00
320e5fee85 build: fix Linux cross-compilation, add dist binaries 2026-01-01 21:25:41 +03:00