Phase 3 - nostr integration complete

This commit is contained in:
gitea
2025-11-05 20:06:30 +01:00
parent f462a3d966
commit 1af9cdbc6d
12 changed files with 828 additions and 22 deletions
+10 -3
View File
@@ -15,23 +15,28 @@ class AppConfig {
/// Immich API key for authentication.
final String immichApiKey;
/// List of Nostr relay URLs for testing and production.
final List<String> nostrRelays;
/// Creates an [AppConfig] instance with the provided values.
///
/// [apiBaseUrl] - The base URL for API requests.
/// [enableLogging] - Whether logging should be enabled.
/// [immichBaseUrl] - Immich server base URL.
/// [immichApiKey] - Immich API key for authentication.
/// [nostrRelays] - List of Nostr relay URLs (e.g., ['wss://relay.example.com']).
const AppConfig({
required this.apiBaseUrl,
required this.enableLogging,
required this.immichBaseUrl,
required this.immichApiKey,
required this.nostrRelays,
});
@override
String toString() {
return 'AppConfig(apiBaseUrl: $apiBaseUrl, enableLogging: $enableLogging, '
'immichBaseUrl: $immichBaseUrl)';
'immichBaseUrl: $immichBaseUrl, nostrRelays: ${nostrRelays.length})';
}
@override
@@ -41,7 +46,8 @@ class AppConfig {
other.apiBaseUrl == apiBaseUrl &&
other.enableLogging == enableLogging &&
other.immichBaseUrl == immichBaseUrl &&
other.immichApiKey == immichApiKey;
other.immichApiKey == immichApiKey &&
other.nostrRelays.toString() == nostrRelays.toString();
}
@override
@@ -49,6 +55,7 @@ class AppConfig {
apiBaseUrl.hashCode ^
enableLogging.hashCode ^
immichBaseUrl.hashCode ^
immichApiKey.hashCode;
immichApiKey.hashCode ^
nostrRelays.hashCode;
}
+7
View File
@@ -39,6 +39,10 @@ class ConfigLoader {
enableLogging: true,
immichBaseUrl: 'https://photos.satoshinakamoto.win', // ← Change your Immich server URL here
immichApiKey: '3v2fTujMJHy1T2rrVJVojdJS0ySm7IRcRvEcvvUvs0', // ← Change your Immich API key here
nostrRelays: [ // ← Add Nostr relay URLs for testing
'wss://nostrum.satoshinakamoto.win',
'wss://nos.lol',
],
);
case 'prod':
return const AppConfig(
@@ -46,6 +50,9 @@ class ConfigLoader {
enableLogging: false,
immichBaseUrl: 'https://photos.satoshinakamoto.win', // ← Change your Immich server URL here
immichApiKey: 'your-prod-api-key-here', // ← Change your Immich API key here
nostrRelays: [ // ← Add Nostr relay URLs for production
'wss://relay.damus.io',
],
);
default:
throw InvalidEnvironmentException(environment);