Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

syn2mas: only set the SSL options if we set any of them #3089

Merged
merged 2 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tools/syn2mas/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ COPY --from=builder /syn2mas/dist ./dist
ARG TARGETARCH
COPY --from=deps /deps/${TARGETARCH}/node_modules ./node_modules

ENTRYPOINT ["/nodejs/bin/node", "--enable-source-maps", "dist/index.js"]
ENTRYPOINT ["/nodejs/bin/node", "--enable-source-maps", "/syn2mas/dist/index.js"]
8 changes: 6 additions & 2 deletions tools/syn2mas/src/db.mts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ export async function connectToSynapseDatabase({
database.args.sslkey && (ssl.key = await readFile(database.args.sslkey));
database.args.sslpassword && (ssl.passphrase = database.args.sslpassword);

connection.ssl = ssl;
if (Object.keys(ssl).length > 0) {
connection.ssl = ssl;
}

return knex({
client: "pg",
Expand Down Expand Up @@ -103,7 +105,9 @@ export async function connectToMASDatabase({
ssl.key = await readFile(database.ssl_key_file);
}

connection.ssl = ssl;
if (Object.keys(ssl).length > 0) {
connection.ssl = ssl;
}

return knex({
client: "pg",
Expand Down
Loading