mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-27 19:34:38 +00:00
refactor(agent): centralize sandbox allowedDomains default in prisma schema
This commit is contained in:
@@ -172,11 +172,7 @@ export class AgentExecutor {
|
||||
})
|
||||
|
||||
const sandbox = await this.getSandbox(teamId)
|
||||
const allowedDomains = sandbox?.allowedDomains || [
|
||||
'github.com',
|
||||
'api.github.com',
|
||||
'raw.githubusercontent.com',
|
||||
]
|
||||
const allowedDomains = sandbox?.allowedDomains || []
|
||||
|
||||
const piDir = path.join(process.cwd(), '.pi')
|
||||
if (!fs.existsSync(piDir)) fs.mkdirSync(piDir, { recursive: true })
|
||||
|
||||
@@ -26,6 +26,7 @@ export class TeamService {
|
||||
enablePublicSignup: true,
|
||||
transcode: { videoStrategy: 'disable', imageStrategy: 'disable' },
|
||||
},
|
||||
sandbox: { create: {} },
|
||||
},
|
||||
})
|
||||
await providerService.initBuiltinProviders(team.id)
|
||||
@@ -42,6 +43,7 @@ export class TeamService {
|
||||
name: req.name,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
settings: {} as any,
|
||||
sandbox: { create: {} },
|
||||
},
|
||||
})
|
||||
|
||||
@@ -208,11 +210,7 @@ export class TeamService {
|
||||
where: { teamId },
|
||||
})
|
||||
return {
|
||||
allowedDomains: sandbox?.allowedDomains || [
|
||||
'github.com',
|
||||
'api.github.com',
|
||||
'raw.githubusercontent.com',
|
||||
],
|
||||
allowedDomains: sandbox?.allowedDomains || [],
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user