mnemo_cards/mnemo_cards_backend/lib/storage/minio_config.dart
Dmitry 9482b52946
Some checks are pending
Backend CI / test (push) Waiting to run
Backend CI / build (push) Blocked by required conditions
Deploy Mnemo Cards / Deploy Backend (push) Waiting to run
Deploy Mnemo Cards / Deploy Web App (push) Blocked by required conditions
Deploy Mnemo Cards / Final Verification (push) Blocked by required conditions
ssl
2025-12-19 04:59:59 +03:00

39 lines
1.1 KiB
Dart

import 'dart:io';
/// Configuration for MinIO connection
class MinioConfig {
final String endpoint;
final int port;
final String accessKey;
final String secretKey;
final bool useSSL;
final String region;
// Bucket names
static const String cardImagesBucket = 'card-images';
static const String testImagesBucket = 'test-images';
static const String voiceAudioBucket = 'voice-audio';
// Presigned URL expiration (4 hours)
static const int presignedUrlExpirySeconds = 4 * 60 * 60;
MinioConfig({
required this.endpoint,
required this.port,
required this.accessKey,
required this.secretKey,
required this.useSSL,
required this.region,
});
factory MinioConfig.fromEnvironment() {
return MinioConfig(
endpoint: Platform.environment['MINIO_SERVER_URL']!,
port: int.parse(Platform.environment['MINIO_PORT'] ?? '443'),
accessKey: Platform.environment['SERVICE_USER_MINIO']!,
secretKey: Platform.environment['SERVICE_PASSWORD_MINIO']!,
useSSL: Platform.environment['MINIO_USE_SSL'] != 'false',
region: Platform.environment['MINIO_REGION'] ?? 'us-east-1',
);
}
}