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: 1469 $ |
---|
12 | * $Author: work@osx.eu $ |
---|
13 | * $Date: 2011-02-01 16:33:41 +0000 (di, 01 feb 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 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 | |
---|
28 | grails.mime.file.extensions = true // enables the parsing of file extensions from URLs into the request format |
---|
29 | grails.mime.use.accept.header = false |
---|
30 | grails.mime.types = [html: ['text/html', 'application/xhtml+xml'], |
---|
31 | xml: ['text/xml', 'application/xml'], |
---|
32 | text: 'text/plain', |
---|
33 | js: 'text/javascript', |
---|
34 | rss: 'application/rss+xml', |
---|
35 | atom: 'application/atom+xml', |
---|
36 | css: 'text/css', |
---|
37 | csv: 'text/csv', |
---|
38 | all: '*/*', |
---|
39 | json: ['application/json', 'text/json'], |
---|
40 | form: 'application/x-www-form-urlencoded', |
---|
41 | multipartForm: 'multipart/form-data' |
---|
42 | ] |
---|
43 | // The default codec used to encode data with ${} |
---|
44 | grails.views.default.codec = "none" // none, html, base64 |
---|
45 | grails.views.gsp.encoding = "UTF-8" |
---|
46 | grails.converters.encoding = "UTF-8" |
---|
47 | |
---|
48 | // enabled native2ascii conversion of i18n properties files |
---|
49 | grails.enable.native2ascii = true |
---|
50 | |
---|
51 | // log4j configuration |
---|
52 | log4j = { |
---|
53 | // Example of changing the log pattern for the default console |
---|
54 | // appender: |
---|
55 | // |
---|
56 | //appenders { |
---|
57 | // console name:'stdout', layout:pattern(conversionPattern: '%c{2} %m%n') |
---|
58 | //} |
---|
59 | |
---|
60 | // info "grails.app" |
---|
61 | |
---|
62 | error 'org.codehaus.groovy.grails.web.servlet', // controllers |
---|
63 | 'org.codehaus.groovy.grails.web.pages', // GSP |
---|
64 | 'org.codehaus.groovy.grails.web.sitemesh', // layouts |
---|
65 | 'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping |
---|
66 | 'org.codehaus.groovy.grails.web.mapping', // URL mapping |
---|
67 | 'org.codehaus.groovy.grails.commons', // core / classloading |
---|
68 | 'org.codehaus.groovy.grails.plugins', // plugins |
---|
69 | 'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration |
---|
70 | 'org.springframework', |
---|
71 | 'org.hibernate' |
---|
72 | |
---|
73 | error stdout:"StackTrace" |
---|
74 | |
---|
75 | warn 'org.mortbay.log' |
---|
76 | |
---|
77 | //info 'org.codehaus.groovy.grails.web.servlet', |
---|
78 | // 'org.codehaus.groovy.grails.plugins' |
---|
79 | // |
---|
80 | //debug 'org.codehaus.groovy.grails.plugins' |
---|
81 | } |
---|
82 | |
---|
83 | graphviz { |
---|
84 | // graphviz installation path is dependent on OS |
---|
85 | // (requirement for class diagram plugin) |
---|
86 | switch (System.properties["os.name"]) { |
---|
87 | case "Mac OS X": |
---|
88 | // define mac path to Graphviz dot executable |
---|
89 | // (install using macports: sudo port install graphviz) |
---|
90 | dot.executable = "/opt/local/bin/dot" |
---|
91 | break |
---|
92 | default: |
---|
93 | // assume the linux default path |
---|
94 | dot.executable = "/usr/bin/dot" |
---|
95 | } |
---|
96 | } |
---|
97 | |
---|
98 | // jquery plugin |
---|
99 | grails.views.javascript.library = "jquery" |
---|
100 | |
---|
101 | // Needed for the Spring Security Core plugin: |
---|
102 | grails.plugins.springsecurity.userLookup.userDomainClassName = 'dbnp.authentication.SecUser' |
---|
103 | grails.plugins.springsecurity.userLookup.authorityJoinClassName = 'dbnp.authentication.SecUserSecRole' |
---|
104 | grails.plugins.springsecurity.authority.className = 'dbnp.authentication.SecRole' |
---|
105 | grails.plugins.springsecurity.password.algorithm = 'SHA-256' |
---|
106 | grails.plugins.springsecurity.password.encodeHashAsBase64 = true |
---|
107 | grails.plugins.springsecurity.dao.reflectionSaltSourceProperty = 'username' // Use the persons username as salt for encryption |
---|
108 | grails.plugins.springsecurity.securityConfigType = grails.plugins.springsecurity.SecurityConfigType.Annotation |
---|
109 | grails.plugins.springsecurity.successHandler.targetUrlParameter = 'spring-security-redirect' |
---|
110 | |
---|
111 | // Needed for the (copy of) the Spring Security UI plugin |
---|
112 | grails.plugins.springsecurity.ui.forgotPassword.emailFrom = 'gscf@dbnp.org' |
---|
113 | grails.plugins.springsecurity.ui.forgotPassword.emailSubject = 'Password reset GSCF' |
---|
114 | |
---|
115 | // Make sure the different controllers provided by springsecurity.ui are only accessible by administrators |
---|
116 | // NB: the RegisterController is used for forgotten passwords. It should be accessible by anyone |
---|
117 | grails.plugins.springsecurity.controllerAnnotations.staticRules = [ |
---|
118 | '/user/**': ['ROLE_ADMIN'], |
---|
119 | '/role/**': ['ROLE_ADMIN'], |
---|
120 | '/aclclass/**': ['ROLE_ADMIN'], |
---|
121 | '/aclentry/**': ['ROLE_ADMIN'], |
---|
122 | '/aclobjectidentity/**': ['ROLE_ADMIN'], |
---|
123 | '/aclsid/**': ['ROLE_ADMIN'], |
---|
124 | '/persistentlogin/**': ['ROLE_ADMIN'], |
---|
125 | '/registrationcode/**': ['ROLE_ADMIN'], |
---|
126 | '/requestmap/**': ['ROLE_ADMIN'], |
---|
127 | '/securityinfo/**': ['ROLE_ADMIN'] |
---|
128 | ] |
---|