core: storage: load from env

This commit is contained in:
undefined committed 2021-09-17 15:42:35 +08:00
1 parent 461b486891
commit 6762e22bae
2 files changed
+6 -1

No files matched your search

+5
View File
@@ -99,6 +99,11 @@ class StorageService {
endPointForUser,
endPointForJudge,
};
if (process.env.MINIO_ACCESS_KEY && process.env.MINIO_SECRET_KEY) {
logger.info('Using MinIO key from environment variables');
this.opts.accessKey = process.env.MINIO_ACCESS_KEY;
this.opts.secretKey = process.env.MINIO_SECRET_KEY;
}
this.client = new Client({
...parseMainEndpointUrl(this.opts.endPoint),
pathStyle: this.opts.pathStyle,