Skip to content

About

No description, website, or topics provided.

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

72 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

VIP Hosting Panel v2 - Enterprise Edition

Modern, secure, and high-performance hosting control panel built with Go, HTMX, and Python/Ansible.

πŸš€ Features

Infrastructure Management

  • Multi-Database Support: MySQL 5.7/8.0, PostgreSQL 12-16, MongoDB 4.4-7.0, Redis 6-7
  • Multi-PHP Support: PHP 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3
  • Multi-Node.js Support: Node.js 14.x, 16.x, 18.x, 20.x, 21.x
  • Multi-Webserver: Nginx, Apache2, LiteSpeed, Caddy (with auto-switching)
  • Server Providers: Hetzner, DigitalOcean, Vultr, AWS, Custom SSH

Security Features

  • WAF Integration: ModSecurity with OWASP Core Rule Set
  • Custom WAF Rules: Per-site and global rule management
  • Anti Code Injection: Input validation and sanitization
  • XSS Protection: Content Security Policy headers
  • SQL Injection Prevention: Prepared statements enforcement
  • ClamAV Antivirus: Real-time file scanning
  • Fail2ban: Brute force protection for SSH, FTP, Email, Panel
  • Firewall Manager: UFW/iptables with preset rules
  • SSL/TLS Management: Let's Encrypt auto-renewal + custom certs
  • 2FA Authentication: TOTP support for all user roles
  • Audit Logging: Comprehensive action tracking

Email Services

  • Mail Server: Postfix (SMTP) + Dovecot (IMAP/POP3)
  • Webmail: Roundcube and SnappyMail integrated
  • Email Accounts: Create/delete/manage mailboxes
  • Email Aliases: Unlimited aliases per domain
  • Email Forwarding: Local and external forwarding
  • Spam Protection: SpamAssassin integration
  • DKIM/SPF/DMARC: Auto-configuration
  • Mail Quotas: Per-account storage limits
  • Email Filters: Sieve-based filtering

DNS Management

  • DNS Servers: Bind9 (primary) or PowerDNS
  • DNS Providers: Cloudflare, Route53, Custom
  • Zone Management: A, AAAA, CNAME, MX, TXT, SRV, CAA records
  • DNSSEC Support: Automated key management
  • DNS Templates: Quick setup for common configurations
  • Geo DNS: Location-based routing
  • Health Checks: Automatic failover

Website Management

  • One-Click Apps: WordPress, Laravel, Node.js, Static sites
  • Git Deployment: GitHub/GitLab webhooks
  • Zero-Downtime Deploy: Blue-green deployments
  • Staging Environments: Isolated testing environments
  • File Manager: Web-based with upload/download
  • FTP/SFTP: Per-user account management
  • Cron Jobs: Visual cron editor
  • Environment Variables: Secure secret management
  • Custom nginx/Apache configs: Per-site overrides

Database Management

  • phpMyAdmin: MySQL/MariaDB management
  • pgAdmin: PostgreSQL management
  • Adminer: Universal database tool
  • MongoDB Compass: MongoDB GUI
  • Redis Commander: Redis management
  • Database Backups: Automated dumps
  • Query Monitor: Slow query detection

Monitoring & Analytics

  • Real-time Metrics: CPU, RAM, Disk, Network
  • Application Performance: Response times, error rates
  • Uptime Monitoring: HTTP/HTTPS checks
  • SSL Certificate Expiry: Alerts before expiration
  • Resource Alerts: Customizable thresholds
  • Log Aggregation: Centralized log viewer
  • Traffic Analytics: Bandwidth usage per site

Backup & Recovery

  • Automated Backups: Scheduled full/incremental
  • Backup Storage: Local, S3, FTP, SFTP
  • One-Click Restore: Point-in-time recovery
  • Backup Encryption: AES-256 encryption
  • Retention Policies: Configurable cleanup
  • Backup Verification: Automated integrity checks

