mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-29 04:55:03 +02:00
Create workspace docker compose fix (#800)
Signed-off-by: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com>
This commit is contained in:
@@ -53,6 +53,7 @@ export const accountId = 'account' as Plugin
|
||||
const accountPlugin = plugin(accountId, {
|
||||
metadata: {
|
||||
Endpoint: '' as Metadata<string>,
|
||||
Transactor: '' as Metadata<string>,
|
||||
Secret: '' as Metadata<string>
|
||||
},
|
||||
status: {
|
||||
@@ -69,7 +70,19 @@ const getSecret = (): string => {
|
||||
}
|
||||
|
||||
const getEndpoint = (): string => {
|
||||
return getMetadata(accountPlugin.metadata.Endpoint) ?? 'wss://transactor.hc.engineering/'
|
||||
const endpoint = getMetadata(accountPlugin.metadata.Endpoint)
|
||||
if (endpoint === undefined) {
|
||||
throw new Error('Please provide transactor endpoint url')
|
||||
}
|
||||
return endpoint
|
||||
}
|
||||
|
||||
const getTransactor = (): string => {
|
||||
const transactor = getMetadata(accountPlugin.metadata.Transactor)
|
||||
if (transactor === undefined) {
|
||||
throw new Error('Please provide transactor url')
|
||||
}
|
||||
return transactor
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -297,7 +310,7 @@ export async function createWorkspace (db: Db, workspace: string, organisation:
|
||||
organisation
|
||||
})
|
||||
.then((e) => e.insertedId.toHexString())
|
||||
await initWorkspace(getEndpoint(), workspace)
|
||||
await initWorkspace(getTransactor(), workspace)
|
||||
return result
|
||||
}
|
||||
|
||||
@@ -378,7 +391,7 @@ export async function assignWorkspace (db: Db, email: string, workspace: string)
|
||||
}
|
||||
|
||||
async function createEmployeeAccount (account: Account, workspace: string): Promise<void> {
|
||||
const connection = await connect(getEndpoint(), workspace, account.email)
|
||||
const connection = await connect(getTransactor(), workspace, account.email)
|
||||
try {
|
||||
const ops = new TxOperations(connection, core.account.System)
|
||||
|
||||
|
||||
@@ -25,7 +25,9 @@ spec:
|
||||
- name: UPLOAD_URL
|
||||
value: /files
|
||||
- name: TRANSACTOR_URL
|
||||
value: ws://transactor/
|
||||
value: wss://transactor.hc.engineering/
|
||||
- name: GMAIL_URL
|
||||
value: gmail.hc.engineering
|
||||
- name: ELASTIC_URL
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
|
||||
Reference in New Issue
Block a user