1 | import 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: 2181 $ |
---|
11 | * $Author: work@osx.eu $ |
---|
12 | * $Date: 2012-03-27 12:38:46 +0000 (di, 27 mrt 2012) $ |
---|
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 | // |
---|
18 | grails.config.locations = [ |
---|
19 | // the default configuration properties |
---|
20 | "classpath:default.properties", |
---|
21 | |
---|
22 | // the external configuration to override the default |
---|
23 | // configuration (e.g. ~/.gscf/ci.properties) |
---|
24 | "file:${userHome}/.${appName}/${grails.util.GrailsUtil.environment}.properties" |
---|
25 | ] |
---|
26 | |
---|
27 | grails.mime.file.extensions = true // enables the parsing of file extensions from URLs into the request format |
---|
28 | grails.mime.use.accept.header = false |
---|
29 | grails.mime.types = [html: ['text/html', 'application/xhtml+xml'], |
---|
30 | xml: ['text/xml', 'application/xml'], |
---|
31 | text: 'text/plain', |
---|
32 | js: 'text/javascript', |
---|
33 | rss: 'application/rss+xml', |
---|
34 | atom: 'application/atom+xml', |
---|
35 | css: 'text/css', |
---|
36 | csv: 'text/csv', |
---|
37 | all: '*/*', |
---|
38 | json: ['application/json', 'text/json'], |
---|
39 | form: 'application/x-www-form-urlencoded', |
---|
40 | multipartForm: 'multipart/form-data' |
---|
41 | ] |
---|
42 | // The default codec used to encode data with ${} |
---|
43 | grails.views.default.codec = "none" // none, html, base64 |
---|
44 | grails.views.gsp.encoding = "UTF-8" |
---|
45 | grails.converters.encoding = "UTF-8" |
---|
46 | |
---|
47 | // enabled native2ascii conversion of i18n properties files |
---|
48 | grails.enable.native2ascii = true |
---|
49 | |
---|
50 | // log4j configuration |
---|
51 | log4j = { |
---|
52 | // Example of changing the log pattern for the default console |
---|
53 | // appender: |
---|
54 | // |
---|
55 | //appenders { |
---|
56 | // console name:'stdout', layout:pattern(conversionPattern: '%c{2} %m%n') |
---|
57 | //} |
---|
58 | appenders { |
---|
59 | rollingFile name: "stacktrace", maxFileSize: 1024, file: "${userHome}/${appName}-${grails.util.GrailsUtil.environment}.log" |
---|
60 | } |
---|
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 | // Spring Security configuration |
---|
112 | grails.plugins.springsecurity.useBasicAuth = true |
---|
113 | grails.plugins.springsecurity.basic.realmName = "Authentication Required" |
---|
114 | grails.plugins.springsecurity.useSessionFixationPrevention = true |
---|
115 | grails.plugins.springsecurity.filterChain.chainMap = [ |
---|
116 | '/rest/hello': 'JOINED_FILTERS,-exceptionTranslationFilter', |
---|
117 | '/api/authenticate': 'JOINED_FILTERS,-exceptionTranslationFilter', |
---|
118 | '/**': 'JOINED_FILTERS,-basicAuthenticationFilter,-basicExceptionTranslationFilter' |
---|
119 | ] |
---|
120 | |
---|
121 | // Needed for the (copy of) the Spring Security UI plugin |
---|
122 | grails.mail.default.from = 'gscf@dbnp.org' |
---|
123 | grails.plugins.springsecurity.ui.forgotPassword.emailFrom = 'gscf@dbnp.org' |
---|
124 | grails.plugins.springsecurity.ui.forgotPassword.emailSubject = 'Password reset GSCF' |
---|
125 | |
---|
126 | // Make sure the different controllers provided by springsecurity.ui are only accessible by administrators |
---|
127 | // NB: the RegisterController is used for forgotten passwords. It should be accessible by anyone |
---|
128 | grails.plugins.springsecurity.controllerAnnotations.staticRules = [ |
---|
129 | '/user/**': ['ROLE_ADMIN'], |
---|
130 | '/role/**': ['ROLE_ADMIN'], |
---|
131 | '/aclclass/**': ['ROLE_ADMIN'], |
---|
132 | '/aclentry/**': ['ROLE_ADMIN'], |
---|
133 | '/aclobjectidentity/**': ['ROLE_ADMIN'], |
---|
134 | '/aclsid/**': ['ROLE_ADMIN'], |
---|
135 | '/persistentlogin/**': ['ROLE_ADMIN'], |
---|
136 | '/registrationcode/**': ['ROLE_ADMIN'], |
---|
137 | '/requestmap/**': ['ROLE_ADMIN'], |
---|
138 | '/securityinfo/**': ['ROLE_ADMIN'] |
---|
139 | ] |
---|
140 | |
---|
141 | // Temporary directory to upload files to. |
---|
142 | // If the directory is given relative (e.g. 'fileuploads/temp'), it is taken relative to the web-app directory |
---|
143 | // Otherwise, it should be given as an absolute path (e.g. '/home/user/sequences') |
---|
144 | // The directory should be writable by the webserver user |
---|
145 | if (grails.util.GrailsUtil.environment == GrailsApplication.ENV_TEST) { |
---|
146 | uploads.uploadDir = "webtestfiles" |
---|
147 | } else { |
---|
148 | uploads.uploadDir = (new File("/tmp")?.canWrite()) ? "/tmp" : "fileuploads" |
---|
149 | } |
---|
150 | |
---|
151 | // Required configuration variables for gdtImporter plugin |
---|
152 | // Does the parent entity have an owner (SecUser in GSCF) |
---|
153 | gdtImporter.parentEntityHasOwner = true |
---|
154 | // How do children refer to the parent (belongsTo) |
---|
155 | gdtImporter.childEntityParentName = "parent" |
---|
156 | // What is the class name of the parent entity |
---|
157 | gdtImporter.parentEntityClassName = "dbnp.studycapturing.Study" |
---|
158 | |
---|
159 | // default application title |
---|
160 | application.title = "Generic Study Capture Framework" |
---|
161 | |
---|
162 | // ****** trackR Config ****** |
---|
163 | trackr.path = "/tmp/" |
---|
164 | trackr.prefix = "gscf.${grails.util.GrailsUtil.environment}." |
---|