From 36db23503774c532b6858c176d891bef52699b01 Mon Sep 17 00:00:00 2001 From: Elora VPN Date: Mon, 16 Dec 2024 20:37:31 +0330 Subject: [PATCH] Improve ReadME --- README.md | 256 +++++++++++++++++++++++++++------------ src/telegram/__init__.py | 4 +- 2 files changed, 180 insertions(+), 80 deletions(-) diff --git a/README.md b/README.md index c0f1132..19441db 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,16 @@ [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) +## Tutorial Video 📝 + +
+ + + youtube logo + + +
+ ## 🚀 Features ### 🌍 Multi-Zone Management @@ -138,43 +148,6 @@ graph TB - Traffic encryption - Secure protocols -## 📖 Usage Guidelines - -### Administrator Tasks -1. Enable SSL and configure domains -2. Set up zones and servers -3. Monitor system health -4. Manage user accounts - -### User Tasks -1. Purchase/activate account -2. Get subscription URL -3. Configure VPN client -4. Monitor usage via bot - -## ⚡ Quick Start - -1. **System Setup** - ```bash - # Install required components - # Configure SSL - # Set up domains - ``` - -2. **Zone Configuration** - ```bash - # Configure zones - # Set up servers - # Enable synchronization - ``` - -3. **Account Management** - ```bash - # Create accounts - # Monitor usage - # Manage subscriptions - ``` - ## ✨ Key Benefits ### For Users @@ -202,7 +175,7 @@ graph TB ### Minimum Hardware Requirements - CPU: 1 core -- RAM: 1 GB +- RAM: 2 GB - Storage: 10 GB ### Prerequisites @@ -215,19 +188,41 @@ The installation script will automatically install these dependencies, but for r ## Quick Installation -### One-Line Installation -Auto-detects your public IP address -```bash -curl -fsSL https://raw.githubusercontent.com/eloravpn/EloraVPNManager/main/install.sh | sudo bash -``` +### Option 1: Custom Domain and Port (Recommended) + +For full functionality, including subscription URLs and all features: -### Custom Domain and Port ```bash curl -fsSL https://raw.githubusercontent.com/eloravpn/EloraVPNManager/main/install.sh | sudo bash -s -- \ --domain your-domain.com \ --port 8080 ``` +**Why use this method?** + +- Ensures all features work correctly +- Enables subscription URL functionality +- Provides better security through domain validation +- Allows proper SSL certificate setup +- Required for production deployments + +### Option 2: Quick One-Line Installation +Basic installation using auto-detected public IP (Limited functionality): + +Auto-detects your public IP address +```bash +curl -fsSL https://raw.githubusercontent.com/eloravpn/EloraVPNManager/main/install.sh | sudo bash +``` +**⚠️ Limitations of IP-based installation:** + +* Subscription URLs will not function +* Some features may be restricted +* Not recommended for production use +* SSL certificate setup may be problematic +* Limited security features + +Note: For production environments, always use Option 1 with a proper domain name. + ### Full Custom Installation ```bash curl -fsSL https://raw.githubusercontent.com/eloravpn/EloraVPNManager/main/install.sh | sudo bash -s -- \ @@ -254,6 +249,19 @@ curl -fsSL https://raw.githubusercontent.com/eloravpn/EloraVPNManager/main/insta | `--version` | Specific version to install | Latest version | +## Updating +To update the application, use one of these commands: + +```bash +# Update to latest version +curl -fsSL https://raw.githubusercontent.com/eloravpn/EloraVPNManager/main/install.sh | sudo bash -s -- --update + +# Update to specific version +curl -fsSL https://raw.githubusercontent.com/eloravpn/EloraVPNManager/main/install.sh | sudo bash -s -- --update --version v1.2.3 +``` +- Restart the service + + ### Domain/IP Configuration - If no domain is specified, the installer will automatically detect and use your server's public IP - If public IP detection fails, it will fall back to 'localhost' @@ -262,14 +270,53 @@ curl -fsSL https://raw.githubusercontent.com/eloravpn/EloraVPNManager/main/insta ## Post-Installation -### To listen on IPv6 -Just change the configuration in /opt/elora-vpn/.env +### To see full log + +`tail -f /var/log/elora-vpn/elora-vpn.log` + +### Configuring IPv6 Support +If your server has IPv6 capability, you can enable IPv6 listening by following these steps: + +**1. Access Control Panel** + +Log in to your control panel with administrator credentials +Navigate to the Settings menu +Select the Basic tab + + +**2. Configure IPv6** + +Locate the "Uvicorn Host" setting +Change the value from 0.0.0.0 to :: +Click Save to apply changes + + +**3. Apply Changes** + ``` -UVICORN_HOST=:: +# Restart the panel to activate IPv6 support +sudo systemctl restart elora-vpn +``` + +#### Verify the service is running +`sudo systemctl status elora-vpn` + +Verify IPv6 Connectivity +``` +# Check if the service is listening on IPv6 +sudo netstat -tulpn | grep elora-vpn ``` + +#### Test IPv6 connectivity (replace port if different) +`curl -6 http://[::1]:8080/` + + +Note: Ensure your firewall rules allow incoming connections on both IPv4 and IPv6 for your configured port. ### SSL Certificate Setup SSL certificates are essential for: + +- To work Subscription URL in all V2ray Clients! - Secure subscription links for V2Ray clients - Encrypted API communications - Secure web interface access @@ -300,24 +347,23 @@ After successful certification, your certificates will be located at: #### 3. Update Configuration -Update .env File +Access your control panel by logging in with your administrator credentials +Navigate to the SSL configuration: -```bash -sudo nano /opt/elora-vpn/.env +Click on "Settings" in the main menu +Select the "SSL" tab from the available options -# Update these lines: -UVICORN_SSL_CERTFILE=/etc/letsencrypt/live/your-domain.com/fullchain.pem -UVICORN_SSL_KEYFILE=/etc/letsencrypt/live/your-domain.com/privkey.pem -SUBSCRIPTION_BASE_URL=https://your-domain.com:your-port/api/sub -``` -Update .config File +Configure the certificate paths: -```bash -sudo nano /opt/elora-vpn/static/config.json +In the "SSL Certificate Path" field, enter the full path to your SSL certificate file (e.g., /etc/ssl/certs/your-certificate.crt) +In the "Private Key Path" field, enter the full path to your private key file (e.g., /etc/ssl/private/your-private-key.key) +Double-check that both paths are correct and the files are readable by the panel + +Apply the changes: + +Click "Save" or "Apply" to confirm your SSL configuration +Restart the panel service to apply the new SSL settings -# Update these line: -"BASE_URL": "https://your-domain.com:your-port/api", -``` #### 4. Enable Auto-Renewal ```bash @@ -350,12 +396,78 @@ sudo systemctl restart elora-vpn # View logs sudo journalctl -u elora-vpn -f ``` +### Configuration Guide + +#### Configuration File +The primary configuration settings are stored in the .env file: + +`nano '/opt/elora-vpn/.env` + +You can customize the panel's behavior through two methods: + +**1. Web Interface Settings** + +Access the control panel's Settings menu to configure: + +General system preferences +User management options +Security settings +Network configurations + + +**2. Environment File** + +For advanced configurations, you can directly edit the .env file. This allows you to: + +Set environment-specific variables +Configure database connections +Modify system paths +Enable debug modes +Set API keys and secrets +Define custom service endpoints + +Note: After modifying the .env file, restart the panel services to apply changes: +`sudo systemctl restart elora-vpn` + +_We recommend using the web interface for routine changes and the .env file for advanced system configurations. Always backup your configuration files before making significant changes._ + +## 📖 Usage Guidelines + +### Administrator Tasks +1. Enable SSL and configure domains +2. Set up zones and servers +3. Monitor system health +4. Manage user accounts + +### User Tasks +1. Purchase/activate account +2. Get subscription URL +3. Configure VPN client +4. Monitor usage via bot + +## ⚡ Quick Start + +1. **System Setup** + ```bash + # Install required components + # Configure SSL + # Set up domains + ``` + +2. **Zone Configuration** + ```bash + # Configure zones + # Set up servers + # Enable synchronization + ``` + +3. **Account Management** + ```bash + # Create accounts + # Monitor usage + # Manage subscriptions + ``` -### Configuration -The main configuration file is located at: -```bash -/opt/elora-vpn/.env -``` ### Default Paths - Installation Directory: `/opt/elora-vpn` @@ -491,18 +603,6 @@ If you encounter any issues: - The `.env` file contains sensitive information and is readable only by root - Default database user has limited permissions to only the necessary database -## Updating -To update the application, use one of these commands: - -```bash -# Update to latest version -curl -fsSL https://raw.githubusercontent.com/eloravpn/EloraVPNManager/main/install.sh | sudo bash -s -- --update - -# Update to specific version -curl -fsSL https://raw.githubusercontent.com/eloravpn/EloraVPNManager/main/install.sh | sudo bash -s -- --update --version v1.2.3 -``` -- Restart the service - ## Uninstallation To completely remove the application: ```bash diff --git a/src/telegram/__init__.py b/src/telegram/__init__.py index dd97f2e..589f536 100644 --- a/src/telegram/__init__.py +++ b/src/telegram/__init__.py @@ -18,7 +18,7 @@ if TELEGRAM_API_TOKEN or TELEGRAM_PAYMENT_API_TOKEN: apihelper.proxy = {"http": TELEGRAM_PROXY_URL, "https": TELEGRAM_PROXY_URL} -if TELEGRAM_API_TOKEN is not None: +if TELEGRAM_API_TOKEN: bot = TeleBot(TELEGRAM_API_TOKEN) @app.on_event("startup") @@ -39,7 +39,7 @@ def start_bot(): else: logger.warn("Telegram Bot not set!") -if TELEGRAM_PAYMENT_API_TOKEN is not None: +if TELEGRAM_PAYMENT_API_TOKEN: payment_bot = TeleBot(TELEGRAM_PAYMENT_API_TOKEN) @app.on_event("startup")