mirror of
https://github.com/PretendoNetwork/account.git
synced 2026-04-25 15:41:36 -05:00
Add S3 config option for region and path-style
This commit is contained in:
parent
875e75f08f
commit
eb31c88f83
|
|
@ -56,7 +56,9 @@ export const config: Config = {
|
|||
s3: {
|
||||
endpoint: process.env.PN_ACT_CONFIG_S3_ENDPOINT || '',
|
||||
key: process.env.PN_ACT_CONFIG_S3_ACCESS_KEY || '',
|
||||
secret: process.env.PN_ACT_CONFIG_S3_ACCESS_SECRET || ''
|
||||
secret: process.env.PN_ACT_CONFIG_S3_ACCESS_SECRET || '',
|
||||
region: process.env.PN_ACT_CONFIG_S3_REGION || '',
|
||||
forcePathStyle: process.env.PN_ACT_CONFIG_S3_FORCE_PATH_STYLE === 'true'
|
||||
},
|
||||
hcaptcha: {
|
||||
secret: process.env.PN_ACT_CONFIG_HCAPTCHA_SECRET || ''
|
||||
|
|
@ -195,6 +197,11 @@ if (!config.s3.secret) {
|
|||
disabledFeatures.s3 = true;
|
||||
}
|
||||
|
||||
if (!config.s3.region) {
|
||||
LOG_WARN('Failed to find S3 region config. Disabling feature. To enable feature set the PN_ACT_CONFIG_S3_REGION environment variable');
|
||||
disabledFeatures.s3 = true;
|
||||
}
|
||||
|
||||
if (!config.server_environment) {
|
||||
LOG_WARN('Failed to find server environment. To change the environment, set the PN_ACT_CONFIG_SERVER_ENVIRONMENT environment variable. Defaulting to prod');
|
||||
config.server_environment = 'prod';
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@ export interface Config {
|
|||
endpoint: string;
|
||||
key: string;
|
||||
secret: string;
|
||||
region: string;
|
||||
forcePathStyle: boolean;
|
||||
};
|
||||
hcaptcha: {
|
||||
secret: string;
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ let s3: S3;
|
|||
if (!disabledFeatures.s3) {
|
||||
s3 = new S3({
|
||||
endpoint: config.s3.endpoint,
|
||||
forcePathStyle: config.s3.forcePathStyle,
|
||||
region: config.s3.region,
|
||||
|
||||
credentials: {
|
||||
accessKeyId: config.s3.key,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user