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