mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-03 08:18:52 +02:00
UBERF-9015: Remove confusing SYSTEM_EMAIL env (#7548)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
|
||||
import client, { ClientSocket } from '@hcengineering/client'
|
||||
import clientResources from '@hcengineering/client-resources'
|
||||
import { Client, ClientConnectEvent } from '@hcengineering/core'
|
||||
import { Client, ClientConnectEvent, systemAccountEmail } from '@hcengineering/core'
|
||||
import { setMetadata } from '@hcengineering/platform'
|
||||
import { getTransactorEndpoint } from '@hcengineering/server-client'
|
||||
import serverToken, { generateToken } from '@hcengineering/server-token'
|
||||
@@ -30,7 +30,7 @@ export async function createPlatformClient (
|
||||
|
||||
setMetadata(serverToken.metadata.Secret, config.ServerSecret)
|
||||
const token = generateToken(
|
||||
config.SystemEmail,
|
||||
systemAccountEmail,
|
||||
{
|
||||
name: workspace
|
||||
},
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
//
|
||||
|
||||
import { CollaboratorClient, getClient as getCollaboratorClient } from '@hcengineering/collaborator-client'
|
||||
import { WorkspaceId } from '@hcengineering/core'
|
||||
import { systemAccountEmail, WorkspaceId } from '@hcengineering/core'
|
||||
import { generateToken } from '@hcengineering/server-token'
|
||||
import config from './config'
|
||||
|
||||
@@ -12,6 +12,6 @@ import config from './config'
|
||||
* @public
|
||||
*/
|
||||
export function createCollaboratorClient (workspaceId: WorkspaceId): CollaboratorClient {
|
||||
const token = generateToken(config.SystemEmail, workspaceId, { mode: 'github' })
|
||||
const token = generateToken(systemAccountEmail, workspaceId, { mode: 'github' })
|
||||
return getCollaboratorClient(workspaceId, token, config.CollaboratorURL)
|
||||
}
|
||||
|
||||
@@ -2,13 +2,10 @@
|
||||
// Copyright © 2023 Hardcore Engineering Inc.
|
||||
//
|
||||
|
||||
import { systemAccountEmail } from '@hcengineering/core'
|
||||
|
||||
interface Config {
|
||||
AccountsURL: string
|
||||
ServiceID: string
|
||||
ServerSecret: string
|
||||
SystemEmail: string
|
||||
FrontURL: string
|
||||
|
||||
// '*' means all workspaces
|
||||
@@ -36,7 +33,6 @@ const envMap: { [key in keyof Config]: string } = {
|
||||
AccountsURL: 'ACCOUNTS_URL',
|
||||
ServiceID: 'SERVICE_ID',
|
||||
ServerSecret: 'SERVER_SECRET',
|
||||
SystemEmail: 'SYSTEM_EMAIL',
|
||||
FrontURL: 'FRONT_URL',
|
||||
|
||||
AppID: 'APP_ID',
|
||||
@@ -62,7 +58,6 @@ const required: Array<keyof Config> = [
|
||||
'AccountsURL',
|
||||
'ServerSecret',
|
||||
'ServiceID',
|
||||
'SystemEmail',
|
||||
'FrontURL',
|
||||
'AppID',
|
||||
'ClientID',
|
||||
@@ -82,7 +77,6 @@ const config: Config = (() => {
|
||||
AccountsURL: process.env[envMap.AccountsURL],
|
||||
ServerSecret: process.env[envMap.ServerSecret],
|
||||
ServiceID: process.env[envMap.ServiceID] ?? 'github-service',
|
||||
SystemEmail: process.env[envMap.SystemEmail] ?? systemAccountEmail,
|
||||
AllowedWorkspaces: process.env[envMap.AllowedWorkspaces]?.split(',') ?? ['*'],
|
||||
FrontURL: process.env[envMap.FrontURL] ?? '',
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import core, {
|
||||
MeasureContext,
|
||||
RateLimiter,
|
||||
Ref,
|
||||
systemAccountEmail,
|
||||
TxOperations
|
||||
} from '@hcengineering/core'
|
||||
import github, { GithubAuthentication, makeQuery, type GithubIntegration } from '@hcengineering/github'
|
||||
@@ -730,7 +731,7 @@ export class PlatformWorker {
|
||||
}
|
||||
await rateLimiter.add(async () => {
|
||||
const token = generateToken(
|
||||
config.SystemEmail,
|
||||
systemAccountEmail,
|
||||
{
|
||||
name: workspace
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user