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

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "2.35.8",
"version": "2.35.9",
"bin": "bin/hydrooj.js",
"main": "src/loader",
"module": "src/loader",
+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,