1 | /** |
---|
2 | * Application Configuration |
---|
3 | * |
---|
4 | * @author Jeroen Wesbeek |
---|
5 | * @since 20100520 |
---|
6 | * |
---|
7 | * Revision information: |
---|
8 | * $Rev: 985 $ |
---|
9 | * $Author: robert@isdat.nl $ |
---|
10 | * $Date: 2010-10-25 13:28:44 +0000 (ma, 25 okt 2010) $ |
---|
11 | */ |
---|
12 | |
---|
13 | // locations to search for config files that get merged into the main config |
---|
14 | // config files can either be Java properties files or ConfigSlurper scripts |
---|
15 | |
---|
16 | // grails.config.locations = [ "classpath:${appName}-config.properties", |
---|
17 | // "classpath:${appName}-config.groovy", |
---|
18 | // "file:${userHome}/.grails/${appName}-config.properties", |
---|
19 | // "file:${userHome}/.grails/${appName}-config.groovy"] |
---|
20 | |
---|
21 | // if(System.properties["${appName}.config.location"]) { |
---|
22 | // grails.config.locations << "file:" + System.properties["${appName}.config.location"] |
---|
23 | // } |
---|
24 | grails.mime.file.extensions = true // enables the parsing of file extensions from URLs into the request format |
---|
25 | grails.mime.use.accept.header = false |
---|
26 | grails.mime.types = [ html: ['text/html','application/xhtml+xml'], |
---|
27 | xml: ['text/xml', 'application/xml'], |
---|
28 | text: 'text/plain', |
---|
29 | js: 'text/javascript', |
---|
30 | rss: 'application/rss+xml', |
---|
31 | atom: 'application/atom+xml', |
---|
32 | css: 'text/css', |
---|
33 | csv: 'text/csv', |
---|
34 | all: '*/*', |
---|
35 | json: ['application/json','text/json'], |
---|
36 | form: 'application/x-www-form-urlencoded', |
---|
37 | multipartForm: 'multipart/form-data' |
---|
38 | ] |
---|
39 | // The default codec used to encode data with ${} |
---|
40 | grails.views.default.codec="none" // none, html, base64 |
---|
41 | grails.views.gsp.encoding="UTF-8" |
---|
42 | grails.converters.encoding="UTF-8" |
---|
43 | |
---|
44 | // enabled native2ascii conversion of i18n properties files |
---|
45 | grails.enable.native2ascii = true |
---|
46 | |
---|
47 | // set per-environment serverURL stem for creating absolute links |
---|
48 | environments { |
---|
49 | production { |
---|
50 | grails.serverURL = "http://gscf.nmcdsp.org" |
---|
51 | } |
---|
52 | development { |
---|
53 | grails.serverURL = "http://localhost:8080/${appName}" |
---|
54 | } |
---|
55 | test { |
---|
56 | grails.serverURL = "http://localhost:8080/${appName}" |
---|
57 | } |
---|
58 | |
---|
59 | } |
---|
60 | |
---|
61 | // log4j configuration |
---|
62 | log4j = { |
---|
63 | // Example of changing the log pattern for the default console |
---|
64 | // appender: |
---|
65 | // |
---|
66 | //appenders { |
---|
67 | // console name:'stdout', layout:pattern(conversionPattern: '%c{2} %m%n') |
---|
68 | //} |
---|
69 | |
---|
70 | error 'org.codehaus.groovy.grails.web.servlet', // controllers |
---|
71 | 'org.codehaus.groovy.grails.web.pages', // GSP |
---|
72 | 'org.codehaus.groovy.grails.web.sitemesh', // layouts |
---|
73 | 'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping |
---|
74 | 'org.codehaus.groovy.grails.web.mapping', // URL mapping |
---|
75 | 'org.codehaus.groovy.grails.commons', // core / classloading |
---|
76 | 'org.codehaus.groovy.grails.plugins', // plugins |
---|
77 | 'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration |
---|
78 | 'org.springframework', |
---|
79 | 'org.hibernate' |
---|
80 | |
---|
81 | warn 'org.mortbay.log' |
---|
82 | } |
---|
83 | |
---|
84 | graphviz { |
---|
85 | // graphviz installation path is dependent on OS |
---|
86 | // (requirement for class diagram plugin) |
---|
87 | switch (System.properties["os.name"]) { |
---|
88 | case "Mac OS X": |
---|
89 | // define mac path to Graphviz dot executable |
---|
90 | // (install using macports: sudo port install graphviz) |
---|
91 | dot.executable = "/opt/local/bin/dot" |
---|
92 | break |
---|
93 | default: |
---|
94 | // assume the linux default path |
---|
95 | dot.executable = "/usr/bin/dot" |
---|
96 | } |
---|
97 | } |
---|
98 | |
---|
99 | // cryptography settings |
---|
100 | // @see WizardTaglib.groovy (encrypt) |
---|
101 | // @see TemplateEditorController.groovy (decrypt) |
---|
102 | crypto { |
---|
103 | shared.secret = "U73reG*mE^\$t@7s!e%" |
---|
104 | } |
---|
105 | |
---|
106 | // GSCF specific configuration |
---|
107 | gscf { |
---|
108 | domain = [ |
---|
109 | // importable entities |
---|
110 | // use: grailsApplication.config.gscf.domain.entities |
---|
111 | entities: [ |
---|
112 | // dbnp.data |
---|
113 | 'dbnp.data.FeatureBase', |
---|
114 | 'dbnp.data.FeatureType', |
---|
115 | 'dbnp.data.Ontology', |
---|
116 | 'dbnp.data.Term', |
---|
117 | |
---|
118 | // dbnp.studycapturing |
---|
119 | 'dbnp.studycapturing.Assay', |
---|
120 | 'dbnp.studycapturing.AssayModule', |
---|
121 | 'dbnp.studycapturing.AssayType', |
---|
122 | 'dbnp.studycapturing.Compound', |
---|
123 | 'dbnp.studycapturing.Event', |
---|
124 | 'dbnp.studycapturing.EventGroup', |
---|
125 | 'dbnp.studycapturing.Person', |
---|
126 | 'dbnp.studycapturing.PersonAffilitation', |
---|
127 | 'dbnp.studycapturing.PersonRole', |
---|
128 | 'dbnp.studycapturing.Publication', |
---|
129 | 'dbnp.studycapturing.Sample', |
---|
130 | 'dbnp.studycapturing.SamplingEvent', |
---|
131 | 'dbnp.studycapturing.Study', |
---|
132 | 'dbnp.studycapturing.StudyPerson', |
---|
133 | 'dbnp.studycapturing.Subject', |
---|
134 | 'dbnp.studycapturing.Template', |
---|
135 | 'dbnp.studycapturing.TemplateEntity', |
---|
136 | 'dbnp.studycapturing.TemplateField', |
---|
137 | 'dbnp.studycapturing.TemplateFieldListItem', |
---|
138 | 'dbnp.studycapturing.TemplateFieldType' |
---|
139 | ], |
---|
140 | |
---|
141 | // importable entities |
---|
142 | // use: grailsApplication.config.gscf.domain.importableEntities |
---|
143 | // @see ImporterController |
---|
144 | importableEntities: [ |
---|
145 | event : [name: 'Event', entity:'dbnp.studycapturing.Event'], |
---|
146 | sample : [name: 'Sample', entity: 'dbnp.studycapturing.Sample'], |
---|
147 | study : [name: 'Study', entity: 'dbnp.studycapturing.Study'], |
---|
148 | subject : [name: 'Subject', entity: 'dbnp.studycapturing.Subject'], |
---|
149 | samplingevent : [name: 'SamplingEvent', entity: 'dbnp.studycapturing.SamplingEvent'] |
---|
150 | |
---|
151 | ] |
---|
152 | ] |
---|
153 | } |
---|
154 | |
---|
155 | // jquery plugin |
---|
156 | grails.views.javascript.library="jquery" |
---|
157 | |
---|
158 | // Needed for the Spring Security Core plugin: |
---|
159 | grails.plugins.springsecurity.userLookup.userDomainClassName = 'dbnp.authentication.SecUser' |
---|
160 | grails.plugins.springsecurity.userLookup.authorityJoinClassName = 'dbnp.authentication.SecUserSecRole' |
---|
161 | grails.plugins.springsecurity.authority.className = 'dbnp.authentication.SecRole' |
---|
162 | grails.plugins.springsecurity.password.algorithm = 'SHA-256' |
---|
163 | grails.plugins.springsecurity.password.encodeHashAsBase64 = true |
---|
164 | grails.plugins.springsecurity.dao.reflectionSaltSourceProperty = 'username' // Use the persons username as salt for encryption |
---|
165 | grails.plugins.springsecurity.securityConfigType = grails.plugins.springsecurity.SecurityConfigType.Annotation |
---|
166 | grails.plugins.springsecurity.successHandler.targetUrlParameter = 'spring-security-redirect' |
---|
167 | |
---|
168 | // Needed for the (copy of) the Spring Security UI plugin |
---|
169 | grails.plugins.springsecurity.ui.forgotPassword.emailFrom = 'gscf@dbnp.org' |
---|
170 | grails.plugins.springsecurity.ui.forgotPassword.emailSubject = 'Password reset GSCF' |
---|
171 | |
---|
172 | // Make sure the different controllers provided by springsecurity.ui are only accessible by administrators |
---|
173 | // NB: the RegisterController is used for forgotten passwords. It should be accessible by anyone |
---|
174 | grails.plugins.springsecurity.controllerAnnotations.staticRules = [ |
---|
175 | '/user/**': ['ROLE_ADMIN'], |
---|
176 | '/role/**': ['ROLE_ADMIN'], |
---|
177 | '/aclclass/**': ['ROLE_ADMIN'], |
---|
178 | '/aclentry/**': ['ROLE_ADMIN'], |
---|
179 | '/aclobjectidentity/**': ['ROLE_ADMIN'], |
---|
180 | '/aclsid/**': ['ROLE_ADMIN'], |
---|
181 | '/persistentlogin/**': ['ROLE_ADMIN'], |
---|
182 | '/registrationcode/**': ['ROLE_ADMIN'], |
---|
183 | '/requestmap/**': ['ROLE_ADMIN'], |
---|
184 | '/securityinfo/**': ['ROLE_ADMIN'] |
---|
185 | ] |
---|
186 | |
---|
187 | |
---|
188 | // Needed for sending emails |
---|
189 | grails { |
---|
190 | mail { |
---|
191 | host = "smtp.gmail.com" |
---|
192 | port = 465 |
---|
193 | username = "gscfproject@gmail.com" |
---|
194 | password = "gscf2010" |
---|
195 | props = [ |
---|
196 | "mail.smtp.auth":"true", |
---|
197 | "mail.smtp.socketFactory.port": '465', |
---|
198 | "mail.smtp.socketFactory.class": "javax.net.ssl.SSLSocketFactory", |
---|
199 | "mail.smtp.socketFactory.fallback": "false" |
---|
200 | ] |
---|
201 | } |
---|
202 | } |
---|
203 | |
---|
204 | // The OAuth consumer key and secret variables are currently replaced by Jeroen's Continuous Integration script. |
---|
205 | // These keys were requested by me (Tjeerd) from myExperiment. |
---|
206 | oauth { |
---|
207 | myExperiment { |
---|
208 | requestTokenUrl = 'http://www.myexperiment.org/oauth/request_token' |
---|
209 | accessTokenUrl = 'http://www.myexperiment.org/oauth/access_token' |
---|
210 | authUrl = 'http://www.myexperiment.org/oauth/authorize' |
---|
211 | scope = 'http://example.com/oauth/feed/api/' // Optional - currently required by the Google GData APIs |
---|
212 | consumer.key = '$oauthkey$' |
---|
213 | consumer.secret = '$oauthsecret$' |
---|
214 | } |
---|
215 | } |
---|
216 | |
---|