mirror of
https://github.com/ershisan99/coolify.git
synced 2025-12-25 04:59:32 +00:00
Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
272b2bb65d | ||
|
|
5d5a478cd1 | ||
|
|
ddd09412cd | ||
|
|
d6cfc2624f | ||
|
|
e92d0914c2 | ||
|
|
0a44867240 | ||
|
|
bb210085b0 | ||
|
|
bfa5fb6f16 | ||
|
|
168eec3fe0 | ||
|
|
4a2696a58e | ||
|
|
6d2b453361 | ||
|
|
61c3f57f4a | ||
|
|
95d29363aa | ||
|
|
d431de8ea5 | ||
|
|
518fdf676a | ||
|
|
b4d658cea1 | ||
|
|
3f7cd317d6 | ||
|
|
de4c195641 | ||
|
|
45be1cb49a | ||
|
|
7dd19c322d | ||
|
|
fb299cdf4c | ||
|
|
2b1c46e1ab | ||
|
|
5d43ea551a | ||
|
|
e861c3fc0f | ||
|
|
5590acd182 | ||
|
|
6b42f4dc5b | ||
|
|
9771bea60a |
@@ -23,7 +23,7 @@ ENV PRISMA_QUERY_ENGINE_BINARY=/app/prisma-engines/query-engine \
|
|||||||
|
|
||||||
COPY --from=coollabsio/prisma-engine:3.15 /prisma-engines/query-engine /prisma-engines/migration-engine /prisma-engines/introspection-engine /prisma-engines/prisma-fmt /app/prisma-engines/
|
COPY --from=coollabsio/prisma-engine:3.15 /prisma-engines/query-engine /prisma-engines/migration-engine /prisma-engines/introspection-engine /prisma-engines/prisma-fmt /app/prisma-engines/
|
||||||
|
|
||||||
RUN apk add --no-cache git git-lfs openssh-client curl jq cmake sqlite openssl
|
RUN apk add --no-cache git git-lfs openssh-client curl jq cmake sqlite openssl psmisc
|
||||||
RUN curl -sL https://unpkg.com/@pnpm/self-installer | node
|
RUN curl -sL https://unpkg.com/@pnpm/self-installer | node
|
||||||
|
|
||||||
RUN mkdir -p ~/.docker/cli-plugins/
|
RUN mkdir -p ~/.docker/cli-plugins/
|
||||||
@@ -33,6 +33,8 @@ RUN curl -SL https://cdn.coollabs.io/bin/$TARGETPLATFORM/docker-20.10.9 -o /usr/
|
|||||||
RUN curl -SL https://cdn.coollabs.io/bin/$TARGETPLATFORM/docker-compose-linux-2.7.0 -o ~/.docker/cli-plugins/docker-compose
|
RUN curl -SL https://cdn.coollabs.io/bin/$TARGETPLATFORM/docker-compose-linux-2.7.0 -o ~/.docker/cli-plugins/docker-compose
|
||||||
RUN chmod +x ~/.docker/cli-plugins/docker-compose /usr/bin/docker
|
RUN chmod +x ~/.docker/cli-plugins/docker-compose /usr/bin/docker
|
||||||
|
|
||||||
|
RUN (curl -sSL "https://github.com/buildpacks/pack/releases/download/v0.27.0/pack-v0.27.0-linux.tgz" | tar -C /usr/local/bin/ --no-same-owner -xzv pack)
|
||||||
|
|
||||||
COPY --from=build /app/apps/api/build/ .
|
COPY --from=build /app/apps/api/build/ .
|
||||||
COPY --from=build /app/apps/ui/build/ ./public
|
COPY --from=build /app/apps/ui/build/ ./public
|
||||||
COPY --from=build /app/apps/api/prisma/ ./prisma
|
COPY --from=build /app/apps/api/prisma/ ./prisma
|
||||||
|
|||||||
9
apps/api/.env.example
Normal file
9
apps/api/.env.example
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
COOLIFY_APP_ID=
|
||||||
|
COOLIFY_SECRET_KEY="12341234123412341234123412341234 - 32 long"
|
||||||
|
COOLIFY_DATABASE_URL=
|
||||||
|
COOLIFY_SENTRY_DSN=
|
||||||
|
|
||||||
|
COOLIFY_IS_ON=docker
|
||||||
|
COOLIFY_WHITE_LABELED=false
|
||||||
|
COOLIFY_WHITE_LABELED_ICON=
|
||||||
|
COOLIFY_AUTO_UPDATE=
|
||||||
@@ -16,9 +16,9 @@ declare module 'fastify' {
|
|||||||
COOLIFY_DATABASE_URL: string,
|
COOLIFY_DATABASE_URL: string,
|
||||||
COOLIFY_SENTRY_DSN: string,
|
COOLIFY_SENTRY_DSN: string,
|
||||||
COOLIFY_IS_ON: string,
|
COOLIFY_IS_ON: string,
|
||||||
COOLIFY_WHITE_LABELED: boolean,
|
COOLIFY_WHITE_LABELED: string,
|
||||||
COOLIFY_WHITE_LABELED_ICON: string | null,
|
COOLIFY_WHITE_LABELED_ICON: string | null,
|
||||||
COOLIFY_AUTO_UPDATE: boolean,
|
COOLIFY_AUTO_UPDATE: string,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -52,16 +52,16 @@ const schema = {
|
|||||||
default: 'docker'
|
default: 'docker'
|
||||||
},
|
},
|
||||||
COOLIFY_WHITE_LABELED: {
|
COOLIFY_WHITE_LABELED: {
|
||||||
type: 'boolean',
|
type: 'string',
|
||||||
default: false
|
default: 'false'
|
||||||
},
|
},
|
||||||
COOLIFY_WHITE_LABELED_ICON: {
|
COOLIFY_WHITE_LABELED_ICON: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
default: null
|
default: null
|
||||||
},
|
},
|
||||||
COOLIFY_AUTO_UPDATE: {
|
COOLIFY_AUTO_UPDATE: {
|
||||||
type: 'boolean',
|
type: 'string',
|
||||||
default: false
|
default: 'false'
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -104,6 +104,7 @@ fastify.listen({ port, host }, async (err: any, address: any) => {
|
|||||||
await initServer();
|
await initServer();
|
||||||
await scheduler.start('deployApplication');
|
await scheduler.start('deployApplication');
|
||||||
await scheduler.start('cleanupStorage');
|
await scheduler.start('cleanupStorage');
|
||||||
|
await scheduler.start('cleanupPrismaEngines');
|
||||||
await scheduler.start('checkProxies');
|
await scheduler.start('checkProxies');
|
||||||
|
|
||||||
// Check if no build is running
|
// Check if no build is running
|
||||||
@@ -116,14 +117,14 @@ fastify.listen({ port, host }, async (err: any, address: any) => {
|
|||||||
scheduler.workers.get('deployApplication').postMessage("status:autoUpdater");
|
scheduler.workers.get('deployApplication').postMessage("status:autoUpdater");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, 60000 * 15)
|
}, isDev ? 5000 : 60000 * 15)
|
||||||
|
|
||||||
// Cleanup storage
|
// Cleanup storage
|
||||||
setInterval(async () => {
|
setInterval(async () => {
|
||||||
if (scheduler.workers.has('deployApplication')) {
|
if (scheduler.workers.has('deployApplication')) {
|
||||||
scheduler.workers.get('deployApplication').postMessage("status:cleanupStorage");
|
scheduler.workers.get('deployApplication').postMessage("status:cleanupStorage");
|
||||||
}
|
}
|
||||||
}, 60000 * 10)
|
}, isDev ? 5000 : 60000 * 10)
|
||||||
|
|
||||||
scheduler.on('worker deleted', async (name) => {
|
scheduler.on('worker deleted', async (name) => {
|
||||||
if (name === 'autoUpdater' || name === 'cleanupStorage') {
|
if (name === 'autoUpdater' || name === 'cleanupStorage') {
|
||||||
|
|||||||
@@ -4,87 +4,92 @@ import { checkContainer } from '../lib/docker';
|
|||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
if (parentPort) {
|
if (parentPort) {
|
||||||
// Coolify Proxy local
|
try {
|
||||||
const engine = '/var/run/docker.sock';
|
// Coolify Proxy local
|
||||||
const localDocker = await prisma.destinationDocker.findFirst({
|
const engine = '/var/run/docker.sock';
|
||||||
where: { engine, network: 'coolify' }
|
const localDocker = await prisma.destinationDocker.findFirst({
|
||||||
});
|
where: { engine, network: 'coolify' }
|
||||||
if (localDocker && localDocker.isCoolifyProxyUsed) {
|
});
|
||||||
// Remove HAProxy
|
if (localDocker && localDocker.isCoolifyProxyUsed) {
|
||||||
const found = await checkContainer({ dockerId: localDocker.id, container: 'coolify-haproxy' });
|
|
||||||
if (found) {
|
|
||||||
await executeDockerCmd({
|
|
||||||
dockerId: localDocker.id,
|
|
||||||
command: `docker stop -t 0 coolify-haproxy && docker rm coolify-haproxy`
|
|
||||||
})
|
|
||||||
}
|
|
||||||
await startTraefikProxy(localDocker.id);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// TCP Proxies
|
|
||||||
const databasesWithPublicPort = await prisma.database.findMany({
|
|
||||||
where: { publicPort: { not: null } },
|
|
||||||
include: { settings: true, destinationDocker: true }
|
|
||||||
});
|
|
||||||
for (const database of databasesWithPublicPort) {
|
|
||||||
const { destinationDockerId, destinationDocker, publicPort, id } = database;
|
|
||||||
if (destinationDockerId && destinationDocker.isCoolifyProxyUsed) {
|
|
||||||
const { privatePort } = generateDatabaseConfiguration(database);
|
|
||||||
// Remove HAProxy
|
// Remove HAProxy
|
||||||
const found = await checkContainer({
|
const found = await checkContainer({ dockerId: localDocker.id, container: 'coolify-haproxy' });
|
||||||
dockerId: localDocker.id, container: `haproxy-for-${publicPort}`
|
|
||||||
});
|
|
||||||
if (found) {
|
if (found) {
|
||||||
await executeDockerCmd({
|
await executeDockerCmd({
|
||||||
dockerId: localDocker.id,
|
dockerId: localDocker.id,
|
||||||
command: `docker stop -t 0 haproxy-for-${publicPort} && docker rm haproxy-for-${publicPort}`
|
command: `docker stop -t 0 coolify-haproxy && docker rm coolify-haproxy`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
await startTraefikTCPProxy(destinationDocker, id, publicPort, privatePort);
|
await startTraefikProxy(localDocker.id);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
// TCP Proxies
|
||||||
}
|
const databasesWithPublicPort = await prisma.database.findMany({
|
||||||
const wordpressWithFtp = await prisma.wordpress.findMany({
|
where: { publicPort: { not: null } },
|
||||||
where: { ftpPublicPort: { not: null } },
|
include: { settings: true, destinationDocker: true }
|
||||||
include: { service: { include: { destinationDocker: true } } }
|
});
|
||||||
});
|
for (const database of databasesWithPublicPort) {
|
||||||
for (const ftp of wordpressWithFtp) {
|
const { destinationDockerId, destinationDocker, publicPort, id } = database;
|
||||||
const { service, ftpPublicPort } = ftp;
|
if (destinationDockerId && destinationDocker.isCoolifyProxyUsed) {
|
||||||
const { destinationDockerId, destinationDocker, id } = service;
|
const { privatePort } = generateDatabaseConfiguration(database);
|
||||||
if (destinationDockerId && destinationDocker.isCoolifyProxyUsed) {
|
// Remove HAProxy
|
||||||
// Remove HAProxy
|
const found = await checkContainer({
|
||||||
const found = await checkContainer({ dockerId: localDocker.id, container: `haproxy-for-${ftpPublicPort}` });
|
dockerId: localDocker.id, container: `haproxy-for-${publicPort}`
|
||||||
if (found) {
|
});
|
||||||
await executeDockerCmd({
|
if (found) {
|
||||||
dockerId: localDocker.id,
|
await executeDockerCmd({
|
||||||
command: `docker stop -t 0 haproxy -for-${ftpPublicPort} && docker rm haproxy-for-${ftpPublicPort}`
|
dockerId: localDocker.id,
|
||||||
})
|
command: `docker stop -t 0 haproxy-for-${publicPort} && docker rm haproxy-for-${publicPort}`
|
||||||
|
})
|
||||||
|
}
|
||||||
|
await startTraefikTCPProxy(destinationDocker, id, publicPort, privatePort);
|
||||||
}
|
}
|
||||||
await startTraefikTCPProxy(destinationDocker, id, ftpPublicPort, 22, 'wordpressftp');
|
|
||||||
}
|
}
|
||||||
|
const wordpressWithFtp = await prisma.wordpress.findMany({
|
||||||
|
where: { ftpPublicPort: { not: null } },
|
||||||
|
include: { service: { include: { destinationDocker: true } } }
|
||||||
|
});
|
||||||
|
for (const ftp of wordpressWithFtp) {
|
||||||
|
const { service, ftpPublicPort } = ftp;
|
||||||
|
const { destinationDockerId, destinationDocker, id } = service;
|
||||||
|
if (destinationDockerId && destinationDocker.isCoolifyProxyUsed) {
|
||||||
|
// Remove HAProxy
|
||||||
|
const found = await checkContainer({ dockerId: localDocker.id, container: `haproxy-for-${ftpPublicPort}` });
|
||||||
|
if (found) {
|
||||||
|
await executeDockerCmd({
|
||||||
|
dockerId: localDocker.id,
|
||||||
|
command: `docker stop -t 0 haproxy -for-${ftpPublicPort} && docker rm haproxy-for-${ftpPublicPort}`
|
||||||
|
})
|
||||||
|
}
|
||||||
|
await startTraefikTCPProxy(destinationDocker, id, ftpPublicPort, 22, 'wordpressftp');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// HTTP Proxies
|
||||||
|
const minioInstances = await prisma.minio.findMany({
|
||||||
|
where: { publicPort: { not: null } },
|
||||||
|
include: { service: { include: { destinationDocker: true } } }
|
||||||
|
});
|
||||||
|
for (const minio of minioInstances) {
|
||||||
|
const { service, publicPort } = minio;
|
||||||
|
const { destinationDockerId, destinationDocker, id } = service;
|
||||||
|
if (destinationDockerId && destinationDocker.isCoolifyProxyUsed) {
|
||||||
|
// Remove HAProxy
|
||||||
|
const found = await checkContainer({ dockerId: localDocker.id, container: `${id}-${publicPort}` });
|
||||||
|
if (found) {
|
||||||
|
await executeDockerCmd({
|
||||||
|
dockerId: localDocker.id,
|
||||||
|
command: `docker stop -t 0 ${id}-${publicPort} && docker rm ${id}-${publicPort} `
|
||||||
|
})
|
||||||
|
}
|
||||||
|
await startTraefikTCPProxy(destinationDocker, id, publicPort, 9000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
|
||||||
|
} finally {
|
||||||
|
await prisma.$disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
// HTTP Proxies
|
|
||||||
const minioInstances = await prisma.minio.findMany({
|
|
||||||
where: { publicPort: { not: null } },
|
|
||||||
include: { service: { include: { destinationDocker: true } } }
|
|
||||||
});
|
|
||||||
for (const minio of minioInstances) {
|
|
||||||
const { service, publicPort } = minio;
|
|
||||||
const { destinationDockerId, destinationDocker, id } = service;
|
|
||||||
if (destinationDockerId && destinationDocker.isCoolifyProxyUsed) {
|
|
||||||
// Remove HAProxy
|
|
||||||
const found = await checkContainer({ dockerId: localDocker.id, container: `${id}-${publicPort}` });
|
|
||||||
if (found) {
|
|
||||||
await executeDockerCmd({
|
|
||||||
dockerId: localDocker.id,
|
|
||||||
command: `docker stop -t 0 ${id}-${publicPort} && docker rm ${id}-${publicPort} `
|
|
||||||
})
|
|
||||||
}
|
|
||||||
await startTraefikTCPProxy(destinationDocker, id, publicPort, 9000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
await prisma.$disconnect();
|
|
||||||
} else process.exit(0);
|
} else process.exit(0);
|
||||||
})();
|
})();
|
||||||
|
|||||||
19
apps/api/src/jobs/cleanupPrismaEngines.ts
Normal file
19
apps/api/src/jobs/cleanupPrismaEngines.ts
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
import { parentPort } from 'node:worker_threads';
|
||||||
|
import { asyncExecShell, isDev, prisma } from '../lib/common';
|
||||||
|
|
||||||
|
(async () => {
|
||||||
|
if (parentPort) {
|
||||||
|
if (!isDev) {
|
||||||
|
try {
|
||||||
|
const { stdout } = await asyncExecShell(`ps -ef | grep /app/prisma-engines/query-engine | grep -v grep | wc -l | xargs`)
|
||||||
|
if (stdout.trim() != null && stdout.trim() != '' && Number(stdout.trim()) > 1) {
|
||||||
|
await asyncExecShell(`killall -q -e /app/prisma-engines/query-engine -o 10m`)
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
} finally {
|
||||||
|
await prisma.$disconnect();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else process.exit(0);
|
||||||
|
})();
|
||||||
@@ -192,9 +192,9 @@ import * as buildpacks from '../lib/buildPacks';
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
// if (!imageFound || deployNeeded) {
|
await copyBaseConfigurationFiles(buildPack, workdir, buildId, applicationId, baseImage);
|
||||||
if (true) {
|
if (!imageFound || deployNeeded) {
|
||||||
await copyBaseConfigurationFiles(buildPack, workdir, buildId, applicationId, baseImage);
|
// if (true) {
|
||||||
if (buildpacks[buildPack])
|
if (buildpacks[buildPack])
|
||||||
await buildpacks[buildPack]({
|
await buildpacks[buildPack]({
|
||||||
dockerId: destinationDocker.id,
|
dockerId: destinationDocker.id,
|
||||||
@@ -248,11 +248,11 @@ import * as buildpacks from '../lib/buildPacks';
|
|||||||
secrets.forEach((secret) => {
|
secrets.forEach((secret) => {
|
||||||
if (pullmergeRequestId) {
|
if (pullmergeRequestId) {
|
||||||
if (secret.isPRMRSecret) {
|
if (secret.isPRMRSecret) {
|
||||||
envs.push(`${secret.name}=${secret.value}`);
|
envs.push(`${secret.name}='${secret.value}'`);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!secret.isPRMRSecret) {
|
if (!secret.isPRMRSecret) {
|
||||||
envs.push(`${secret.name}=${secret.value}`);
|
envs.push(`${secret.name}='${secret.value}'`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -303,6 +303,7 @@ import * as buildpacks from '../lib/buildPacks';
|
|||||||
labels,
|
labels,
|
||||||
depends_on: [],
|
depends_on: [],
|
||||||
restart: 'always',
|
restart: 'always',
|
||||||
|
expose: [port],
|
||||||
...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
|
...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
|
||||||
// logging: {
|
// logging: {
|
||||||
// driver: 'fluentd',
|
// driver: 'fluentd',
|
||||||
|
|||||||
@@ -523,7 +523,7 @@ export async function buildImage({
|
|||||||
await saveBuildLog({ line: `Building image started.`, buildId, applicationId });
|
await saveBuildLog({ line: `Building image started.`, buildId, applicationId });
|
||||||
}
|
}
|
||||||
if (debug) {
|
if (debug) {
|
||||||
await saveBuildLog({ line: `\n###############\nIMPORTANT: Due to some issues during implementing Remote Docker Engine, the builds logs are not streamed at the moment. You will see the full build log when the build is finished!\n###############`, buildId, applicationId });
|
await saveBuildLog({ line: `\n###############\nIMPORTANT: Due to some issues during implementing Remote Docker Engine, the builds logs are not streamed at the moment - but will be soon! You will see the full build log when the build is finished!\n###############`, buildId, applicationId });
|
||||||
}
|
}
|
||||||
if (!debug && isCache) {
|
if (!debug && isCache) {
|
||||||
await saveBuildLog({
|
await saveBuildLog({
|
||||||
|
|||||||
29
apps/api/src/lib/buildPacks/heroku.ts
Normal file
29
apps/api/src/lib/buildPacks/heroku.ts
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
import { executeDockerCmd, prisma } from "../common"
|
||||||
|
import { saveBuildLog } from "./common";
|
||||||
|
|
||||||
|
export default async function (data: any): Promise<void> {
|
||||||
|
try {
|
||||||
|
const { buildId, applicationId, tag, dockerId, debug, workdir } = data
|
||||||
|
await saveBuildLog({ line: `Building image started.`, buildId, applicationId });
|
||||||
|
const { stdout } = await executeDockerCmd({
|
||||||
|
dockerId,
|
||||||
|
command: `pack build -p ${workdir} ${applicationId}:${tag} --builder heroku/buildpacks:20`
|
||||||
|
})
|
||||||
|
|
||||||
|
if (debug) {
|
||||||
|
const array = stdout.split('\n')
|
||||||
|
for (const line of array) {
|
||||||
|
if (line !== '\n') {
|
||||||
|
await saveBuildLog({
|
||||||
|
line: `${line.replace('\n', '')}`,
|
||||||
|
buildId,
|
||||||
|
applicationId
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await saveBuildLog({ line: `Building image successful.`, buildId, applicationId });
|
||||||
|
} catch (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,6 +15,7 @@ import eleventy from './static';
|
|||||||
import python from './python';
|
import python from './python';
|
||||||
import deno from './deno';
|
import deno from './deno';
|
||||||
import laravel from './laravel';
|
import laravel from './laravel';
|
||||||
|
import heroku from './heroku';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
node,
|
node,
|
||||||
@@ -33,5 +34,6 @@ export {
|
|||||||
eleventy,
|
eleventy,
|
||||||
python,
|
python,
|
||||||
deno,
|
deno,
|
||||||
laravel
|
laravel,
|
||||||
|
heroku
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import { checkContainer, removeContainer } from './docker';
|
|||||||
import { day } from './dayjs';
|
import { day } from './dayjs';
|
||||||
import * as serviceFields from './serviceFields'
|
import * as serviceFields from './serviceFields'
|
||||||
|
|
||||||
export const version = '3.2.0';
|
export const version = '3.2.3';
|
||||||
export const isDev = process.env.NODE_ENV === 'development';
|
export const isDev = process.env.NODE_ENV === 'development';
|
||||||
|
|
||||||
const algorithm = 'aes-256-ctr';
|
const algorithm = 'aes-256-ctr';
|
||||||
@@ -38,8 +38,8 @@ export function getAPIUrl() {
|
|||||||
const newURL = href.replace('https://', 'https://3001-').replace(/\/$/, '')
|
const newURL = href.replace('https://', 'https://3001-').replace(/\/$/, '')
|
||||||
return newURL
|
return newURL
|
||||||
}
|
}
|
||||||
if (process.env.CODESANDBOX_HOST) {
|
if (process.env.CODESANDBOX_HOST) {
|
||||||
return `https://${process.env.CODESANDBOX_HOST.replace(/\$PORT/,'3001')}`
|
return `https://${process.env.CODESANDBOX_HOST.replace(/\$PORT/, '3001')}`
|
||||||
}
|
}
|
||||||
return isDev ? 'http://localhost:3001' : 'http://localhost:3000';
|
return isDev ? 'http://localhost:3001' : 'http://localhost:3000';
|
||||||
}
|
}
|
||||||
@@ -50,8 +50,8 @@ export function getUIUrl() {
|
|||||||
const newURL = href.replace('https://', 'https://3000-').replace(/\/$/, '')
|
const newURL = href.replace('https://', 'https://3000-').replace(/\/$/, '')
|
||||||
return newURL
|
return newURL
|
||||||
}
|
}
|
||||||
if (process.env.CODESANDBOX_HOST) {
|
if (process.env.CODESANDBOX_HOST) {
|
||||||
return `https://${process.env.CODESANDBOX_HOST.replace(/\$PORT/,'3000')}`
|
return `https://${process.env.CODESANDBOX_HOST.replace(/\$PORT/, '3000')}`
|
||||||
}
|
}
|
||||||
return 'http://localhost:3000';
|
return 'http://localhost:3000';
|
||||||
}
|
}
|
||||||
@@ -1614,7 +1614,7 @@ export async function cleanupDockerStorage(dockerId, lowDiskSpace, force) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
await executeDockerCmd({ dockerId, command: `docker container prune -f` })
|
await executeDockerCmd({ dockerId, command: `docker container prune -f --filter "label=coolify.managed=true"` })
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
//console.log(error);
|
//console.log(error);
|
||||||
}
|
}
|
||||||
@@ -1637,7 +1637,7 @@ export function persistentVolumes(id, persistentStorage, config) {
|
|||||||
return `${id}${storage.path.replace(/\//gi, '-')}:${storage.path}`;
|
return `${id}${storage.path.replace(/\//gi, '-')}:${storage.path}`;
|
||||||
}) || [];
|
}) || [];
|
||||||
|
|
||||||
let volumes = [ ...persistentVolume]
|
let volumes = [...persistentVolume]
|
||||||
if (config.volume) volumes = [config.volume, ...volumes]
|
if (config.volume) volumes = [config.volume, ...volumes]
|
||||||
|
|
||||||
const composeVolumes = volumes.length > 0 && volumes.map((volume) => {
|
const composeVolumes = volumes.length > 0 && volumes.map((volume) => {
|
||||||
|
|||||||
@@ -35,6 +35,10 @@ const options: any = {
|
|||||||
{
|
{
|
||||||
name: 'cleanupStorage',
|
name: 'cleanupStorage',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'cleanupPrismaEngines',
|
||||||
|
interval: '1m'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'checkProxies',
|
name: 'checkProxies',
|
||||||
interval: '10s'
|
interval: '10s'
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ export async function getDestination(request: FastifyRequest<OnlyId>) {
|
|||||||
throw { status: 404, message: `Destination not found.` };
|
throw { status: 404, message: `Destination not found.` };
|
||||||
}
|
}
|
||||||
const settings = await listSettings();
|
const settings = await listSettings();
|
||||||
let payload = {
|
const payload = {
|
||||||
destination,
|
destination,
|
||||||
settings
|
settings
|
||||||
};
|
};
|
||||||
@@ -218,7 +218,11 @@ export async function verifyRemoteDockerEngine(request: FastifyRequest, reply: F
|
|||||||
if (!stdout) {
|
if (!stdout) {
|
||||||
await asyncExecShell(`DOCKER_HOST=${host} docker network create --attachable ${network}`);
|
await asyncExecShell(`DOCKER_HOST=${host} docker network create --attachable ${network}`);
|
||||||
}
|
}
|
||||||
|
const { stdout:coolifyNetwork } = await asyncExecShell(`DOCKER_HOST=${host} docker network ls --filter 'name=coolify-infra' --no-trunc --format "{{json .}}"`);
|
||||||
|
|
||||||
|
if (!coolifyNetwork) {
|
||||||
|
await asyncExecShell(`DOCKER_HOST=${host} docker network create --attachable coolify-infra`);
|
||||||
|
}
|
||||||
await prisma.destinationDocker.update({ where: { id }, data: { remoteVerified: true } })
|
await prisma.destinationDocker.update({ where: { id }, data: { remoteVerified: true } })
|
||||||
return reply.code(201).send()
|
return reply.code(201).send()
|
||||||
|
|
||||||
|
|||||||
@@ -1,38 +0,0 @@
|
|||||||
# create-svelte
|
|
||||||
|
|
||||||
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).
|
|
||||||
|
|
||||||
## Creating a project
|
|
||||||
|
|
||||||
If you're seeing this, you've probably already done this step. Congrats!
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# create a new project in the current directory
|
|
||||||
npm init svelte
|
|
||||||
|
|
||||||
# create a new project in my-app
|
|
||||||
npm init svelte my-app
|
|
||||||
```
|
|
||||||
|
|
||||||
## Developing
|
|
||||||
|
|
||||||
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm run dev
|
|
||||||
|
|
||||||
# or start the server and open the app in a new browser tab
|
|
||||||
npm run dev -- --open
|
|
||||||
```
|
|
||||||
|
|
||||||
## Building
|
|
||||||
|
|
||||||
To create a production version of your app:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm run build
|
|
||||||
```
|
|
||||||
|
|
||||||
You can preview the production build with `npm run preview`.
|
|
||||||
|
|
||||||
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
|
|
||||||
@@ -24,7 +24,7 @@ export function getWebhookUrl(type: string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (CODESANDBOX_HOST) {
|
if (CODESANDBOX_HOST) {
|
||||||
const newURL = CODESANDBOX_HOST.replace(/\$PORT/,'3001')
|
const newURL = `https://${CODESANDBOX_HOST.replace(/\$PORT/,'3001')}`
|
||||||
if (type === 'github') {
|
if (type === 'github') {
|
||||||
return `${newURL}/webhooks/github/events`
|
return `${newURL}/webhooks/github/events`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<section>
|
<section>
|
||||||
<article class="toast toast-bottom toast-end rounded-none" role="alert" transition:fade>
|
<article class="toast toast-bottom toast-end rounded-none" role="alert" transition:fade>
|
||||||
{#each $toasts as toast (toast.id)}
|
{#each $toasts as toast (toast.id)}
|
||||||
<Toast type={toast.type}>{toast.message}</Toast>
|
<Toast type={toast.type}>{@html toast.message}</Toast>
|
||||||
{/each}
|
{/each}
|
||||||
</article>
|
</article>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -293,6 +293,13 @@ export const buildPacks = [
|
|||||||
hoverColor: 'hover:bg-green-700',
|
hoverColor: 'hover:bg-green-700',
|
||||||
color: 'bg-green-700'
|
color: 'bg-green-700'
|
||||||
}
|
}
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: 'heroku',
|
||||||
|
// fancyName: 'Heroku Buildpack',
|
||||||
|
// hoverColor: 'hover:bg-indigo-700',
|
||||||
|
// color: 'bg-indigo-700'
|
||||||
|
// }
|
||||||
];
|
];
|
||||||
export const scanningTemplates = {
|
export const scanningTemplates = {
|
||||||
'@sveltejs/kit': {
|
'@sveltejs/kit': {
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
async function createSecret(isNew: any) {
|
async function createSecret(isNew: any) {
|
||||||
try {
|
try {
|
||||||
if (!name || !value) return
|
if (!name || !value) return;
|
||||||
await saveSecret({
|
await saveSecret({
|
||||||
isNew,
|
isNew,
|
||||||
name,
|
name,
|
||||||
@@ -53,12 +53,16 @@
|
|||||||
name = '';
|
name = '';
|
||||||
value = '';
|
value = '';
|
||||||
isBuildSecret = false;
|
isBuildSecret = false;
|
||||||
|
addToast({
|
||||||
|
message: 'Secret added.',
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
dispatch('refresh');
|
|
||||||
addToast({
|
addToast({
|
||||||
message: 'Secret removed.',
|
message: 'Secret updated.',
|
||||||
type: 'success'
|
type: 'success'
|
||||||
});
|
});
|
||||||
|
dispatch('refresh');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
return errorNotification(error);
|
return errorNotification(error);
|
||||||
@@ -79,7 +83,7 @@
|
|||||||
applicationId: id
|
applicationId: id
|
||||||
});
|
});
|
||||||
addToast({
|
addToast({
|
||||||
message: 'Secret removed.',
|
message: 'Secret updated.',
|
||||||
type: 'success'
|
type: 'success'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,10 +106,10 @@
|
|||||||
{#if currentStatus === 'queued'}
|
{#if currentStatus === 'queued'}
|
||||||
<div class="text-center font-bold text-xl">{$t('application.build.queued_waiting_exec')}</div>
|
<div class="text-center font-bold text-xl">{$t('application.build.queued_waiting_exec')}</div>
|
||||||
{:else}
|
{:else}
|
||||||
<div class="flex justify-end sticky top-0 p-1 mx-1">
|
<div class="flex justify-end sticky top-0 p-2 mx-1">
|
||||||
<button
|
<button
|
||||||
on:click={followBuild}
|
on:click={followBuild}
|
||||||
class="bg-transparent tooltip tooltip-primary tooltip-bottom hover:text-green-500 hover:bg-coolgray-500"
|
class="bg-transparent btn btn-sm tooltip tooltip-primary tooltip-bottom hover:text-green-500 hover:bg-coolgray-500"
|
||||||
data-tip="Follow logs"
|
data-tip="Follow logs"
|
||||||
class:text-green-500={followingBuild}
|
class:text-green-500={followingBuild}
|
||||||
>
|
>
|
||||||
@@ -134,7 +134,7 @@
|
|||||||
<button
|
<button
|
||||||
on:click={cancelBuild}
|
on:click={cancelBuild}
|
||||||
class:animation-spin={cancelInprogress}
|
class:animation-spin={cancelInprogress}
|
||||||
class="bg-transparent hover:text-red-500 hover:bg-coolgray-500 tooltip tooltip-primary tooltip-bottom"
|
class="bg-transparent btn btn-sm btn-link hover:text-red-500 hover:bg-coolgray-500 tooltip tooltip-primary tooltip-bottom"
|
||||||
data-tip="Cancel build"
|
data-tip="Cancel build"
|
||||||
>
|
>
|
||||||
{#if cancelInprogress}
|
{#if cancelInprogress}
|
||||||
|
|||||||
@@ -147,7 +147,7 @@
|
|||||||
<div class="flex justify-end sticky top-0 p-1 mx-1">
|
<div class="flex justify-end sticky top-0 p-1 mx-1">
|
||||||
<button
|
<button
|
||||||
on:click={followBuild}
|
on:click={followBuild}
|
||||||
class="bg-transparent tooltip tooltip-primary tooltip-bottom"
|
class="bg-transparent btn btn-sm tooltip tooltip-primary tooltip-bottom"
|
||||||
data-tip="Follow logs"
|
data-tip="Follow logs"
|
||||||
class:text-green-500={followingLogs}
|
class:text-green-500={followingLogs}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -130,7 +130,7 @@
|
|||||||
<div class="flex justify-end sticky top-0 p-1 mx-1">
|
<div class="flex justify-end sticky top-0 p-1 mx-1">
|
||||||
<button
|
<button
|
||||||
on:click={followBuild}
|
on:click={followBuild}
|
||||||
class="bg-transparent tooltip tooltip-primary tooltip-bottom"
|
class="bg-transparent btn btn-sm tooltip tooltip-primary tooltip-bottom"
|
||||||
data-tip="Follow logs"
|
data-tip="Follow logs"
|
||||||
class:text-green-500={followingLogs}
|
class:text-green-500={followingLogs}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -127,7 +127,7 @@
|
|||||||
<div class="flex justify-end sticky top-0 p-1 mx-1">
|
<div class="flex justify-end sticky top-0 p-1 mx-1">
|
||||||
<button
|
<button
|
||||||
on:click={followBuild}
|
on:click={followBuild}
|
||||||
class="bg-transparent tooltip tooltip-primary tooltip-bottom"
|
class="bg-transparent btn btn-sm tooltip tooltip-primary tooltip-bottom"
|
||||||
data-tip="Follow logs"
|
data-tip="Follow logs"
|
||||||
class:text-green-500={followingLogs}
|
class:text-green-500={followingLogs}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "coolify",
|
"name": "coolify",
|
||||||
"description": "An open-source & self-hostable Heroku / Netlify alternative.",
|
"description": "An open-source & self-hostable Heroku / Netlify alternative.",
|
||||||
"version": "3.2.0",
|
"version": "3.2.3",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"repository": "github:coollabsio/coolify",
|
"repository": "github:coollabsio/coolify",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user