]> source.dussan.org Git - archiva.git/blob
22ad7d1ac2067e0971cf3890d5e027b0526c475f
[archiva.git] /
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!--
3   ~ Licensed to the Apache Software Foundation (ASF) under one
4   ~ or more contributor license agreements.  See the NOTICE file
5   ~ distributed with this work for additional information
6   ~ regarding copyright ownership.  The ASF licenses this file
7   ~ to you under the Apache License, Version 2.0 (the
8   ~ "License"); you may not use this file except in compliance
9   ~ with the License.  You may obtain a copy of the License at
10   ~
11   ~   http://www.apache.org/licenses/LICENSE-2.0
12   ~
13   ~ Unless required by applicable law or agreed to in writing,
14   ~ software distributed under the License is distributed on an
15   ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16   ~ KIND, either express or implied.  See the License for the
17   ~ specific language governing permissions and limitations
18   ~ under the License.
19   -->
20
21 <plexus>
22   <components>
23     <component>
24       <role>org.codehaus.plexus.registry.Registry</role>
25       <implementation>org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry</implementation>
26       <role-hint>commons-configuration</role-hint>
27       <configuration>
28         <properties>
29           <system/>
30           <jndi prefix="java:comp/env" config-optional="true"/>
31           <xml fileName="${user.home}/.m2/archiva.xml" config-optional="true"
32                config-name="org.apache.maven.archiva.user"
33                config-at="org.apache.maven.archiva"/>
34           <xml fileName="${user.home}/.m2/shared.xml" config-optional="true"
35                config-name="org.apache.maven.shared.app.user" config-at="org.apache.maven.shared.app"
36                config-forceCreate="true"/>
37           <properties fileName="${user.home}/.m2/security.properties" config-optional="true"
38                       config-at="org.codehaus.plexus.redback"/>
39           <properties fileName="${user.home}/.m2/archiva.properties" config-optional="true"
40                       config-at="org.codehaus.plexus.redback"/>
41           <xml fileName="${appserver.base}/conf/archiva.xml" config-optional="true"
42                config-name="org.apache.maven.archiva.base"
43                config-at="org.apache.maven.archiva"/>
44           <xml fileName="${appserver.base}/conf/shared.xml" config-optional="true"
45                config-name="org.apache.maven.shared.app.base" config-at="org.apache.maven.shared.app"/>
46           <xml fileName="${appserver.base}/conf/common.xml" config-optional="true"/>
47           <properties fileName="${appserver.base}/conf/security.properties" config-optional="true"
48                       config-at="org.codehaus.plexus.redback"/>
49           <xml fileName="${appserver.home}/conf/archiva.xml" config-optional="true"
50                config-at="org.apache.maven.archiva"/>
51           <xml fileName="${appserver.home}/conf/shared.xml" config-optional="true"
52                config-at="org.apache.maven.shared.app"/>
53           <xml fileName="${appserver.home}/conf/common.xml" config-optional="true"/>
54           <properties fileName="${appserver.home}/conf/security.properties" config-optional="true"
55                       config-at="org.codehaus.plexus.redback"/>
56           <properties fileName="org/apache/maven/archiva/security.properties" config-at="org.codehaus.plexus.redback"/>
57         </properties>
58       </configuration>
59     </component>
60
61     <component>
62       <role>org.codehaus.plexus.mailsender.MailSender</role>
63       <implementation>org.codehaus.plexus.mailsender.javamail.JndiJavamailMailSender</implementation>
64       <configuration>
65         <jndiSessionName>java:comp/env/mail/Session</jndiSessionName>
66       </configuration>
67     </component>
68
69     <component>
70       <role>org.codehaus.plexus.jdo.JdoFactory</role>
71       <role-hint>archiva</role-hint>
72       <implementation>org.codehaus.plexus.jdo.DataSourceConfigurableJdoFactory</implementation>
73       <configuration>
74
75         <connectionFactoryName>java:comp/env/jdbc/archiva</connectionFactoryName>
76         <shutdownConnectionFactoryName>java:comp/env/jdbc/archivaShutdown</shutdownConnectionFactoryName>
77
78         <!-- JPOX and JDO configuration -->
79         <persistenceManagerFactoryClass>org.jpox.PersistenceManagerFactoryImpl</persistenceManagerFactoryClass>
80         <otherProperties>
81           <property>
82             <name>org.jpox.autoCreateSchema</name>
83             <value>true</value>
84           </property>
85           <property>
86             <name>org.jpox.autoCreateColumns</name>
87             <value>true</value>
88           </property>
89           <property>
90             <name>org.jpox.validateTables</name>
91             <value>false</value>
92           </property>
93           <property>
94             <name>org.jpox.validateConstraints</name>
95             <value>false</value>
96           </property>
97           <property>
98             <name>org.jpox.validateColumns</name>
99             <value>false</value>
100           </property>
101           <property>
102             <name>org.jpox.autoStartMechanism</name>
103             <value>None</value>
104           </property>
105           <property>
106             <name>org.jpox.transactionIsolation</name>
107             <value>READ_COMMITTED</value>
108           </property>
109           <property>
110             <name>org.jpox.poid.transactionIsolation</name>
111             <value>READ_COMMITTED</value>
112           </property>
113           <property>
114             <name>org.jpox.rdbms.dateTimezone</name>
115             <value>JDK_DEFAULT_TIMEZONE</value>
116           </property>
117           <!-- NEEDED FOR POSTGRES, But causes problems in other JDBC implementations.
118           <property>
119             <name>org.jpox.identifier.case</name>
120             <value>PreserveCase</value>
121           </property>
122             -->
123         </otherProperties>
124       </configuration>
125     </component>
126
127     <component>
128       <role>org.codehaus.plexus.jdo.JdoFactory</role>
129       <role-hint>users</role-hint>
130       <implementation>org.codehaus.plexus.jdo.DataSourceConfigurableJdoFactory</implementation>
131       <configuration>
132
133         <connectionFactoryName>java:comp/env/jdbc/users</connectionFactoryName>
134         <shutdownConnectionFactoryName>java:comp/env/jdbc/usersShutdown</shutdownConnectionFactoryName>
135
136         <!-- JPOX and JDO configuration -->
137         <persistenceManagerFactoryClass>org.jpox.PersistenceManagerFactoryImpl</persistenceManagerFactoryClass>
138         <otherProperties>
139           <property>
140             <name>org.jpox.autoCreateSchema</name>
141             <value>true</value>
142           </property>
143           <property>
144             <name>org.jpox.validateTables</name>
145             <value>false</value>
146           </property>
147           <property>
148             <name>org.jpox.validateConstraints</name>
149             <value>false</value>
150           </property>
151           <property>
152             <name>org.jpox.validateColumns</name>
153             <value>false</value>
154           </property>
155           <property>
156             <name>org.jpox.autoStartMechanism</name>
157             <value>None</value>
158           </property>
159           <property>
160             <name>org.jpox.transactionIsolation</name>
161             <value>READ_COMMITTED</value>
162           </property>
163           <property>
164             <name>org.jpox.poid.transactionIsolation</name>
165             <value>READ_COMMITTED</value>
166           </property>
167           <property>
168             <name>org.jpox.rdbms.dateTimezone</name>
169             <value>JDK_DEFAULT_TIMEZONE</value>
170           </property>
171           <!-- NEEDED FOR POSTGRES, But causes problems in other JDBC implementations.
172           <property>
173             <name>org.jpox.identifier.case</name>
174             <value>PreserveCase</value>
175           </property>
176             -->
177         </otherProperties>
178       </configuration>
179     </component>
180     
181     <!-- <component>
182       <role>org.apache.maven.archiva.webdav.util.MimeTypes</role>
183       <implementation>org.apache.maven.archiva.webdav.util.MimeTypes</implementation>
184       <description>MimeTypes</description>
185       <configuration>
186         <resource>archiva-mime-types.txt</resource>
187       </configuration>
188     </component> -->
189
190     <!--
191      | Logger manager
192      -->
193     <component>
194       <role>org.codehaus.plexus.logging.LoggerManager</role>
195       <implementation>org.codehaus.plexus.logging.slf4j.Slf4jLoggerManager</implementation>
196       <lifecycle-handler>basic</lifecycle-handler>
197     </component>
198
199     <!-- 
200    PLXREDBACK-81 bad role hint, redefining here until redback alpha-2 is released.
201     -->
202     <component>
203       <role>org.codehaus.plexus.redback.system.check.EnvironmentCheck</role>
204       <role-hint>locked-admin-check</role-hint>
205       <implementation>org.codehaus.plexus.redback.xwork.checks.security.LockedAdminEnvironmentCheck</implementation>
206       <description>LockedAdminEnvironmentCheck: checks if accounts marked as system administrator are locked
207         and unlocks them on startup.
208       </description>
209       <requirements>
210         <requirement>
211           <role>org.codehaus.plexus.redback.users.UserManager</role>
212           <role-hint>cached</role-hint>
213           <field-name>userManager</field-name>
214         </requirement>
215         <requirement>
216           <role>org.codehaus.plexus.redback.rbac.RBACManager</role>
217           <role-hint>cached</role-hint>
218           <field-name>rbacManager</field-name>
219         </requirement>
220       </requirements>
221     </component>
222
223     <!-- START SNIPPET: ldap -->
224     <!-- 
225        Ldap Authentication can be enabled by setting enabling these components and setting the following configuration options in your security.properties file
226
227        ============================================================
228        user.manager.impl=ldap
229        ldap.bind.authenticator.enabled=true
230        redback.default.admin=admin
231        redback.default.guest=guest
232        security.policy.password.expiration.enabled=false
233
234        ldap.config.hostname=ldap.hostname
235        ldap.config.port=389
236        ldap.config.base.dn=o=com
237        ldap.config.context.factory=com.sun.jndi.ldap.LdapCtxFactory
238        ldap.config.bind.dn=uid=myusername,o=com
239        ldap.config.password=s3cr3t
240        #ldap.config.authentication.method=
241        ============================================================
242
243        * ldap.config.hostname - The hostname of the ldap server
244        * ldap.config.port - The port of the ldap server
245        * ldap.config.base.dn - The baseDn of the ldap system
246        * ldap.config.context.factory - context factory for ldap connections
247        * ldap.config.bind.dn - the core user used for authentication the ldap server, must be able to perform the necessary searches, etc.
248        * ldap.config.password - password for the bindDn for the root ldap connection
249
250        until this process is better documented, the following is the document for configuration ldap with redback
251       
252        http://redback.codehaus.org/integration/ldap.html
253     -->
254
255     <!--
256     
257     this component manages the connection to the ldap server
258      -->
259
260     <!-- component>
261       <role>org.codehaus.plexus.redback.common.ldap.connection.LdapConnectionFactory</role>
262       <role-hint>configurable</role-hint>
263       <implementation>org.codehaus.plexus.redback.common.ldap.connection.ConfigurableLdapConnectionFactory</implementation>
264       <requirements>
265         <requirement>
266           <role>org.codehaus.plexus.redback.configuration.UserConfiguration</role>
267         </requirement>
268       </requirements>
269     </component-->
270     
271     <!-- 
272     
273     this component manages the mapping of attributes in ldap to user information in redback. To configure the mapping, you can add the following properties in your security.properties
274
275        ============================================================
276        ldap.config.mapper.attribute.email=mail
277        ldap.config.mapper.attribute.fullname=givenName
278        ldap.config.mapper.attribute.password=userPassword
279        ldap.config.mapper.attribute.user.id=cn
280        ldap.config.mapper.attribute.user.base.dn=
281        ldap.config.mapper.attribute.user.object.class=inetOrgPerson
282        ldap.config.mapper.attribute.user.filter=(attributeName=value)
283        ============================================================
284
285
286      * email-attribute - The name of the attribute on a user that contains the email address
287      * full-name-attribute - The name of the attribute on a user that contains the users fullName
288      * password-attribute - The name of the attribute containing the users password, used for the authentiction using the user manager and not the ldap bind authenticator
289      * user-id-attribute - The name of the attribute containing the users userId, most commonly cn or sn.
290      * user-base-dn - The base dn that will be subtree searched for users.
291      * user-object-class - the objectClass used in the ldap server for indentifying users, most commonly inetOrgPerson.
292      -->
293     
294     <!-- component>
295       <role>org.codehaus.plexus.redback.common.ldap.UserMapper</role>
296       <role-hint>ldap</role-hint>
297       <implementation>org.codehaus.plexus.redback.common.ldap.LdapUserMapper</implementation>
298       <configuration>
299         <email-attribute>email</email-attribute>
300         <full-name-attribute>givenName</full-name-attribute>
301         <password-attribute>userPassword</password-attribute>
302         <user-id-attribute>cn</user-id-attribute>
303         <user-base-dn>o=com</user-base-dn>
304         <user-object-class>inetOrgPerson</user-object-class>
305       </configuration>
306       <requirements>
307         <requirement>
308           <role>org.codehaus.plexus.redback.configuration.UserConfiguration</role>
309         </requirement>
310       </requirements>
311     </component-->
312     
313     <!--
314      
315     If caching is desired to improve performance then make uncomment this and make sure the following configuration parameter is in the security.properties
316      
317     user.manager.impl=cached
318     -->
319      
320     <!-- component>
321       <role>org.codehaus.plexus.redback.users.UserManager</role>
322       <role-hint>cached</role-hint>
323       <implementation>org.codehaus.plexus.redback.users.cached.CachedUserManager</implementation>
324       <description>CachedUserManager</description>
325       <requirements>
326         <requirement>
327           <role>org.codehaus.plexus.redback.users.UserManager</role>
328           <role-hint>ldap</role-hint>
329           <field-name>userImpl</field-name>
330         </requirement>
331         <requirement>
332           <role>org.codehaus.plexus.ehcache.EhcacheComponent</role>
333           <role-hint>users</role-hint>
334           <field-name>usersCache</field-name>
335         </requirement>
336       </requirements>
337     </component-->
338     
339     <!-- 
340     
341     if using the user manager authenticator to authenticate the user and not the ldap bind authenticator make sure
342     this definition has the correct password encoder
343     
344     Note: you should probably just use the ldap bind authenticator which is enabled by putting
345     
346     ldap.bind.authenticator.enabled=true
347     
348     in the security.properties
349     -->
350     
351     <!-- component>
352       <role>org.codehaus.plexus.redback.policy.UserSecurityPolicy</role>
353       <role-hint>default</role-hint>
354       <implementation>org.codehaus.plexus.redback.policy.DefaultUserSecurityPolicy</implementation>
355       <description>User Security Policy.</description>
356       <requirements>
357         <requirement>
358           <role>org.codehaus.plexus.redback.configuration.UserConfiguration</role>
359           <field-name>config</field-name>
360         </requirement>
361         <requirement>
362           <role>org.codehaus.plexus.redback.policy.PasswordEncoder</role>
363           <role-hint>sha1</role-hint>
364           <field-name>passwordEncoder</field-name>
365         </requirement>
366         <requirement>
367           <role>org.codehaus.plexus.redback.policy.UserValidationSettings</role>
368           <field-name>userValidationSettings</field-name>
369         </requirement>
370         <requirement>
371           <role>org.codehaus.plexus.redback.policy.CookieSettings</role>
372           <role-hint>rememberMe</role-hint>
373           <field-name>rememberMeCookieSettings</field-name>
374         </requirement>
375         <requirement>
376           <role>org.codehaus.plexus.redback.policy.CookieSettings</role>
377           <role-hint>signon</role-hint>
378           <field-name>signonCookieSettings</field-name>
379         </requirement>
380         <requirement>
381           <role>org.codehaus.plexus.redback.policy.PasswordRule</role>
382           <field-name>rules</field-name>
383         </requirement>
384       </requirements>
385     </component-->
386     <!-- END SNIPPET: ldap -->
387   </components>
388
389   <lifecycle-handler-manager implementation="org.codehaus.plexus.lifecycle.DefaultLifecycleHandlerManager">
390     <default-lifecycle-handler-id>plexus</default-lifecycle-handler-id>
391     <lifecycle-handlers>
392       <lifecycle-handler implementation="org.codehaus.plexus.personality.plexus.PlexusLifecycleHandler">
393         <id>plexus</id>
394         <name>Plexus Lifecycle Handler</name>
395         <begin-segment>
396           <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.LogEnablePhase"/>
397           <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.CompositionPhase"/>
398           <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.ContextualizePhase"/>
399           <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.AutoConfigurePhase"/>
400           <phase implementation="org.codehaus.plexus.registry.RegistryConfigurePhase"/>
401           <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.ServiceablePhase"/>
402           <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializePhase"/>
403           <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.StartPhase"/>
404         </begin-segment>
405         <suspend-segment>
406           <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.SuspendPhase"/>
407         </suspend-segment>
408         <resume-segment>
409           <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.ResumePhase"/>
410         </resume-segment>
411         <end-segment>
412           <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.StopPhase"/>
413           <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.DisposePhase"/>
414           <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.LogDisablePhase"/>
415         </end-segment>
416       </lifecycle-handler>
417     </lifecycle-handlers>
418   </lifecycle-handler-manager>
419 </plexus>