diff --git a/apps/pusher_app_prem/appserver/static/git_pusher.js b/apps/pusher_app_prem/appserver/static/git_pusher.js
index 21ddb04b..e07576ee 100644
--- a/apps/pusher_app_prem/appserver/static/git_pusher.js
+++ b/apps/pusher_app_prem/appserver/static/git_pusher.js
@@ -3,32 +3,74 @@
// Version 2.1 avec déploiement vers SH Cluster
// ============================================
-// Configuration
-const GIT_PUSHER_CONFIG = {
- // URL du serveur Git Pusher API
- serverUrl: (function() {
- const hostname = window.location.hostname;
- const protocol = window.location.protocol;
-
- // Si déjà sur le domaine API, l'utiliser directement
- if (hostname === 'myprivspldev-api.jp-engineering.fr') {
- return protocol + '//' + hostname;
- }
-
- // Si accès via le domaine Splunk principal, utiliser le domaine API
- if (hostname === 'myprivspldev.jp-engineering.fr') {
- return protocol + '//myprivspldev-api.jp-engineering.fr';
+// Configuration par défaut
+const DEFAULT_CONFIG = {
+ api: {
+ url: '',
+ port: 9999,
+ useProxy: true
+ },
+ deployer: {
+ enabled: false,
+ host: '',
+ port: 9998,
+ token: '',
+ useSSL: true
+ }
+};
+
+// Charger la configuration
+function loadAppConfig() {
+ try {
+ const stored = localStorage.getItem('git_pusher_config');
+ if (stored) {
+ return JSON.parse(stored);
}
-
- // Si c'est une IP ou localhost, ajouter le port 9999
- if (/^(\d{1,3}\.){3}\d{1,3}$/.test(hostname) || hostname === 'localhost') {
- return protocol + '//' + hostname + ':9999';
+ } catch (e) {
+ console.warn('Erreur chargement config localStorage:', e);
+ }
+ return DEFAULT_CONFIG;
+}
+
+// Déterminer l'URL du serveur API
+function getServerUrl() {
+ const config = loadAppConfig();
+ const hostname = window.location.hostname;
+ const protocol = window.location.protocol;
+
+ // Si une URL est configurée, l'utiliser
+ if (config.api && config.api.url) {
+ let url = config.api.url;
+ // Ajouter le port si pas de proxy
+ if (!config.api.useProxy && config.api.port) {
+ url = url.replace(/\/$/, '') + ':' + config.api.port;
}
-
- // Par défaut, ajouter le port 9999
+ return url;
+ }
+
+ // Auto-détection basée sur le hostname
+ // Si accès via le domaine Splunk principal, utiliser le domaine API
+ if (hostname === 'myprivspldev.jp-engineering.fr') {
+ return protocol + '//myprivspldev-api.jp-engineering.fr';
+ }
+
+ // Si déjà sur le domaine API
+ if (hostname === 'myprivspldev-api.jp-engineering.fr') {
+ return protocol + '//' + hostname;
+ }
+
+ // Si c'est une IP ou localhost, ajouter le port 9999
+ if (/^(\d{1,3}\.){3}\d{1,3}$/.test(hostname) || hostname === 'localhost') {
return protocol + '//' + hostname + ':9999';
- })(),
+ }
+ // Par défaut, ajouter le port 9999
+ return protocol + '//' + hostname + ':9999';
+}
+
+// Configuration
+const GIT_PUSHER_CONFIG = {
+ serverUrl: getServerUrl(),
credentialsKey: 'git_pusher_credentials',
deployerConfigKey: 'git_pusher_deployer_config',
version: '2.1.0'
diff --git a/apps/pusher_app_prem/appserver/static/git_pusher_config.js b/apps/pusher_app_prem/appserver/static/git_pusher_config.js
new file mode 100644
index 00000000..2b68714d
--- /dev/null
+++ b/apps/pusher_app_prem/appserver/static/git_pusher_config.js
@@ -0,0 +1,381 @@
+// ============================================
+// GIT PUSHER - CONFIGURATION PAGE
+// Version 2.1 - Compatible Splunk
+// ============================================
+
+require([
+ 'jquery',
+ 'splunkjs/mvc',
+ 'splunkjs/mvc/simplexml/ready!'
+], function($, mvc) {
+
+ console.log('Git Pusher Config v2.1 initializing...');
+
+ // Configuration par défaut
+ var DEFAULT_CONFIG = {
+ api: {
+ url: '',
+ port: 9999,
+ useProxy: true
+ },
+ deployer: {
+ enabled: false,
+ host: '',
+ port: 9998,
+ token: '',
+ useSSL: true
+ },
+ license: {
+ checkInterval: 24
+ },
+ advanced: {
+ logLevel: 'INFO',
+ timeout: 30,
+ gitTimeout: 120
+ }
+ };
+
+ // URL de l'API pour la config
+ function getConfigApiUrl() {
+ var hostname = window.location.hostname;
+ var protocol = window.location.protocol;
+
+ // Essayer de charger depuis localStorage
+ try {
+ var stored = localStorage.getItem('git_pusher_config');
+ if (stored) {
+ var config = JSON.parse(stored);
+ if (config.api && config.api.url) {
+ var url = config.api.url;
+ if (!config.api.useProxy && config.api.port) {
+ url = url.replace(/\/$/, '') + ':' + config.api.port;
+ }
+ return url;
+ }
+ }
+ } catch(e) {}
+
+ // Auto-détection
+ if (hostname === 'myprivspldev.jp-engineering.fr') {
+ return protocol + '//myprivspldev-api.jp-engineering.fr';
+ }
+ if (hostname === 'myprivspldev-api.jp-engineering.fr') {
+ return protocol + '//' + hostname;
+ }
+ if (/^(\d{1,3}\.){3}\d{1,3}$/.test(hostname) || hostname === 'localhost') {
+ return protocol + '//' + hostname + ':9999';
+ }
+ return protocol + '//' + hostname + ':9999';
+ }
+
+ // ============================================
+ // CHARGEMENT DE LA CONFIGURATION
+ // ============================================
+
+ function loadConfig() {
+ console.log('Loading configuration...');
+ var apiUrl = getConfigApiUrl();
+
+ $.ajax({
+ url: apiUrl + '/config',
+ method: 'GET',
+ dataType: 'json',
+ success: function(config) {
+ console.log('Config loaded:', config);
+ applyConfigToForm(config);
+ showMessage('Configuration chargée', 'success');
+ },
+ error: function(xhr, status, error) {
+ console.log('No server config, using defaults:', error);
+ applyConfigToForm(DEFAULT_CONFIG);
+ }
+ });
+
+ loadLicenseStatus();
+ }
+
+ function applyConfigToForm(config) {
+ // API
+ $('#api-url').val(config.api ? config.api.url || '' : '');
+ $('#api-port').val(config.api ? config.api.port || 9999 : 9999);
+ $('#use-proxy').prop('checked', config.api ? config.api.useProxy !== false : true);
+
+ // Deployer
+ $('#deployer-enabled').prop('checked', config.deployer ? config.deployer.enabled || false : false);
+ $('#deployer-host').val(config.deployer ? config.deployer.host || '' : '');
+ $('#deployer-port').val(config.deployer ? config.deployer.port || 9998 : 9998);
+ $('#deployer-token').val(config.deployer ? config.deployer.token || '' : '');
+ $('#deployer-use-ssl').prop('checked', config.deployer ? config.deployer.useSSL !== false : true);
+
+ // Licence
+ $('#license-check-interval').val(config.license ? config.license.checkInterval || 24 : 24);
+
+ // Avancé
+ $('#log-level').val(config.advanced ? config.advanced.logLevel || 'INFO' : 'INFO');
+ $('#timeout').val(config.advanced ? config.advanced.timeout || 30 : 30);
+ $('#git-timeout').val(config.advanced ? config.advanced.gitTimeout || 120 : 120);
+ }
+
+ function getConfigFromForm() {
+ return {
+ api: {
+ url: $('#api-url').val().trim(),
+ port: parseInt($('#api-port').val()) || 9999,
+ useProxy: $('#use-proxy').is(':checked')
+ },
+ deployer: {
+ enabled: $('#deployer-enabled').is(':checked'),
+ host: $('#deployer-host').val().trim(),
+ port: parseInt($('#deployer-port').val()) || 9998,
+ token: $('#deployer-token').val(),
+ useSSL: $('#deployer-use-ssl').is(':checked')
+ },
+ license: {
+ checkInterval: parseInt($('#license-check-interval').val()) || 24
+ },
+ advanced: {
+ logLevel: $('#log-level').val(),
+ timeout: parseInt($('#timeout').val()) || 30,
+ gitTimeout: parseInt($('#git-timeout').val()) || 120
+ }
+ };
+ }
+
+ // ============================================
+ // SAUVEGARDE DE LA CONFIGURATION
+ // ============================================
+
+ function saveConfig() {
+ console.log('Saving configuration...');
+ var config = getConfigFromForm();
+ var apiUrl = getConfigApiUrl();
+
+ $.ajax({
+ url: apiUrl + '/config',
+ method: 'POST',
+ contentType: 'application/json',
+ data: JSON.stringify(config),
+ dataType: 'json',
+ success: function(result) {
+ console.log('Save result:', result);
+ if (result.success) {
+ showMessage('✅ Configuration sauvegardée avec succès !', 'success');
+ // Sauvegarder aussi dans localStorage
+ localStorage.setItem('git_pusher_config', JSON.stringify(config));
+ } else {
+ showMessage('❌ Erreur: ' + (result.error || 'Échec de la sauvegarde'), 'error');
+ }
+ },
+ error: function(xhr, status, error) {
+ console.error('Save error:', error);
+ showMessage('❌ Erreur de connexion au serveur: ' + error, 'error');
+ }
+ });
+ }
+
+ function resetConfig() {
+ if (confirm('Voulez-vous vraiment réinitialiser la configuration ?')) {
+ applyConfigToForm(DEFAULT_CONFIG);
+ showMessage('Configuration réinitialisée (non sauvegardée)', 'success');
+ }
+ }
+
+ // ============================================
+ // TESTS DE CONNEXION
+ // ============================================
+
+ function testApiConnection() {
+ console.log('Testing API connection...');
+ var $status = $('#api-status');
+ $status.removeClass('connected disconnected').text('● Test en cours...');
+
+ var apiUrl = $('#api-url').val().trim();
+
+ if (!apiUrl) {
+ apiUrl = getConfigApiUrl();
+ } else if (!$('#use-proxy').is(':checked')) {
+ var port = $('#api-port').val() || 9999;
+ if (apiUrl.indexOf(':' + port) === -1) {
+ apiUrl = apiUrl.replace(/\/$/, '') + ':' + port;
+ }
+ }
+
+ console.log('Testing URL:', apiUrl);
+
+ $.ajax({
+ url: apiUrl + '/health',
+ method: 'GET',
+ dataType: 'json',
+ timeout: 10000,
+ success: function(data) {
+ console.log('API health:', data);
+ $status.addClass('connected').text('● Connecté');
+ },
+ error: function(xhr, status, error) {
+ console.error('API test failed:', error);
+ $status.addClass('disconnected').text('● Échec connexion');
+ }
+ });
+ }
+
+ function testDeployerConnection() {
+ console.log('Testing Deployer connection...');
+ var $status = $('#deployer-status');
+ $status.removeClass('connected disconnected').text('● Test en cours...');
+
+ var host = $('#deployer-host').val().trim();
+ var port = $('#deployer-port').val() || 9998;
+ var useSSL = $('#deployer-use-ssl').is(':checked');
+ var token = $('#deployer-token').val();
+
+ if (!host) {
+ $status.addClass('disconnected').text('● Adresse manquante');
+ return;
+ }
+
+ var protocol = useSSL ? 'https' : 'http';
+ var url = protocol + '://' + host + ':' + port + '/health';
+
+ console.log('Testing Deployer URL:', url);
+
+ $.ajax({
+ url: url,
+ method: 'GET',
+ dataType: 'json',
+ timeout: 10000,
+ headers: {
+ 'X-Auth-Token': token
+ },
+ success: function(data) {
+ console.log('Deployer health:', data);
+ $status.addClass('connected').text('● Connecté');
+ },
+ error: function(xhr, status, error) {
+ console.error('Deployer test failed:', error);
+ $status.addClass('disconnected').text('● Échec connexion');
+ }
+ });
+ }
+
+ // ============================================
+ // STATUT DE LA LICENCE
+ // ============================================
+
+ function loadLicenseStatus() {
+ var $status = $('#license-status');
+
+ try {
+ var stored = localStorage.getItem('git_pusher_license');
+
+ if (stored) {
+ var parsed = JSON.parse(stored);
+ var licenseData = parsed.licenseData;
+
+ if (licenseData) {
+ var expires = new Date(licenseData.expires);
+ var now = new Date();
+ var daysRemaining = Math.ceil((expires - now) / (1000 * 60 * 60 * 24));
+
+ if (daysRemaining > 0) {
+ $status.html(
+ '● Active' +
+ ' Type: ' + licenseData.type_name + ' | Expire: ' + licenseData.expires + ' (' + daysRemaining + 'j)'
+ );
+ } else {
+ $status.html(
+ '● Expirée' +
+ ' Expirée le ' + licenseData.expires + ''
+ );
+ }
+ return;
+ }
+ }
+
+ $status.html('● Non installée');
+
+ } catch (error) {
+ console.error('Erreur lecture licence:', error);
+ $status.html('● Erreur');
+ }
+ }
+
+ // ============================================
+ // UTILITAIRES
+ // ============================================
+
+ function showMessage(message, type) {
+ var $msg = $('#config-message');
+ $msg.text(message).removeClass('success error').addClass(type).show();
+
+ setTimeout(function() {
+ $msg.fadeOut();
+ }, 5000);
+ }
+
+ // ============================================
+ // ATTACHER LES ÉVÉNEMENTS
+ // ============================================
+
+ function attachEvents() {
+ console.log('Attaching events...');
+
+ // Bouton Test API
+ $('#test-api-btn').on('click', function(e) {
+ e.preventDefault();
+ console.log('Test API clicked');
+ testApiConnection();
+ });
+
+ // Bouton Test Deployer
+ $('#test-deployer-btn').on('click', function(e) {
+ e.preventDefault();
+ console.log('Test Deployer clicked');
+ testDeployerConnection();
+ });
+
+ // Bouton Sauvegarder
+ $('#save-btn').on('click', function(e) {
+ e.preventDefault();
+ console.log('Save clicked');
+ saveConfig();
+ });
+
+ // Bouton Réinitialiser
+ $('#reset-btn').on('click', function(e) {
+ e.preventDefault();
+ console.log('Reset clicked');
+ resetConfig();
+ });
+
+ console.log('Events attached to buttons');
+ }
+
+ // ============================================
+ // INITIALISATION
+ // ============================================
+
+ // Attendre que le DOM soit complètement prêt
+ function init() {
+ if ($('#api-url').length > 0) {
+ console.log('DOM ready, initializing...');
+ attachEvents();
+ loadConfig();
+ } else {
+ console.log('DOM not ready, retrying...');
+ setTimeout(init, 300);
+ }
+ }
+
+ setTimeout(init, 500);
+
+ // Exposer globalement pour le debug
+ window.gitPusherConfig = {
+ saveConfig: saveConfig,
+ resetConfig: resetConfig,
+ testApiConnection: testApiConnection,
+ testDeployerConnection: testDeployerConnection,
+ loadConfig: loadConfig
+ };
+
+ console.log('Git Pusher Config module loaded');
+});
\ No newline at end of file
diff --git a/apps/pusher_app_prem/appserver/static/license_validation.js b/apps/pusher_app_prem/appserver/static/license_validation.js
index 8cb7303c..3be600dc 100644
--- a/apps/pusher_app_prem/appserver/static/license_validation.js
+++ b/apps/pusher_app_prem/appserver/static/license_validation.js
@@ -3,34 +3,66 @@
// Version 2.1 - 100% Client-Side Validation
// ============================================
+// Configuration par défaut
+const DEFAULT_APP_CONFIG = {
+ api: {
+ url: '',
+ port: 9999,
+ useProxy: true
+ }
+};
+
+// Charger la configuration
+function loadAppConfigForLicense() {
+ try {
+ const stored = localStorage.getItem('git_pusher_config');
+ if (stored) {
+ return JSON.parse(stored);
+ }
+ } catch (e) {
+ console.warn('Erreur chargement config localStorage:', e);
+ }
+ return DEFAULT_APP_CONFIG;
+}
+
+// Déterminer l'URL du serveur API
+function getLicenseServerUrl() {
+ const config = loadAppConfigForLicense();
+ const hostname = window.location.hostname;
+ const protocol = window.location.protocol;
+
+ // Si une URL est configurée, l'utiliser
+ if (config.api && config.api.url) {
+ let url = config.api.url;
+ // Ajouter le port si pas de proxy
+ if (!config.api.useProxy && config.api.port) {
+ url = url.replace(/\/$/, '') + ':' + config.api.port;
+ }
+ return url;
+ }
+
+ // Auto-détection basée sur le hostname
+ if (hostname === 'myprivspldev.jp-engineering.fr') {
+ return protocol + '//myprivspldev-api.jp-engineering.fr';
+ }
+
+ if (hostname === 'myprivspldev-api.jp-engineering.fr') {
+ return protocol + '//' + hostname;
+ }
+
+ if (/^(\d{1,3}\.){3}\d{1,3}$/.test(hostname) || hostname === 'localhost') {
+ return protocol + '//' + hostname + ':9999';
+ }
+
+ return protocol + '//' + hostname + ':9999';
+}
+
// Configuration
const LICENSE_CONFIG = {
storageKey: 'git_pusher_license',
usageKey: 'git_pusher_usage',
version: '2.1.0',
- // URL du serveur Git Pusher API
- serverUrl: (function() {
- const hostname = window.location.hostname;
- const protocol = window.location.protocol;
-
- // Si déjà sur le domaine API, l'utiliser directement
- if (hostname === 'myprivspldev-api.jp-engineering.fr') {
- return protocol + '//' + hostname;
- }
-
- // Si accès via le domaine Splunk principal, utiliser le domaine API
- if (hostname === 'myprivspldev.jp-engineering.fr') {
- return protocol + '//myprivspldev-api.jp-engineering.fr';
- }
-
- // Si c'est une IP ou localhost, ajouter le port 9999
- if (/^(\d{1,3}\.){3}\d{1,3}$/.test(hostname) || hostname === 'localhost') {
- return protocol + '//' + hostname + ':9999';
- }
-
- // Par défaut, ajouter le port 9999
- return protocol + '//' + hostname + ':9999';
- })()
+ serverUrl: getLicenseServerUrl()
};
// ============================================
diff --git a/apps/pusher_app_prem/bin/git_pusher.pid b/apps/pusher_app_prem/bin/git_pusher.pid
index 234db133..f460701d 100644
--- a/apps/pusher_app_prem/bin/git_pusher.pid
+++ b/apps/pusher_app_prem/bin/git_pusher.pid
@@ -1 +1 @@
-1293739
+1762012
diff --git a/apps/pusher_app_prem/bin/git_pusher.py b/apps/pusher_app_prem/bin/git_pusher.py
index 8c75cc17..d4634388 100755
--- a/apps/pusher_app_prem/bin/git_pusher.py
+++ b/apps/pusher_app_prem/bin/git_pusher.py
@@ -46,29 +46,87 @@ except ImportError:
def parse_license_content(c): return {}
# ============================================
-# CONFIGURATION SH DEPLOYER
+# CONFIGURATION
# ============================================
# Chemins Splunk
SPLUNK_HOME = os.environ.get('SPLUNK_HOME', '/opt/splunk')
APP_HOME = os.path.join(SPLUNK_HOME, 'etc', 'apps', 'pusher_app_prem')
+CONFIG_FILE = os.path.join(APP_HOME, 'local', 'config.json')
-# Configuration du SH Deployer (peut être surchargée par les paramètres)
+# Configuration par défaut
+DEFAULT_CONFIG = {
+ "api": {
+ "url": "",
+ "port": 9999,
+ "useProxy": True
+ },
+ "deployer": {
+ "enabled": False,
+ "host": "",
+ "port": 9998,
+ "token": "",
+ "useSSL": True
+ },
+ "license": {
+ "checkInterval": 24
+ },
+ "advanced": {
+ "logLevel": "INFO",
+ "timeout": 30,
+ "gitTimeout": 120
+ }
+}
+
+def load_config():
+ """Charger la configuration depuis le fichier"""
+ try:
+ if os.path.exists(CONFIG_FILE):
+ with open(CONFIG_FILE, 'r') as f:
+ config = json.load(f)
+ # Fusionner avec la config par défaut pour les clés manquantes
+ return {**DEFAULT_CONFIG, **config}
+ except Exception as e:
+ logger.error(f"Erreur chargement config: {e}")
+ return DEFAULT_CONFIG.copy()
+
+def save_config(config):
+ """Sauvegarder la configuration dans le fichier"""
+ try:
+ local_dir = os.path.join(APP_HOME, 'local')
+ os.makedirs(local_dir, exist_ok=True)
+
+ with open(CONFIG_FILE, 'w') as f:
+ json.dump(config, f, indent=2)
+
+ os.chmod(CONFIG_FILE, 0o600)
+ logger.info(f"Configuration sauvegardée: {CONFIG_FILE}")
+ return True
+ except Exception as e:
+ logger.error(f"Erreur sauvegarde config: {e}")
+ return False
+
+# Charger la configuration au démarrage
+APP_CONFIG = load_config()
+
+# Configuration du SH Deployer (depuis la config ou valeurs par défaut)
SH_DEPLOYER_CONFIG = {
- "enabled": True,
- "host": "10.10.40.14",
- "port": 9998,
- "use_ssl": True,
- "token": "deployer_agent_secret_token_change_me_in_production",
- "timeout": 30
+ "enabled": APP_CONFIG.get("deployer", {}).get("enabled", False),
+ "host": APP_CONFIG.get("deployer", {}).get("host", ""),
+ "port": APP_CONFIG.get("deployer", {}).get("port", 9998),
+ "use_ssl": APP_CONFIG.get("deployer", {}).get("useSSL", True),
+ "token": APP_CONFIG.get("deployer", {}).get("token", ""),
+ "timeout": APP_CONFIG.get("advanced", {}).get("timeout", 30)
}
# Configuration du logging
log_dir = '/opt/splunk/var/log/splunk'
os.makedirs(log_dir, exist_ok=True)
+log_level = getattr(logging, APP_CONFIG.get("advanced", {}).get("logLevel", "INFO"), logging.INFO)
+
logging.basicConfig(
- level=logging.INFO,
+ level=log_level,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
handlers=[
logging.FileHandler(os.path.join(log_dir, 'git_pusher.log')),
@@ -87,7 +145,7 @@ class GitPusherRequestHandler(BaseHTTPRequestHandler):
origin = self.headers.get('Origin', '*')
self.send_header('Access-Control-Allow-Origin', origin)
self.send_header('Access-Control-Allow-Methods', 'POST, GET, OPTIONS, PUT, DELETE')
- self.send_header('Access-Control-Allow-Headers', 'Content-Type, Authorization, X-Requested-With, Accept, Origin')
+ self.send_header('Access-Control-Allow-Headers', 'Content-Type, Authorization, X-Requested-With, Accept, Origin, X-Splunk-Form-Key, X-Auth-Token')
self.send_header('Access-Control-Allow-Credentials', 'true')
self.send_header('Access-Control-Max-Age', '86400') # Cache preflight 24h
@@ -161,6 +219,18 @@ class GitPusherRequestHandler(BaseHTTPRequestHandler):
self.wfile.write(json.dumps(response).encode())
+ # ============================================
+ # ENDPOINT CONFIGURATION
+ # ============================================
+
+ elif path == '/config':
+ # Retourner la configuration actuelle
+ config = load_config()
+ # Masquer le token pour la sécurité
+ if 'deployer' in config and 'token' in config['deployer']:
+ config['deployer']['token'] = '***' if config['deployer']['token'] else ''
+ self.wfile.write(json.dumps(config).encode())
+
elif path == '/health':
# Health check
response = {
@@ -239,11 +309,57 @@ class GitPusherRequestHandler(BaseHTTPRequestHandler):
logger.info(f"POST request to {path}")
+ # ============================================
+ # ENDPOINT CONFIGURATION
+ # ============================================
+
+ if path == '/config':
+ # Sauvegarder la configuration
+ content_length = int(self.headers.get('Content-Length', 0))
+ body = self.rfile.read(content_length).decode('utf-8')
+
+ try:
+ new_config = json.loads(body)
+
+ # Charger la config existante pour préserver le token si masqué
+ existing_config = load_config()
+
+ # Si le token est masqué (***), garder l'ancien
+ if new_config.get('deployer', {}).get('token') == '***':
+ new_config['deployer']['token'] = existing_config.get('deployer', {}).get('token', '')
+
+ # Sauvegarder
+ if save_config(new_config):
+ # Recharger la config globale
+ global APP_CONFIG, SH_DEPLOYER_CONFIG
+ APP_CONFIG = load_config()
+ SH_DEPLOYER_CONFIG = {
+ "enabled": APP_CONFIG.get("deployer", {}).get("enabled", False),
+ "host": APP_CONFIG.get("deployer", {}).get("host", ""),
+ "port": APP_CONFIG.get("deployer", {}).get("port", 9998),
+ "use_ssl": APP_CONFIG.get("deployer", {}).get("useSSL", True),
+ "token": APP_CONFIG.get("deployer", {}).get("token", ""),
+ "timeout": APP_CONFIG.get("advanced", {}).get("timeout", 30)
+ }
+
+ response = {"success": True, "message": "Configuration sauvegardée"}
+ else:
+ response = {"success": False, "error": "Erreur lors de la sauvegarde"}
+
+ except json.JSONDecodeError as e:
+ response = {"success": False, "error": f"JSON invalide: {str(e)}"}
+ except Exception as e:
+ logger.error(f"Erreur sauvegarde config: {e}")
+ response = {"success": False, "error": str(e)}
+
+ self.wfile.write(json.dumps(response).encode())
+ return
+
# ============================================
# ENDPOINTS LICENCE
# ============================================
- if path == '/license/upload' or path == '/license/save':
+ elif path == '/license/upload' or path == '/license/save':
# Sauvegarder la licence sur le serveur (fichier)
# La validation RSA est faite côté client
content_length = int(self.headers.get('Content-Length', 0))
diff --git a/apps/pusher_app_prem/default/data/ui/nav/default.xml b/apps/pusher_app_prem/default/data/ui/nav/default.xml
index d494b32c..9b4f4d60 100644
--- a/apps/pusher_app_prem/default/data/ui/nav/default.xml
+++ b/apps/pusher_app_prem/default/data/ui/nav/default.xml
@@ -1,3 +1,4 @@
diff --git a/apps/pusher_app_prem/local/config.json b/apps/pusher_app_prem/local/config.json
new file mode 100644
index 00000000..90eccb76
--- /dev/null
+++ b/apps/pusher_app_prem/local/config.json
@@ -0,0 +1,22 @@
+{
+ "api": {
+ "url": "https://myprivspldev-api.jp-engineering.fr",
+ "port": 9999,
+ "useProxy": true
+ },
+ "deployer": {
+ "enabled": false,
+ "host": "10.10.40.14",
+ "port": 9998,
+ "token": "bc2564e5a885d49ac3811dc946ca5620da24da19b8a8f5c5fdfcd7c07a241688",
+ "useSSL": true
+ },
+ "license": {
+ "checkInterval": 24
+ },
+ "advanced": {
+ "logLevel": "INFO",
+ "timeout": 30,
+ "gitTimeout": 120
+ }
+}
\ No newline at end of file
diff --git a/apps/pusher_app_prem/local/data/ui/views/git_pusher_config.xml b/apps/pusher_app_prem/local/data/ui/views/git_pusher_config.xml
new file mode 100644
index 00000000..b1fde3b1
--- /dev/null
+++ b/apps/pusher_app_prem/local/data/ui/views/git_pusher_config.xml
@@ -0,0 +1,311 @@
+
+
+ Configuration de l'application Git Pusher
+
+
+
+
+
+
+
+
+
⚙️ Configuration Git Pusher
+
Configurez les paramètres de l'application
+
+
+
+
+
+
+
🌐 Configuration API
+
+
+
+ L'URL du serveur Git Pusher (sans le port si proxy)
+
+
+
+ Port utilisé si accès direct par IP (ignoré si URL de domaine)
+
+
+
+ Coché si vous utilisez un reverse proxy (Nginx, etc.)
+
+
+
+
+ ● Non testé
+
+
+
+
+
+
+
🚀 Configuration SH Deployer
+
+
+
+ Activer le déploiement automatique vers le Search Head Cluster
+
+
+
+ Adresse IP ou hostname du serveur SH Deployer
+
+
+
+
+
+
+ Token configuré dans deployer_agent.py
+
+
+
+
+
+