Upload 72 files
Browse files- core/__pycache__/__init__.cpython-311.pyc +0 -0
- core/__pycache__/dhcp_server.cpython-311.pyc +0 -0
- core/__pycache__/firewall.cpython-311.pyc +0 -0
- core/__pycache__/ip_parser.cpython-311.pyc +0 -0
- core/__pycache__/logger.cpython-311.pyc +0 -0
- core/__pycache__/nat_engine.cpython-311.pyc +0 -0
- core/__pycache__/openvpn_manager.cpython-311.pyc +0 -0
- core/__pycache__/packet_bridge.cpython-311.pyc +0 -0
- core/__pycache__/session_tracker.cpython-311.pyc +0 -0
- core/__pycache__/socket_translator.cpython-311.pyc +0 -0
- core/__pycache__/tcp_engine.cpython-311.pyc +0 -0
- core/__pycache__/traffic_router.cpython-311.pyc +0 -0
- core/__pycache__/virtual_router.cpython-311.pyc +0 -0
- main.py +2 -0
- models/__pycache__/enhanced_user.cpython-311.pyc +0 -0
- models/__pycache__/user.cpython-311.pyc +0 -0
- models/enhanced_user.py +2 -2
- models/user.py +2 -0
- requirements.txt +1 -1
- routes/__pycache__/auth.cpython-311.pyc +0 -0
- routes/__pycache__/isp_api.cpython-311.pyc +0 -0
- routes/__pycache__/user.cpython-311.pyc +0 -0
- routes/auth.py +3 -1
core/__pycache__/__init__.cpython-311.pyc
CHANGED
|
Binary files a/core/__pycache__/__init__.cpython-311.pyc and b/core/__pycache__/__init__.cpython-311.pyc differ
|
|
|
core/__pycache__/dhcp_server.cpython-311.pyc
CHANGED
|
Binary files a/core/__pycache__/dhcp_server.cpython-311.pyc and b/core/__pycache__/dhcp_server.cpython-311.pyc differ
|
|
|
core/__pycache__/firewall.cpython-311.pyc
CHANGED
|
Binary files a/core/__pycache__/firewall.cpython-311.pyc and b/core/__pycache__/firewall.cpython-311.pyc differ
|
|
|
core/__pycache__/ip_parser.cpython-311.pyc
CHANGED
|
Binary files a/core/__pycache__/ip_parser.cpython-311.pyc and b/core/__pycache__/ip_parser.cpython-311.pyc differ
|
|
|
core/__pycache__/logger.cpython-311.pyc
CHANGED
|
Binary files a/core/__pycache__/logger.cpython-311.pyc and b/core/__pycache__/logger.cpython-311.pyc differ
|
|
|
core/__pycache__/nat_engine.cpython-311.pyc
CHANGED
|
Binary files a/core/__pycache__/nat_engine.cpython-311.pyc and b/core/__pycache__/nat_engine.cpython-311.pyc differ
|
|
|
core/__pycache__/openvpn_manager.cpython-311.pyc
CHANGED
|
Binary files a/core/__pycache__/openvpn_manager.cpython-311.pyc and b/core/__pycache__/openvpn_manager.cpython-311.pyc differ
|
|
|
core/__pycache__/packet_bridge.cpython-311.pyc
CHANGED
|
Binary files a/core/__pycache__/packet_bridge.cpython-311.pyc and b/core/__pycache__/packet_bridge.cpython-311.pyc differ
|
|
|
core/__pycache__/session_tracker.cpython-311.pyc
CHANGED
|
Binary files a/core/__pycache__/session_tracker.cpython-311.pyc and b/core/__pycache__/session_tracker.cpython-311.pyc differ
|
|
|
core/__pycache__/socket_translator.cpython-311.pyc
CHANGED
|
Binary files a/core/__pycache__/socket_translator.cpython-311.pyc and b/core/__pycache__/socket_translator.cpython-311.pyc differ
|
|
|
core/__pycache__/tcp_engine.cpython-311.pyc
CHANGED
|
Binary files a/core/__pycache__/tcp_engine.cpython-311.pyc and b/core/__pycache__/tcp_engine.cpython-311.pyc differ
|
|
|
core/__pycache__/traffic_router.cpython-311.pyc
CHANGED
|
Binary files a/core/__pycache__/traffic_router.cpython-311.pyc and b/core/__pycache__/traffic_router.cpython-311.pyc differ
|
|
|
core/__pycache__/virtual_router.cpython-311.pyc
CHANGED
|
Binary files a/core/__pycache__/virtual_router.cpython-311.pyc and b/core/__pycache__/virtual_router.cpython-311.pyc differ
|
|
|
main.py
CHANGED
|
@@ -6,6 +6,7 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
|
|
| 6 |
from flask import Flask, send_from_directory
|
| 7 |
from models.user import db
|
| 8 |
from routes.user import user_bp
|
|
|
|
| 9 |
from routes.isp_api import init_engines, isp_api
|
| 10 |
from core.openvpn_manager import initialize_openvpn_manager
|
| 11 |
|
|
@@ -15,6 +16,7 @@ app.config['SECRET_KEY'] = 'asdf#FGSgvasgf$5$WGT'
|
|
| 15 |
|
| 16 |
app.register_blueprint(user_bp, url_prefix='/api')
|
| 17 |
app.register_blueprint(isp_api, url_prefix='/api')
|
|
|
|
| 18 |
|
| 19 |
# uncomment if you need to use database
|
| 20 |
app.config['SQLALCHEMY_DATABASE_URI'] = f"sqlite:///{os.path.join(os.path.dirname(__file__), 'database', 'app.db')}"
|
|
|
|
| 6 |
from flask import Flask, send_from_directory
|
| 7 |
from models.user import db
|
| 8 |
from routes.user import user_bp
|
| 9 |
+
from routes.auth import auth_bp
|
| 10 |
from routes.isp_api import init_engines, isp_api
|
| 11 |
from core.openvpn_manager import initialize_openvpn_manager
|
| 12 |
|
|
|
|
| 16 |
|
| 17 |
app.register_blueprint(user_bp, url_prefix='/api')
|
| 18 |
app.register_blueprint(isp_api, url_prefix='/api')
|
| 19 |
+
app.register_blueprint(auth_bp, url_prefix='/api')
|
| 20 |
|
| 21 |
# uncomment if you need to use database
|
| 22 |
app.config['SQLALCHEMY_DATABASE_URI'] = f"sqlite:///{os.path.join(os.path.dirname(__file__), 'database', 'app.db')}"
|
models/__pycache__/enhanced_user.cpython-311.pyc
CHANGED
|
Binary files a/models/__pycache__/enhanced_user.cpython-311.pyc and b/models/__pycache__/enhanced_user.cpython-311.pyc differ
|
|
|
models/__pycache__/user.cpython-311.pyc
CHANGED
|
Binary files a/models/__pycache__/user.cpython-311.pyc and b/models/__pycache__/user.cpython-311.pyc differ
|
|
|
models/enhanced_user.py
CHANGED
|
@@ -5,7 +5,7 @@ This module provides comprehensive user management with security features,
|
|
| 5 |
VPN client management, and session tracking capabilities.
|
| 6 |
"""
|
| 7 |
|
| 8 |
-
|
| 9 |
from werkzeug.security import generate_password_hash, check_password_hash
|
| 10 |
from datetime import datetime, timedelta
|
| 11 |
import secrets
|
|
@@ -13,7 +13,7 @@ import jwt
|
|
| 13 |
import re
|
| 14 |
from flask import current_app
|
| 15 |
|
| 16 |
-
|
| 17 |
|
| 18 |
class User(db.Model):
|
| 19 |
"""Enhanced User model with authentication and VPN management"""
|
|
|
|
| 5 |
VPN client management, and session tracking capabilities.
|
| 6 |
"""
|
| 7 |
|
| 8 |
+
|
| 9 |
from werkzeug.security import generate_password_hash, check_password_hash
|
| 10 |
from datetime import datetime, timedelta
|
| 11 |
import secrets
|
|
|
|
| 13 |
import re
|
| 14 |
from flask import current_app
|
| 15 |
|
| 16 |
+
from .user import db
|
| 17 |
|
| 18 |
class User(db.Model):
|
| 19 |
"""Enhanced User model with authentication and VPN management"""
|
models/user.py
CHANGED
|
@@ -16,3 +16,5 @@ class User(db.Model):
|
|
| 16 |
'username': self.username,
|
| 17 |
'email': self.email
|
| 18 |
}
|
|
|
|
|
|
|
|
|
| 16 |
'username': self.username,
|
| 17 |
'email': self.email
|
| 18 |
}
|
| 19 |
+
|
| 20 |
+
|
requirements.txt
CHANGED
|
@@ -27,7 +27,7 @@ multidict==6.6.3
|
|
| 27 |
propcache==0.3.2
|
| 28 |
typing_extensions==4.14.0
|
| 29 |
yarl==1.20.1
|
| 30 |
-
|
| 31 |
# Additional dependencies for VPN management
|
| 32 |
psutil==5.9.8
|
| 33 |
|
|
|
|
| 27 |
propcache==0.3.2
|
| 28 |
typing_extensions==4.14.0
|
| 29 |
yarl==1.20.1
|
| 30 |
+
|
| 31 |
# Additional dependencies for VPN management
|
| 32 |
psutil==5.9.8
|
| 33 |
|
routes/__pycache__/auth.cpython-311.pyc
CHANGED
|
Binary files a/routes/__pycache__/auth.cpython-311.pyc and b/routes/__pycache__/auth.cpython-311.pyc differ
|
|
|
routes/__pycache__/isp_api.cpython-311.pyc
CHANGED
|
Binary files a/routes/__pycache__/isp_api.cpython-311.pyc and b/routes/__pycache__/isp_api.cpython-311.pyc differ
|
|
|
routes/__pycache__/user.cpython-311.pyc
CHANGED
|
Binary files a/routes/__pycache__/user.cpython-311.pyc and b/routes/__pycache__/user.cpython-311.pyc differ
|
|
|
routes/auth.py
CHANGED
|
@@ -6,10 +6,12 @@ Flask routes for user registration, login, password reset, and account managemen
|
|
| 6 |
|
| 7 |
from flask import Blueprint, request, jsonify, current_app
|
| 8 |
from flask_cors import cross_origin
|
| 9 |
-
from models.
|
|
|
|
| 10 |
from functools import wraps
|
| 11 |
import logging
|
| 12 |
import re
|
|
|
|
| 13 |
from datetime import datetime, timedelta
|
| 14 |
|
| 15 |
logger = logging.getLogger(__name__)
|
|
|
|
| 6 |
|
| 7 |
from flask import Blueprint, request, jsonify, current_app
|
| 8 |
from flask_cors import cross_origin
|
| 9 |
+
from models.user import db
|
| 10 |
+
from models.enhanced_user import User, VPNClient
|
| 11 |
from functools import wraps
|
| 12 |
import logging
|
| 13 |
import re
|
| 14 |
+
import secrets
|
| 15 |
from datetime import datetime, timedelta
|
| 16 |
|
| 17 |
logger = logging.getLogger(__name__)
|