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

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

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

  • Moved PasteDeployAppServer? class to ndg.security.server.utils.paste_utils module so that it can be included in scripts as part of the paster templates.
  • tidied and rationalised attribute and authorisation service scripts.
  • 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_FILES = ${AUTHZ_SERVICE_INI_FILENAME} pip-mapping.txt policy.xml \
124        public authorisationserviceapp.py
125AUTHZ_SERVICE_PKI_DEST_DIR = ${AUTHZ_SERVICE_DEST_DIR}pki/
126AUTHZ_SERVICE_CA_DEST_DIR = ${AUTHZ_SERVICE_PKI_DEST_DIR}ca/
127
128
129authorisation_service_tmpl:
130        @-echo Preparing Authorisation Service template ...
131        @-echo
132        @-echo Copying test ini file and other configuration files ...
133        mkdir ${AUTHZ_SERVICE_DEST_DIR}
134        for i in ${AUTHZ_SERVICE_FILES}; do \
135                cp -r ${AUTHZ_SERVICE_SRC_DIR}$$i ${AUTHZ_SERVICE_DEST_DIR} ; \
136        done ;
137        @-echo Making substitutions for template variables ...
138        sed -e s/'# Description:.*'/'# Description: Paster ini file for SAML\/XACML based Authorisation Service'/ \
139        -e s/'saml\.mountPath.*'/'saml.mountPath = %%\{mountPath\}'/ \
140        -e s/'samlIssuerName =.*'/'samlIssuerName = %%\{issuerName}'/ \
141        -e s/'samlIssuerFormat =.*'/'samlIssuerFormat = %%\{issuerFormat}'/ \
142        -e s/'testConfigDir = .*'// \
143        -e s/testConfigDir/here/g \
144        -e s/\(os\.path\.join\(\'%\(here\)s\'/\(os.path.join\(\'%%\{outputDir}\',\ \'log\'/ \
145        ${AUTHZ_SERVICE_INI_FILEPATH_TMP} > ${AUTHZ_SERVICE_INI_TMPL_FILEPATH}
146        rm -f ${AUTHZ_SERVICE_INI_FILEPATH_TMP}
147        @-echo
148        @-echo Make log directory ...
149        -mkdir ${AUTHZ_SERVICE_DEST_DIR}log
150        @-echo Create PKI directory and copying files ...
151        mkdir -p ${AUTHZ_SERVICE_CA_DEST_DIR}
152        cp ${SERVER_CERT_SRC_FILEPATH} ${AUTHZ_SERVICE_PKI_DEST_DIR}
153        cp ${SERVER_KEY_SRC_FILEPATH} ${AUTHZ_SERVICE_PKI_DEST_DIR}
154        cp ${CA_SRC_DIR}* ${AUTHZ_SERVICE_CA_DEST_DIR}
155        @-echo Clear out SVN directories ...
156        @-find ${AUTHZ_SERVICE_DEST_DIR} -name ".svn" -print | xargs /bin/rm -rf
157        @-echo
158        @-echo Done.
159       
160authorisation_service_tmpl_clean:
161        @-echo Clearing Authorisation Service template ...
162        rm -rf ${AUTHZ_SERVICE_DEST_DIR}
163
164
165# Attribute Service Template
166ATTR_SERVICE_DIRNAME = attributeservice/
167ATTR_SERVICE_SRC_DIR = ${TEST_CONFIG_SRC_DIR}attributeauthority/sitea/
168ATTR_SERVICE_DEST_DIR = ${DEST_DIR}${ATTR_SERVICE_DIRNAME}
169ATTR_SERVICE_INI_FILENAME = attribute-service.ini
170ATTR_SERVICE_INI_FILEPATH_TMP = ${ATTR_SERVICE_DEST_DIR}${ATTR_SERVICE_INI_FILENAME}
171ATTR_SERVICE_INI_TMPL_FILEPATH = ${ATTR_SERVICE_INI_FILEPATH_TMP}_tmpl
172ATTR_SERVICE_FILES = ${ATTR_SERVICE_INI_FILENAME} public attributeauthorityapp.py
173ATTR_SERVICE_STATIC_CONTENT_DEST_DIR = ${ATTR_SERVICE_DEST_DIR}public/
174ATTR_SERVICE_PKI_DEST_DIR = ${ATTR_SERVICE_DEST_DIR}pki/
175ATTR_SERVICE_CA_DEST_DIR = ${ATTR_SERVICE_PKI_DEST_DIR}ca/
176
177
178attribute_service_tmpl:
179        @-echo Preparing Attribute Service template ...
180        @-echo
181        -mkdir ${ATTR_SERVICE_DEST_DIR}
182        @-echo Copying content directories and files ...
183        for i in ${ATTR_SERVICE_FILES}; do \
184                cp -r ${ATTR_SERVICE_SRC_DIR}$$i ${ATTR_SERVICE_DEST_DIR} ; \
185        done ;
186        @-echo Making substitutions for template variables ...
187        sed -e s/'# Description:.*'/'# Description: Paster ini file for SAML Attribute Service'/ \
188        -e s/'dbConnectionString = .*'/'dbConnectionString = sqlite:\/\/\/%(here)s\/user.db'/ \
189        -e s/'port = .*'/'port = %%\{portNumber}'/ \
190        -e s/'saml\.soapbinding\.mountPath.*'/'saml.soapbinding.mountPath = %%\{mountPath\}'/ \
191        -e s/'saml\.soapbinding\.issuerName.*'/'saml.soapbinding.issuerName = %%\{issuerName}'/ \
192        -e s/'saml\.soapbinding\.issuerFormat.*'/'saml\.soapbinding\.issuerFormat = %%\{issuerFormat}'/ \
193        -e s/\(os\.path\.join\(\'%\(here\)s\'/\(os.path.join\(\'%%\{outputDir}\',\ \'log\'/ \
194        ${ATTR_SERVICE_INI_FILEPATH_TMP} > ${ATTR_SERVICE_INI_TMPL_FILEPATH}
195        rm -f ${ATTR_SERVICE_INI_FILEPATH_TMP}
196        @-echo
197        @-echo Create PKI directory and copying files ...
198        -mkdir ${ATTR_SERVICE_PKI_DEST_DIR}
199        cp ${SERVER_CERT_SRC_FILEPATH} ${ATTR_SERVICE_PKI_DEST_DIR}
200        cp ${SERVER_KEY_SRC_FILEPATH} ${ATTR_SERVICE_PKI_DEST_DIR}
201        -mkdir ${ATTR_SERVICE_CA_DEST_DIR}
202        cp ${CA_SRC_DIR}* ${ATTR_SERVICE_CA_DEST_DIR}
203        @-echo Make log directory ...
204        -mkdir ${ATTR_SERVICE_DEST_DIR}log
205        @-echo Copying test SQLite user database ...
206        cp ${USERDB_FILEPATH} ${ATTR_SERVICE_DEST_DIR}
207        @-echo Clear out SVN directories ...
208        @-find ${ATTR_SERVICE_DEST_DIR} -name ".svn" -print | xargs /bin/rm -rf
209        @-echo
210        @-echo Done.
211       
212attribute_service_tmpl_clean:
213        @-echo Clearing Attribute Service template ...
214        rm -rf ${ATTR_SERVICE_DEST_DIR}
215       
216
217# Settings to create OpenID Provider template
218OP_DIRNAME = openidprovider/
219OP_SRC_DIR = ${INTEGRATION_TEST_DIR}${OP_DIRNAME}
220OP_DEST_DIR = ${DEST_DIR}${OP_DIRNAME}
221OP_INI_FILENAME = service.ini
222OP_INI_FILEPATH_TMP = ${OP_DEST_DIR}openidprovider.ini
223OP_INI_TMPL_FILEPATH = ${OP_DEST_DIR}${OP_INI_FILENAME}_tmpl
224OP_PKI_DEST_DIR = ${OP_DEST_DIR}pki/
225OP_CA_DEST_DIR = ${OP_PKI_DEST_DIR}ca/
226OP_CONFIG_FILES = templates openidprovider.ini public
227OP_TMPL_DIR = ${OP_DEST_DIR}templates/
228OP_SERVER_YADIS_TMPL_FILEPATH_TMP = ${OP_TMPL_DIR}serveryadis.xml
229OP_SERVER_YADIS_TMPL_FILEPATH = ${OP_SERVER_YADIS_TMPL_FILEPATH_TMP}_tmpl
230OP_YADIS_TMPL_FILEPATH_TMP = ${OP_TMPL_DIR}yadis.xml
231OP_YADIS_TMPL_FILEPATH = ${OP_YADIS_TMPL_FILEPATH_TMP}_tmpl
232
233
234openidprovider_tmpl:
235        @-echo Preparing OpenID Provider template ...
236        @-echo
237        @-echo Copying templates, CSS and graphics and ini file ...
238        mkdir ${OP_DEST_DIR}
239        mkdir ${OP_DEST_DIR}log
240        @-echo Copying files ...
241        for i in ${OP_CONFIG_FILES} ; do \
242                cp -r ${OP_SRC_DIR}$$i ${OP_DEST_DIR}; \
243        done ;
244        @-echo Making substitutions for template variables ...
245        sed -e s/'portNum = .*'/'portNum = %%\{portNumber}'/ \
246        -e s/'baseURI =.*'/'baseURI = %%\{baseURI}'/ \
247        -e s/'testConfigDir = %(here)s\/\.\.\/\.\.\/config'// \
248        -e s/testConfigDir/here/g \
249        -e s/'# Revision:.*'// \
250        -e s/'beaker.session.secret =.*'/'beaker.session.secret = %%\{beakerSessionCookieSecret}'/ \
251        -e s/\(os\.path\.join\(\'%\(here\)s\'/\(os.path.join\(\'%%\{outputDir}\'/ \
252        ${OP_INI_FILEPATH_TMP} > ${OP_INI_TMPL_FILEPATH}
253        rm -f ${OP_INI_FILEPATH_TMP}
254        @-echo Making substitutions for Yadis templates ...
255        sed -r -e /'<Service priority=\"(1|19|30|20)\">'/,/'<XRD>'/d \
256        -e s/'<XRD>'/'%%\{serveryadisExtraXrdEntries}\n    <XRD>'/ \
257                ${OP_SERVER_YADIS_TMPL_FILEPATH_TMP} > \
258                ${OP_SERVER_YADIS_TMPL_FILEPATH}
259        rm -f ${OP_SERVER_YADIS_TMPL_FILEPATH_TMP}
260        sed -r -e /'<Service priority=\"(1|19|30|20)\">'/,/'<XRD>'/d \
261        -e s/'<XRD>'/'%%\{yadisExtraXrdEntries}\n    <XRD>'/ \
262                ${OP_YADIS_TMPL_FILEPATH_TMP} > \
263                ${OP_YADIS_TMPL_FILEPATH}
264        rm -f ${OP_YADIS_TMPL_FILEPATH_TMP}
265        @-echo
266        @-echo
267        @-echo Copying test SQLite user database ...
268        cp ${USERDB_FILEPATH} ${OP_DEST_DIR}
269        @-echo
270        @-echo Create PKI directory and copying files ...
271        -mkdir ${OP_PKI_DEST_DIR}
272        cp ${SERVER_CERT_SRC_FILEPATH} ${OP_PKI_DEST_DIR}
273        cp ${SERVER_KEY_SRC_FILEPATH} ${OP_PKI_DEST_DIR}
274        -mkdir ${OP_CA_DEST_DIR}
275        cp ${CA_SRC_DIR}* ${OP_CA_DEST_DIR}
276        @-echo Clear out SVN directories ...
277        @-find ${OP_DEST_DIR} -name ".svn" -print | xargs /bin/rm -rf
278        @-echo
279        @-echo Done.
280       
281openidprovider_tmpl_clean:
282        @-echo Clearing OpenID Provider template ...
283        rm -rf ${OP_DEST_DIR}
284
285       
286clean: service_tmpl_clean authorisation_service_tmpl_clean \
287                attribute_service_tmpl_clean openidprovider_tmpl_clean
288
Note: See TracBrowser for help on using the repository browser.