convert analytics to TS

This commit is contained in:
chreamy authored and wancat committed 2024-02-28 23:38:33 +08:00
1 parent fb69cb4e10
commit 923de901c4
24 files changed
+11093 -211

No files matched your search

+4 -4
View File
@@ -2,7 +2,7 @@ import Docker from 'dockerode'
import config, { getQuestImage } from '../config.js'
import logger from '../utils/logger.js'
const engine = new Docker()
const engine = new Docker({ socketPath: '//./pipe/docker_engine' })
const containerOptions = {
AttachStdin: true,
@@ -29,8 +29,8 @@ export function createContainer(
if (!config.isProduction && hostPwd && mountQuest === questId) {
logger.info('Mounting quest folder', mountQuest)
option.HostConfig!.Binds = [
`${hostPwd}/quests/${mountQuest}/home:/home/commander`,
`${hostPwd}/packages/container:/usr/local/lib/container`,
`${hostPwd.replace(/\\/g, '/')}/quests/${mountQuest}/home:/home/commander`,
`${hostPwd.replace(/\\/g, '/')}/packages/container:/usr/local/lib/container`,
]
}
return engine.createContainer(option)
@@ -62,7 +62,7 @@ export async function attachContainer(
Tty: true,
Env: [
`TOKEN=${token}`,
`API_ENDPOINT=${config.backendUrl}`,
`API_ENDPOINT=http://backend:3000`,
'ZDOTDIR=/etc/zsh',
],
})