Billing & Reseller

  • Multi-tenant: Unlimited reseller levels
  • Stripe Integration: Subscriptions and one-time payments
  • Invoice Generation: Automated PDF invoices
  • Usage-Based Billing: Metered resources
  • Reseller Margins: Configurable markup
  • Client Portal: Self-service management
  • Payment Methods: Card, PayPal, Bank transfer

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚     FRONTEND: HTMX + Alpine.js              β”‚
β”‚     β€’ Server-Side Rendering (Templ)         β”‚
β”‚     β€’ Real-time updates (SSE)               β”‚
β”‚     β€’ Tailwind CSS + DaisyUI                β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    ↕
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚     API GATEWAY: Go + Fiber                 β”‚
β”‚     β€’ JWT Authentication                    β”‚
β”‚     β€’ Rate Limiting                         β”‚
β”‚     β€’ RBAC Middleware                       β”‚
β”‚     β€’ Request Validation                    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    ↕
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚     SERVICES LAYER (Go)                     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ β€’ Server Management                         β”‚
β”‚ β€’ Site Deployment                           β”‚
β”‚ β€’ DNS Management                            β”‚
β”‚ β€’ Email Management                          β”‚
β”‚ β€’ Database Management                       β”‚
β”‚ β€’ SSL/Certificate Management                β”‚
β”‚ β€’ Backup Management                         β”‚
β”‚ β€’ Monitoring & Alerts                       β”‚
β”‚ β€’ Billing & Invoicing                       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    ↕
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  PostgreSQL  β”‚    Redis     β”‚   TimescaleDB β”‚
β”‚  (Core Data) β”‚(Cache/Queue) β”‚   (Metrics)   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    ↕
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚     WORKER POOL (Go + Asynq)                β”‚
β”‚     β€’ Async job processing                  β”‚
β”‚     β€’ Server provisioning                   β”‚
β”‚     β€’ Backup execution                      β”‚
β”‚     β€’ SSL renewal                           β”‚
β”‚     β€’ Health checks                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    ↕
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚     AUTOMATION LAYER                        β”‚
β”‚     Python Scripts + Ansible Playbooks      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ β€’ Server provisioning & hardening           β”‚
β”‚ β€’ Web server configuration                  β”‚
β”‚ β€’ Database installation                     β”‚
β”‚ β€’ Email server setup                        β”‚
β”‚ β€’ Security configuration                    β”‚
β”‚ β€’ Monitoring agent installation             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    ↕
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚     MANAGED SERVERS                         β”‚
β”‚     β€’ Agent (optional): Metrics collection  β”‚
β”‚     β€’ SSH Access: Ansible-based management  β”‚
β”‚     β€’ Services: Nginx, PHP-FPM, MySQL, etc. β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“ Project Structure

