Contribution guide + code refactor + package updates

This commit is contained in:
Andras Bacsai
2022-08-29 15:29:00 +02:00
parent a6ffb5c61c
commit ccd550bbc4
20 changed files with 3103 additions and 3243 deletions

View File

@@ -5,7 +5,7 @@ import compare from 'compare-versions';
import cuid from 'cuid';
import bcrypt from 'bcryptjs';
import { asyncExecShell, asyncSleep, cleanupDockerStorage, errorHandler, isDev, listSettings, prisma, uniqueName, version } from '../../../lib/common';
import { supportedServiceTypesAndVersions } from '../../../lib/services/supportedVersions';
import type { FastifyReply, FastifyRequest } from 'fastify';
import type { Login, Update } from '.';
import type { GetCurrentUser } from './types';
@@ -300,6 +300,7 @@ export async function getCurrentUser(request: FastifyRequest<GetCurrentUser>, fa
}
return {
settings: await prisma.setting.findFirst(),
supportedServiceTypesAndVersions,
token,
...request.user
}

File diff suppressed because it is too large Load Diff

View File

@@ -26,12 +26,11 @@ import {
saveServiceType,
saveServiceVersion,
setSettingsService,
startService,
stopService
} from './handlers';
import type { OnlyId } from '../../../../types';
import type { ActivateWordpressFtp, CheckService, CheckServiceDomain, DeleteServiceSecret, DeleteServiceStorage, GetServiceLogs, SaveService, SaveServiceDestination, SaveServiceSecret, SaveServiceSettings, SaveServiceStorage, SaveServiceType, SaveServiceVersion, ServiceStartStop, SetWordpressSettings } from './types';
import { startService, stopService } from '../../../../lib/services/handlers';
const root: FastifyPluginAsync = async (fastify): Promise<void> => {
fastify.addHook('onRequest', async (request) => {

View File

@@ -1,5 +1,7 @@
import { FastifyRequest } from "fastify";
import { errorHandler, getDomain, isDev, prisma, supportedServiceTypesAndVersions, include, executeDockerCmd } from "../../../lib/common";
import { errorHandler, getDomain, isDev, prisma, executeDockerCmd } from "../../../lib/common";
import { supportedServiceTypesAndVersions } from "../../../lib/services/supportedVersions";
import { includeServices } from "../../../lib/services/common";
import { TraefikOtherConfiguration } from "./types";
function configureMiddleware(
@@ -234,7 +236,7 @@ export async function traefikConfiguration(request, reply) {
}
const services: any = await prisma.service.findMany({
where: { destinationDocker: { remoteEngine: false } },
include,
include: includeServices,
orderBy: { createdAt: 'desc' },
});