From 147d9946c38bab7215c1cb88ab34c14653bbe4ec Mon Sep 17 00:00:00 2001 From: xbgmsharp Date: Mon, 16 Oct 2023 00:29:16 +0200 Subject: [PATCH] Update connections limit to 20 for anonymous --- initdb/02_6_signalk_roles.sql | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/initdb/02_6_signalk_roles.sql b/initdb/02_6_signalk_roles.sql index e0ec323..af17959 100644 --- a/initdb/02_6_signalk_roles.sql +++ b/initdb/02_6_signalk_roles.sql @@ -15,13 +15,13 @@ select current_database(); -- -- api_anonymous -- nologin --- api_anonymous role in the database with which to execute anonymous web requests, limit 10 connections +-- api_anonymous role in the database with which to execute anonymous web requests, limit 20 connections -- api_anonymous allows JWT token generation with an expiration time via function api.login() from auth.accounts table -create role api_anonymous WITH NOSUPERUSER NOCREATEDB NOCREATEROLE NOINHERIT NOLOGIN NOBYPASSRLS NOREPLICATION CONNECTION LIMIT 10; +create role api_anonymous WITH NOSUPERUSER NOCREATEDB NOCREATEROLE NOINHERIT NOLOGIN NOBYPASSRLS NOREPLICATION CONNECTION LIMIT 20; comment on role api_anonymous is 'The role that PostgREST will switch to when a user is not authenticated.'; --- Limit to 10 connections ---alter user api_anonymous connection limit 10; +-- Limit to 20 connections +--alter user api_anonymous connection limit 20; grant usage on schema api to api_anonymous; -- explicitly limit EXECUTE privileges to only signup and login and reset functions grant execute on function api.login(text,text) to api_anonymous; @@ -46,7 +46,7 @@ comment on role authenticator is 'Role that serves as an entry-point for API servers such as PostgREST.'; grant api_anonymous to authenticator; --- Grafana user and role with login, read-only, limit 15 connections +-- Grafana user and role with login, read-only, limit 20 connections CREATE ROLE grafana WITH NOSUPERUSER NOCREATEDB NOCREATEROLE NOINHERIT NOBYPASSRLS NOREPLICATION CONNECTION LIMIT 20 LOGIN PASSWORD 'mysecretpassword'; comment on role grafana is 'Role that grafana will use for authenticated web users.';