#!/bin/sh #actual system user named pygame is not needed if #sudo adduser pygame #sudo passwd pygame #sudo usermod -a -G wheel pygame #fix this part of docs for Fedora: #near: #brew install yuicompressor node optipng #apt-get install yui-compressor nodejs optipng #add: sudo dnf install -y yuicompressor nodejs optipng ImageMagick #NOTE: ImageMagick is needed for the convert command called by the image_thumb function (and test_dashboard_view self test), but it is NOT listed as a dep in the docs if ! systemctl is-active --quiet postgresql then #the check above returns 0 if active, but for some reason ! is needed (tested thoroughly) echo "installing postgresql postgresql-server..." sudo dnf install -y postgresql postgresql-server sudo systemctl enable postgresql echo "postgresql-setup initdb..." sudo postgresql-setup initdb echo "starting postgresql service..." sudo systemctl start postgresql fi # cd to /tmp to avoid error: could not change directory to "/home/owner/Downloads/git/pygameweb": Permission denied' cd /tmp sudo -u postgres createdb pygame sudo -u postgres psql pygame -c "CREATE USER pygame WITH PASSWORD 'password';" sudo -u postgres psql pygame -c "GRANT ALL PRIVILEGES ON DATABASE pygame to pygame;" sudo -u postgres createdb pygame_test sudo -u postgres psql pygame -c "CREATE USER pygame_test WITH PASSWORD 'password';" sudo -u postgres psql pygame_test -c "GRANT ALL PRIVILEGES ON DATABASE pygame_test to pygame_test;" #echo "IGNORE ERROR: 'could not change directory to ...' SHOWN ABOVE." echo echo "Now you must manually edit" sudo -u postgres psql -c "SHOW hba_file;" echo "and change:" echo "host all all 127.0.0.1/32 ident" echo "to" echo "host all all 127.0.0.1/32 md5" echo "and change" echo "host all all ::1/128 ident" echo "to" echo "host all all ::1/128 md5" echo "so that local connections can login via password (instead of only via matching local username)." echo "then run:" echo "systemctl restart postgresql" echo echo "AFTER doing those manual steps, as long as there are no other errors caused by them, proceed to run the next script (install-pygameweb-step2.sh)" echo