feat: allow self signed certificates with postgres connections (#5143)
This commit is contained in:
@ -34,6 +34,7 @@ import TabItem from '@theme/TabItem';
|
|||||||
|
|
||||||
<OptionTable options={[
|
<OptionTable options={[
|
||||||
['PG_DATABASE_URL', 'postgres://user:pw@localhost:5432/default?connection_limit=1', 'Database connection'],
|
['PG_DATABASE_URL', 'postgres://user:pw@localhost:5432/default?connection_limit=1', 'Database connection'],
|
||||||
|
['PG_SSL_ALLOW_SELF_SIGNED', 'false', 'Allow self signed certificates'],
|
||||||
['REDIS_HOST', '127.0.0.1', 'Redis connection host'],
|
['REDIS_HOST', '127.0.0.1', 'Redis connection host'],
|
||||||
['REDIS_PORT', '6379', 'Redis connection port'],
|
['REDIS_PORT', '6379', 'Redis connection port'],
|
||||||
['FRONT_BASE_URL', 'http://localhost:3001', 'Url to the hosted frontend'],
|
['FRONT_BASE_URL', 'http://localhost:3001', 'Url to the hosted frontend'],
|
||||||
|
|||||||
@ -71,3 +71,4 @@ SIGN_IN_PREFILLED=true
|
|||||||
# API_RATE_LIMITING_LIMIT=
|
# API_RATE_LIMITING_LIMIT=
|
||||||
# MUTATION_MAXIMUM_RECORD_AFFECTED=100
|
# MUTATION_MAXIMUM_RECORD_AFFECTED=100
|
||||||
# CHROME_EXTENSION_REDIRECT_URL=https://bggmipldbceihilonnbpgoeclgbkblkp.chromiumapp.org
|
# CHROME_EXTENSION_REDIRECT_URL=https://bggmipldbceihilonnbpgoeclgbkblkp.chromiumapp.org
|
||||||
|
# PG_SSL_ALLOW_SELF_SIGNED=true
|
||||||
|
|||||||
@ -14,6 +14,12 @@ export const typeORMCoreModuleOptions: TypeOrmModuleOptions = {
|
|||||||
migrationsRun: false,
|
migrationsRun: false,
|
||||||
migrationsTableName: '_typeorm_migrations',
|
migrationsTableName: '_typeorm_migrations',
|
||||||
migrations: ['dist/src/database/typeorm/core/migrations/*{.ts,.js}'],
|
migrations: ['dist/src/database/typeorm/core/migrations/*{.ts,.js}'],
|
||||||
|
ssl:
|
||||||
|
process.env.PG_SSL_ALLOW_SELF_SIGNED === 'true'
|
||||||
|
? {
|
||||||
|
rejectUnauthorized: false,
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
};
|
};
|
||||||
export const connectionSource = new DataSource(
|
export const connectionSource = new DataSource(
|
||||||
typeORMCoreModuleOptions as DataSourceOptions,
|
typeORMCoreModuleOptions as DataSourceOptions,
|
||||||
|
|||||||
@ -14,6 +14,12 @@ export const typeORMMetadataModuleOptions: TypeOrmModuleOptions = {
|
|||||||
migrationsRun: false,
|
migrationsRun: false,
|
||||||
migrationsTableName: '_typeorm_migrations',
|
migrationsTableName: '_typeorm_migrations',
|
||||||
migrations: ['dist/src/database/typeorm/metadata/migrations/*{.ts,.js}'],
|
migrations: ['dist/src/database/typeorm/metadata/migrations/*{.ts,.js}'],
|
||||||
|
ssl:
|
||||||
|
process.env.PG_SSL_ALLOW_SELF_SIGNED === 'true'
|
||||||
|
? {
|
||||||
|
rejectUnauthorized: false,
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
};
|
};
|
||||||
export const connectionSource = new DataSource(
|
export const connectionSource = new DataSource(
|
||||||
typeORMMetadataModuleOptions as DataSourceOptions,
|
typeORMMetadataModuleOptions as DataSourceOptions,
|
||||||
|
|||||||
@ -33,6 +33,11 @@ export class TypeORMService implements OnModuleInit, OnModuleDestroy {
|
|||||||
BillingSubscription,
|
BillingSubscription,
|
||||||
BillingSubscriptionItem,
|
BillingSubscriptionItem,
|
||||||
],
|
],
|
||||||
|
ssl: environmentService.get('PG_SSL_ALLOW_SELF_SIGNED')
|
||||||
|
? {
|
||||||
|
rejectUnauthorized: false,
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -103,6 +103,11 @@ export class EnvironmentVariables {
|
|||||||
})
|
})
|
||||||
PG_DATABASE_URL: string;
|
PG_DATABASE_URL: string;
|
||||||
|
|
||||||
|
@CastToBoolean()
|
||||||
|
@IsBoolean()
|
||||||
|
@IsOptional()
|
||||||
|
PG_SSL_ALLOW_SELF_SIGNED = false;
|
||||||
|
|
||||||
// Frontend URL
|
// Frontend URL
|
||||||
@IsUrl({ require_tld: false })
|
@IsUrl({ require_tld: false })
|
||||||
FRONT_BASE_URL: string;
|
FRONT_BASE_URL: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user