Skip to content

Create readonly postgres user for solrupdater#2150

Merged
mekarpeles merged 3 commits intointernetarchive:masterfrom
cdrini:fix/solr-updater-user
May 28, 2019
Merged

Create readonly postgres user for solrupdater#2150
mekarpeles merged 3 commits intointernetarchive:masterfrom
cdrini:fix/solr-updater-user

Conversation

@cdrini
Copy link
Copy Markdown
Collaborator

@cdrini cdrini commented May 25, 2019

Description

Fix: Creates a readonly postgres user for solrupdater so there's a stronger guarantee that when we run this on logs ~1mo out-of-date (for the last phase of #1843 ) it won't be causing any unintentional database edits.

Technical

  • In our local environment, the default authentication for users is peer; this requires us to create a system user but means we don't need a password (good for dev). On production we'll have to give the postgres user a password somehow?
  • Solution based on https://gist.github.com/oinopion/4a207726edba8b99fd0be31cb28124d0
  • Note that it's a readcreate user; it can still create new tables. Removing this seemed like more trouble than it's worth (especially if we want to keep prod in sync), so didn't bother.

Testing

  • I tried running web.ctx.site.save, but this never worked from solrupdater because there's no ol account associated with it.
  • I used the debugger to ensure that when it connects to infobase it connects with username solrupdater
  • I tried giving the new postgres user 0 permissions, and new-solr-updater failed (as expected).

@cdrini cdrini added the Affects: Configuration Related to the configuration of the dev/staging/prod environments, CI, docker, etc. [managed] label May 25, 2019
@cdrini cdrini requested review from mekarpeles and tfmorris May 25, 2019 00:28
Copy link
Copy Markdown
Member

@mekarpeles mekarpeles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mekarpeles mekarpeles merged commit 916cde6 into internetarchive:master May 28, 2019
@tfmorris
Copy link
Copy Markdown
Contributor

LGTM (confirming what I communicated via Slack)

@cdrini cdrini deleted the fix/solr-updater-user branch June 7, 2019 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Affects: Configuration Related to the configuration of the dev/staging/prod environments, CI, docker, etc. [managed]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants