Skip to content

Commit c7ae871

Browse files
author
Regina Hain
committed
Files needed for porting portal system to CentOS 6
1 parent 1a35c78 commit c7ae871

6 files changed

+827
-0
lines changed

install-ch-centos.sh

+103
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
#!/bin/bash
2+
# -*- Mode:bash -*-
3+
4+
# Exit on error
5+
set -e
6+
# Echo commands with variables expanded
7+
set -x
8+
9+
# If this script should install config files for a given host, define
10+
# a block for that host. Define these variables:
11+
# * INSTALL_CONFIG_FILES="yes"
12+
# * CH_EMAIL: e-mail address of the admin for this CH
13+
# * CH_HOST: the FQDN to which this CH should answer
14+
# * PORTAL_PASSWORD: the portal user's psql database password
15+
# Currently, all known hosts have config files managed out of band,
16+
# so the EXAMPLE_CH_FQDN block has been left in as an example
17+
INSTALL_CONFIG_FILES="yes"
18+
19+
CH_HOST='fields.bbn.com'
20+
PORTAL_PASSWORD='portal'
21+
GCF_INI=/usr/share/geni-ch/gcf.d/gcf.ini
22+
APACHE_HTTPS_CH=/etc/httpd/sites-enabled/ch-ssl
23+
APACHE_HTTPS_PORTAL=/etc/httpd/sites-enabled/portal-ssl
24+
APACHE_HTTP=/etc/httpd/sites-enabled/default
25+
SHARE_DIR=/usr/share/geni-ch
26+
27+
autoreconf --install
28+
sleep 10
29+
./configure --prefix=/usr --sysconfdir=/etc \
30+
--bindir=/usr/local/bin --sbindir=/usr/local/sbin
31+
sleep 10
32+
make
33+
sleep 10
34+
sudo make install
35+
sleep 10
36+
37+
if [ "${INSTALL_CONFIG_FILES}" = "yes" ]; then
38+
sudo cp /etc/geni-ch/example-services.ini /etc/geni-ch/services.ini
39+
40+
# Modify recommended settings using sed
41+
sudo sed -i -e "/^email=/s/=.*/=$CH_EMAIL/" /etc/geni-ch/services.ini
42+
sudo sed -i -e "/^authority=/s/=.*/=$CH_HOST/" /etc/geni-ch/services.ini
43+
sudo sed -i -e "/^servicehost=/s/=.*/=$CH_HOST/" /etc/geni-ch/services.ini
44+
else
45+
test -f /etc/geni-ch/services.ini
46+
fi
47+
48+
if [ -f /usr/share/geni-ch/CA/cacert.pem ]; then
49+
echo "CA certificate already exists - reusing it"
50+
else
51+
sudo geni-init-ca /etc/geni-ch/services.ini
52+
sleep 10
53+
fi
54+
55+
sudo geni-init-services /etc/geni-ch/services.ini --sql out.sql
56+
sleep 10
57+
58+
make cleandb
59+
sleep 10
60+
61+
psql -h localhost portal portal -f out.sql
62+
sleep 10
63+
64+
/usr/bin/sudo /bin/cp -R portal/gcf.d ${SHARE_DIR}
65+
66+
if [ "${INSTALL_CONFIG_FILES}" = "yes" ]; then
67+
sudo cp /usr/share/geni-ch/gcf.d/example-gcf.ini $GCF_INI
68+
sudo sed -i -e "/^base_name=/s/=.*/=$CH_HOST/" $GCF_INI
69+
sudo sed -i -e "s,//localhost,//$CH_HOST,g" $GCF_INI
70+
else
71+
test -f $GCF_INI
72+
fi
73+
74+
sudo /bin/ln -s /usr/share/geni-ch/CA/cacert.pem /usr/share/geni-ch/gcf.d/trusted_roots/cacert.pem
75+
sudo /bin/ln -s /usr/share/geni-ch/ma/ma-cert.pem /usr/share/geni-ch/gcf.d/trusted_roots/ma-cert.pem
76+
sleep 10
77+
78+
sudo service httpd restart
79+
sleep 10
80+
81+
if [ "${INSTALL_CONFIG_FILES}" = "yes" ]; then
82+
sudo /bin/cp /etc/geni-ch/example-settings.php /etc/geni-ch/settings.php
83+
84+
sudo sed -i -e "/^\$db_dsn =/s/=.*/= 'pgsql:\/\/portal:$PORTAL_PASSWORD@localhost\/portal';/" /etc/geni-ch/settings.php
85+
sudo sed -i -e "/^\$portal_admin_email =/s/=.*/= '$CH_EMAIL';/" /etc/geni-ch/settings.php
86+
sudo sed -i -e "/^\$service_registry_url =/s/=.*/= 'https:\/\/$CH_HOST:8444\/SR';/" /etc/geni-ch/settings.php
87+
sudo sed -i -e "/^\$genilib_trusted_host =/s/=.*/= 'https:\/\/$CH_HOST:8444';/" /etc/geni-ch/settings.php
88+
else
89+
test -f /etc/geni-ch/settings.php
90+
fi
91+
92+
# Look in portal-cert.pem for a line like:
93+
# email:[email protected], URI:urn:publicid:IDN+ch5.gpolab.bbn.com+authority+portal, URI:uuid:bb9a5610-eae5-443d-9cfa-c6970af9440c
94+
# and get the URN from that line
95+
portal_urn=$(openssl x509 -text -noout -in /usr/share/geni-ch/portal/portal-cert.pem | grep authority+portal | awk '{print $2}' | awk -F, '{print $1}' | awk -F"URI:" '{print $2}')
96+
test -n "${portal_urn}"
97+
if [ -n "${PORTAL_PASSWORD}" ]; then
98+
geni-add-trusted-tool -p ${PORTAL_PASSWORD} portal "${portal_urn}"
99+
else
100+
test -f ${PORTAL_PASSWORD_FILE}
101+
sudo -u ${PORTAL_PASSWORD_FILE_USER} \
102+
geni-add-trusted-tool -P ${PORTAL_PASSWORD_FILE} portal "${portal_urn}"
103+
fi

