fix: exposedport on save
This commit is contained in:
parent
44a691ae29
commit
e6ea07f9b7
@ -139,10 +139,10 @@ export const prisma = new PrismaClient({
|
||||
});
|
||||
|
||||
// prisma.$on('query', (e) => {
|
||||
// console.log({e})
|
||||
// console.log('Query: ' + e.query)
|
||||
// console.log('Params: ' + e.params)
|
||||
// console.log('Duration: ' + e.duration + 'ms')
|
||||
// console.log({e})
|
||||
// console.log('Query: ' + e.query)
|
||||
// console.log('Params: ' + e.params)
|
||||
// console.log('Duration: ' + e.duration + 'ms')
|
||||
// })
|
||||
export const base64Encode = (text: string): string => {
|
||||
return Buffer.from(text).toString('base64');
|
||||
@ -1089,7 +1089,6 @@ export async function checkExposedPort({ id, configuredPort, exposePort, dockerI
|
||||
if (exposePort < 1024 || exposePort > 65535) {
|
||||
throw { status: 500, message: `Exposed Port needs to be between 1024 and 65535.` }
|
||||
}
|
||||
|
||||
if (configuredPort) {
|
||||
if (configuredPort !== exposePort) {
|
||||
const availablePort = await getFreeExposedPort(id, exposePort, dockerId, remoteIpAddress);
|
||||
|
@ -249,8 +249,8 @@ export async function saveApplication(request: FastifyRequest<SaveApplication>,
|
||||
exposePort = Number(exposePort);
|
||||
}
|
||||
|
||||
const { destinationDocker: { id: dockerId, remoteIpAddress } } = await prisma.application.findUnique({ where: { id }, include: { destinationDocker: true } })
|
||||
if (exposePort) await checkExposedPort({ id, exposePort, dockerId, remoteIpAddress })
|
||||
const { destinationDocker: { id: dockerId, remoteIpAddress }, exposePort: configuredPort } = await prisma.application.findUnique({ where: { id }, include: { destinationDocker: true } })
|
||||
if (exposePort) await checkExposedPort({ id, configuredPort, exposePort, dockerId, remoteIpAddress })
|
||||
if (denoOptions) denoOptions = denoOptions.trim();
|
||||
const defaultConfiguration = await setDefaultConfiguration({
|
||||
buildPack,
|
||||
|
Loading…
Reference in New Issue
Block a user