From 17d44ec2c41a5b485cecae51a07396f85a601248 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 30 Jun 2017 02:53:57 +0300 Subject: Fix builds page to correctly display unbuilt package count --- INSTALL-DEV | 53 ++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 48 insertions(+), 5 deletions(-) (limited to 'INSTALL-DEV') diff --git a/INSTALL-DEV b/INSTALL-DEV index 8f5ba6f..eb74ff8 100644 --- a/INSTALL-DEV +++ b/INSTALL-DEV @@ -28,14 +28,26 @@ group, not user. However, most installations use the same name for both.] $ sudo sudo -u postgres psql # Note: double sudo is not a mistake. -CREATE DATABASE brep_package TEMPLATE template0 ENCODING 'UTF8' -LC_COLLATE 'en_US.UTF8' LC_CTYPE 'en_US.UTF8'; -CREATE DATABASE brep_build TEMPLATE template0 ENCODING 'UTF8' -LC_COLLATE 'en_US.UTF8' LC_CTYPE 'en_US.UTF8'; +CREATE DATABASE brep_package + TEMPLATE template0 + ENCODING 'UTF8' + LC_COLLATE 'en_US.UTF8' + LC_CTYPE 'en_US.UTF8'; + +CREATE DATABASE brep_build + TEMPLATE template0 + ENCODING 'UTF8' + LC_COLLATE 'en_US.UTF8' + LC_CTYPE 'en_US.UTF8'; + CREATE USER ; + GRANT ALL PRIVILEGES ON DATABASE brep_package, brep_build TO ; + CREATE USER "www-data" INHERIT IN ROLE ; +CREATE USER "brep-build" INHERIT IN ROLE PASSWORD '-'; + Exit psql (^D), then make sure the logins work: $ psql -d brep_package @@ -47,6 +59,33 @@ $ sudo sudo -u www-data psql -d brep_package $ sudo sudo -u www-data psql -d brep_build ^D +$ sudo sudo -u postgres psql -d brep_build + +CREATE EXTENSION postgres_fdw; + +CREATE SERVER package_server + FOREIGN DATA WRAPPER postgres_fdw + OPTIONS (dbname 'brep_package', updatable 'false'); + +GRANT USAGE ON FOREIGN SERVER package_server to ; + +CREATE USER MAPPING FOR PUBLIC + SERVER package_server + OPTIONS (user 'brep-build', password '-'); + +Exit psql (^D) + +Add the following lines at the beginning of the PostgreSQL client +authentication configuration file (pg_hba.conf): + +# TYPE DATABASE USER ADDRESS METHOD +local brep_package brep-build md5 + +Restart PostgreSQL (use the second version for systemd): + +$ sudo /etc/init.d/postgresql restart +$ sudo systemctl restart postgresql + To troubleshoot, see PostgreSQL logs, for example: $ sudo tail -f /var/log/postgresql/*.log @@ -68,6 +107,7 @@ To verify: $ psql -d brep_package -c 'SELECT name, summary FROM repository' $ psql -d brep_build -c 'SELECT package_name FROM build' # Empty row set. +$ psql -d brep_build -c 'SELECT DISTINCT name FROM build_package' 3. Setup Apache2 Module @@ -76,7 +116,8 @@ Here we assume Apache2 is installed and you have an appropriate VirtualServer ready (the one for the default site is usually a good candidate). Open the corresponding Apache2 .conf file and add the following inside VirtualServer, replacing and with the actual absolute paths -(if you built brep in the source tree, then the two would be the same). +(if you built brep in the source tree, then the two would be the same), and +replacing with your login. # Load the brep module. # @@ -113,6 +154,8 @@ replacing and with the actual absolute paths # Brep module configuration. # brep-conf /etc/brep-module.conf + brep-package-db-role + brep-build-db-role # Static brep content (CSS files). # -- cgit v1.1