vip-hosting-panel-v2/
β”œβ”€β”€ cmd/
β”‚   β”œβ”€β”€ api/                    # Main web server
β”‚   β”‚   └── main.go
β”‚   β”œβ”€β”€ worker/                 # Background job processor
β”‚   β”‚   └── main.go
β”‚   β”œβ”€β”€ agent/                  # Server monitoring agent (optional)
β”‚   β”‚   └── main.go
β”‚   └── cli/                    # CLI tools
β”‚       └── main.go
β”‚
β”œβ”€β”€ internal/
β”‚   β”œβ”€β”€ auth/                   # Authentication & authorization
β”‚   β”‚   β”œβ”€β”€ jwt.go
β”‚   β”‚   β”œβ”€β”€ rbac.go
β”‚   β”‚   β”œβ”€β”€ session.go
β”‚   β”‚   └── twofa.go
β”‚   β”‚
β”‚   β”œβ”€β”€ handlers/               # HTTP request handlers
β”‚   β”‚   β”œβ”€β”€ auth.go
β”‚   β”‚   β”œβ”€β”€ dashboard.go
β”‚   β”‚   β”œβ”€β”€ servers.go
β”‚   β”‚   β”œβ”€β”€ sites.go
β”‚   β”‚   β”œβ”€β”€ databases.go
β”‚   β”‚   β”œβ”€β”€ email.go
β”‚   β”‚   β”œβ”€β”€ dns.go
β”‚   β”‚   β”œβ”€β”€ ssl.go
β”‚   β”‚   β”œβ”€β”€ backups.go
β”‚   β”‚   β”œβ”€β”€ monitoring.go
β”‚   β”‚   β”œβ”€β”€ firewall.go
β”‚   β”‚   β”œβ”€β”€ users.go
β”‚   β”‚   └── billing.go
β”‚   β”‚
β”‚   β”œβ”€β”€ services/               # Business logic
β”‚   β”‚   β”œβ”€β”€ servers/
β”‚   β”‚   β”‚   β”œβ”€β”€ provisioner.go
β”‚   β”‚   β”‚   β”œβ”€β”€ hetzner.go
β”‚   β”‚   β”‚   β”œβ”€β”€ digitalocean.go
β”‚   β”‚   β”‚   └── manager.go
β”‚   β”‚   β”œβ”€β”€ sites/
β”‚   β”‚   β”‚   β”œβ”€β”€ deployer.go
β”‚   β”‚   β”‚   β”œβ”€β”€ templates.go
β”‚   β”‚   β”‚   └── manager.go
β”‚   β”‚   β”œβ”€β”€ databases/
β”‚   β”‚   β”‚   β”œβ”€β”€ mysql.go
β”‚   β”‚   β”‚   β”œβ”€β”€ postgresql.go
β”‚   β”‚   β”‚   β”œβ”€β”€ mongodb.go
β”‚   β”‚   β”‚   └── redis.go
β”‚   β”‚   β”œβ”€β”€ email/
β”‚   β”‚   β”‚   β”œβ”€β”€ postfix.go
β”‚   β”‚   β”‚   β”œβ”€β”€ dovecot.go
β”‚   β”‚   β”‚   β”œβ”€β”€ accounts.go
β”‚   β”‚   β”‚   β”œβ”€β”€ aliases.go
β”‚   β”‚   β”‚   └── spam.go
β”‚   β”‚   β”œβ”€β”€ dns/
β”‚   β”‚   β”‚   β”œβ”€β”€ bind9.go
β”‚   β”‚   β”‚   β”œβ”€β”€ cloudflare.go
β”‚   β”‚   β”‚   β”œβ”€β”€ route53.go
β”‚   β”‚   β”‚   └── manager.go
β”‚   β”‚   β”œβ”€β”€ ssl/
β”‚   β”‚   β”‚   β”œβ”€β”€ acme.go
β”‚   β”‚   β”‚   β”œβ”€β”€ letsencrypt.go
β”‚   β”‚   β”‚   └── manager.go
β”‚   β”‚   β”œβ”€β”€ security/
β”‚   β”‚   β”‚   β”œβ”€β”€ waf.go
β”‚   β”‚   β”‚   β”œβ”€β”€ firewall.go
β”‚   β”‚   β”‚   β”œβ”€β”€ fail2ban.go
β”‚   β”‚   β”‚   β”œβ”€β”€ clamav.go
β”‚   β”‚   β”‚   └── scanner.go
β”‚   β”‚   β”œβ”€β”€ backups/
β”‚   β”‚   β”‚   β”œβ”€β”€ scheduler.go
β”‚   β”‚   β”‚   β”œβ”€β”€ s3.go
β”‚   β”‚   β”‚   └── restore.go
β”‚   β”‚   β”œβ”€β”€ monitoring/
β”‚   β”‚   β”‚   β”œβ”€β”€ metrics.go
β”‚   β”‚   β”‚   β”œβ”€β”€ alerts.go
β”‚   β”‚   β”‚   └── uptime.go
β”‚   β”‚   └── billing/
β”‚   β”‚       β”œβ”€β”€ stripe.go
β”‚   β”‚       β”œβ”€β”€ invoices.go
β”‚   β”‚       └── usage.go
β”‚   β”‚
β”‚   β”œβ”€β”€ models/                 # Database models
β”‚   β”‚   β”œβ”€β”€ user.go
β”‚   β”‚   β”œβ”€β”€ server.go
β”‚   β”‚   β”œβ”€β”€ site.go
β”‚   β”‚   β”œβ”€β”€ database.go
β”‚   β”‚   β”œβ”€β”€ email.go
β”‚   β”‚   β”œβ”€β”€ dns.go
β”‚   β”‚   β”œβ”€β”€ backup.go
β”‚   β”‚   └── invoice.go
β”‚   β”‚
β”‚   β”œβ”€β”€ jobs/                   # Background jobs
β”‚   β”‚   β”œβ”€β”€ server_provisioning.go
β”‚   β”‚   β”œβ”€β”€ site_deployment.go
β”‚   β”‚   β”œβ”€β”€ backup_execution.go
β”‚   β”‚   β”œβ”€β”€ ssl_renewal.go
β”‚   β”‚   β”œβ”€β”€ health_check.go
β”‚   β”‚   └── cleanup.go
β”‚   β”‚
β”‚   β”œβ”€β”€ middleware/             # HTTP middleware
β”‚   β”‚   β”œβ”€β”€ auth.go
β”‚   β”‚   β”œβ”€β”€ rbac.go
β”‚   β”‚   β”œβ”€β”€ rate_limit.go
β”‚   β”‚   β”œβ”€β”€ logging.go
β”‚   β”‚   └── cors.go
β”‚   β”‚
β”‚   β”œβ”€β”€ repository/             # Database access layer
β”‚   β”‚   β”œβ”€β”€ user.go
β”‚   β”‚   β”œβ”€β”€ server.go
β”‚   β”‚   β”œβ”€β”€ site.go
β”‚   β”‚   └── ...
β”‚   β”‚
β”‚   └── utils/                  # Helper functions
β”‚       β”œβ”€β”€ crypto.go
β”‚       β”œβ”€β”€ validator.go
β”‚       β”œβ”€β”€ ssh.go
β”‚       └── helpers.go
β”‚
β”œβ”€β”€ web/
β”‚   β”œβ”€β”€ templates/              # Templ HTML templates
β”‚   β”‚   β”œβ”€β”€ layouts/
β”‚   β”‚   β”‚   β”œβ”€β”€ base.templ
β”‚   β”‚   β”‚   β”œβ”€β”€ dashboard.templ
β”‚   β”‚   β”‚   └── auth.templ
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”‚   β”œβ”€β”€ dashboard.templ
β”‚   β”‚   β”‚   β”œβ”€β”€ servers/
β”‚   β”‚   β”‚   β”œβ”€β”€ sites/
β”‚   β”‚   β”‚   β”œβ”€β”€ databases/
β”‚   β”‚   β”‚   β”œβ”€β”€ email/
β”‚   β”‚   β”‚   β”œβ”€β”€ dns/
β”‚   β”‚   β”‚   β”œβ”€β”€ ssl/
β”‚   β”‚   β”‚   β”œβ”€β”€ backups/
β”‚   β”‚   β”‚   β”œβ”€β”€ monitoring/
β”‚   β”‚   β”‚   └── settings/
β”‚   β”‚   └── components/
β”‚   β”‚       β”œβ”€β”€ navbar.templ
β”‚   β”‚       β”œβ”€β”€ sidebar.templ
β”‚   β”‚       β”œβ”€β”€ server_card.templ
β”‚   β”‚       β”œβ”€β”€ site_card.templ
β”‚   β”‚       β”œβ”€β”€ modals.templ
β”‚   β”‚       └── forms.templ
β”‚   β”‚
β”‚   └── static/
β”‚       β”œβ”€β”€ css/
β”‚       β”‚   β”œβ”€β”€ tailwind.css
β”‚       β”‚   └── custom.css
β”‚       β”œβ”€β”€ js/
β”‚       β”‚   β”œβ”€β”€ alpine.js
β”‚       β”‚   └── htmx.js
β”‚       β”œβ”€β”€ images/
β”‚       └── icons/
β”‚
β”œβ”€β”€ automation/
β”‚   β”œβ”€β”€ playbooks/              # Ansible playbooks
β”‚   β”‚   β”œβ”€β”€ provision-server.yml
β”‚   β”‚   β”œβ”€β”€ setup-webserver.yml
β”‚   β”‚   β”œβ”€β”€ install-php.yml
β”‚   β”‚   β”œβ”€β”€ install-nodejs.yml
β”‚   β”‚   β”œβ”€β”€ install-mysql.yml
β”‚   β”‚   β”œβ”€β”€ install-postgresql.yml
β”‚   β”‚   β”œβ”€β”€ install-mongodb.yml
β”‚   β”‚   β”œβ”€β”€ install-redis.yml
β”‚   β”‚   β”œβ”€β”€ setup-email.yml
β”‚   β”‚   β”œβ”€β”€ setup-dns.yml
β”‚   β”‚   β”œβ”€β”€ configure-firewall.yml
β”‚   β”‚   β”œβ”€β”€ install-waf.yml
β”‚   β”‚   β”œβ”€β”€ install-fail2ban.yml
β”‚   β”‚   β”œβ”€β”€ install-clamav.yml
β”‚   β”‚   β”œβ”€β”€ configure-ssl.yml
β”‚   β”‚   β”œβ”€β”€ setup-backups.yml
β”‚   β”‚   β”œβ”€β”€ install-monitoring.yml
β”‚   β”‚   └── security-hardening.yml
β”‚   β”‚
β”‚   β”œβ”€β”€ roles/                  # Ansible roles
β”‚   β”‚   β”œβ”€β”€ common/
β”‚   β”‚   β”œβ”€β”€ webserver/
β”‚   β”‚   β”œβ”€β”€ database/
β”‚   β”‚   β”œβ”€β”€ email/
β”‚   β”‚   β”œβ”€β”€ security/
β”‚   β”‚   └── monitoring/
β”‚   β”‚
β”‚   β”œβ”€β”€ scripts/                # Python management scripts
β”‚   β”‚   β”œβ”€β”€ server_manager.py
β”‚   β”‚   β”œβ”€β”€ site_manager.py
β”‚   β”‚   β”œβ”€β”€ database_manager.py
β”‚   β”‚   β”œβ”€β”€ email_manager.py
β”‚   β”‚   β”œβ”€β”€ dns_manager.py
β”‚   β”‚   β”œβ”€β”€ ssl_manager.py
β”‚   β”‚   β”œβ”€β”€ backup_manager.py
β”‚   β”‚   β”œβ”€β”€ firewall_manager.py
β”‚   β”‚   └── monitoring_agent.py
β”‚   β”‚
β”‚   β”œβ”€β”€ templates/              # Configuration templates
β”‚   β”‚   β”œβ”€β”€ nginx/
β”‚   β”‚   β”‚   β”œβ”€β”€ vhost.conf.j2
β”‚   β”‚   β”‚   β”œβ”€β”€ php.conf.j2
β”‚   β”‚   β”‚   └── nodejs.conf.j2
β”‚   β”‚   β”œβ”€β”€ apache/
β”‚   β”‚   β”‚   └── vhost.conf.j2
β”‚   β”‚   β”œβ”€β”€ php/
β”‚   β”‚   β”‚   └── php.ini.j2
β”‚   β”‚   β”œβ”€β”€ mysql/
β”‚   β”‚   β”‚   └── my.cnf.j2
β”‚   β”‚   β”œβ”€β”€ postfix/
β”‚   β”‚   β”‚   β”œβ”€β”€ main.cf.j2
β”‚   β”‚   β”‚   └── master.cf.j2
β”‚   β”‚   β”œβ”€β”€ dovecot/
β”‚   β”‚   β”‚   └── dovecot.conf.j2
β”‚   β”‚   β”œβ”€β”€ fail2ban/
β”‚   β”‚   β”‚   └── jail.local.j2
β”‚   β”‚   └── modsecurity/
β”‚   β”‚       └── custom-rules.conf.j2
β”‚   β”‚
β”‚   └── inventory/              # Ansible inventory
β”‚       β”œβ”€β”€ production.ini
β”‚       └── staging.ini
β”‚
β”œβ”€β”€ migrations/                 # Database migrations
β”‚   β”œβ”€β”€ 001_initial_schema.sql
β”‚   β”œβ”€β”€ 002_add_email_tables.sql
β”‚   β”œβ”€β”€ 003_add_dns_tables.sql
β”‚   └── ...
β”‚
β”œβ”€β”€ configs/                    # Configuration files
β”‚   β”œβ”€β”€ config.yaml.example
β”‚   β”œβ”€β”€ providers.yaml.example
β”‚   └── security.yaml.example
β”‚
β”œβ”€β”€ scripts/                    # Build and deployment scripts
β”‚   β”œβ”€β”€ build.sh
β”‚   β”œβ”€β”€ deploy.sh
β”‚   β”œβ”€β”€ migrate.sh
β”‚   └── setup-dev.sh
β”‚
β”œβ”€β”€ tests/                      # Tests
β”‚   β”œβ”€β”€ unit/
β”‚   β”œβ”€β”€ integration/
β”‚   └── e2e/
β”‚
β”œβ”€β”€ docs/                       # Documentation
β”‚   β”œβ”€β”€ getting-started.md
β”‚   β”œβ”€β”€ architecture.md
β”‚   β”œβ”€β”€ api-reference.md
β”‚   β”œβ”€β”€ ansible-playbooks.md
β”‚   └── security.md
β”‚
β”œβ”€β”€ docker/                     # Docker configuration
β”‚   β”œβ”€β”€ api/
β”‚   β”‚   └── Dockerfile
β”‚   β”œβ”€β”€ worker/
β”‚   β”‚   └── Dockerfile
β”‚   └── agent/
β”‚       └── Dockerfile
β”‚
β”œβ”€β”€ docker-compose.yml          # Development environment
β”œβ”€β”€ docker-compose.prod.yml     # Production setup
β”œβ”€β”€ Makefile                    # Build automation
β”œβ”€β”€ go.mod                      # Go dependencies
β”œβ”€β”€ go.sum
β”œβ”€β”€ package.json                # Frontend dependencies
β”œβ”€β”€ tailwind.config.js          # Tailwind configuration
└── README.md                   # This file

