Open
Conversation
b2f03c7 to
8720574
Compare
Creates a remote admin role with CREATEDB + CREATEROLE privileges and its own admin_users group (created if it doesn't exist). pg_hba entries allow access to ALL databases (not sameuser like remote_users). Supports --host-networks (host entries, for private subnets behind a TLS-terminating proxy) and --hostssl-networks (hostssl entries, for shared/untrusted networks where TLS at the pg level is required).
64ed9c2 to
c6885ec
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pg-addadminscript that creates a remote admin role withCREATEDB+CREATEROLEprivilegespg_hba.confentry allowing the admin to connect to ALL databases (unlikepg-adduserusers who are limited tosameuser)pg-adduser: prefix + random hex suffix, base58 password, member ofremote_usersgroupThis is needed for automation tools (like pmx-ng) that provision tenant databases remotely via an admin DSN. Run once per Postgres instance after
pg-addgroup.Test plan
pg-addgroup hostssl remote_users 15432on a test instancepg-addadmin admin 15432 remote_usersand verify role is created with CREATEDB + CREATEROLEpostgresdatabase (not just sameuser)