fix: edgedb stuff
This commit is contained in:
@@ -419,7 +419,7 @@ export const supportedDatabaseTypesAndVersions = [
|
|||||||
name: 'edgedb',
|
name: 'edgedb',
|
||||||
fancyName: 'EdgeDB',
|
fancyName: 'EdgeDB',
|
||||||
baseImage: 'edgedb/edgedb',
|
baseImage: 'edgedb/edgedb',
|
||||||
versions: ['2.0', '1.4']
|
versions: ['latest', '2.1', '2.0', '1.4']
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -648,8 +648,7 @@ export function generatePassword({ length = 24, symbols = false, isHex = false }
|
|||||||
return password;
|
return password;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function generateDatabaseConfiguration(database: any, arch: string):
|
type DatabaseConfiguration = {
|
||||||
| {
|
|
||||||
volume: string;
|
volume: string;
|
||||||
image: string;
|
image: string;
|
||||||
command?: string;
|
command?: string;
|
||||||
@@ -697,22 +696,13 @@ export function generateDatabaseConfiguration(database: any, arch: string):
|
|||||||
ulimits: Record<string, unknown>;
|
ulimits: Record<string, unknown>;
|
||||||
privatePort: number;
|
privatePort: number;
|
||||||
environmentVariables: {
|
environmentVariables: {
|
||||||
POSTGRESQL_POSTGRES_PASSWORD: string;
|
POSTGRES_PASSWORD?: string;
|
||||||
POSTGRESQL_USERNAME: string;
|
POSTGRES_USER?: string;
|
||||||
POSTGRESQL_PASSWORD: string;
|
POSTGRES_DB?: string;
|
||||||
POSTGRESQL_DATABASE: string;
|
POSTGRESQL_POSTGRES_PASSWORD?: string;
|
||||||
};
|
POSTGRESQL_USERNAME?: string;
|
||||||
}
|
POSTGRESQL_PASSWORD?: string;
|
||||||
| {
|
POSTGRESQL_DATABASE?: string;
|
||||||
volume: string;
|
|
||||||
image: string;
|
|
||||||
command?: string;
|
|
||||||
ulimits: Record<string, unknown>;
|
|
||||||
privatePort: number;
|
|
||||||
environmentVariables: {
|
|
||||||
POSTGRES_USER: string;
|
|
||||||
POSTGRES_PASSWORD: string;
|
|
||||||
POSTGRES_DB: string;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
@@ -740,6 +730,7 @@ export function generateDatabaseConfiguration(database: any, arch: string):
|
|||||||
| {
|
| {
|
||||||
volume: string;
|
volume: string;
|
||||||
image: string;
|
image: string;
|
||||||
|
command?: string;
|
||||||
ulimits: Record<string, unknown>;
|
ulimits: Record<string, unknown>;
|
||||||
privatePort: number;
|
privatePort: number;
|
||||||
environmentVariables: {
|
environmentVariables: {
|
||||||
@@ -748,7 +739,8 @@ export function generateDatabaseConfiguration(database: any, arch: string):
|
|||||||
EDGEDB_SERVER_DATABASE: string;
|
EDGEDB_SERVER_DATABASE: string;
|
||||||
EDGEDB_SERVER_SECURITY: string;
|
EDGEDB_SERVER_SECURITY: string;
|
||||||
};
|
};
|
||||||
} {
|
}
|
||||||
|
export function generateDatabaseConfiguration(database: any, arch: string): DatabaseConfiguration {
|
||||||
const {
|
const {
|
||||||
id,
|
id,
|
||||||
dbUser,
|
dbUser,
|
||||||
@@ -780,7 +772,7 @@ export function generateDatabaseConfiguration(database: any, arch: string):
|
|||||||
}
|
}
|
||||||
return configuration
|
return configuration
|
||||||
} else if (type === 'mariadb') {
|
} else if (type === 'mariadb') {
|
||||||
const configuration = {
|
const configuration: DatabaseConfiguration = {
|
||||||
privatePort: 3306,
|
privatePort: 3306,
|
||||||
environmentVariables: {
|
environmentVariables: {
|
||||||
MARIADB_ROOT_USER: rootUser,
|
MARIADB_ROOT_USER: rootUser,
|
||||||
@@ -798,7 +790,7 @@ export function generateDatabaseConfiguration(database: any, arch: string):
|
|||||||
}
|
}
|
||||||
return configuration
|
return configuration
|
||||||
} else if (type === 'mongodb') {
|
} else if (type === 'mongodb') {
|
||||||
const configuration = {
|
const configuration: DatabaseConfiguration = {
|
||||||
privatePort: 27017,
|
privatePort: 27017,
|
||||||
environmentVariables: {
|
environmentVariables: {
|
||||||
MONGODB_ROOT_USER: rootUser,
|
MONGODB_ROOT_USER: rootUser,
|
||||||
@@ -817,7 +809,7 @@ export function generateDatabaseConfiguration(database: any, arch: string):
|
|||||||
}
|
}
|
||||||
return configuration
|
return configuration
|
||||||
} else if (type === 'postgresql') {
|
} else if (type === 'postgresql') {
|
||||||
const configuration = {
|
const configuration: DatabaseConfiguration = {
|
||||||
privatePort: 5432,
|
privatePort: 5432,
|
||||||
environmentVariables: {
|
environmentVariables: {
|
||||||
POSTGRESQL_POSTGRES_PASSWORD: rootUserPassword,
|
POSTGRESQL_POSTGRES_PASSWORD: rootUserPassword,
|
||||||
@@ -839,7 +831,7 @@ export function generateDatabaseConfiguration(database: any, arch: string):
|
|||||||
}
|
}
|
||||||
return configuration
|
return configuration
|
||||||
} else if (type === 'redis') {
|
} else if (type === 'redis') {
|
||||||
const configuration = {
|
const configuration: DatabaseConfiguration = {
|
||||||
privatePort: 6379,
|
privatePort: 6379,
|
||||||
command: undefined,
|
command: undefined,
|
||||||
environmentVariables: {
|
environmentVariables: {
|
||||||
@@ -856,7 +848,7 @@ export function generateDatabaseConfiguration(database: any, arch: string):
|
|||||||
}
|
}
|
||||||
return configuration
|
return configuration
|
||||||
} else if (type === 'couchdb') {
|
} else if (type === 'couchdb') {
|
||||||
const configuration = {
|
const configuration: DatabaseConfiguration = {
|
||||||
privatePort: 5984,
|
privatePort: 5984,
|
||||||
environmentVariables: {
|
environmentVariables: {
|
||||||
COUCHDB_PASSWORD: dbUserPassword,
|
COUCHDB_PASSWORD: dbUserPassword,
|
||||||
@@ -871,7 +863,7 @@ export function generateDatabaseConfiguration(database: any, arch: string):
|
|||||||
}
|
}
|
||||||
return configuration
|
return configuration
|
||||||
} else if (type === 'edgedb') {
|
} else if (type === 'edgedb') {
|
||||||
return {
|
const configuration: DatabaseConfiguration = {
|
||||||
privatePort: 5656,
|
privatePort: 5656,
|
||||||
environmentVariables: {
|
environmentVariables: {
|
||||||
EDGEDB_SERVER_PASSWORD: rootUserPassword,
|
EDGEDB_SERVER_PASSWORD: rootUserPassword,
|
||||||
@@ -880,9 +872,10 @@ export function generateDatabaseConfiguration(database: any, arch: string):
|
|||||||
EDGEDB_SERVER_SECURITY: 'insecure_dev_mode'
|
EDGEDB_SERVER_SECURITY: 'insecure_dev_mode'
|
||||||
},
|
},
|
||||||
image: `${baseImage}:${version}`,
|
image: `${baseImage}:${version}`,
|
||||||
volume: `${id}-${type}-data:/edgedb/edgedb`,
|
volume: `${id}-${type}-data:/var/lib/edgedb/data`,
|
||||||
ulimits: {}
|
ulimits: {}
|
||||||
};
|
};
|
||||||
|
return configuration
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export function isARM(arch: string) {
|
export function isARM(arch: string) {
|
||||||
|
@@ -3,7 +3,7 @@ import type { FastifyRequest } from 'fastify';
|
|||||||
import { FastifyReply } from 'fastify';
|
import { FastifyReply } from 'fastify';
|
||||||
import yaml from 'js-yaml';
|
import yaml from 'js-yaml';
|
||||||
import fs from 'fs/promises';
|
import fs from 'fs/promises';
|
||||||
import { ComposeFile, createDirectories, decrypt, encrypt, errorHandler, executeDockerCmd, generateDatabaseConfiguration, generatePassword, getContainerUsage, getDatabaseImage, getDatabaseVersions, getFreePublicPort, listSettings, makeLabelForStandaloneDatabase, prisma, startTraefikTCPProxy, stopDatabaseContainer, stopTcpHttpProxy, supportedDatabaseTypesAndVersions, uniqueName, updatePasswordInDb } from '../../../../lib/common';
|
import { ComposeFile, createDirectories, decrypt, defaultComposeConfiguration, encrypt, errorHandler, executeDockerCmd, generateDatabaseConfiguration, generatePassword, getContainerUsage, getDatabaseImage, getDatabaseVersions, getFreePublicPort, listSettings, makeLabelForStandaloneDatabase, prisma, startTraefikTCPProxy, stopDatabaseContainer, stopTcpHttpProxy, supportedDatabaseTypesAndVersions, uniqueName, updatePasswordInDb } from '../../../../lib/common';
|
||||||
import { day } from '../../../../lib/dayjs';
|
import { day } from '../../../../lib/dayjs';
|
||||||
|
|
||||||
import { GetDatabaseLogs, OnlyId, SaveDatabase, SaveDatabaseDestination, SaveDatabaseSettings, SaveVersion } from '../../../../types';
|
import { GetDatabaseLogs, OnlyId, SaveDatabase, SaveDatabaseDestination, SaveDatabaseSettings, SaveVersion } from '../../../../types';
|
||||||
@@ -248,20 +248,11 @@ export async function startDatabase(request: FastifyRequest<OnlyId>) {
|
|||||||
container_name: id,
|
container_name: id,
|
||||||
image,
|
image,
|
||||||
command,
|
command,
|
||||||
networks: [network],
|
|
||||||
environment: environmentVariables,
|
environment: environmentVariables,
|
||||||
volumes: [volume],
|
volumes: [volume],
|
||||||
ulimits,
|
ulimits,
|
||||||
labels,
|
labels,
|
||||||
restart: 'always',
|
...defaultComposeConfiguration(network),
|
||||||
deploy: {
|
|
||||||
restart_policy: {
|
|
||||||
condition: 'on-failure',
|
|
||||||
delay: '5s',
|
|
||||||
max_attempts: 3,
|
|
||||||
window: '120s'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
networks: {
|
networks: {
|
||||||
|
@@ -6,5 +6,6 @@ export { default as MongoDB } from './MongoDB.svelte';
|
|||||||
export { default as MySQL } from './MySQL.svelte';
|
export { default as MySQL } from './MySQL.svelte';
|
||||||
export { default as PostgreSQL } from './PostgreSQL.svelte';
|
export { default as PostgreSQL } from './PostgreSQL.svelte';
|
||||||
export { default as Redis } from './Redis.svelte';
|
export { default as Redis } from './Redis.svelte';
|
||||||
|
export { default as EdgeDB } from './EdgeDB.svelte';
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user