feat: custom/private docker registries

This commit is contained in:
Andras Bacsai
2022-11-23 14:39:30 +01:00
parent 03861af893
commit d4f10a9af3
7 changed files with 301 additions and 3 deletions

View File

@@ -241,7 +241,8 @@ export async function getApplicationFromDB(id: string, teamId: string) {
secrets: true,
persistentStorage: true,
connectedDatabase: true,
previewApplication: true
previewApplication: true,
dockerRegistry: true
}
});
if (!application) {

View File

@@ -11,6 +11,8 @@ export async function listAllSettings(request: FastifyRequest) {
const teamId = request.user.teamId;
const settings = await listSettings();
const sshKeys = await prisma.sshKey.findMany({ where: { team: { id: teamId } } })
const publicRegistries = await prisma.dockerRegistry.findMany({ where: { isSystemWide: true } })
const registries = await prisma.dockerRegistry.findMany({ where: { team: { id: teamId } } })
const unencryptedKeys = []
if (sshKeys.length > 0) {
for (const key of sshKeys) {
@@ -27,7 +29,11 @@ export async function listAllSettings(request: FastifyRequest) {
return {
settings,
certificates: cns,
sshKeys: unencryptedKeys
sshKeys: unencryptedKeys,
registries: {
public: publicRegistries,
private: registries
}
}
} catch ({ status, message }) {
return errorHandler({ status, message })