configure postgresql
@@ -22,6 +22,7 @@ addons:
- postgresql-client-10
- postgresql-contrib
- postgresql-10-pgaudit
+ - openssl
jdk:
- oraclejdk8
@@ -36,6 +37,34 @@ cache:
- $HOME/.m2
before_script:
+ - sudo service postgresql stop 10
+ - sudo sh -c "echo 'host all all 0.0.0.0/0 md5' | sudo tee --append /etc/postgresql/10/main/pg_hba.conf"
+ - openssl rand -base64 48 > passphrase.txt
+ - openssl genrsa -des3 -passout file:passphrase.txt -out server.pass.key 2048
+ - openssl rsa -passin file:passphrase.txt -in server.pass.key -out server.key
+ - rm server.pass.key
+ - openssl req -new -key server.key -out server.csr -subj "/C=UK/ST=Postgresqll/L=Travis/O=Hack23/OU=demo/CN=localhost"
+ - openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt
+ - rm passphrase.txt
+ - rm server.csr
+ - sudo cp server.crt /var/lib/postgresql/10/main/server.crt
+ - sudo cp server.key /var/lib/postgresql/10/main/server.key
+ - rm server.key
+ - mkdir ~/.postgresql
+ - cp server.crt ~/.postgresql/root.crt
+ - chmod 700 ~/.postgresql/root.crt
+ - rm server.crt
+ - sudo chmod 700 /var/lib/postgresql/10/main/server.*
+ - sudo chown postgres:postgres /var/lib/postgresql/10/main/server.*
+ - echo "ssl_cert_file = '/var/lib/postgresql/10/main/server.crt'" | sudo tee --append /etc/postgresql/10/main/postgresql.conf
+ - echo "ssl_key_file = '/var/lib/postgresql/10/main/server.key'" | sudo tee --append /etc/postgresql/10/main/postgresql.conf
+ - echo "max_prepared_transactions = 100" | sudo tee --append /etc/postgresql/10/main/postgresql.conf
+ - echo "shared_preload_libraries = 'pg_stat_statements, pgaudit, pgcrypto'" | sudo tee --append /etc/postgresql/10/main/postgresql.conf
+ - echo "pgaudit.log = ddl" | sudo tee --append /etc/postgresql/10/main/postgresql.conf
+ - echo "pg_stat_statements.track = all" | sudo tee --append /etc/postgresql/10/main/postgresql.conf
+ - echo "pg_stat_statements.max = 10000" | sudo tee --append /etc/postgresql/10/main/postgresql.conf
+ - echo "listen_addresses = '*'" | sudo tee --append /etc/postgresql/10/main/postgresql.conf
+ - sudo service postgresql start 10
- sudo -u postgres psql -c "CREATE USER eris WITH password 'discord';" -U postgres
- sudo -u postgres psql -c "create database cia_dev" -U postgres
- sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE cia_dev to eris;" -U postgres
