debug: add detailed connection config logging
- Log the actual connection config being passed to Knex - Show password length to verify it's set - This should help identify why PostgreSQL sees 'root' user
This commit is contained in:
parent
fcbd082f6d
commit
6eb68b7bd3
@ -13,28 +13,31 @@ export default ({ env }) => {
|
||||
console.log('DATABASE_SSL:', env('DATABASE_SSL', 'not-set'));
|
||||
|
||||
if (client === 'postgres') {
|
||||
const config = {
|
||||
const connectionConfig = {
|
||||
host: env('DATABASE_HOST', 'localhost'),
|
||||
port: env.int('DATABASE_PORT', 5432),
|
||||
database: env('DATABASE_NAME', 'strapi'),
|
||||
user: env('DATABASE_USERNAME', 'strapi'),
|
||||
password: env('DATABASE_PASSWORD', 'strapi'),
|
||||
ssl: env.bool('DATABASE_SSL', false) ? { rejectUnauthorized: false } : false,
|
||||
};
|
||||
|
||||
console.log('PostgreSQL connection config:', JSON.stringify({
|
||||
...connectionConfig,
|
||||
password: connectionConfig.password ? `***${connectionConfig.password.length} chars***` : '***NOT SET***'
|
||||
}, null, 2));
|
||||
|
||||
return {
|
||||
connection: {
|
||||
client: 'postgres',
|
||||
connection: {
|
||||
host: env('DATABASE_HOST', 'localhost'),
|
||||
port: env.int('DATABASE_PORT', 5432),
|
||||
database: env('DATABASE_NAME', 'strapi'),
|
||||
user: env('DATABASE_USERNAME', 'strapi'),
|
||||
password: env('DATABASE_PASSWORD', 'strapi'),
|
||||
ssl: env.bool('DATABASE_SSL', false),
|
||||
},
|
||||
connection: connectionConfig,
|
||||
pool: {
|
||||
min: env.int('DATABASE_POOL_MIN', 2),
|
||||
max: env.int('DATABASE_POOL_MAX', 10),
|
||||
},
|
||||
acquireConnectionTimeout: env.int('DATABASE_TIMEOUT', 60000),
|
||||
debug: env.bool('DATABASE_DEBUG', false),
|
||||
},
|
||||
};
|
||||
|
||||
console.log('Using PostgreSQL configuration');
|
||||
return config;
|
||||
}
|
||||
|
||||
console.log('Using SQLite configuration');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user