Merge branch 'main' into ui
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { base64Encode, executeDockerCmd, generateTimestamp, getDomain, isDev, prisma, version } from "../common";
|
||||
import { base64Encode, encrypt, executeDockerCmd, generateTimestamp, getDomain, isDev, prisma, version } from "../common";
|
||||
import { promises as fs } from 'fs';
|
||||
import { day } from "../dayjs";
|
||||
|
||||
@@ -461,17 +461,32 @@ export const saveBuildLog = async ({
|
||||
buildId: string;
|
||||
applicationId: string;
|
||||
}): Promise<any> => {
|
||||
const { default: got } = await import('got')
|
||||
|
||||
if (line && typeof line === 'string' && line.includes('ghs_')) {
|
||||
const regex = /ghs_.*@/g;
|
||||
line = line.replace(regex, '<SENSITIVE_DATA_DELETED>@');
|
||||
}
|
||||
const addTimestamp = `[${generateTimestamp()}] ${line}`;
|
||||
if (isDev) console.debug(`[${applicationId}] ${addTimestamp}`);
|
||||
return await prisma.buildLog.create({
|
||||
data: {
|
||||
line: addTimestamp, buildId, time: Number(day().valueOf()), applicationId
|
||||
}
|
||||
});
|
||||
const fluentBitUrl = isDev ? 'http://localhost:24224' : 'http://coolify-fluentbit:24224';
|
||||
|
||||
if (isDev) {
|
||||
console.debug(`[${applicationId}] ${addTimestamp}`);
|
||||
}
|
||||
try {
|
||||
return await got.post(`${fluentBitUrl}/${applicationId}_buildlog_${buildId}.csv`, {
|
||||
json: {
|
||||
line: encrypt(line)
|
||||
}
|
||||
})
|
||||
} catch(error) {
|
||||
return await prisma.buildLog.create({
|
||||
data: {
|
||||
line: addTimestamp, buildId, time: Number(day().valueOf()), applicationId
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
export async function copyBaseConfigurationFiles(
|
||||
@@ -707,7 +722,6 @@ export async function buildCacheImageWithNode(data, imageForBuild) {
|
||||
Dockerfile.push(`RUN ${installCommand}`);
|
||||
}
|
||||
Dockerfile.push(`RUN ${buildCommand}`);
|
||||
console.log(Dockerfile.join('\n'))
|
||||
await fs.writeFile(`${workdir}/Dockerfile-cache`, Dockerfile.join('\n'));
|
||||
await buildImage({ ...data, isCache: true });
|
||||
}
|
||||
|
@@ -21,7 +21,7 @@ import { scheduler } from './scheduler';
|
||||
import { supportedServiceTypesAndVersions } from './services/supportedVersions';
|
||||
import { includeServices } from './services/common';
|
||||
|
||||
export const version = '3.10.3';
|
||||
export const version = '3.10.4';
|
||||
export const isDev = process.env.NODE_ENV === 'development';
|
||||
|
||||
const algorithm = 'aes-256-ctr';
|
||||
@@ -45,9 +45,7 @@ export function getAPIUrl() {
|
||||
if (process.env.CODESANDBOX_HOST) {
|
||||
return `https://${process.env.CODESANDBOX_HOST.replace(/\$PORT/, '3001')}`;
|
||||
}
|
||||
return isDev
|
||||
? 'http://localhost:3001'
|
||||
: 'http://localhost:3000';
|
||||
return isDev ? 'http://host.docker.internal:3001' : 'http://localhost:3000';
|
||||
}
|
||||
|
||||
export function getUIUrl() {
|
||||
|
@@ -1374,10 +1374,6 @@ async function startAppWriteService(request: FastifyRequest<ServiceStartStop>) {
|
||||
const teamId = request.user.teamId;
|
||||
const { version, fqdn, destinationDocker, secrets, exposePort, network, port, workdir, image, appwrite } = await defaultServiceConfigurations({ id, teamId })
|
||||
|
||||
let isStatsEnabled = false
|
||||
if (secrets.find(s => s === '_APP_USAGE_STATS=enabled')) {
|
||||
isStatsEnabled = true
|
||||
}
|
||||
const {
|
||||
opensslKeyV1,
|
||||
executorSecret,
|
||||
@@ -1755,50 +1751,48 @@ async function startAppWriteService(request: FastifyRequest<ServiceStartStop>) {
|
||||
},
|
||||
|
||||
};
|
||||
if (isStatsEnabled) {
|
||||
dockerCompose[id].depends_on.push(`${id}-influxdb`);
|
||||
dockerCompose[`${id}-usage`] = {
|
||||
image: `${image}:${version}`,
|
||||
container_name: `${id}-usage`,
|
||||
labels: makeLabelForServices('appwrite'),
|
||||
entrypoint: "usage",
|
||||
depends_on: [
|
||||
`${id}-mariadb`,
|
||||
`${id}-influxdb`,
|
||||
],
|
||||
environment: [
|
||||
"_APP_ENV=production",
|
||||
`_APP_OPENSSL_KEY_V1=${opensslKeyV1}`,
|
||||
`_APP_DB_HOST=${mariadbHost}`,
|
||||
`_APP_DB_PORT=${mariadbPort}`,
|
||||
`_APP_DB_SCHEMA=${mariadbDatabase}`,
|
||||
`_APP_DB_USER=${mariadbUser}`,
|
||||
`_APP_DB_PASS=${mariadbPassword}`,
|
||||
`_APP_INFLUXDB_HOST=${id}-influxdb`,
|
||||
"_APP_INFLUXDB_PORT=8086",
|
||||
`_APP_REDIS_HOST=${id}-redis`,
|
||||
"_APP_REDIS_PORT=6379",
|
||||
...secrets
|
||||
],
|
||||
...defaultComposeConfiguration(network),
|
||||
}
|
||||
dockerCompose[`${id}-influxdb`] = {
|
||||
image: "appwrite/influxdb:1.5.0",
|
||||
container_name: `${id}-influxdb`,
|
||||
volumes: [
|
||||
`${id}-influxdb:/var/lib/influxdb:rw`
|
||||
],
|
||||
...defaultComposeConfiguration(network),
|
||||
}
|
||||
dockerCompose[`${id}-telegraf`] = {
|
||||
image: "appwrite/telegraf:1.4.0",
|
||||
container_name: `${id}-telegraf`,
|
||||
environment: [
|
||||
`_APP_INFLUXDB_HOST=${id}-influxdb`,
|
||||
"_APP_INFLUXDB_PORT=8086",
|
||||
],
|
||||
...defaultComposeConfiguration(network),
|
||||
}
|
||||
dockerCompose[id].depends_on.push(`${id}-influxdb`);
|
||||
dockerCompose[`${id}-usage`] = {
|
||||
image: `${image}:${version}`,
|
||||
container_name: `${id}-usage`,
|
||||
labels: makeLabelForServices('appwrite'),
|
||||
entrypoint: "usage",
|
||||
depends_on: [
|
||||
`${id}-mariadb`,
|
||||
`${id}-influxdb`,
|
||||
],
|
||||
environment: [
|
||||
"_APP_ENV=production",
|
||||
`_APP_OPENSSL_KEY_V1=${opensslKeyV1}`,
|
||||
`_APP_DB_HOST=${mariadbHost}`,
|
||||
`_APP_DB_PORT=${mariadbPort}`,
|
||||
`_APP_DB_SCHEMA=${mariadbDatabase}`,
|
||||
`_APP_DB_USER=${mariadbUser}`,
|
||||
`_APP_DB_PASS=${mariadbPassword}`,
|
||||
`_APP_INFLUXDB_HOST=${id}-influxdb`,
|
||||
"_APP_INFLUXDB_PORT=8086",
|
||||
`_APP_REDIS_HOST=${id}-redis`,
|
||||
"_APP_REDIS_PORT=6379",
|
||||
...secrets
|
||||
],
|
||||
...defaultComposeConfiguration(network),
|
||||
}
|
||||
dockerCompose[`${id}-influxdb`] = {
|
||||
image: "appwrite/influxdb:1.5.0",
|
||||
container_name: `${id}-influxdb`,
|
||||
volumes: [
|
||||
`${id}-influxdb:/var/lib/influxdb:rw`
|
||||
],
|
||||
...defaultComposeConfiguration(network),
|
||||
}
|
||||
dockerCompose[`${id}-telegraf`] = {
|
||||
image: "appwrite/telegraf:1.4.0",
|
||||
container_name: `${id}-telegraf`,
|
||||
environment: [
|
||||
`_APP_INFLUXDB_HOST=${id}-influxdb`,
|
||||
"_APP_INFLUXDB_PORT=8086",
|
||||
],
|
||||
...defaultComposeConfiguration(network),
|
||||
}
|
||||
|
||||
const composeFile: any = {
|
||||
|
@@ -1,3 +1,24 @@
|
||||
/*
|
||||
Example of a supported version:
|
||||
{
|
||||
// Name used to identify the service internally
|
||||
name: 'umami',
|
||||
// Fancier name to show to the user
|
||||
fancyName: 'Umami',
|
||||
// Docker base image for the service
|
||||
baseImage: 'ghcr.io/mikecao/umami',
|
||||
// Optional: If there is any dependent image, you should list it here
|
||||
images: [],
|
||||
// Usable tags
|
||||
versions: ['postgresql-latest'],
|
||||
// Which tag is the recommended
|
||||
recommendedVersion: 'postgresql-latest',
|
||||
// Application's default port, Umami listens on 3000
|
||||
ports: {
|
||||
main: 3000
|
||||
}
|
||||
}
|
||||
*/
|
||||
export const supportedServiceTypesAndVersions = [
|
||||
{
|
||||
name: 'plausibleanalytics',
|
||||
@@ -151,7 +172,7 @@ export const supportedServiceTypesAndVersions = [
|
||||
fancyName: 'Appwrite',
|
||||
baseImage: 'appwrite/appwrite',
|
||||
images: ['mariadb:10.7', 'redis:6.2-alpine', 'appwrite/telegraf:1.4.0'],
|
||||
versions: ['latest', '0.15.3'],
|
||||
versions: ['latest', '1.0','0.15.3'],
|
||||
recommendedVersion: '0.15.3',
|
||||
ports: {
|
||||
main: 80
|
||||
|
Reference in New Issue
Block a user