🚦 Quick Start

Prerequisites

  • Ubuntu 22.04/24.04 or Debian 11/12
  • Go 1.21+
  • Node.js 18+
  • PostgreSQL 15+
  • Redis 7+
  • systemd (included in Ubuntu/Debian)
  • Nginx (as reverse proxy)

Production Installation

  1. Clone the repository
git clone https://github.com/yourusername/vip-hosting-panel-v2.git
cd vip-hosting-panel-v2
  1. Run the automated installer
sudo bash scripts/install.sh

This will:

  • Install all system dependencies (PostgreSQL, Redis, Nginx)
  • Build the Go binaries
  • Setup systemd services
  • Configure firewall
  • Create database and run migrations
  • Generate SSL certificates
  • Start all services

Manual Installation

  1. Install system dependencies
# Update system
sudo apt update && sudo apt upgrade -y

# Install PostgreSQL
sudo apt install postgresql postgresql-contrib -y

# Install Redis
sudo apt install redis-server -y

# Install Nginx
sudo apt install nginx -y

# Install Go (if not installed)
wget https://go.dev/dl/go1.21.6.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.21.6.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin

# Install Node.js
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install nodejs -y

# Install Python dependencies
sudo apt install python3 python3-pip ansible -y
pip3 install -r automation/requirements.txt
  1. Setup database
