From 99abf60b527cddb0da540e169f3df35be25695ef Mon Sep 17 00:00:00 2001 From: streaper2 Date: Wed, 26 Aug 2026 09:05:30 +0200 Subject: [PATCH] feat: implement automated deployment pipeline and add identity management settings screen with account status synchronization --- .gitea/workflows/deploy.yaml | 5 +++++ lib/features/settings/settings_screen.dart | 8 ++++---- lib/services/wallet_identity_service.dart | 10 +++++----- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 95c251d7..02d02569 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -4,6 +4,11 @@ on: push: branches: - main + paths: + - 'backendia/**' + - 'docker-compose.prod.yml' + - '.gitea/workflows/deploy.yaml' + workflow_dispatch: jobs: deploy: diff --git a/lib/features/settings/settings_screen.dart b/lib/features/settings/settings_screen.dart index f0876b76..bbe3c9f4 100644 --- a/lib/features/settings/settings_screen.dart +++ b/lib/features/settings/settings_screen.dart @@ -26,7 +26,7 @@ class _SettingsScreenState extends State { bool _isUploadEnabled = false; bool _isBanned = false; String? _banReason; - String _serverUrl = 'http://localhost:3000'; + String _serverUrl = 'https://backendia.kevlar.cloud'; @override void initState() { @@ -398,20 +398,20 @@ class _SettingsScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ const Text( - 'Indiquez l\'adresse IP ou l\'URL du serveur backend IA (port 3000) :', + 'Indiquez l\'URL du serveur backend IA :', style: TextStyle(fontSize: 13, color: Colors.grey), ), const SizedBox(height: 12), TextField( controller: urlController, decoration: const InputDecoration( - hintText: 'Ex: http://192.168.1.50:3000', + hintText: 'https://backendia.kevlar.cloud', border: OutlineInputBorder(), ), ), const SizedBox(height: 8), const Text( - '💡 Sur émulateur : http://10.0.2.2:3000\n💡 Sur smartphone réel : IP locale de votre PC (ex: http://192.168.1.X:3000)', + '💡 Serveur officiel : https://backendia.kevlar.cloud', style: TextStyle(fontSize: 11, color: Colors.grey), ), ], diff --git a/lib/services/wallet_identity_service.dart b/lib/services/wallet_identity_service.dart index 3c084e99..0b6b3ab3 100644 --- a/lib/services/wallet_identity_service.dart +++ b/lib/services/wallet_identity_service.dart @@ -44,17 +44,17 @@ class WalletIdentityService { 'bulk', 'bullet', 'bundle', 'bunker', 'burden', 'burger', 'burst', 'bus', 'business', 'butter' ]; - /// Retourne l'URL de base du serveur configuré (ex: http://192.168.1.50:3000 ou http://10.0.2.2:3000) + /// URL par défaut du serveur de production + static const String defaultServerUrl = 'https://backendia.kevlar.cloud'; + + /// Retourne l'URL de base du serveur configuré (par défaut: https://backendia.kevlar.cloud) Future getServerBaseUrl() async { final prefs = await SharedPreferences.getInstance(); final customUrl = prefs.getString(_serverUrlKey); if (customUrl != null && customUrl.trim().isNotEmpty) { return customUrl.trim().replaceAll(RegExp(r'/api/upload/?$'), ''); } - if (Platform.isAndroid) { - return 'http://10.0.2.2:3000'; - } - return 'http://localhost:3000'; + return defaultServerUrl; } /// Définit une URL personnalisée pour le serveur IA