From 876cf900c35dbf4299c70e0d57ca0cf76c75b61f Mon Sep 17 00:00:00 2001 From: Valmo Date: Tue, 24 Mar 2026 16:56:19 -0300 Subject: [PATCH] Changed dialogs and module UI to get mTLS needed params --- addons/server/CfgVehicles.hpp | 123 ++++++++++++++++++++----- addons/server/dialog.hpp | 169 ++++++++++++++++++++++++++++++++-- 2 files changed, 262 insertions(+), 30 deletions(-) diff --git a/addons/server/CfgVehicles.hpp b/addons/server/CfgVehicles.hpp index af7fce6..2072105 100644 --- a/addons/server/CfgVehicles.hpp +++ b/addons/server/CfgVehicles.hpp @@ -1,12 +1,13 @@ class CfgVehicles { class Logic; - class Module_F : Logic - { - class AttributesBase + class Module_F : Logic { - class Edit; - class ModuleDescription; - }; + class AttributesBase + { + class Edit; + class Combo; + class ModuleDescription; + }; class ModuleDescription; }; @@ -22,10 +23,10 @@ class CfgVehicles { scopeCurator = 2; }; - class GVAR(coreModule): GVAR(moduleBase) { - scope = 2; - scopeCurator = 0; - displayname = "CoT Router"; + class GVAR(coreModule): GVAR(moduleBase) { + scope = 2; + scopeCurator = 0; + displayname = "CoT Router"; icon = "\a3\Modules_F_Curator\Data\iconRadio_ca.paa"; category = QEGVAR(main,moduleCategory); function = QFUNC(3denCoreModuleConfig); @@ -40,23 +41,101 @@ class CfgVehicles { canSetAreaShape = 0; canSetAreaHeight = 0; - class Attributes: AttributesBase { - class GVAR(moduleInstanceAddress): Edit { - property = QGVAR(moduleInstanceAddress); - displayname = "TAK Server Address"; + class Attributes: AttributesBase { + class GVAR(moduleTransportMode): Combo { + property = QGVAR(moduleTransportMode); + displayname = "Transport Mode"; + tooltip = "Choose how ArmaTAK connects to the TAK or IronTAK server."; + typeName = "STRING"; + defaultValue = "'tcp'"; + class Values { + class tcp { + name = "TCP 8088 (Unauthenticated)"; + value = "tcp"; + default = 1; + }; + class manual_mtls { + name = "mTLS (Manual Certificate)"; + value = "manual_mtls"; + }; + class enroll_mtls { + name = "mTLS (GET config + POST signClient)"; + value = "enroll_mtls"; + }; + }; + }; + class GVAR(moduleInstanceAddress): Edit { + property = QGVAR(moduleInstanceAddress); + displayname = "TAK Server Address"; tooltip = "TAK Server Instance Address"; typeName = "STRING"; defaultValue = "localhost"; }; - class GVAR(moduleInstancePort): Edit { - property = QGVAR(moduleInstancePort); - displayname = "TAK Server TCP Port"; - tooltip = "TAK Server instance Port for TCP connection"; - typeName = "NUMBER"; - defaultValue = "8088"; + class GVAR(moduleInstancePort): Edit { + property = QGVAR(moduleInstancePort); + displayname = "TAK Server TCP Port"; + tooltip = "TAK Server instance Port for TCP connection"; + typeName = "NUMBER"; + defaultValue = "8088"; + }; + class GVAR(moduleTlsServerName): Edit { + property = QGVAR(moduleTlsServerName); + displayname = "TLS Server Name"; + tooltip = "Optional hostname used for TLS certificate validation. Leave blank to reuse the address host."; + typeName = "STRING"; + defaultValue = ""; + }; + class GVAR(moduleTlsCaCertPath): Edit { + property = QGVAR(moduleTlsCaCertPath); + displayname = "TLS CA Cert Path"; + tooltip = "PEM path for the CA that signs the IronTAK or TAK server certificate."; + typeName = "STRING"; + defaultValue = ""; + }; + class GVAR(moduleTlsClientCertPath): Edit { + property = QGVAR(moduleTlsClientCertPath); + displayname = "TLS Client Cert Path"; + tooltip = "PEM path for the client certificate used by this ArmaTAK session."; + typeName = "STRING"; + defaultValue = ""; + }; + class GVAR(moduleTlsClientKeyPath): Edit { + property = QGVAR(moduleTlsClientKeyPath); + displayname = "TLS Client Key Path"; + tooltip = "PEM path for the private key that matches the client certificate."; + typeName = "STRING"; + defaultValue = ""; + }; + class GVAR(moduleEnrollmentPort): Edit { + property = QGVAR(moduleEnrollmentPort); + displayname = "Enrollment HTTPS Port"; + tooltip = "Port used for GET /Marti/api/tls/config and POST /Marti/api/tls/signClient/v2."; + typeName = "NUMBER"; + defaultValue = "8446"; + }; + class GVAR(moduleEnrollmentUsername): Edit { + property = QGVAR(moduleEnrollmentUsername); + displayname = "Enrollment Username"; + tooltip = "Socket enrollment username for Basic Auth."; + typeName = "STRING"; + defaultValue = ""; + }; + class GVAR(moduleEnrollmentPassword): Edit { + property = QGVAR(moduleEnrollmentPassword); + displayname = "Enrollment Password"; + tooltip = "Socket enrollment password for Basic Auth."; + typeName = "STRING"; + defaultValue = ""; + }; + class GVAR(moduleEnrollmentClientUid): Edit { + property = QGVAR(moduleEnrollmentClientUid); + displayname = "Enrollment Client UID"; + tooltip = "Optional device identifier sent as clientUid. Leave blank to auto-generate."; + typeName = "STRING"; + defaultValue = ""; + }; + class ModuleDescription: ModuleDescription {}; }; - class ModuleDescription: ModuleDescription {}; - }; class ModuleDescription: ModuleDescription { description = "Generate the initial ARMATAK configuration, syncronizing all players to the TAK server instance"; diff --git a/addons/server/dialog.hpp b/addons/server/dialog.hpp index 068209a..2e80e29 100644 --- a/addons/server/dialog.hpp +++ b/addons/server/dialog.hpp @@ -10,9 +10,9 @@ class armatak_zeus_core_module_dialog { class armatak_gui_module_zeus_core_dialog_main_frame: RscBackground { idc = 1800; x = "0.386562 * safezoneW + safezoneX"; - y = "0.401 * safezoneH + safezoneY"; + y = "0.08 * safezoneH + safezoneY"; w = "0.216563 * safezoneW"; - h = "0.242 * safezoneH"; + h = "0.84 * safezoneH"; colorBackground[]={0,0,0,0.45}; }; }; @@ -21,7 +21,7 @@ class armatak_zeus_core_module_dialog { idc = 14000; text = "localhost"; x = "0.391719 * safezoneW + safezoneX"; - y = "0.445 * safezoneH + safezoneY"; + y = "0.185 * safezoneH + safezoneY"; w = "0.20625 * safezoneW"; h = "0.044 * safezoneH"; colorBackground[]={0,0,0,0.5}; @@ -30,16 +30,105 @@ class armatak_zeus_core_module_dialog { idc = 14001; text = "8088"; x = "0.391719 * safezoneW + safezoneX"; - y = "0.522 * safezoneH + safezoneY"; + y = "0.255 * safezoneH + safezoneY"; w = "0.20625 * safezoneW"; h = "0.044 * safezoneH"; colorBackground[]={0,0,0,0.5}; }; + class armatak_gui_module_zeus_core_dialog_transport_mode_edit: RscEdit { + idc = 14006; + text = "tcp"; + x = "0.391719 * safezoneW + safezoneX"; + y = "0.115 * safezoneH + safezoneY"; + w = "0.20625 * safezoneW"; + h = "0.044 * safezoneH"; + colorBackground[]={0,0,0,0.5}; + }; + class armatak_gui_module_zeus_core_dialog_enrollment_port_edit: RscEdit { + idc = 14007; + text = "8446"; + x = "0.391719 * safezoneW + safezoneX"; + y = "0.325 * safezoneH + safezoneY"; + w = "0.20625 * safezoneW"; + h = "0.044 * safezoneH"; + colorBackground[]={0,0,0,0.5}; + }; + class armatak_gui_module_zeus_core_dialog_enrollment_user_edit: RscEdit { + idc = 14008; + text = ""; + x = "0.391719 * safezoneW + safezoneX"; + y = "0.395 * safezoneH + safezoneY"; + w = "0.20625 * safezoneW"; + h = "0.044 * safezoneH"; + colorBackground[]={0,0,0,0.5}; + }; + class armatak_gui_module_zeus_core_dialog_tls_name_edit: RscEdit { + idc = 14002; + text = ""; + x = "0.391719 * safezoneW + safezoneX"; + y = "0.465 * safezoneH + safezoneY"; + w = "0.20625 * safezoneW"; + h = "0.044 * safezoneH"; + colorBackground[]={0,0,0,0.5}; + }; + class armatak_gui_module_zeus_core_dialog_tls_ca_edit: RscEdit { + idc = 14003; + text = ""; + x = "0.391719 * safezoneW + safezoneX"; + y = "0.535 * safezoneH + safezoneY"; + w = "0.20625 * safezoneW"; + h = "0.044 * safezoneH"; + colorBackground[]={0,0,0,0.5}; + }; + class armatak_gui_module_zeus_core_dialog_tls_client_cert_edit: RscEdit { + idc = 14004; + text = ""; + x = "0.391719 * safezoneW + safezoneX"; + y = "0.605 * safezoneH + safezoneY"; + w = "0.20625 * safezoneW"; + h = "0.044 * safezoneH"; + colorBackground[]={0,0,0,0.5}; + }; + class armatak_gui_module_zeus_core_dialog_tls_client_key_edit: RscEdit { + idc = 14005; + text = ""; + x = "0.391719 * safezoneW + safezoneX"; + y = "0.675 * safezoneH + safezoneY"; + w = "0.20625 * safezoneW"; + h = "0.044 * safezoneH"; + colorBackground[]={0,0,0,0.5}; + }; + class armatak_gui_module_zeus_core_dialog_enrollment_password_edit: RscEdit { + idc = 14009; + text = ""; + x = "0.391719 * safezoneW + safezoneX"; + y = "0.745 * safezoneH + safezoneY"; + w = "0.20625 * safezoneW"; + h = "0.044 * safezoneH"; + colorBackground[]={0,0,0,0.5}; + }; + class armatak_gui_module_zeus_core_dialog_enrollment_client_uid_edit: RscEdit { + idc = 14010; + text = ""; + x = "0.391719 * safezoneW + safezoneX"; + y = "0.815 * safezoneH + safezoneY"; + w = "0.20625 * safezoneW"; + h = "0.044 * safezoneH"; + colorBackground[]={0,0,0,0.5}; + }; + class armatak_gui_module_zeus_core_dialog_transport_mode_text: RscText { + idc = 1006; + text = "Transport Mode (tcp/manual_mtls/enroll_mtls)"; + x = "0.391719 * safezoneW + safezoneX"; + y = "0.082 * safezoneH + safezoneY"; + w = "0.20625 * safezoneW"; + h = "0.033 * safezoneH"; + }; class armatak_gui_module_zeus_core_dialog_address_text: RscText { idc = 1000; text = "TAK Server Address"; x = "0.391719 * safezoneW + safezoneX"; - y = "0.412 * safezoneH + safezoneY"; + y = "0.152 * safezoneH + safezoneY"; w = "0.20625 * safezoneW"; h = "0.033 * safezoneH"; }; @@ -47,7 +136,71 @@ class armatak_zeus_core_module_dialog { idc = 1001; text = "TAK Server Port"; x = "0.391719 * safezoneW + safezoneX"; - y = "0.489 * safezoneH + safezoneY"; + y = "0.222 * safezoneH + safezoneY"; + w = "0.20625 * safezoneW"; + h = "0.033 * safezoneH"; + }; + class armatak_gui_module_zeus_core_dialog_enrollment_port_text: RscText { + idc = 1007; + text = "Enrollment HTTPS Port"; + x = "0.391719 * safezoneW + safezoneX"; + y = "0.292 * safezoneH + safezoneY"; + w = "0.20625 * safezoneW"; + h = "0.033 * safezoneH"; + }; + class armatak_gui_module_zeus_core_dialog_enrollment_user_text: RscText { + idc = 1008; + text = "Enrollment Username"; + x = "0.391719 * safezoneW + safezoneX"; + y = "0.362 * safezoneH + safezoneY"; + w = "0.20625 * safezoneW"; + h = "0.033 * safezoneH"; + }; + class armatak_gui_module_zeus_core_dialog_tls_name_text: RscText { + idc = 1002; + text = "TLS Server Name"; + x = "0.391719 * safezoneW + safezoneX"; + y = "0.432 * safezoneH + safezoneY"; + w = "0.20625 * safezoneW"; + h = "0.033 * safezoneH"; + }; + class armatak_gui_module_zeus_core_dialog_tls_ca_text: RscText { + idc = 1003; + text = "TLS CA Cert Path"; + x = "0.391719 * safezoneW + safezoneX"; + y = "0.502 * safezoneH + safezoneY"; + w = "0.20625 * safezoneW"; + h = "0.033 * safezoneH"; + }; + class armatak_gui_module_zeus_core_dialog_tls_client_cert_text: RscText { + idc = 1004; + text = "TLS Client Cert Path"; + x = "0.391719 * safezoneW + safezoneX"; + y = "0.572 * safezoneH + safezoneY"; + w = "0.20625 * safezoneW"; + h = "0.033 * safezoneH"; + }; + class armatak_gui_module_zeus_core_dialog_tls_client_key_text: RscText { + idc = 1005; + text = "TLS Client Key Path"; + x = "0.391719 * safezoneW + safezoneX"; + y = "0.642 * safezoneH + safezoneY"; + w = "0.20625 * safezoneW"; + h = "0.033 * safezoneH"; + }; + class armatak_gui_module_zeus_core_dialog_enrollment_password_text: RscText { + idc = 1009; + text = "Enrollment Password"; + x = "0.391719 * safezoneW + safezoneX"; + y = "0.712 * safezoneH + safezoneY"; + w = "0.20625 * safezoneW"; + h = "0.033 * safezoneH"; + }; + class armatak_gui_module_zeus_core_dialog_enrollment_client_uid_text: RscText { + idc = 1010; + text = "Enrollment Client UID"; + x = "0.391719 * safezoneW + safezoneX"; + y = "0.782 * safezoneH + safezoneY"; w = "0.20625 * safezoneW"; h = "0.033 * safezoneH"; }; @@ -56,7 +209,7 @@ class armatak_zeus_core_module_dialog { text = "Cancel"; action = "closeDialog 2;"; x = "0.551563 * safezoneW + safezoneX"; - y = "0.577 * safezoneH + safezoneY"; + y = "0.855 * safezoneH + safezoneY"; w = "0.0464063 * safezoneW"; h = "0.055 * safezoneH"; }; @@ -65,7 +218,7 @@ class armatak_zeus_core_module_dialog { text = "Ok"; action = QUOTE(call FUNC(zeusCoreModuleConfig)); x = "0.5 * safezoneW + safezoneX"; - y = "0.577 * safezoneH + safezoneY"; + y = "0.855 * safezoneH + safezoneY"; w = "0.0464063 * safezoneW"; h = "0.055 * safezoneH"; };