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

Revision 1661, 5.1 KB (checked in by work@…, 3 years ago)

- partly reverted the previous change (else instead of else if)

  • Property svn:keywords set to Rev Author Date
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//
16grails.config.locations = [
17        // the default per-environment configuration
18        // (e.g. src/java/config-development.properties)
19        "classpath:config-${grails.util.GrailsUtil.environment}.properties",
20
21        // the external configuration to override the default
22        // configuration (e.g. ~/.grails-config/ci-gscf.properties)
23        "file:${userHome}/.grails-config/${grails.util.GrailsUtil.environment}-${appName}.properties",
24
25        // or in /etc/gscf/ (e.g. /etc/gscf/ci.properties)
26        "file:/etc/${appName}/${grails.util.GrailsUtil.environment}.properties"
27]
28
29grails.mime.file.extensions = true // enables the parsing of file extensions from URLs into the request format
30grails.mime.use.accept.header = false
31grails.mime.types = [html: ['text/html', 'application/xhtml+xml'],
32        xml: ['text/xml', 'application/xml'],
33        text: 'text/plain',
34        js: 'text/javascript',
35        rss: 'application/rss+xml',
36        atom: 'application/atom+xml',
37        css: 'text/css',
38        csv: 'text/csv',
39        all: '*/*',
40        json: ['application/json', 'text/json'],
41        form: 'application/x-www-form-urlencoded',
42        multipartForm: 'multipart/form-data'
43]
44// The default codec used to encode data with ${}
45grails.views.default.codec = "none" // none, html, base64
46grails.views.gsp.encoding = "UTF-8"
47grails.converters.encoding = "UTF-8"
48
49// enabled native2ascii conversion of i18n properties files
50grails.enable.native2ascii = true
51
52// log4j configuration
53log4j = {
54        // Example of changing the log pattern for the default console
55        // appender:
56        //
57        //appenders {
58        //    console name:'stdout', layout:pattern(conversionPattern: '%c{2} %m%n')
59        //}
60       
61        // info "grails.app"
62
63        error 'org.codehaus.groovy.grails.web.servlet',  //  controllers
64                'org.codehaus.groovy.grails.web.pages', //  GSP
65                'org.codehaus.groovy.grails.web.sitemesh', //  layouts
66                'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping
67                'org.codehaus.groovy.grails.web.mapping', // URL mapping
68                'org.codehaus.groovy.grails.commons', // core / classloading
69                'org.codehaus.groovy.grails.plugins', // plugins
70                'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration
71                'org.springframework',
72                'org.hibernate'
73
74    error stdout:"StackTrace"
75
76        warn 'org.mortbay.log'
77
78        //info 'org.codehaus.groovy.grails.web.servlet',
79        //       'org.codehaus.groovy.grails.plugins'
80        //
81        //debug 'org.codehaus.groovy.grails.plugins'
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// jquery plugin
100grails.views.javascript.library = "jquery"
101
102// Needed for the Spring Security Core plugin:
103grails.plugins.springsecurity.userLookup.userDomainClassName = 'dbnp.authentication.SecUser'
104grails.plugins.springsecurity.userLookup.authorityJoinClassName = 'dbnp.authentication.SecUserSecRole'
105grails.plugins.springsecurity.authority.className = 'dbnp.authentication.SecRole'
106grails.plugins.springsecurity.password.algorithm = 'SHA-256'
107grails.plugins.springsecurity.password.encodeHashAsBase64 = true
108grails.plugins.springsecurity.dao.reflectionSaltSourceProperty = 'username' // Use the persons username as salt for encryption
109grails.plugins.springsecurity.securityConfigType = grails.plugins.springsecurity.SecurityConfigType.Annotation
110grails.plugins.springsecurity.successHandler.targetUrlParameter = 'spring-security-redirect'
111
112// Needed for the (copy of) the Spring Security UI plugin
113grails.plugins.springsecurity.ui.forgotPassword.emailFrom = 'gscf@dbnp.org'
114grails.plugins.springsecurity.ui.forgotPassword.emailSubject = 'Password reset GSCF'
115
116// Make sure the different controllers provided by springsecurity.ui are only accessible by administrators
117// NB: the RegisterController is used for forgotten passwords. It should be accessible by anyone
118grails.plugins.springsecurity.controllerAnnotations.staticRules = [
119        '/user/**': ['ROLE_ADMIN'],
120        '/role/**': ['ROLE_ADMIN'],
121        '/aclclass/**': ['ROLE_ADMIN'],
122        '/aclentry/**': ['ROLE_ADMIN'],
123        '/aclobjectidentity/**': ['ROLE_ADMIN'],
124        '/aclsid/**': ['ROLE_ADMIN'],
125        '/persistentlogin/**': ['ROLE_ADMIN'],
126        '/registrationcode/**': ['ROLE_ADMIN'],
127        '/requestmap/**': ['ROLE_ADMIN'],
128        '/securityinfo/**': ['ROLE_ADMIN']
129]
130
131// Temporary directory to upload files to.
132// If the directory is given relative (e.g. 'fileuploads/temp'), it is taken relative to the web-app directory
133// Otherwise, it should be given as an absolute path (e.g. '/home/user/sequences')
134// The directory should be writable by the webserver user
135if (GrailsUtil.Environment.current == Environment.TEST) {
136    uploads.uploadDir = "webtestfiles"
137} else {
138    uploads.uploadDir = (new File("/tmp")?.canWrite()) ? "/tmp" : "fileuploads"   
139}
Note: See TracBrowser for help on using the browser.