Compare commits

..

5 Commits

Author SHA1 Message Date
Andras Bacsai
039350d762 Merge pull request #490 from coollabsio/next
v3.1.2
2022-07-14 10:52:34 +02:00
Andras Bacsai
ce31146a9c fix: turn off autodeploy if double branch is configured 2022-07-14 08:00:57 +00:00
Andras Bacsai
344dd7db28 fix: message for double branches 2022-07-14 07:42:05 +00:00
Andras Bacsai
b735ca2da7 fix: admin password reset should not timeout 2022-07-14 07:22:26 +00:00
Andras Bacsai
cbdd098528 chore: version++ 2022-07-14 07:22:12 +00:00
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",