mirror of
https://github.com/cupcakearmy/coolify.git
synced 2024-10-23 08:34:11 +02:00
commit
bed1bb2429
@ -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.3.2';
|
export const version = '3.3.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';
|
||||||
@ -96,17 +96,23 @@ export const base64Decode = (text: string): string => {
|
|||||||
};
|
};
|
||||||
export const decrypt = (hashString: string) => {
|
export const decrypt = (hashString: string) => {
|
||||||
if (hashString) {
|
if (hashString) {
|
||||||
const hash = JSON.parse(hashString);
|
try {
|
||||||
const decipher = crypto.createDecipheriv(
|
const hash = JSON.parse(hashString);
|
||||||
algorithm,
|
const decipher = crypto.createDecipheriv(
|
||||||
process.env['COOLIFY_SECRET_KEY'],
|
algorithm,
|
||||||
Buffer.from(hash.iv, 'hex')
|
process.env['COOLIFY_SECRET_KEY'],
|
||||||
);
|
Buffer.from(hash.iv, 'hex')
|
||||||
const decrpyted = Buffer.concat([
|
);
|
||||||
decipher.update(Buffer.from(hash.content, 'hex')),
|
const decrpyted = Buffer.concat([
|
||||||
decipher.final()
|
decipher.update(Buffer.from(hash.content, 'hex')),
|
||||||
]);
|
decipher.final()
|
||||||
return decrpyted.toString();
|
]);
|
||||||
|
return decrpyted.toString();
|
||||||
|
} catch (error) {
|
||||||
|
console.log({ decryptionError: error.message })
|
||||||
|
return hashString
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
export const encrypt = (text: string) => {
|
export const encrypt = (text: string) => {
|
||||||
@ -867,6 +873,11 @@ export function generateDatabaseConfiguration(database: any, arch: string):
|
|||||||
}
|
}
|
||||||
if (isARM(arch)) {
|
if (isARM(arch)) {
|
||||||
configuration.volume = `${id}-${type}-data:/var/lib/postgresql`;
|
configuration.volume = `${id}-${type}-data:/var/lib/postgresql`;
|
||||||
|
configuration.environmentVariables = {
|
||||||
|
POSTGRES_PASSWORD: dbUserPassword,
|
||||||
|
POSTGRES_USER: dbUser,
|
||||||
|
POSTGRES_DB: defaultDatabase
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return configuration
|
return configuration
|
||||||
} else if (type === 'redis') {
|
} else if (type === 'redis') {
|
||||||
@ -903,7 +914,7 @@ export function generateDatabaseConfiguration(database: any, arch: string):
|
|||||||
return configuration
|
return configuration
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export function isARM(arch) {
|
export function isARM(arch: string) {
|
||||||
if (arch === 'arm' || arch === 'arm64') {
|
if (arch === 'arm' || arch === 'arm64') {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
@ -1226,7 +1237,6 @@ export async function startTraefikTCPProxy(
|
|||||||
}
|
}
|
||||||
traefikUrl = `${ip}/webhooks/traefik/other.json`
|
traefikUrl = `${ip}/webhooks/traefik/other.json`
|
||||||
}
|
}
|
||||||
console.log(traefikUrl)
|
|
||||||
const tcpProxy = {
|
const tcpProxy = {
|
||||||
version: '3.8',
|
version: '3.8',
|
||||||
services: {
|
services: {
|
||||||
@ -1291,6 +1301,7 @@ export async function getServiceFromDB({ id, teamId }: { id: string; teamId: str
|
|||||||
return s;
|
return s;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
body[type] = { ...body[type], ...getUpdateableFields(type, body[type]) }
|
body[type] = { ...body[type], ...getUpdateableFields(type, body[type]) }
|
||||||
return { ...body, settings };
|
return { ...body, settings };
|
||||||
}
|
}
|
||||||
|
@ -326,7 +326,7 @@ export const fider = [{
|
|||||||
isBoolean: false,
|
isBoolean: false,
|
||||||
isEncrypted: true
|
isEncrypted: true
|
||||||
}, {
|
}, {
|
||||||
name: 'postgreslUser',
|
name: 'postgresqlUser',
|
||||||
isEditable: false,
|
isEditable: false,
|
||||||
isLowerCase: false,
|
isLowerCase: false,
|
||||||
isNumber: false,
|
isNumber: false,
|
||||||
|
@ -197,13 +197,11 @@ export async function getService(request: FastifyRequest<OnlyId>) {
|
|||||||
const teamId = request.user.teamId;
|
const teamId = request.user.teamId;
|
||||||
const { id } = request.params;
|
const { id } = request.params;
|
||||||
const service = await getServiceFromDB({ id, teamId });
|
const service = await getServiceFromDB({ id, teamId });
|
||||||
const settings = await listSettings()
|
|
||||||
if (!service) {
|
if (!service) {
|
||||||
throw { status: 404, message: 'Service not found.' }
|
throw { status: 404, message: 'Service not found.' }
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
service,
|
service
|
||||||
settings
|
|
||||||
}
|
}
|
||||||
} catch ({ status, message }) {
|
} catch ({ status, message }) {
|
||||||
return errorHandler({ status, message })
|
return errorHandler({ status, message })
|
||||||
|
2
csb.nix
2
csb.nix
@ -1,7 +1,7 @@
|
|||||||
with import <nixpkgs> {};
|
with import <nixpkgs> {};
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "git";
|
name = "environment";
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
git
|
git
|
||||||
git-lfs
|
git-lfs
|
||||||
|
@ -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.3.2",
|
"version": "3.3.3",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"repository": "github:coollabsio/coolify",
|
"repository": "github:coollabsio/coolify",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
Loading…
Reference in New Issue
Block a user