mirror of
https://github.com/ahmadk953/poixpixel-discord-bot.git
synced 2025-05-10 10:43:06 +00:00
chore: modified code to use self-signed ssl certificates
This commit is contained in:
parent
b961218206
commit
7fd9497fb8
7 changed files with 89 additions and 7 deletions
|
@ -1,6 +1,8 @@
|
|||
// ========================
|
||||
// External Imports
|
||||
// ========================
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import pkg from 'pg';
|
||||
import { drizzle } from 'drizzle-orm/node-postgres';
|
||||
import { Client } from 'discord.js';
|
||||
|
@ -98,7 +100,11 @@ export async function initializeDatabaseConnection(): Promise<boolean> {
|
|||
// Create new connection pool
|
||||
dbPool = new Pool({
|
||||
connectionString: config.database.dbConnectionString,
|
||||
ssl: true,
|
||||
ssl: {
|
||||
ca: fs.readFileSync(path.resolve('./certs/psql-ca.crt')),
|
||||
cert: fs.readFileSync(path.resolve('./certs/psql-server.crt')),
|
||||
key: fs.readFileSync(path.resolve('./certs/psql-client.key')),
|
||||
},
|
||||
connectionTimeoutMillis: 10000,
|
||||
});
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import Redis from 'ioredis';
|
||||
import { Client } from 'discord.js';
|
||||
|
||||
|
@ -91,6 +93,11 @@ async function initializeRedisConnection() {
|
|||
},
|
||||
maxRetriesPerRequest: 3,
|
||||
enableOfflineQueue: true,
|
||||
tls: {
|
||||
ca: fs.readFileSync(path.resolve('./certs/cache-ca.crt')),
|
||||
cert: fs.readFileSync(path.resolve('./certs/cache-server.crt')),
|
||||
key: fs.readFileSync(path.resolve('./certs/cache-client.key')),
|
||||
},
|
||||
});
|
||||
|
||||
// ========================
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue