source: TI12-security/trunk/NDGSecurity/python/ndg_security_server/ndg/security/server/paster_templates/Makefile @ 7829

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/NDGSecurity/python/ndg_security_server/ndg/security/server/paster_templates/Makefile@7829
Revision 7829, 12.0 KB checked in by pjkersha, 10 years ago (diff)

Incomplete - task 16: NDG Security 2.x.x - incl. updated Paster templates

  • Completed Attribute Service template and tested standalone
  • Property svn:keywords set to Id
Line 
1#
2# Makefile to copy ndg.security.test.integration configurations and make them
3# into templates.  This is intended for use preparing a distribution, not
4# for post-installation use.
5#
6# @author P J Kershaw 16/11/10
7#
8# @copyright: (C) 2010 STFC
9#
10# @license: BSD - LICENSE file
11#
12# $Id$
13
14# Settings for all Templates
15ROOT_FILEPATH = ../../../../../
16DEST_DIR = ./
17TEST_DIR = ${ROOT_FILEPATH}ndg_security_test/ndg/security/test/
18TEST_CONFIG_SRC_DIR = ${TEST_DIR}config/
19PKI_SRC_DIR = ${TEST_CONFIG_SRC_DIR}pki/
20CA_SRC_DIR = ${PKI_SRC_DIR}ca/
21SERVER_CERT_SRC_FILEPATH = ${PKI_SRC_DIR}localhost.crt
22SERVER_KEY_SRC_FILEPATH = ${PKI_SRC_DIR}localhost.key
23INTEGRATION_TEST_DIR = ${TEST_DIR}integration/
24
25USERDB_FILENAME = user.db
26USERDB_FILEPATH = ${TEST_CONFIG_SRC_DIR}${USERDB_FILENAME}
27
28
29# OpenID Provider Specific Settings
30OP_SERVER_YADIS_TMPL_SRC_FILENAME = serveryadis.xml
31OP_YADIS_TMPL_SRC_FILENAME = yadis.xml
32
33# Generic Services Template Settings
34SERVICE_SRC_DIRNAME = full_system/
35SERVICE_DEST_DIRNAME = services/
36SERVICE_SRC_DIR = ${INTEGRATION_TEST_DIR}${SERVICE_SRC_DIRNAME}
37SERVICE_DEST_DIR = ${DEST_DIR}${SERVICE_DEST_DIRNAME}
38SERVICE_SRC_INI_FILENAME = securityservices.ini
39SERVICE_SRC_INI_FILEPATH = ${SERVICE_SRC_DIR}${SERVICE_SRC_INI_FILENAME}
40SERVICE_INI_FILEPATH_TMP = ${SERVICE_DEST_DIR}${SERVICE_SRC_INI_FILENAME}
41SERVICE_INI_TMPL_FILEPATH = ${SERVICE_DEST_DIR}service.ini_tmpl
42SERVICE_PKI_DEST_DIR = ${SERVICE_DEST_DIR}pki/
43SERVICE_CA_DEST_DIR = ${SERVICE_PKI_DEST_DIR}ca/
44SERVICE_SURPLUS_FILES = README __init__.* attributeinterface.* securedapp.* \
45        securityservicesapp.* request-filter.xml pep_result_handler *.pyc \
46        authn/* openidprovider/associations/  openidprovider/beaker/ \
47        openidprovider/README openidprovider/nonces/ openidprovider/temp/ \
48        openidrelyparty/store/ openidrelyparty/__init__.* \
49        pip-session-cache/*
50SERVICE_OP_DIRNAME = openidprovider/
51SERVICE_OP_DIR = ${SERVICE_DEST_DIR}${SERVICE_OP_DIRNAME}
52SERVICE_OP_TMPL_DIR = ${SERVICE_OP_DIR}templates/
53SERVICE_OP_SERVER_YADIS_TMPL_FILEPATH_TMP = ${SERVICE_OP_TMPL_DIR}serveryadis.xml
54SERVICE_OP_SERVER_YADIS_TMPL_FILEPATH = ${SERVICE_OP_SERVER_YADIS_TMPL_FILEPATH_TMP}_tmpl
55SERVICE_OP_YADIS_TMPL_FILEPATH_TMP = ${SERVICE_OP_TMPL_DIR}yadis.xml
56SERVICE_OP_YADIS_TMPL_FILEPATH = ${SERVICE_OP_YADIS_TMPL_FILEPATH_TMP}_tmpl
57
58       
59service_tmpl: ${SERVICE_SRC_DIR}
60        @-echo Preparing Generic Services template ...
61        @-echo
62        @-echo Copying configuration files ...
63        @-cp -r ${SERVICE_SRC_DIR} ${SERVICE_DEST_DIR} 2> /dev/null
64        @-echo Clear out SVN directories ...
65        @-find ${SERVICE_DEST_DIR} -name ".svn" -print | xargs /bin/rm -rf
66        @-echo Remove unneeded files ...
67        for i in ${SERVICE_SURPLUS_FILES} ; do \
68                rm -rf ${SERVICE_DEST_DIR}$$i ; \
69        done ;
70        @-echo Making substitutions for ini file template variables ...
71        sed -e s/'portNum = .*'/'portNum = %%\{portNumber}'/ \
72        -e s/'baseURI =.*'/'baseURI = %%\{baseURI}'/ \
73        -e s/'saml\.soapbinding\.mountPath.*'/'saml.soapbinding.mountPath = %%\{attributeServiceMountPoint\}'/ \
74        -e s/'saml\.mountPath.*'/'saml.mountPath = %%\{authorisationServiceMountPoint\}'/ \
75        -e s/'saml\.soapbinding\.issuerName =.*'/'saml.soapbinding.issuerName = %%\{attributeServiceIssuerName}'/ \
76        -e s/'saml\.issuerName =.*'/'samlIssuerName = %%\{authorisationServiceIssuerName}'/ \
77        -e s/'saml\.soapbinding\.issuerFormat =.*'/'saml.soapbinding.issuerFormat = %%\{attributeServiceIssuerFormat}'/ \
78        -e s/'saml\.issuerFormat =.*'/'saml.issuerFormat = %%\{authorisationServiceIssuerFormat}'/ \
79        -e s/'authkitCookieSecret =.*'/'authkitCookieSecret = %%\{authkitCookieSecret}'/ \
80        -e s/'beakerSessionCookieSecret =.*'/'beakerSessionCookieSecret = %%\{beakerSessionCookieSecret}'/ \
81        -e s/'authkit.openid.session.secret = .*'/'authkit.openid.session.secret = %%\{openidRelyingPartyCookieSecret}'/ \
82        -e s/'testConfigDir = .*'// \
83        -e s/testConfigDir/here/g \
84        -e s/'# Revision:.*'//g \
85                ${SERVICE_INI_FILEPATH_TMP} > ${SERVICE_INI_TMPL_FILEPATH}
86        rm -f ${SERVICE_INI_FILEPATH_TMP}
87        @-echo Making substitutions for OpenID Provider Yadis templates ...
88        @-echo Removing unneeded XRD entries ...
89        sed -r -e /'<Service priority=\"(1|19|30|20)\">'/,/'<XRD>'/d \
90        -e s/'<XRD>'/'%%\{serveryadisExtraXrdEntries}\n    <XRD>'/ \
91                ${SERVICE_OP_SERVER_YADIS_TMPL_FILEPATH_TMP} > \
92                ${SERVICE_OP_SERVER_YADIS_TMPL_FILEPATH}
93        rm -f ${SERVICE_OP_SERVER_YADIS_TMPL_FILEPATH_TMP}
94        sed -r -e /'<Service priority=\"(1|19|30|20)\">'/,/'<XRD>'/d \
95        -e s/'<XRD>'/'%%\{yadisExtraXrdEntries}\n    <XRD>'/ \
96                ${SERVICE_OP_YADIS_TMPL_FILEPATH_TMP} > \
97                ${SERVICE_OP_YADIS_TMPL_FILEPATH}
98        rm -f ${SERVICE_OP_YADIS_TMPL_FILEPATH_TMP}
99        @-echo
100        @-echo Create PKI directory and copying files ...
101        -mkdir ${SERVICE_PKI_DEST_DIR}
102        cp ${SERVER_CERT_SRC_FILEPATH} ${SERVICE_PKI_DEST_DIR}
103        cp ${SERVER_KEY_SRC_FILEPATH} ${SERVICE_PKI_DEST_DIR}
104        -mkdir ${SERVICE_CA_DEST_DIR}
105        cp ${CA_SRC_DIR}* ${SERVICE_CA_DEST_DIR}
106        @-echo Copying test SQLite user database ...
107        cp ${USERDB_FILEPATH} ${SERVICE_DEST_DIR}
108        @-echo
109        @-echo Done.
110       
111service_tmpl_clean:
112        @-echo Clearing Services template ...
113        rm -rf ${SERVICE_DEST_DIR}
114
115
116# Authorisation Service Template Settings
117AUTHZ_SERVICE_DIRNAME = authorisationservice/
118AUTHZ_SERVICE_SRC_DIR = ${TEST_CONFIG_SRC_DIR}${AUTHZ_SERVICE_DIRNAME}
119AUTHZ_SERVICE_DEST_DIR = ${DEST_DIR}${AUTHZ_SERVICE_DIRNAME}
120AUTHZ_SERVICE_INI_FILENAME = authorisation-service.ini
121AUTHZ_SERVICE_INI_FILEPATH_TMP = ${AUTHZ_SERVICE_DEST_DIR}/${AUTHZ_SERVICE_INI_FILENAME}
122AUTHZ_SERVICE_INI_TMPL_FILEPATH = ${AUTHZ_SERVICE_INI_FILEPATH_TMP}_tmpl
123AUTHZ_SERVICE_PKI_DEST_DIR = ${AUTHZ_SERVICE_DEST_DIR}pki/
124AUTHZ_SERVICE_CA_DEST_DIR = ${AUTHZ_SERVICE_PKI_DEST_DIR}ca/
125
126
127authorisation_service_tmpl:
128        @-echo Preparing Authorisation Service template ...
129        @-echo
130        @-echo Copying test ini file and other configuration files ...
131        mkdir ${AUTHZ_SERVICE_DEST_DIR}
132        cp -r ${AUTHZ_SERVICE_SRC_DIR}* ${AUTHZ_SERVICE_DEST_DIR}
133        @-echo Making substitutions for template variables ...
134        sed -e s/'# Description:.*'/'# Description: Paster ini file for SAML/XACML based Authorisation Service'/ \
135        -e s/'saml\.mountPath.*'/'saml.mountPath = %%\{mountPath\}'/ \
136        -e s/'samlIssuerName =.*'/'samlIssuerName = %%\{issuerName}'/ \
137        -e s/'samlIssuerFormat =.*'/'samlIssuerFormat = %%\{issuerFormat}'/ \
138        -e s/'testConfigDir = \.\.\/\.\.\/\.\.\/config'// \
139        -e s/testConfigDir/here/g \
140        ${AUTHZ_SERVICE_INI_FILEPATH_TMP} > ${AUTHZ_SERVICE_INI_TMPL_FILEPATH}
141        rm -f ${AUTHZ_SERVICE_INI_FILEPATH_TMP}
142        @-echo
143        @-echo Create PKI directory and copying files ...
144        cp ${SERVER_CERT_SRC_FILEPATH} ${AUTHZ_SERVICE_PKI_DEST_DIR}
145        cp ${SERVER_KEY_SRC_FILEPATH} ${AUTHZ_SERVICE_PKI_DEST_DIR}
146        cp ${CA_SRC_DIR}* ${AUTHZ_SERVICE_CA_DEST_DIR}
147        @-echo Clear out SVN directories ...
148        @-find ${AUTHZ_SERVICE_DEST_DIR} -name ".svn" -print | xargs /bin/rm -rf
149        @-echo
150        @-echo Done.
151       
152authorisation_service_tmpl_clean:
153        @-echo Clearing Authorisation Service template ...
154        rm -rf ${AUTHZ_SERVICE_DEST_DIR}
155
156
157# Attribute Service Template
158ATTR_SERVICE_DIRNAME = attributeservice/
159ATTR_SERVICE_SRC_DIR = ${TEST_CONFIG_SRC_DIR}attributeauthority/sitea/
160ATTR_SERVICE_STATIC_CONTENT_SRC_DIR = ${ATTR_SERVICE_SRC_DIR}public/
161ATTR_SERVICE_SRC_INI_FILENAME = site-a.ini
162ATTR_SERVICE_SRC_INI_FILEPATH = ${ATTR_SERVICE_SRC_DIR}${ATTR_SERVICE_SRC_INI_FILENAME}
163ATTR_SERVICE_DEST_DIR = ${DEST_DIR}${ATTR_SERVICE_DIRNAME}
164ATTR_SERVICE_INI_FILENAME = attribute-service.ini
165ATTR_SERVICE_INI_FILEPATH_TMP = ${ATTR_SERVICE_DEST_DIR}${ATTR_SERVICE_INI_FILENAME}
166ATTR_SERVICE_INI_TMPL_FILEPATH = ${ATTR_SERVICE_INI_FILEPATH_TMP}_tmpl
167ATTR_SERVICE_STATIC_CONTENT_DEST_DIR = ${ATTR_SERVICE_DEST_DIR}public/
168ATTR_SERVICE_PKI_DEST_DIR = ${ATTR_SERVICE_DEST_DIR}pki/
169ATTR_SERVICE_CA_DEST_DIR = ${ATTR_SERVICE_PKI_DEST_DIR}ca/
170
171
172attribute_service_tmpl:
173        @-echo Preparing Attribute Service template ...
174        @-echo
175        @-echo Copying test ini file ...
176        -mkdir ${ATTR_SERVICE_DEST_DIR}
177        cp -r ${ATTR_SERVICE_SRC_INI_FILEPATH} ${ATTR_SERVICE_INI_FILEPATH_TMP}
178        @-echo Making substitutions for template variables ...
179        sed -e s/'# Description:.*'/'# Description: Paster ini file for SAML Attribute Service'/ \
180        -e s/'dbConnectionString = .*'/'dbConnectionString = sqlite:\/\/\/%(here)s\/user.db'/ \
181        -e s/'port = .*'/'port = %%\{portNumber}'/ \
182        -e s/'saml\.soapbinding\.mountPath.*'/'saml.soapbinding.mountPath = %%\{mountPath\}'/ \
183        -e s/'saml\.soapbinding\.issuerName.*'/'saml.soapbinding.issuerName = %%\{issuerName}'/ \
184        -e s/'saml\.soapbinding\.issuerFormat.*'/'saml\.soapbinding\.issuerFormat = %%\{issuerFormat}'/ \
185        -e s/\(os\.path\.join\(\'%\(here\)s\'/\(os.path.join\(\'%%\{outputDir}\',\ \'log\'/ \
186        ${ATTR_SERVICE_INI_FILEPATH_TMP} > ${ATTR_SERVICE_INI_TMPL_FILEPATH}
187        rm -f ${ATTR_SERVICE_INI_FILEPATH_TMP}
188        @-echo
189        @-echo Copying static content directories and files ...
190        cp -r ${ATTR_SERVICE_STATIC_CONTENT_SRC_DIR} ${ATTR_SERVICE_STATIC_CONTENT_DEST_DIR}
191        @-echo Create PKI directory and copying files ...
192        -mkdir ${ATTR_SERVICE_PKI_DEST_DIR}
193        cp ${SERVER_CERT_SRC_FILEPATH} ${ATTR_SERVICE_PKI_DEST_DIR}
194        cp ${SERVER_KEY_SRC_FILEPATH} ${ATTR_SERVICE_PKI_DEST_DIR}
195        -mkdir ${ATTR_SERVICE_CA_DEST_DIR}
196        cp ${CA_SRC_DIR}* ${ATTR_SERVICE_CA_DEST_DIR}
197        @-echo Make log directory ...
198        -mkdir ${ATTR_SERVICE_DEST_DIR}log
199        @-echo Copying test SQLite user database ...
200        cp ${USERDB_FILEPATH} ${ATTR_SERVICE_DEST_DIR}
201        @-echo Clear out SVN directories ...
202        @-find ${ATTR_SERVICE_DEST_DIR} -name ".svn" -print | xargs /bin/rm -rf
203        @-echo
204        @-echo Done.
205       
206attribute_service_tmpl_clean:
207        @-echo Clearing Attribute Service template ...
208        rm -rf ${ATTR_SERVICE_DEST_DIR}
209       
210
211# Settings to create OpenID Provider template
212OP_DIRNAME = openidprovider/
213OP_SRC_DIR = ${INTEGRATION_TEST_DIR}${OP_DIRNAME}
214OP_DEST_DIR = ${DEST_DIR}${OP_DIRNAME}
215OP_INI_FILENAME = service.ini
216OP_INI_FILEPATH_TMP = ${OP_DEST_DIR}openidprovider.ini
217OP_INI_TMPL_FILEPATH = ${OP_DEST_DIR}${OP_INI_FILENAME}_tmpl
218OP_PKI_DEST_DIR = ${OP_DEST_DIR}pki/
219OP_CA_DEST_DIR = ${OP_PKI_DEST_DIR}ca/
220OP_CONFIG_FILES = templates openidprovider.ini public
221OP_TMPL_DIR = ${OP_DEST_DIR}templates/
222OP_SERVER_YADIS_TMPL_FILEPATH_TMP = ${OP_TMPL_DIR}serveryadis.xml
223OP_SERVER_YADIS_TMPL_FILEPATH = ${OP_SERVER_YADIS_TMPL_FILEPATH_TMP}_tmpl
224OP_YADIS_TMPL_FILEPATH_TMP = ${OP_TMPL_DIR}yadis.xml
225OP_YADIS_TMPL_FILEPATH = ${OP_YADIS_TMPL_FILEPATH_TMP}_tmpl
226
227
228openidprovider_tmpl:
229        @-echo Preparing OpenID Provider template ...
230        @-echo
231        @-echo Copying templates, CSS and graphics and ini file ...
232        mkdir ${OP_DEST_DIR}
233        mkdir ${OP_DEST_DIR}log
234        @-echo Copying files ...
235        for i in ${OP_CONFIG_FILES} ; do \
236                cp -r ${OP_SRC_DIR}$$i ${OP_DEST_DIR}; \
237        done ;
238        @-echo Making substitutions for template variables ...
239        sed -e s/'portNum = .*'/'portNum = %%\{portNumber}'/ \
240        -e s/'baseURI =.*'/'baseURI = %%\{baseURI}'/ \
241        -e s/'testConfigDir = %(here)s\/\.\.\/\.\.\/config'// \
242        -e s/testConfigDir/here/g \
243        -e s/'# Revision:.*'// \
244        -e s/'beaker.session.secret =.*'/'beaker.session.secret = %%\{beakerSessionCookieSecret}'/ \
245        -e s/\(os\.path\.join\(\'%\(here\)s\'/\(os.path.join\(\'%%\{outputDir}\'/ \
246        ${OP_INI_FILEPATH_TMP} > ${OP_INI_TMPL_FILEPATH}
247        rm -f ${OP_INI_FILEPATH_TMP}
248        @-echo Making substitutions for Yadis templates ...
249        sed -r -e /'<Service priority=\"(1|19|30|20)\">'/,/'<XRD>'/d \
250        -e s/'<XRD>'/'%%\{serveryadisExtraXrdEntries}\n    <XRD>'/ \
251                ${OP_SERVER_YADIS_TMPL_FILEPATH_TMP} > \
252                ${OP_SERVER_YADIS_TMPL_FILEPATH}
253        rm -f ${OP_SERVER_YADIS_TMPL_FILEPATH_TMP}
254        sed -r -e /'<Service priority=\"(1|19|30|20)\">'/,/'<XRD>'/d \
255        -e s/'<XRD>'/'%%\{yadisExtraXrdEntries}\n    <XRD>'/ \
256                ${OP_YADIS_TMPL_FILEPATH_TMP} > \
257                ${OP_YADIS_TMPL_FILEPATH}
258        rm -f ${OP_YADIS_TMPL_FILEPATH_TMP}
259        @-echo
260        @-echo
261        @-echo Copying test SQLite user database ...
262        cp ${USERDB_FILEPATH} ${OP_DEST_DIR}
263        @-echo
264        @-echo Create PKI directory and copying files ...
265        -mkdir ${OP_PKI_DEST_DIR}
266        cp ${SERVER_CERT_SRC_FILEPATH} ${OP_PKI_DEST_DIR}
267        cp ${SERVER_KEY_SRC_FILEPATH} ${OP_PKI_DEST_DIR}
268        -mkdir ${OP_CA_DEST_DIR}
269        cp ${CA_SRC_DIR}* ${OP_CA_DEST_DIR}
270        @-echo Clear out SVN directories ...
271        @-find ${OP_DEST_DIR} -name ".svn" -print | xargs /bin/rm -rf
272        @-echo
273        @-echo Done.
274       
275openidprovider_tmpl_clean:
276        @-echo Clearing OpenID Provider template ...
277        rm -rf ${OP_DEST_DIR}
278
279       
280clean: service_tmpl_clean authorisation_service_tmpl_clean \
281                attribute_service_tmpl_clean openidprovider_tmpl_clean
282
Note: See TracBrowser for help on using the repository browser.