forked from divad12/khan-dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add postgres setup to mac and linux set up scripts
Summary: This patch installs postgresql server as part of the overall khan setup process. To allow our access to the database in our tests and dev environment, we need to make a couple small tweaks to the default settings. In os x land, we need to create a postgres user since the only user created by homebrew matches the logged in user. In linux world, we need to relax the authentication requirements to match the settings that homebrew provides - namely to allow local users to login with any username. Note that we create the postgres databases as Makefile step within webapp (to keep all schema changes to that repo). That forthcoming change will need to land before this one. Test Plan: To test my changes on os x, I uninstalled posgres using homebrew manually, then ran the steps in `./mac-setup.sh` and verified that they worked without error. To test my changes on linux, I booted a blank ubuntu (18.04) container using docker, with the devtools directory mounted as a volume: `` docker run -v `/home/dhruv/khan/devtools`:/root/khan/devtools --rm -it ubuntu `` I then commented out all steps in `linux_setup.sh` except `install_postgresql` and ran the following `` install_postgresql runs apt-get update apt-get install -y sudo curl gnupg software-properties-common cd /root/khan/devtools/khan-dotfiles ./linux-setup.sh ``` Reviewers: benkraft, Kai, csilvers Reviewed By: Kai, csilvers Subscribers: kphilip, aric, #classroom-be, csilvers Differential Revision: https://phabricator.khanacademy.org/D54534
- Loading branch information
Showing
4 changed files
with
61 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# We allow any connection by the postgres user to local addresses, without a | ||
# password. | ||
|
||
# TYPE DATABASE USER ADDRESS METHOD | ||
# "local" is for Unix domain socket connections only | ||
local all postgres trust | ||
|
||
# IPv4 local connections: | ||
host all postgres 127.0.0.1/32 trust | ||
# IPv6 local connections: | ||
host all postgres ::1/128 trust | ||
|
||
|
This file contains 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