sudo -u postgres psql << EOF
CREATE DATABASE vip_hosting;
CREATE USER vip_panel WITH PASSWORD 'change_this_password';
GRANT ALL PRIVILEGES ON DATABASE vip_hosting TO vip_panel;
\c vip_hosting
GRANT ALL ON SCHEMA public TO vip_panel;
EOF
  1. Copy and configure
# Copy config files
cp configs/config.yaml.example configs/config.yaml
cp configs/providers.yaml.example configs/providers.yaml

# Edit configurations
nano configs/config.yaml
  1. Build the application
make build
  1. Install systemd services
sudo make install-services
  1. Start services
sudo systemctl enable vip-panel-api
sudo systemctl enable vip-panel-worker
sudo systemctl start vip-panel-api
sudo systemctl start vip-panel-worker
  1. Setup Nginx reverse proxy
sudo make setup-nginx
sudo systemctl reload nginx
  1. Access the panel
https://your-domain.com or https://your-server-ip
Default credentials:
Email: admin@example.com
Password: admin123

Development Setup

# Install dependencies
go mod download
npm install

# Run migrations
make migrate

# Start in development mode
make dev

πŸ”§ Configuration

Main Configuration (configs/config.yaml)

server:
  host: 0.0.0.0
  port: 3000
  read_timeout: 30s
  write_timeout: 30s

