Merge pull request #490 from coollabsio/next

v3.1.2
This commit is contained in:
Andras Bacsai 2022-07-14 10:52:34 +02:00 committed by GitHub
commit 039350d762
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 7 deletions

View File

@ -16,7 +16,7 @@ import { day } from './dayjs';
import * as serviceFields from './serviceFields'
import axios from 'axios';
export const version = '3.1.1';
export const version = '3.1.2';
export const isDev = process.env.NODE_ENV === 'development';
const algorithm = 'aes-256-ctr';

View File

@ -267,7 +267,8 @@ export async function saveApplicationSettings(request: FastifyRequest<SaveApplic
const { debug, previews, dualCerts, autodeploy, branch, projectId } = request.body
const isDouble = await checkDoubleBranch(branch, projectId);
if (isDouble && autodeploy) {
throw { status: 500, message: 'Application not configured.' }
await prisma.applicationSettings.updateMany({ where: { application: { branch, projectId } }, data: { autodeploy: false } })
throw { status: 500, message: 'Cannot activate automatic deployments until only one application is defined for this repository / branch.' }
}
await prisma.application.update({
where: { id },
@ -526,6 +527,10 @@ export async function saveRepository(request, reply) {
data: { repository, branch, projectId, settings: { update: { autodeploy } } }
});
}
const isDouble = await checkDoubleBranch(branch, projectId);
if (isDouble) {
await prisma.applicationSettings.updateMany({ where: { application: { branch, projectId } }, data: { autodeploy: false } })
}
return reply.code(201).send()
} catch ({ status, message }) {
return errorHandler({ status, message })

View File

@ -157,10 +157,18 @@ export async function login(request: FastifyRequest<Login>, reply: FastifyReply)
if (userFound.password === 'RESETME') {
const hashedPassword = await hashPassword(password);
if (userFound.updatedAt < new Date(Date.now() - 1000 * 60 * 10)) {
await prisma.user.update({
where: { email: userFound.email },
data: { password: 'RESETTIMEOUT' }
});
if (userFound.id === '0') {
await prisma.user.update({
where: { email: userFound.email },
data: { password: 'RESETME' }
});
} else {
await prisma.user.update({
where: { email: userFound.email },
data: { password: 'RESETTIMEOUT' }
});
}
throw {
status: 500,
message: 'Password reset link has expired. Please request a new one.'

View File

@ -1,7 +1,7 @@
{
"name": "coolify",
"description": "An open-source & self-hostable Heroku / Netlify alternative.",
"version": "3.1.1",
"version": "3.1.2",
"license": "AGPL-3.0",
"scripts": {
"db:studio": "pnpm run --filter coolify-api db:studio",