cleanup + arm support
This commit is contained in:
@@ -17,8 +17,6 @@ import { day } from './dayjs';
|
||||
import * as serviceFields from './services/serviceFields';
|
||||
import { saveBuildLog } from './buildPacks/common';
|
||||
import { scheduler } from './scheduler';
|
||||
import { supportedServiceTypesAndVersions } from './services/supportedVersions';
|
||||
import { includeServices } from './services/common';
|
||||
|
||||
export const version = '3.10.16';
|
||||
export const isDev = process.env.NODE_ENV === 'development';
|
||||
@@ -400,12 +398,6 @@ export function generateTimestamp(): string {
|
||||
return `${day().format('HH:mm:ss.SSS')}`;
|
||||
}
|
||||
|
||||
export async function listServicesWithIncludes(): Promise<any> {
|
||||
return await prisma.service.findMany({
|
||||
include: includeServices,
|
||||
orderBy: { createdAt: 'desc' }
|
||||
});
|
||||
}
|
||||
|
||||
export const supportedDatabaseTypesAndVersions = [
|
||||
{
|
||||
@@ -1452,7 +1444,12 @@ export async function getServiceFromDB({
|
||||
const settings = await prisma.setting.findFirst();
|
||||
const body = await prisma.service.findFirst({
|
||||
where: { id, teams: { some: { id: teamId === '0' ? undefined : teamId } } },
|
||||
include: includeServices
|
||||
include: {
|
||||
destinationDocker: true,
|
||||
persistentStorage: true,
|
||||
serviceSecret: true,
|
||||
serviceSetting: true,
|
||||
}
|
||||
});
|
||||
if (!body) {
|
||||
return null
|
||||
@@ -1469,22 +1466,6 @@ export async function getServiceFromDB({
|
||||
return { ...body, settings };
|
||||
}
|
||||
|
||||
export function getServiceImage(type: string): string {
|
||||
const found = supportedServiceTypesAndVersions.find((t) => t.name === type);
|
||||
if (found) {
|
||||
return found.baseImage;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
export function getServiceImages(type: string): string[] {
|
||||
const found = supportedServiceTypesAndVersions.find((t) => t.name === type);
|
||||
if (found) {
|
||||
return found.images;
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
export function saveUpdateableFields(type: string, data: any) {
|
||||
const update = {};
|
||||
if (type && serviceFields[type]) {
|
||||
@@ -1534,14 +1515,6 @@ export function fixType(type) {
|
||||
return type?.replaceAll(' ', '').toLowerCase() || null;
|
||||
}
|
||||
|
||||
export const getServiceMainPort = (service: string) => {
|
||||
const serviceType = supportedServiceTypesAndVersions.find((s) => s.name === service);
|
||||
if (serviceType) {
|
||||
return serviceType.ports.main;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
export function makeLabelForServices(type) {
|
||||
return [
|
||||
'coolify.managed=true',
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { createDirectories, getServiceFromDB, getServiceImage, getServiceMainPort, isDev, makeLabelForServices } from "./common";
|
||||
import { isDev } from "./common";
|
||||
import fs from 'fs/promises';
|
||||
export async function getTemplates() {
|
||||
let templates: any = [];
|
||||
@@ -141,21 +141,3 @@ export async function getTemplates() {
|
||||
// }
|
||||
return templates
|
||||
}
|
||||
export async function defaultServiceConfigurations({ id, teamId }) {
|
||||
const service = await getServiceFromDB({ id, teamId });
|
||||
const { destinationDockerId, destinationDocker, type, serviceSecret } = service;
|
||||
|
||||
const network = destinationDockerId && destinationDocker.network;
|
||||
const port = getServiceMainPort(type);
|
||||
|
||||
const { workdir } = await createDirectories({ repository: type, buildId: id });
|
||||
|
||||
const image = getServiceImage(type);
|
||||
let secrets = [];
|
||||
if (serviceSecret.length > 0) {
|
||||
serviceSecret.forEach((secret) => {
|
||||
secrets.push(`${secret.name}=${secret.value}`);
|
||||
});
|
||||
}
|
||||
return { ...service, network, port, workdir, image, secrets }
|
||||
}
|
@@ -2,27 +2,6 @@
|
||||
import cuid from 'cuid';
|
||||
import { encrypt, generatePassword, prisma } from '../common';
|
||||
|
||||
export const includeServices: any = {
|
||||
destinationDocker: true,
|
||||
persistentStorage: true,
|
||||
serviceSecret: true,
|
||||
serviceSetting: true,
|
||||
minio: true,
|
||||
plausibleAnalytics: true,
|
||||
vscodeserver: true,
|
||||
wordpress: true,
|
||||
ghost: true,
|
||||
meiliSearch: true,
|
||||
umami: true,
|
||||
hasura: true,
|
||||
fider: true,
|
||||
moodle: true,
|
||||
appwrite: true,
|
||||
glitchTip: true,
|
||||
searxng: true,
|
||||
weblate: true,
|
||||
taiga: true,
|
||||
};
|
||||
export async function configureServiceType({
|
||||
id,
|
||||
type
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user