Skip to content

Commit

Permalink
Add privilege for BOB runtime user to read the staging database, whic…
Browse files Browse the repository at this point in the history
…h is required for forthcoming (rather than live) ballots
  • Loading branch information
mvl22 committed Oct 9, 2013
1 parent 86c9ee6 commit 42b41cf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions 2-install-bob.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ postfix reload
${mysql} -e "CREATE DATABASE IF NOT EXISTS ${bobDbDatabase} DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;"

# Create database user privileges (which will create the users if they do not exist); see: https://github.com/cusu/bob/blob/master/BOB.php#L1436
# NB Staging permission also will be created later if using the ingest module
${mysql} -e "GRANT SELECT,INSERT,UPDATE ON ${bobDbDatabase}.* TO '${bobDbUsername}'@'localhost' IDENTIFIED BY '${bobDbPassword}';"
${mysql} -e "GRANT SELECT,CREATE ON ${bobDbDatabase}.* TO '${bobDbSetupUsername}'@'localhost' IDENTIFIED BY '${bobDbPassword}';"

Expand Down
4 changes: 4 additions & 0 deletions 4-install-bob-gui-ingest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ ${mysql} -e "GRANT SELECT,INSERT,CREATE ON ${bobDbDatabase}.* TO '${bobDbIngestU
# Create the instances table, by cloning the structure of the main instances table
${mysql} -e "CREATE TABLE IF NOT EXISTS ${bobDbIngestDatabase}.instances LIKE ${bobDbDatabase}.instances;"

# Allow live BOB to read from the ingest database, now we have confirmed we are using an ingest setup
#!# Need to audit why BOB insists on "exactly select,insert,update" rather than just select here
${mysql} -e "GRANT SELECT,INSERT,UPDATE ON ${bobDbIngestDatabase}.* TO '${bobDbUsername}'@'localhost' IDENTIFIED BY '${bobDbPassword}';"

# Add the hourly cron job to the (root) cron.d, running as the ingest user; see the .cron.example file
cronJob="30 * * * * su ${ingestUser} -c 'php -d memory_limit=700M ${documentRoot}/bob-gui/ingest/bobguiIngestWrapper.php'"
echo "${cronJob}" > /etc/cron.d/bobguiIngest.cron
Expand Down

0 comments on commit 42b41cf

Please sign in to comment.