install-gcf-centos.sh

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/sh
2+
3+
# A script to configure a GPO lab VM with the right stuff
4+
# to allow the prototype clearinghouse to run.
5+
6+
set -x
7+
set -e
8+
#
9+
# gcf installation
10+
#
11+
SHARE_DIR=/usr/share/geni-ch
12+
13+
# Make a directory for gcf to live in
14+
if [ ! -d "${SHARE_DIR}" ]; then
15+
/usr/bin/sudo /bin/mkdir -p "${SHARE_DIR}"
16+
fi
17+
18+
GCF=gcf-2.5
19+
GCF_PKG=${GCF}.tar.gz
20+
/usr/bin/wget http://www.gpolab.bbn.com/internal/projects/proto-ch/${GCF_PKG}
21+
/usr/bin/sudo /bin/tar xzfC "${GCF_PKG}" "${SHARE_DIR}"
22+
/usr/bin/sudo /bin/ln -s -f ${SHARE_DIR}/${GCF} ${SHARE_DIR}/gcf
23+
24+
exit 0

postgres/8.4.20/pg_hba.conf

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# PostgreSQL Client Authentication Configuration File
2+
# ===================================================
3+
#
4+
# Refer to the "Client Authentication" section in the
5+
# PostgreSQL documentation for a complete description
6+
# of this file. A short synopsis follows.
7+
#
8+
# This file controls: which hosts are allowed to connect, how clients
9+
# are authenticated, which PostgreSQL user names they can use, which
10+
# databases they can access. Records take one of these forms:
11+
#
12+
# local DATABASE USER METHOD [OPTIONS]
13+
# host DATABASE USER CIDR-ADDRESS METHOD [OPTIONS]
14+
# hostssl DATABASE USER CIDR-ADDRESS METHOD [OPTIONS]
15+
# hostnossl DATABASE USER CIDR-ADDRESS METHOD [OPTIONS]
16+
#
17+
# (The uppercase items must be replaced by actual values.)
18+
#
19+
# The first field is the connection type: "local" is a Unix-domain socket,
20+
# "host" is either a plain or SSL-encrypted TCP/IP socket, "hostssl" is an
21+
# SSL-encrypted TCP/IP socket, and "hostnossl" is a plain TCP/IP socket.
22+
#
23+
# DATABASE can be "all", "sameuser", "samerole", a database name, or
24+
# a comma-separated list thereof.
25+
#
26+
# USER can be "all", a user name, a group name prefixed with "+", or
27+
# a comma-separated list thereof. In both the DATABASE and USER fields
28+
# you can also write a file name prefixed with "@" to include names from
29+
# a separate file.
30+
#
31+
# CIDR-ADDRESS specifies the set of hosts the record matches.
32+
# It is made up of an IP address and a CIDR mask that is an integer
33+
# (between 0 and 32 (IPv4) or 128 (IPv6) inclusive) that specifies
34+
# the number of significant bits in the mask. Alternatively, you can write
35+
# an IP address and netmask in separate columns to specify the set of hosts.
36+
#
37+
# METHOD can be "trust", "reject", "md5", "password", "gss", "sspi", "krb5",
38+
# "ident", "pam", "ldap" or "cert". Note that "password" sends passwords
39+
# in clear text; "md5" is preferred since it sends encrypted passwords.
40+
#
41+
# OPTIONS are a set of options for the authentication in the format
42+
# NAME=VALUE. The available options depend on the different authentication
43+
# methods - refer to the "Client Authentication" section in the documentation
44+
# for a list of which options are available for which authentication methods.
45+
#
46+
# Database and user names containing spaces, commas, quotes and other special
47+
# characters must be quoted. Quoting one of the keywords "all", "sameuser" or
48+
# "samerole" makes the name lose its special character, and just match a
49+
# database or username with that name.
50+
#
51+
# This file is read on server startup and when the postmaster receives
52+
# a SIGHUP signal. If you edit the file on a running system, you have
53+
# to SIGHUP the postmaster for the changes to take effect. You can use
54+
# "pg_ctl reload" to do that.
55+
56+
# Put your actual configuration here
57+
# ----------------------------------
58+
#
59+
# If you want to allow non-local connections, you need to add more
60+
# "host" records. In that case you will also need to make PostgreSQL listen
61+
# on a non-local interface via the listen_addresses configuration parameter,
62+
# or via the -i or -h command line switches.
63+
#
64+
65+
66+
67+
# TYPE DATABASE USER CIDR-ADDRESS METHOD
68+
69+
# "local" is for Unix domain socket connections only
70+
local all all ident
71+
# IPv4 local connections:
72+
host all all 127.0.0.1/32 md5
73+
# IPv6 local connections:
74+
host all all ::1/128 md5
75+
host all all 0.0.0.0/0 md5

0 commit comments

Comments
 (0)