database:
  host: localhost
  port: 5432
  name: vip_hosting
  user: postgres
  password: postgres
  max_connections: 100

redis:
  host: localhost
  port: 6379
  password: ""
  db: 0

jwt:
  secret: "your-secret-key-change-in-production"
  expiration: 24h

features:
  multi_php: true
  multi_nodejs: true
  multi_database: true
  email_server: true
  dns_management: true
  waf: true
  antivirus: true

Provider Configuration (configs/providers.yaml)

providers:
  hetzner:
    enabled: true
    api_token: "your-hetzner-api-token"
    default_region: nbg1
    
  digitalocean:
    enabled: false
    api_token: ""
    
  cloudflare:
    enabled: true
    api_token: "your-cloudflare-api-token"
    email: "your-email@example.com"

stripe:
  enabled: true
  secret_key: "sk_test_..."
  public_key: "pk_test_..."
  webhook_secret: "whsec_..."

πŸ“š API Documentation

Authentication

POST /api/auth/login

{
  "email": "user@example.com",
  "password": "password123"
}

POST /api/auth/register

{
  "email": "user@example.com",
  "password": "password123",
  "name": "John Doe"
}

Server Management

GET /api/servers - List all servers POST /api/servers - Create new server GET /api/servers/:id - Get server details PUT /api/servers/:id - Update server DELETE /api/servers/:id - Delete server POST /api/servers/:id/reboot - Reboot server POST /api/servers/:id/resize - Resize server

