Conventions
Yes, I’m using Debian Stretch.
At this point I’m too lazy to write more details.
Setup PostgreSQL
echo "deb http://kambing.ui.ac.id/postgresql/repos/apt/ stretch-pgdg main" | sudo tee /etc/apt/sources.list.d/postgresql.listwget --quiet -O - http://kambing.ui.ac.id/postgresql/repos/apt/ACCC4CF8.asc | sudo apt-key add -sudo apt updatesudo apt install postgresql-10Create new user and database.
sudo -u postgres createuser -D -A -P casigsudo -u postgres createdb -O casig casigdbAdd access for all remote clients.
sudo tee -a /etc/postgresql/10/main/pg_hba.conf << EOFhost all all 0.0.0.0/0 md5host all all ::/0 md5EOFRestart PostgreSQL server.
sudo /etc/init.d/postgresql restartCAS Service Registry
Add to CAS’ gradle build dependencies:
compile "org.apereo.cas:cas-server-support-jdbc-drivers:${project.'cas.version'}"compile "org.apereo.cas:cas-server-support-jpa-service-registry:${project.'cas.version'}"Add to etc/cas/config/cas.properties:
cas.serviceRegistry.jpa.url=jdbc:postgresql://192.0.2.9/casigdbcas.serviceRegistry.jpa.user=casigcas.serviceRegistry.jpa.password=cimeiwoh7pee4eeg0kae6Jaeyee3Oof7cas.serviceRegistry.jpa.ddlAuto=updatecas.serviceRegistry.jpa.driverClass=org.postgresql.Drivercas.serviceRegistry.jpa.dialect=org.hibernate.dialect.PostgreSQL95DialectDon’t forget the dialect or later we would not have DDL.
Default services
This would install default service for HTTPS/IMAPS. It should be automatically installed by CAS on the first run. But, hey, may be something goes wrong and we need to make our own service.
insert into regexregisteredservice (id, name, serviceid, evaluation_order) values (1, 'Generic HTTPS and IMAPS', '^(https?|imaps?|http?)://.*', 0);Test
casigdb=> \dt List of relations Schema | Name | Type | Owner--------+--------------------------------------------+-------+------- public | regexregisteredservice | table | casig public | regexregisteredserviceproperty | table | casig public | registeredservice_contacts | table | casig public | registeredserviceimpl_props | table | casig public | registeredserviceimplcontact | table | casig public | samlregisteredservice_attributenameformats | table | casig(6 rows)References
JDBC Drivers, PostgreSQL Configuration Properties, Database Service Registry
