Skip to content

Commit

Permalink
[postgres] allow db ssl if configured (default: unchanged)
Browse files Browse the repository at this point in the history
  • Loading branch information
drew-u410 committed Oct 28, 2024
1 parent 6548c42 commit 87d79e1
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 2 deletions.
3 changes: 3 additions & 0 deletions packages/indexer-agent/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- Upgraded `common-ts` dependency to v2.0.11
- Add support for database SSL being enabled (default unchanged: disabled)

## [0.21.2] - 2024-01-18
### Changed
Expand Down
2 changes: 1 addition & 1 deletion packages/indexer-agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"graph-indexer-agent": "bin/graph-indexer-agent"
},
"dependencies": {
"@graphprotocol/common-ts": "2.0.10",
"@graphprotocol/common-ts": "2.0.11",
"@graphprotocol/indexer-common": "^0.21.4",
"@thi.ng/heaps": "^1.3.1",
"@uniswap/sdk": "3.0.3",
Expand Down
7 changes: 7 additions & 0 deletions packages/indexer-agent/src/commands/common-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ export function injectCommonStartupOptions(argv: Argv): Argv {
required: true,
group: 'Postgres',
})
.option('postgres-ssl', {
description: 'Postgres ssl enabled',
type: 'boolean',
required: false,
default: false,
group: 'Postgres',
})
.option('postgres-pool-size', {
description: 'Postgres maximum connection pool size',
type: 'number',
Expand Down
2 changes: 2 additions & 0 deletions packages/indexer-agent/src/commands/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@ export async function run(
port: argv.postgresPort,
database: argv.postgresDatabase,
poolMax: argv.postgresPoolSize,
ssl: argv.postgresSslEnabled,
})
const sequelize = await connectDatabase({
logging: undefined,
Expand All @@ -540,6 +541,7 @@ export async function run(
username: argv.postgresUsername,
password: argv.postgresPassword,
database: argv.postgresDatabase,
ssl: argv.postgresSslEnabled,
poolMin: 0,
poolMax: argv.postgresPoolSize,
})
Expand Down
3 changes: 3 additions & 0 deletions packages/indexer-service/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- Upgraded `common-ts` dependency to v2.0.11
- Add support for database SSL being enabled (default unchanged: disabled)

## [0.21.2] - 2024-01-18
### Changed
Expand Down
2 changes: 1 addition & 1 deletion packages/indexer-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
},
"dependencies": {
"@google-cloud/profiler": "6.0.1",
"@graphprotocol/common-ts": "2.0.10",
"@graphprotocol/common-ts": "2.0.11",
"@graphprotocol/indexer-common": "^0.21.4",
"@graphprotocol/indexer-native": "0.21.4",
"@graphql-tools/load": "8.0.0",
Expand Down
9 changes: 9 additions & 0 deletions packages/indexer-service/src/commands/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ export default {
required: true,
group: 'Postgres',
})
.option('postgres-ssl', {
description: 'Postgres ssl enabled',
type: 'boolean',
required: false,
default: false,
group: 'Postgres',
})
.option('network-subgraph-deployment', {
description: 'Network subgraph deployment',
type: 'string',
Expand Down Expand Up @@ -292,6 +299,7 @@ export default {
host: argv.postgresHost,
port: argv.postgresPort,
database: argv.postgresDatabase,
ssl: argv.postgresSslEnabled,
})
const sequelize = await connectDatabase({
logging: undefined,
Expand All @@ -300,6 +308,7 @@ export default {
username: argv.postgresUsername,
password: argv.postgresPassword,
database: argv.postgresDatabase,
ssl: argv.postgresSslEnabled,
})
const queryFeeModels = defineQueryFeeModels(sequelize)
const models = defineIndexerManagementModels(sequelize)
Expand Down

0 comments on commit 87d79e1

Please sign in to comment.