root/trunk/grails-app/conf/Config.groovy @ 976

Revision 976, 7.5 KB (checked in by robert@…, 4 years ago)

Authentication and authorization for studies is added, according to ticket 118

  • Property svn:keywords set to Author Date Rev
Line 
1/**
2 * Application Configuration
3 *
4 * @author  Jeroen Wesbeek
5 * @since       20100520
6 *
7 * Revision information:
8 * $Rev$
9 * $Author$
10 * $Date$
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// }
24grails.mime.file.extensions = true // enables the parsing of file extensions from URLs into the request format
25grails.mime.use.accept.header = false
26grails.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 ${}
40grails.views.default.codec="none" // none, html, base64
41grails.views.gsp.encoding="UTF-8"
42grails.converters.encoding="UTF-8"
43
44// enabled native2ascii conversion of i18n properties files
45grails.enable.native2ascii = true
46
47// set per-environment serverURL stem for creating absolute links
48environments {
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
62log4j = {
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
84graphviz {
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)
102crypto {
103        shared.secret = "U73reG*mE^\$t@7s!e%"
104}
105
106// GSCF specific configuration
107gscf {
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
156grails.views.javascript.library="jquery"
157
158// Needed for the Spring Security Core plugin:
159grails.plugins.springsecurity.userLookup.userDomainClassName = 'dbnp.authentication.SecUser'
160grails.plugins.springsecurity.userLookup.authorityJoinClassName = 'dbnp.authentication.SecUserSecRole'
161grails.plugins.springsecurity.authority.className = 'dbnp.authentication.SecRole'
162grails.plugins.springsecurity.password.algorithm = 'SHA-256'
163grails.plugins.springsecurity.password.encodeHashAsBase64 = true
164grails.plugins.springsecurity.dao.reflectionSaltSourceProperty = 'username' // Use the persons username as salt for encryption
165grails.plugins.springsecurity.securityConfigType = grails.plugins.springsecurity.SecurityConfigType.Annotation
166
167// Make sure the different controllers provided by springsecurity.ui are only accessible by administrators
168// NB: the RegisterController is used for forgotten passwords. It should be accessible by anyone
169grails.plugins.springsecurity.controllerAnnotations.staticRules = [
170    '/user/**': ['ROLE_ADMIN'],
171    '/role/**': ['ROLE_ADMIN'],
172    '/aclclass/**': ['ROLE_ADMIN'],
173    '/aclentry/**': ['ROLE_ADMIN'],
174    '/aclobjectidentity/**': ['ROLE_ADMIN'],
175    '/aclsid/**': ['ROLE_ADMIN'],
176    '/persistentlogin/**': ['ROLE_ADMIN'],
177    '/registrationcode/**': ['ROLE_ADMIN'],
178    '/requestmap/**': ['ROLE_ADMIN'],
179    '/securityinfo/**': ['ROLE_ADMIN']
180]
181
182
183// Needed for sending emails
184grails {
185    mail {
186        host = "smtp.gmail.com"
187        port = 465
188        username = "gscfproject@gmail.com"
189        password = "gscf2010"
190        props = [
191            "mail.smtp.auth":"true",
192            "mail.smtp.socketFactory.port": '465',
193            "mail.smtp.socketFactory.class": "javax.net.ssl.SSLSocketFactory",
194            "mail.smtp.socketFactory.fallback": "false"
195        ]
196    }
197}
198
199// The OAuth consumer key and secret variables are currently replaced by Jeroen's Continuous Integration script.
200// These keys were requested by me (Tjeerd) from myExperiment.
201oauth {
202        myExperiment {
203                requestTokenUrl = 'http://www.myexperiment.org/oauth/request_token'
204                accessTokenUrl = 'http://www.myexperiment.org/oauth/access_token'
205                authUrl = 'http://www.myexperiment.org/oauth/authorize'
206                scope = 'http://example.com/oauth/feed/api/' // Optional - currently required by the Google GData APIs
207                consumer.key = '$oauthkey$'
208                consumer.secret = '$oauthsecret$'
209        }
210}
211
Note: See TracBrowser for help on using the browser.