Add pushPublicKey to front (#6043)

* Add pushPublicKey to front

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>

* Fix formatting

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>

---------

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov 2024-07-10 17:38:41 +05:00 committed by GitHub
parent 55af032065
commit f815d1e4f5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View File

@ -240,6 +240,7 @@ export function start (
collaboratorApiUrl: string collaboratorApiUrl: string
brandingUrl?: string brandingUrl?: string
previewConfig: string previewConfig: string
pushPublicKey?: string
}, },
port: number, port: number,
extraConfig?: Record<string, string | undefined> extraConfig?: Record<string, string | undefined>
@ -279,6 +280,7 @@ export function start (
COLLABORATOR_API_URL: config.collaboratorApiUrl, COLLABORATOR_API_URL: config.collaboratorApiUrl,
BRANDING_URL: config.brandingUrl, BRANDING_URL: config.brandingUrl,
PREVIEW_CONFIG: config.previewConfig, PREVIEW_CONFIG: config.previewConfig,
PUSH_PUBLIC_KEY: config.pushPublicKey,
...(extraConfig ?? {}) ...(extraConfig ?? {})
} }
res.set('Cache-Control', cacheControlNoCache) res.set('Cache-Control', cacheControlNoCache)

View File

@ -106,6 +106,8 @@ export function startFront (ctx: MeasureContext, extraConfig?: Record<string, st
previewConfig = `*|${uploadUrl}/:workspace?file=:blobId.:format&size=:size` previewConfig = `*|${uploadUrl}/:workspace?file=:blobId.:format&size=:size`
} }
const pushPublicKey = process.env.PUSH_PUBLIC_KEY
const brandingUrl = process.env.BRANDING_URL const brandingUrl = process.env.BRANDING_URL
setMetadata(serverToken.metadata.Secret, serverSecret) setMetadata(serverToken.metadata.Secret, serverSecret)
@ -123,7 +125,8 @@ export function startFront (ctx: MeasureContext, extraConfig?: Record<string, st
collaboratorUrl, collaboratorUrl,
collaboratorApiUrl, collaboratorApiUrl,
brandingUrl, brandingUrl,
previewConfig previewConfig,
pushPublicKey
} }
console.log('Starting Front service with', config) console.log('Starting Front service with', config)
const shutdown = start(ctx, config, SERVER_PORT, extraConfig) const shutdown = start(ctx, config, SERVER_PORT, extraConfig)