Füge Unterstützung für SSL/TLS in die Konfiguration und das Build-System ein
- Integriere die libwebsockets-Bibliothek für SSL/TLS WebSocket-Unterstützung in `CMakeLists.txt`. - Aktualisiere `chatconfig.json`, um SSL-Optionen wie `ssl_enabled`, `ssl_cert_path` und `ssl_key_path` hinzuzufügen. - Ergänze das `deploy.sh`-Skript um einen Schritt zur optionalen Einrichtung von SSL/TLS. - Modifiziere `update_config.sh`, um die SSL-Konfiguration in die Servereinstellungen zu integrieren. - Implementiere eine Überprüfung in `main.cpp`, um den SSL-Status zu prüfen und entsprechende Meldungen auszugeben.
This commit is contained in:
@@ -137,6 +137,18 @@ def merge_json(source_file, target_file, output_file):
|
||||
if 'database' not in db_config:
|
||||
db_config['database'] = database
|
||||
|
||||
# Spezielle Behandlung für server-Konfiguration (SSL)
|
||||
if 'server' in merged_data and isinstance(merged_data['server'], dict):
|
||||
server_config = merged_data['server']
|
||||
|
||||
# SSL-Konfiguration hinzufügen falls nicht vorhanden
|
||||
if 'ssl_enabled' not in server_config:
|
||||
server_config['ssl_enabled'] = False
|
||||
if 'ssl_cert_path' not in server_config:
|
||||
server_config['ssl_cert_path'] = "/etc/yourpart/server.crt"
|
||||
if 'ssl_key_path' not in server_config:
|
||||
server_config['ssl_key_path'] = "/etc/yourpart/server.key"
|
||||
|
||||
with open(output_file, 'w') as f:
|
||||
json.dump(merged_data, f, indent=4, ensure_ascii=False)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user