ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.
Python astracloudflarecontrol-panelcyberpaneldnsfablehosting-control-panelhosting-panelkimi-k3server-managementserverkitubuntu-web-panelwebserver
Add dynamic ServerKit version endpoint and UI
Juan Denisb619779059b4
diff --git a/backend/app/api/system.py b/backend/app/api/system.pyindex 78cb5a77..ea019f98 100644--- a/backend/app/api/system.py+++ b/backend/app/api/system.py@@ -1,4 +1,5 @@-from flask import Blueprint, jsonify+import os+from flask import Blueprint, jsonify, current_appfrom flask_jwt_extended import jwt_required, get_jwt_identityfrom app.models import Userfrom app.services.system_service import SystemService@@ -6,6 +7,33 @@ from app.services.system_service import SystemServicesystem_bp = Blueprint('system', __name__)+@system_bp.route('/version', methods=['GET'])+def get_version():+ """Get ServerKit version - no auth required."""+ version = '1.0.0' # Default version++ # Try to read from VERSION file+ version_paths = [+ '/opt/serverkit/VERSION',+ os.path.join(current_app.root_path, '..', 'VERSION'),+ os.path.join(current_app.root_path, '..', '..', 'VERSION'),+ ]++ for path in version_paths:+ try:+ if os.path.exists(path):+ with open(path, 'r') as f:+ version = f.read().strip()+ break+ except Exception:+ pass++ return jsonify({+ 'version': version,+ 'name': 'ServerKit'+ }), 200++@system_bp.route('/metrics', methods=['GET'])@jwt_required()def get_metrics():diff --git a/frontend/src/pages/Settings.jsx b/frontend/src/pages/Settings.jsxindex 01241d5f..4cf1fc42 100644--- a/frontend/src/pages/Settings.jsx+++ b/frontend/src/pages/Settings.jsx@@ -1647,6 +1647,20 @@ const SystemInfo = () => {};const AboutSection = () => {+ const [version, setVersion] = useState('...');++ useEffect(() => {+ const fetchVersion = async () => {+ try {+ const response = await api.get('/system/version');+ setVersion(response.data.version);+ } catch (error) {+ setVersion('1.0.0');+ }+ };+ fetchVersion();+ }, []);+return (<div className="settings-section"><div className="section-header">@@ -1661,7 +1675,7 @@ const AboutSection = () => {</svg></div><h3>ServerKit</h3>- <p className="version">Version 1.0.0</p>+ <p className="version">Version {version}</p><p className="description">A modern, lightweight server management panel for managing web applications,databases, domains, and more. Built with Flask and React.