Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

update

Andras Bacsai1126dcacf574
diff --git a/apps/api/src/index.ts b/apps/api/src/index.ts
index e53665a2c4..289b2fddf7 100644
--- a/apps/api/src/index.ts
+++ b/apps/api/src/index.ts
@@ -97,9 +97,23 @@ fastify.register(autoLoad, {
fastify.register(cookie)
fastify.register(cors);
fastify.addHook('onRequest', async (request, reply) => {
+ let allowedList = ['coolify:3000'];
+ const { ipv4, ipv6, fqdn } = await prisma.setting.findFirst({})
+
+ ipv4 && allowedList.push(ipv4);
+ ipv6 && allowedList.push(ipv6);
+ fqdn && allowedList.push(fqdn);
+
+ const remotes = await prisma.destinationDocker.findMany({ where: { remoteEngine: true, remoteVerified: true } })
+ if (remotes.length > 0) {
+ remotes.forEach(remote => {
+ allowedList.push(`${remote.remoteIpAddress}:3000`);
+ })
+ }
+ console.log({ allowedList })
console.log({ host: request.headers.host, origin: request.headers.origin })
if (!request.headers.origin && !request.headers.host.startsWith('host.docker.internal')) {
-
+
}
})
fastify.listen({ port, host }, async (err: any, address: any) => {