1 | /** |
---|
2 | * Application Configuration |
---|
3 | * |
---|
4 | * @author Jeroen Wesbeek |
---|
5 | * @since 20100520 |
---|
6 | * |
---|
7 | * Revision information: |
---|
8 | * $Rev: 1658 $ |
---|
9 | * $Author: t.w.abma@umcutrecht.nl $ |
---|
10 | * $Date: 2011-03-22 15:33:49 +0000 (di, 22 mrt 2011) $ |
---|
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 = [ |
---|
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 | |
---|
29 | grails.mime.file.extensions = true // enables the parsing of file extensions from URLs into the request format |
---|
30 | grails.mime.use.accept.header = false |
---|
31 | grails.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 ${} |
---|
45 | grails.views.default.codec = "none" // none, html, base64 |
---|
46 | grails.views.gsp.encoding = "UTF-8" |
---|
47 | grails.converters.encoding = "UTF-8" |
---|
48 | |
---|
49 | // enabled native2ascii conversion of i18n properties files |
---|
50 | grails.enable.native2ascii = true |
---|
51 | |
---|
52 | // log4j configuration |
---|
53 | log4j = { |
---|
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 | |
---|
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 | // jquery plugin |
---|
100 | grails.views.javascript.library = "jquery" |
---|
101 | |
---|
102 | // Needed for the Spring Security Core plugin: |
---|
103 | grails.plugins.springsecurity.userLookup.userDomainClassName = 'dbnp.authentication.SecUser' |
---|
104 | grails.plugins.springsecurity.userLookup.authorityJoinClassName = 'dbnp.authentication.SecUserSecRole' |
---|
105 | grails.plugins.springsecurity.authority.className = 'dbnp.authentication.SecRole' |
---|
106 | grails.plugins.springsecurity.password.algorithm = 'SHA-256' |
---|
107 | grails.plugins.springsecurity.password.encodeHashAsBase64 = true |
---|
108 | grails.plugins.springsecurity.dao.reflectionSaltSourceProperty = 'username' // Use the persons username as salt for encryption |
---|
109 | grails.plugins.springsecurity.securityConfigType = grails.plugins.springsecurity.SecurityConfigType.Annotation |
---|
110 | grails.plugins.springsecurity.successHandler.targetUrlParameter = 'spring-security-redirect' |
---|
111 | |
---|
112 | // Needed for the (copy of) the Spring Security UI plugin |
---|
113 | grails.plugins.springsecurity.ui.forgotPassword.emailFrom = 'gscf@dbnp.org' |
---|
114 | grails.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 |
---|
118 | grails.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 |
---|
135 | if (GrailsUtil.Environment.current == Environment.TEST) { |
---|
136 | uploads.uploadDir = "webtestfiles" |
---|
137 | } else |
---|
138 | if (GrailsUtil.Environment.current == Environment.DEVELOPMENT) { |
---|
139 | uploads.uploadDir = (new File("/tmp")?.canWrite()) ? "/tmp" : "fileuploads" |
---|
140 | } |
---|