Skip to content

Commit

Permalink
move signing key to api entry
Browse files Browse the repository at this point in the history
  • Loading branch information
dholms committed Oct 30, 2023
1 parent 50d9a78 commit 0c2d71d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 5 additions & 0 deletions services/bsky/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const {
CloudfrontInvalidator,
MultiImageInvalidator,
} = require('@atproto/aws')
const { Secp256k1Keypair } = require('@atproto/crypto')
const {
DatabaseCoordinator,
PrimaryDatabase,
Expand Down Expand Up @@ -64,6 +65,8 @@ const main = async () => {
blobCacheLocation: env.blobCacheLocation,
})

const signingKey = await Secp256k1Keypair.import(env.serviceSigningKey)

// configure zero, one, or both image invalidators
let imgInvalidator
const bunnyInvalidator = env.bunnyAccessKey
Expand Down Expand Up @@ -93,6 +96,7 @@ const main = async () => {
const algos = env.feedPublisherDid ? makeAlgos(env.feedPublisherDid) : {}
const bsky = BskyAppView.create({
db,
signingKey,
config: cfg,
imgInvalidator,
algos,
Expand Down Expand Up @@ -146,6 +150,7 @@ const getEnv = () => ({
dbPoolSize: maybeParseInt(process.env.DB_POOL_SIZE),
dbPoolMaxUses: maybeParseInt(process.env.DB_POOL_MAX_USES),
dbPoolIdleTimeoutMs: maybeParseInt(process.env.DB_POOL_IDLE_TIMEOUT_MS),
serviceSigningKey: process.env.SERVICE_SIGNING_KEY,
publicUrl: process.env.PUBLIC_URL,
didPlcUrl: process.env.DID_PLC_URL,
imgUriSalt: process.env.IMG_URI_SALT,
Expand Down
5 changes: 0 additions & 5 deletions services/bsky/indexer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ require('dd-trace/init') // Only works with commonjs

// Tracer code above must come before anything else
const { CloudfrontInvalidator, BunnyInvalidator } = require('@atproto/aws')
const { Secp256k1Keypair } = require('@atproto/crypto')
const {
IndexerConfig,
BskyIndexer,
Expand All @@ -27,8 +26,6 @@ const main = async () => {
dbPostgresSchema: env.dbPostgresSchema,
})

const signingKey = await Secp256k1Keypair.import(env.serviceSigningKey)

// configure zero, one, or both image invalidators
let imgInvalidator
const bunnyInvalidator = env.bunnyAccessKey
Expand Down Expand Up @@ -68,7 +65,6 @@ const main = async () => {
)
const indexer = BskyIndexer.create({
db,
signingKey,
redis,
cfg,
imgInvalidator,
Expand Down Expand Up @@ -101,7 +97,6 @@ const getEnv = () => ({
dbPoolSize: maybeParseInt(process.env.DB_POOL_SIZE),
dbPoolMaxUses: maybeParseInt(process.env.DB_POOL_MAX_USES),
dbPoolIdleTimeoutMs: maybeParseInt(process.env.DB_POOL_IDLE_TIMEOUT_MS),
serviceSigningKey: process.env.SERVICE_SIGNING_KEY,
bunnyAccessKey: process.env.BUNNY_ACCESS_KEY,
cfDistributionId: process.env.CF_DISTRIBUTION_ID,
imgUriEndpoint: process.env.IMG_URI_ENDPOINT,
Expand Down

0 comments on commit 0c2d71d

Please sign in to comment.