Site Management

GET /api/sites - List all sites POST /api/sites - Create new site GET /api/sites/:id - Get site details PUT /api/sites/:id - Update site DELETE /api/sites/:id - Delete site POST /api/sites/:id/deploy - Deploy site

Database Management

GET /api/databases - List all databases POST /api/databases - Create database DELETE /api/databases/:id - Delete database

Email Management

GET /api/email/accounts - List email accounts POST /api/email/accounts - Create email account GET /api/email/aliases - List aliases POST /api/email/aliases - Create alias

DNS Management

GET /api/dns/zones - List DNS zones POST /api/dns/zones - Create DNS zone GET /api/dns/records - List DNS records POST /api/dns/records - Create DNS record

πŸ” Security Features

WAF Rules

The panel includes ModSecurity with OWASP Core Rule Set. Custom rules can be added per-site:

# Custom WAF rule example
SecRule REQUEST_URI "@contains /admin" \
    "id:1000,phase:1,deny,status:403,msg:'Admin access blocked'"

Firewall Rules

Default firewall rules are automatically configured:

  • SSH (22) - Restricted to management IPs
  • HTTP (80) - Open
  • HTTPS (443) - Open
  • MySQL (3306) - Localhost only
  • PostgreSQL (5432) - Localhost only
  • SMTP (25, 587) - Open
  • IMAP (143, 993) - Open
  • POP3 (110, 995) - Open

Fail2ban Configuration

Automatic brute-force protection for:

  • SSH
  • FTP
  • Email (SMTP, IMAP, POP3)
  • Panel login
  • WordPress
  • Custom rules per application

πŸ“Š Monitoring

Metrics Collected

  • CPU usage (per core and total)
  • Memory usage (used, free, cached)
  • Disk usage (per partition)
  • Network traffic (in/out)
  • Process count
  • Load average
  • Database connections
  • Web server requests
  • Email queue size

Alert Conditions

  • CPU > 80% for 5 minutes
  • Memory > 90%
  • Disk > 85%
  • Service down
  • SSL certificate expiring in < 7 days
  • Backup failed
  • Security scan detected malware

πŸ”„ Backup System

Backup Types

  1. Full Backup: Complete server snapshot
  2. Incremental Backup: Changes since last backup
  3. Database Backup: SQL dumps
  4. File Backup: Website files only

Backup Storage

  • Local storage (on-server)
  • S3-compatible (AWS, DigitalOcean Spaces, MinIO)
  • FTP/SFTP remote servers
  • Multiple destinations per backup

Restore Process

  1. Select backup point
  2. Choose restore type (full, files only, database only)
  3. Select destination (original location or new location)
  4. Verify and confirm
  5. Automated rollback if restore fails

πŸ’³ Billing System

Subscription Plans

  • Tiered pricing based on resources
  • Custom pricing per reseller
  • Usage-based add-ons
  • One-time charges support

Invoice Generation

  • Automated monthly invoicing
  • Prorated charges for upgrades/downgrades
  • VAT/tax calculation
  • Multi-currency support
  • PDF generation with custom branding

🎯 Roadmap

v1.0 (Current - Months 1-2)

  • βœ… Core infrastructure
  • βœ… Multi-PHP/Node.js support
  • βœ… Basic security features
  • βœ… Email server
  • βœ… DNS management
  • βœ… Billing integration

v1.1 (Month 3)

  • Advanced WAF rules
  • Container support (Docker)
  • Kubernetes integration
  • Advanced analytics
  • Mobile app

v1.2 (Month 4)

  • White-labeling
  • Plugin system
  • Marketplace
  • Advanced automation
  • AI-powered optimization

πŸ“– Documentation

🀝 Contributing

Contributions are welcome! Please read CONTRIBUTING.md for details.

πŸ“„ License

This project is licensed under the MIT License - see LICENSE file for details.

πŸ™ Acknowledgments

  • HTMX for the hypermedia approach
  • Templ for type-safe Go templates
  • Fiber for the blazing-fast web framework
  • Ansible for infrastructure automation
  • The open-source community

πŸ“ž Support


Made with ❀️ by the VIP Hosting Panel Team

About

No description, website, or topics provided.

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages