From 3922906a33b317772acac8f3e703da53042eab09 Mon Sep 17 00:00:00 2001 From: Reimar Date: Mon, 16 Sep 2024 13:31:02 +0200 Subject: [PATCH] Fix errors in prod backend and android app --- API/skantravels.service | 1 + Mobile/build-apk.sh | 4 ++++ Mobile/environment.prod.json | 4 ++++ Mobile/lib/main.dart | 2 ++ rust-backend/skantravels-rust.service | 1 + 5 files changed, 12 insertions(+) create mode 100755 Mobile/build-apk.sh create mode 100644 Mobile/environment.prod.json diff --git a/API/skantravels.service b/API/skantravels.service index 1ca9378..9defbb8 100644 --- a/API/skantravels.service +++ b/API/skantravels.service @@ -8,6 +8,7 @@ Environment=PATH=$PATH:/home/reimar/.dotnet Environment=DEFAULT_CONNECTION="Data Source=/home/reimar/skantravels/database.sqlite3" ExecStartPre=/home/reimar/skantravels/efbundle ExecStart=/home/reimar/skantravels/API --urls=http://0.0.0.0:5001 +WorkingDirectory=/home/reimar/skantravels Type=simple [Install] diff --git a/Mobile/build-apk.sh b/Mobile/build-apk.sh new file mode 100755 index 0000000..a2e2b75 --- /dev/null +++ b/Mobile/build-apk.sh @@ -0,0 +1,4 @@ +#!/bin/sh +java -version +flutter build apk --split-per-abi --dart-define-from-file environment.prod.json + diff --git a/Mobile/environment.prod.json b/Mobile/environment.prod.json new file mode 100644 index 0000000..2b45ad5 --- /dev/null +++ b/Mobile/environment.prod.json @@ -0,0 +1,4 @@ +{ + "AUTH_SERVICE_HOST": "https://skantravels.reim.ar", + "APP_SERVICE_HOST": "https://skantravels.reim.ar" +} diff --git a/Mobile/lib/main.dart b/Mobile/lib/main.dart index 3784ba8..9c5e11a 100644 --- a/Mobile/lib/main.dart +++ b/Mobile/lib/main.dart @@ -18,6 +18,8 @@ import 'api.dart' as api; import 'package:http/http.dart' as http; void main() async { + WidgetsFlutterBinding.ensureInitialized(); + // Refresh JWT on startup final prefs = await SharedPreferences.getInstance(); if (prefs.getString("token") != null && prefs.getString("refresh-token") != null) { diff --git a/rust-backend/skantravels-rust.service b/rust-backend/skantravels-rust.service index 29dc22f..f38ebf3 100644 --- a/rust-backend/skantravels-rust.service +++ b/rust-backend/skantravels-rust.service @@ -6,6 +6,7 @@ After=network.target Environment=RUST_BACKEND_PORT=5002 Environment=RUST_BACKEND_DB=/home/reimar/skantravels/database-rust.sqlite3 ExecStart=/home/reimar/skantravels/skantravels +WorkingDirectory=/home/reimar/skantravels Type=simple [Install]