Some checks are pending
Backend CI / test (push) Waiting to run
Backend CI / build (push) Blocked by required conditions
Web App CI / test (push) Waiting to run
Web App 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
41 lines
1.3 KiB
Dart
41 lines
1.3 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
|
|
// Note: cardImagesBucket is used for all images (both card images and test images)
|
|
// to simplify bucket management and reduce complexity
|
|
static const String cardImagesBucket = 'card-images';
|
|
static const String voiceAudioBucket = 'voice-audio';
|
|
|
|
// Presigned URL expiration (7 days)
|
|
// Increased from 4 hours to prevent 403 errors on cached card data
|
|
static const int presignedUrlExpirySeconds = 1 * 24 * 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',
|
|
);
|
|
}
|
|
}
|