From b5a9a2cea89cbc91510fb8b400e3c0bbfca99570 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 12 Apr 2022 16:49:52 +0200 Subject: [PATCH 1/4] fix: Types --- src/lib/api.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/api.ts b/src/lib/api.ts index 2e9271a6c..6d226ef15 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -53,7 +53,7 @@ async function send({ export function get( path: string, - headers: Record + headers?: Record ): Promise> { return send({ method: 'GET', path, headers }); } @@ -61,7 +61,7 @@ export function get( export function del( path: string, data: Record, - headers: Record + headers?: Record ): Promise> { return send({ method: 'DELETE', path, data, headers }); } @@ -77,7 +77,7 @@ export function post( export function put( path: string, data: Record, - headers: Record + headers?: Record ): Promise> { return send({ method: 'PUT', path, data, headers }); } From ff2c38aa16344e3ffb7f7a0f2def56316b71cc45 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 12 Apr 2022 16:49:59 +0200 Subject: [PATCH 2/4] fix: Invitations --- src/routes/iam/index.svelte | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/routes/iam/index.svelte b/src/routes/iam/index.svelte index 8c33d5a38..1ebfaac60 100644 --- a/src/routes/iam/index.svelte +++ b/src/routes/iam/index.svelte @@ -32,6 +32,7 @@ export let account; export let accounts; + export let invitations; if (accounts.length === 0) { accounts.push(account); } @@ -74,12 +75,51 @@ return errorNotification(error); } } + async function acceptInvitation(id, teamId) { + try { + await post(`/iam/team/${teamId}/invitation/accept.json`, { id }); + return window.location.reload(); + } catch ({ error }) { + return errorNotification(error); + } + } + async function revokeInvitation(id, teamId) { + try { + await post(`/iam/team/${teamId}/invitation/revoke.json`, { id }); + return window.location.reload(); + } catch ({ error }) { + return errorNotification(error); + } + }
Identity and Access Management
+{#if invitations.length > 0} +
+
Pending invitations
+
+ {#each invitations as invitation} +
+
+ Invited to {invitation.teamName} with + {invitation.permission} permission. +
+ + +
+ {/each} +
+
+{/if}
{#if $session.teamId === '0' && accounts.length > 0}
Accounts
From cc2ec55c4dd91be55c7cb96a5cb7550fee43901e Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 12 Apr 2022 16:50:13 +0200 Subject: [PATCH 3/4] chore: version++ --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ac318b2ad..c42352555 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "coolify", "description": "An open-source & self-hostable Heroku / Netlify alternative.", - "version": "2.4.4", + "version": "2.4.5", "license": "AGPL-3.0", "scripts": { "dev": "docker-compose -f docker-compose-dev.yaml up -d && cross-env NODE_ENV=development & svelte-kit dev", From 03962663c2f7fbe227d06bbbd1684f5e1fdff639 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 12 Apr 2022 18:21:10 +0200 Subject: [PATCH 4/4] fix: Timeout values --- src/lib/api.ts | 4 +--- src/lib/haproxy/configuration.ts | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/lib/api.ts b/src/lib/api.ts index 6d226ef15..ab145a2f7 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -1,11 +1,9 @@ -// TODO: Make this functions generic - async function send({ method, path, data = {}, headers, - timeout = 30000 + timeout = 120000 }): Promise> { const controller = new AbortController(); const id = setTimeout(() => controller.abort(), timeout); diff --git a/src/lib/haproxy/configuration.ts b/src/lib/haproxy/configuration.ts index 8a967befd..f0bd2bb08 100644 --- a/src/lib/haproxy/configuration.ts +++ b/src/lib/haproxy/configuration.ts @@ -20,10 +20,10 @@ global defaults mode http log global - timeout http-request 60s + timeout http-request 120s timeout connect 10s - timeout client 60s - timeout server 60s + timeout client 120s + timeout server 120s userlist haproxy-dataplaneapi user admin insecure-password "\${HAPROXY_PASSWORD}"