Merge pull request #536 from coollabsio/next

v3.3.3
This commit is contained in:
Andras Bacsai 2022-08-14 22:04:28 +02:00 committed by GitHub
commit bed1bb2429
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 29 additions and 20 deletions

View File

@ -17,7 +17,7 @@ import { checkContainer, removeContainer } from './docker';
import { day } from './dayjs';
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';
const algorithm = 'aes-256-ctr';
@ -96,17 +96,23 @@ export const base64Decode = (text: string): string => {
};
export const decrypt = (hashString: string) => {
if (hashString) {
const hash = JSON.parse(hashString);
const decipher = crypto.createDecipheriv(
algorithm,
process.env['COOLIFY_SECRET_KEY'],
Buffer.from(hash.iv, 'hex')
);
const decrpyted = Buffer.concat([
decipher.update(Buffer.from(hash.content, 'hex')),
decipher.final()
]);
return decrpyted.toString();
try {
const hash = JSON.parse(hashString);
const decipher = crypto.createDecipheriv(
algorithm,
process.env['COOLIFY_SECRET_KEY'],
Buffer.from(hash.iv, 'hex')
);
const decrpyted = Buffer.concat([
decipher.update(Buffer.from(hash.content, 'hex')),
decipher.final()
]);
return decrpyted.toString();
} catch (error) {
console.log({ decryptionError: error.message })
return hashString
}
}
};
export const encrypt = (text: string) => {
@ -867,6 +873,11 @@ export function generateDatabaseConfiguration(database: any, arch: string):
}
if (isARM(arch)) {
configuration.volume = `${id}-${type}-data:/var/lib/postgresql`;
configuration.environmentVariables = {
POSTGRES_PASSWORD: dbUserPassword,
POSTGRES_USER: dbUser,
POSTGRES_DB: defaultDatabase
}
}
return configuration
} else if (type === 'redis') {
@ -903,7 +914,7 @@ export function generateDatabaseConfiguration(database: any, arch: string):
return configuration
}
}
export function isARM(arch) {
export function isARM(arch: string) {
if (arch === 'arm' || arch === 'arm64') {
return true
}
@ -1226,7 +1237,6 @@ export async function startTraefikTCPProxy(
}
traefikUrl = `${ip}/webhooks/traefik/other.json`
}
console.log(traefikUrl)
const tcpProxy = {
version: '3.8',
services: {
@ -1291,6 +1301,7 @@ export async function getServiceFromDB({ id, teamId }: { id: string; teamId: str
return s;
});
}
body[type] = { ...body[type], ...getUpdateableFields(type, body[type]) }
return { ...body, settings };
}

View File

@ -326,7 +326,7 @@ export const fider = [{
isBoolean: false,
isEncrypted: true
}, {
name: 'postgreslUser',
name: 'postgresqlUser',
isEditable: false,
isLowerCase: false,
isNumber: false,

View File

@ -197,13 +197,11 @@ export async function getService(request: FastifyRequest<OnlyId>) {
const teamId = request.user.teamId;
const { id } = request.params;
const service = await getServiceFromDB({ id, teamId });
const settings = await listSettings()
if (!service) {
throw { status: 404, message: 'Service not found.' }
}
return {
service,
settings
service
}
} catch ({ status, message }) {
return errorHandler({ status, message })

View File

@ -1,7 +1,7 @@
with import <nixpkgs> {};
stdenv.mkDerivation {
name = "git";
name = "environment";
buildInputs = [
git
git-lfs

View File

@ -1,7 +1,7 @@
{
"name": "coolify",
"description": "An open-source & self-hostable Heroku / Netlify alternative.",
"version": "3.3.2",
"version": "3.3.3",
"license": "Apache-2.0",
"repository": "github:coollabsio/coolify",
"scripts": {