diff --git a/src/core/mongo/index.ts b/src/core/mongo/index.ts index f9904c4..ddfbdc6 100644 --- a/src/core/mongo/index.ts +++ b/src/core/mongo/index.ts @@ -221,7 +221,7 @@ export class MongoPlugin implements DepkerPlugin { const database = name; const username = name; - const password = generator.generate(); + const password = generator.generate(20, true, true, false); await this.exec(` use ${database}; @@ -354,7 +354,7 @@ export class MongoPlugin implements DepkerPlugin { const config = await this.depker.config.service(MongoPlugin.NAME); if (!config.username || !config.password) { config.username = "root"; - config.password = generator.generate(); + config.password = generator.generate(20, true, true, false); await this.depker.config.service(MongoPlugin.NAME, () => config); } diff --git a/src/core/mysql/index.ts b/src/core/mysql/index.ts index 09da8de..4f07ae9 100644 --- a/src/core/mysql/index.ts +++ b/src/core/mysql/index.ts @@ -220,7 +220,7 @@ export class MysqlPlugin implements DepkerPlugin { const database = name; const username = name; - const password = generator.generate(); + const password = generator.generate(20, true, true, false); await this.exec([ `DROP USER IF EXISTS ${username}`, @@ -341,7 +341,7 @@ export class MysqlPlugin implements DepkerPlugin { const config = await this.depker.config.service(MysqlPlugin.NAME); if (!config.username || !config.password) { config.username = "root"; - config.password = generator.generate(); + config.password = generator.generate(20, true, true, false); await this.depker.config.service(MysqlPlugin.NAME, () => config); } diff --git a/src/core/postgres/index.ts b/src/core/postgres/index.ts index 6725590..1055558 100644 --- a/src/core/postgres/index.ts +++ b/src/core/postgres/index.ts @@ -170,7 +170,7 @@ export class PostgresPlugin implements DepkerPlugin { value.PGSQL_NAME = database; value.PGSQL_USER = username; value.PGSQL_PASS = password; - value.PGSQL_URL = `postgresql://${value.PGSQL_USER}:${value.PGSQL_PASS}@${value.PGSQL_HOST}:${value.PGSQL_PORT}/${value.PGSQL_NAME}`; + value.PGSQL_URL = `postgres://${value.PGSQL_USER}:${value.PGSQL_PASS}@${value.PGSQL_HOST}:${value.PGSQL_PORT}/${value.PGSQL_NAME}?sslmode=disable`; return value; }); } @@ -216,7 +216,7 @@ export class PostgresPlugin implements DepkerPlugin { const database = name; const username = name; - const password = generator.generate(); + const password = generator.generate(20, true, true, false); await this.exec([ `DROP USER IF EXISTS ${username}`, @@ -260,7 +260,7 @@ export class PostgresPlugin implements DepkerPlugin { value.PGSQL_NAME = name; value.PGSQL_USER = config.username; value.PGSQL_PASS = config.password; - value.PGSQL_URL = `postgresql://${value.PGSQL_USER}:${value.PGSQL_PASS}@${value.PGSQL_HOST}:${value.PGSQL_PORT}/${value.PGSQL_NAME}`; + value.PGSQL_URL = `postgres://${value.PGSQL_USER}:${value.PGSQL_PASS}@${value.PGSQL_HOST}:${value.PGSQL_PORT}/${value.PGSQL_NAME}?sslmode=disable`; return value; } else if (config.databases?.[name]) { const value: Record = {}; @@ -269,7 +269,7 @@ export class PostgresPlugin implements DepkerPlugin { value.PGSQL_NAME = name; value.PGSQL_USER = config.databases[name].username; value.PGSQL_PASS = config.databases[name].password; - value.PGSQL_URL = `postgresql://${value.PGSQL_USER}:${value.PGSQL_PASS}@${value.PGSQL_HOST}:${value.PGSQL_PORT}/${value.PGSQL_NAME}`; + value.PGSQL_URL = `postgres://${value.PGSQL_USER}:${value.PGSQL_PASS}@${value.PGSQL_HOST}:${value.PGSQL_PORT}/${value.PGSQL_NAME}?sslmode=disable`; return value; } else { throw new Error(`PostgreSQL database is not configured with name: ${name}`); @@ -327,7 +327,7 @@ export class PostgresPlugin implements DepkerPlugin { const config = await this.depker.config.service(PostgresPlugin.NAME); if (!config.username || !config.password) { config.username = "postgres"; - config.password = generator.generate(); + config.password = generator.generate(20, true, true, false); await this.depker.config.service(PostgresPlugin.NAME, () => config); } diff --git a/src/core/redis/index.ts b/src/core/redis/index.ts index d569361..72af398 100644 --- a/src/core/redis/index.ts +++ b/src/core/redis/index.ts @@ -219,7 +219,7 @@ export class RedisPlugin implements DepkerPlugin { } const username = name; - const password = generator.generate(); + const password = generator.generate(20, true, true, false); await this.exec(`ACL SETUSER ${username} on allkeys allchannels allcommands >'${password}'`); config.databases = config.databases ?? {}; @@ -330,7 +330,7 @@ export class RedisPlugin implements DepkerPlugin { const config = await this.depker.config.service(RedisPlugin.NAME); if (!config.username || !config.password) { config.username = "default"; - config.password = generator.generate(); + config.password = generator.generate(20, true, true, false); await this.depker.config.service(RedisPlugin.NAME, () => config); }