public inbox for [email protected]help / color / mirror / Atom feed
Re: Changing postgres User 4+ messages / 3 participants [nested] [flat]
* Re: Changing postgres User @ 2024-10-14 21:46 Adrian Klaver <[email protected]> 2024-10-14 22:09 ` Re: Changing postgres User Zac Warham <[email protected]> 0 siblings, 1 reply; 4+ messages in thread From: Adrian Klaver @ 2024-10-14 21:46 UTC (permalink / raw) To: Zac Warham <[email protected]>; [email protected] <[email protected]> On 10/14/24 13:11, Zac Warham wrote: > Hi, > > We are trying to setup a postgresql Docker container alongside pgadmin > and caddy for use in the PrairieLearn student testing software. Our main > set back is that the PrairieLearn production environment user runs as > user 1001:1001 and as such we have had to rename the postgres user > within Linux to 1001 and alter the credentials management significantly. Why? Per: https://www.postgresql.org/docs/current/app-initdb.html You can have the initdb create the cluster as any user: "-U username --username=username Sets the user name of the bootstrap superuser. This defaults to the name of the operating-system user running initdb. " > > We are currently brainstorming some better ways but if anyone has any > suggestions on easier ways to make these changes then we would > appreciate them. The code is open source and can be viewed here - > https://github.com/PrairieLearn/PrairieLearn/pull/10713 > <https://github.com/PrairieLearn/PrairieLearn/pull/10713; > > Thanks, > Zac -- Adrian Klaver [email protected] ^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Changing postgres User 2024-10-14 21:46 Re: Changing postgres User Adrian Klaver <[email protected]> @ 2024-10-14 22:09 ` Zac Warham <[email protected]> 2024-10-14 22:27 ` Re: Changing postgres User Tom Lane <[email protected]> 2024-10-14 23:38 ` Re: Changing postgres User Adrian Klaver <[email protected]> 0 siblings, 2 replies; 4+ messages in thread From: Zac Warham @ 2024-10-14 22:09 UTC (permalink / raw) To: Adrian Klaver <[email protected]>; [email protected] <[email protected]> Hi Adrian, Thank you for the link to the documentation however it is the UID and GID of 1001:1001 that is required, not the username which I believe this is intended for? Is there a similar option for UID and GID? Apologies if my original question was not clear in this manner. Zac ________________________________ From: Adrian Klaver <[email protected]> Sent: Monday, 14 October 2024 2:46 PM To: Zac Warham <[email protected]>; [email protected] <[email protected]> Subject: Re: Changing postgres User On 10/14/24 13:11, Zac Warham wrote: > Hi, > > We are trying to setup a postgresql Docker container alongside pgadmin > and caddy for use in the PrairieLearn student testing software. Our main > set back is that the PrairieLearn production environment user runs as > user 1001:1001 and as such we have had to rename the postgres user > within Linux to 1001 and alter the credentials management significantly. Why? Per: https://aus01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.postgresql.org%2Fdocs%2Fcurren...; You can have the initdb create the cluster as any user: "-U username --username=username Sets the user name of the bootstrap superuser. This defaults to the name of the operating-system user running initdb. " > > We are currently brainstorming some better ways but if anyone has any > suggestions on easier ways to make these changes then we would > appreciate them. The code is open source and can be viewed here - > https://aus01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FPrairieLearn%2FPrairi...; > <https://aus01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FPrairieLearn%2FPrairi...; > > Thanks, > Zac -- Adrian Klaver [email protected] ^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Changing postgres User 2024-10-14 21:46 Re: Changing postgres User Adrian Klaver <[email protected]> 2024-10-14 22:09 ` Re: Changing postgres User Zac Warham <[email protected]> @ 2024-10-14 22:27 ` Tom Lane <[email protected]> 1 sibling, 0 replies; 4+ messages in thread From: Tom Lane @ 2024-10-14 22:27 UTC (permalink / raw) To: Zac Warham <[email protected]>; +Cc: Adrian Klaver <[email protected]>; [email protected] <[email protected]> Zac Warham <[email protected]> writes: > Thank you for the link to the documentation however it is the UID and GID of 1001:1001 that is required, not the username which I believe this is intended for? Is there a similar option for UID and GID? Apologies if my original question was not clear in this manner. The underlying UID/GID will necessarily be that of the OS account that is running initdb. I don't see why you need to worry about it. If you don't want the Postgres role name of the initial superuser role to be the same as the OS account's name, you can select something else using the switch Adrian mentioned --- but that's really mostly cosmetic. It has nothing to do with OS-level privileges. regards, tom lane ^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Changing postgres User 2024-10-14 21:46 Re: Changing postgres User Adrian Klaver <[email protected]> 2024-10-14 22:09 ` Re: Changing postgres User Zac Warham <[email protected]> @ 2024-10-14 23:38 ` Adrian Klaver <[email protected]> 1 sibling, 0 replies; 4+ messages in thread From: Adrian Klaver @ 2024-10-14 23:38 UTC (permalink / raw) To: Zac Warham <[email protected]>; [email protected] <[email protected]> On 10/14/24 15:09, Zac Warham wrote: > Hi Adrian, > > Thank you for the link to the documentation however it is the UID and > GID of 1001:1001 that is required, not the username which I believe this > is intended for? Is there a similar option for UID and GID? Apologies if > my original question was not clear in this manner. The UID/GID map to a user and group and that is what you care about. > > Zac > ------------------------------------------------------------------------ > *From:* Adrian Klaver <[email protected]> > *Sent:* Monday, 14 October 2024 2:46 PM > *To:* Zac Warham <[email protected]>; > [email protected] <[email protected]> > *Subject:* Re: Changing postgres User > On 10/14/24 13:11, Zac Warham wrote: >> Hi, >> >> We are trying to setup a postgresql Docker container alongside pgadmin >> and caddy for use in the PrairieLearn student testing software. Our main >> set back is that the PrairieLearn production environment user runs as >> user 1001:1001 and as such we have had to rename the postgres user >> within Linux to 1001 and alter the credentials management significantly. > > Why? > > Per: > > https://aus01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.postgresql.org%2Fdocs%2Fcurren... <https://www.postgresql.org/docs/current/app-initdb.html; > > You can have the initdb create the cluster as any user: > > "-U username > --username=username > > Sets the user name of the bootstrap superuser. This defaults to the > name of the operating-system user running initdb. > " > >> >> We are currently brainstorming some better ways but if anyone has any >> suggestions on easier ways to make these changes then we would >> appreciate them. The code is open source and can be viewed here - >> https://aus01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FPrairieLearn%2FPrairi... <https://github.com/PrairieLearn/PrairieLearn/pull/10713; >> <https://aus01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FPrairieLearn%2FPrairi... <https://github.com/PrairieLearn/PrairieLearn/pull/10713>; >> >> Thanks, >> Zac > > -- > Adrian Klaver > [email protected] > -- Adrian Klaver [email protected] ^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2024-10-14 23:38 UTC | newest] Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2024-10-14 21:46 Re: Changing postgres User Adrian Klaver <[email protected]> 2024-10-14 22:09 ` Zac Warham <[email protected]> 2024-10-14 22:27 ` Tom Lane <[email protected]> 2024-10-14 23:38 ` Adrian Klaver <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox