Skip to content

Commit cfc88b2

Browse files
authored
Configure MeeSign Server for test client via enviromental variables (#13)
Configure the MeeSign server domain and port via enviromental variables. This allows for easier integration tests.
1 parent 82a38c8 commit cfc88b2

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

meesign_core/test/core_test.dart

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ void main() {
5656

5757
List<int>? serverCerts;
5858
final String? serverCertsPath = io.Platform.environment['SERVER_CERTS'];
59+
final String? meesignServerDomain =
60+
io.Platform.environment['MEESIGN_SERVER_DOMAIN'];
61+
final String? meesignServerPort =
62+
io.Platform.environment['MEESIGN_SERVER_PORT'];
63+
5964
if (serverCertsPath != null) {
6065
serverCerts = io.File(serverCertsPath).readAsBytesSync();
6166
}
@@ -64,10 +69,12 @@ void main() {
6469
database = Database(appDir);
6570
keyStore = KeyStore(appDir);
6671
dispatcher = NetworkDispatcher(
67-
'localhost',
72+
meesignServerDomain ?? "localhost",
6873
keyStore,
6974
serverCerts: serverCerts,
7075
allowBadCerts: serverCerts == null,
76+
// TODO is there a better way to set the default?
77+
port: int.tryParse(meesignServerPort ?? "") ?? 1337,
7178
);
7279
deviceRepository = DeviceRepository(
7380
dispatcher,

0 commit comments

Comments
 (0)