source: trunk/grails-app/conf/Config.groovy @ 1741

Last change on this file since 1741 was 1741, checked in by work@…, 10 years ago
  • changed file upload definition logic
  • Property svn:keywords set to Rev Author Date
File size: 5.2 KB
Line 
1import org.codehaus.groovy.grails.commons.GrailsApplication
2
3/**
4 * Application Configuration
5 *
6 * @author Jeroen Wesbeek
7 * @since 20100520
8 *
9 * Revision information:
10 * $Rev: 1741 $
11 * $Author: work@osx.eu $
12 * $Date: 2011-04-11 08:55:28 +0000 (ma, 11 apr 2011) $
13 */
14
15// locations to search for config files that get merged into the main config
16// config files can either be Java properties files or ConfigSlurper scripts
17//
18grails.config.locations = [
19        // the default per-environment configuration
20        // (e.g. src/java/config-development.properties)
21        "classpath:config-${grails.util.GrailsUtil.environment}.properties",
22
23        // the external configuration to override the default
24        // configuration (e.g. ~/.grails-config/ci-gscf.properties)
25        "file:${userHome}/.grails-config/${grails.util.GrailsUtil.environment}-${appName}.properties",
26
27        // or in /etc/gscf/ (e.g. /etc/gscf/ci.properties)
28        "file:/etc/${appName}/${grails.util.GrailsUtil.environment}.properties"
29]
30
31grails.mime.file.extensions = true // enables the parsing of file extensions from URLs into the request format
32grails.mime.use.accept.header = false
33grails.mime.types = [html: ['text/html', 'application/xhtml+xml'],
34        xml: ['text/xml', 'application/xml'],
35        text: 'text/plain',
36        js: 'text/javascript',
37        rss: 'application/rss+xml',
38        atom: 'application/atom+xml',
39        css: 'text/css',
40        csv: 'text/csv',
41        all: '*/*',
42        json: ['application/json', 'text/json'],
43        form: 'application/x-www-form-urlencoded',
44        multipartForm: 'multipart/form-data'
45]
46// The default codec used to encode data with ${}
47grails.views.default.codec = "none" // none, html, base64
48grails.views.gsp.encoding = "UTF-8"
49grails.converters.encoding = "UTF-8"
50
51// enabled native2ascii conversion of i18n properties files
52grails.enable.native2ascii = true
53
54// log4j configuration
55log4j = {
56        // Example of changing the log pattern for the default console
57        // appender:
58        //
59        //appenders {
60        //    console name:'stdout', layout:pattern(conversionPattern: '%c{2} %m%n')
61        //}
62       
63        // info "grails.app"
64
65        error 'org.codehaus.groovy.grails.web.servlet',  //  controllers
66                'org.codehaus.groovy.grails.web.pages', //  GSP
67                'org.codehaus.groovy.grails.web.sitemesh', //  layouts
68                'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping
69                'org.codehaus.groovy.grails.web.mapping', // URL mapping
70                'org.codehaus.groovy.grails.commons', // core / classloading
71                'org.codehaus.groovy.grails.plugins', // plugins
72                'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration
73                'org.springframework',
74                'org.hibernate'
75
76    error stdout:"StackTrace"
77
78        warn 'org.mortbay.log'
79
80        //info 'org.codehaus.groovy.grails.web.servlet',
81        //       'org.codehaus.groovy.grails.plugins'
82        //
83        //debug 'org.codehaus.groovy.grails.plugins'
84}
85
86graphviz {
87        // graphviz installation path is dependent on OS
88        // (requirement for class diagram plugin)
89        switch (System.properties["os.name"]) {
90                case "Mac OS X":
91                        // define mac path to Graphviz dot executable
92                        // (install using macports: sudo port install graphviz)
93                        dot.executable = "/opt/local/bin/dot"
94                        break
95                default:
96                        // assume the linux default path
97                        dot.executable = "/usr/bin/dot"
98        }
99}
100
101// jquery plugin
102grails.views.javascript.library = "jquery"
103
104// Needed for the Spring Security Core plugin:
105grails.plugins.springsecurity.userLookup.userDomainClassName = 'dbnp.authentication.SecUser'
106grails.plugins.springsecurity.userLookup.authorityJoinClassName = 'dbnp.authentication.SecUserSecRole'
107grails.plugins.springsecurity.authority.className = 'dbnp.authentication.SecRole'
108grails.plugins.springsecurity.password.algorithm = 'SHA-256'
109grails.plugins.springsecurity.password.encodeHashAsBase64 = true
110grails.plugins.springsecurity.dao.reflectionSaltSourceProperty = 'username' // Use the persons username as salt for encryption
111grails.plugins.springsecurity.securityConfigType = grails.plugins.springsecurity.SecurityConfigType.Annotation
112grails.plugins.springsecurity.successHandler.targetUrlParameter = 'spring-security-redirect'
113
114// Needed for the (copy of) the Spring Security UI plugin
115grails.mail.default.from = 'gscf@dbnp.org'
116grails.plugins.springsecurity.ui.forgotPassword.emailFrom = 'gscf@dbnp.org'
117grails.plugins.springsecurity.ui.forgotPassword.emailSubject = 'Password reset GSCF'
118
119// Make sure the different controllers provided by springsecurity.ui are only accessible by administrators
120// NB: the RegisterController is used for forgotten passwords. It should be accessible by anyone
121grails.plugins.springsecurity.controllerAnnotations.staticRules = [
122        '/user/**': ['ROLE_ADMIN'],
123        '/role/**': ['ROLE_ADMIN'],
124        '/aclclass/**': ['ROLE_ADMIN'],
125        '/aclentry/**': ['ROLE_ADMIN'],
126        '/aclobjectidentity/**': ['ROLE_ADMIN'],
127        '/aclsid/**': ['ROLE_ADMIN'],
128        '/persistentlogin/**': ['ROLE_ADMIN'],
129        '/registrationcode/**': ['ROLE_ADMIN'],
130        '/requestmap/**': ['ROLE_ADMIN'],
131        '/securityinfo/**': ['ROLE_ADMIN']
132]
133
134// Temporary directory to upload files to.
135// If the directory is given relative (e.g. 'fileuploads/temp'), it is taken relative to the web-app directory
136// Otherwise, it should be given as an absolute path (e.g. '/home/user/sequences')
137// The directory should be writable by the webserver user
138if (grails.util.GrailsUtil.environment == GrailsApplication.ENV_TEST) {
139    uploads.uploadDir = "webtestfiles"
140} else {
141    uploads.uploadDir = (new File("/tmp")?.canWrite()) ? "/tmp" : "fileuploads"   
142}
Note: See TracBrowser for help on using the repository browser.