Ottomata has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/117024

Change subject: [WIP] Adding archiva module
......................................................................

[WIP] Adding archiva module

Change-Id: Ib77056e035df677b004cee59d482fa0ac02c3411
---
A modules/archiva/files/archiva-gitfat-link
A modules/archiva/manifests/gitfat.pp
A modules/archiva/manifests/init.pp
A modules/archiva/templates/archiva.conf.erb
A modules/archiva/templates/jetty.xml.erb
5 files changed, 595 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/24/117024/1

diff --git a/modules/archiva/files/archiva-gitfat-link 
b/modules/archiva/files/archiva-gitfat-link
new file mode 100755
index 0000000..1ea2a92
--- /dev/null
+++ b/modules/archiva/files/archiva-gitfat-link
@@ -0,0 +1,89 @@
+#!/bin/sh
+
+#
+# This script is intended to be used to symlink .jar files found
+# in an Archiva repository into a directory with links named by
+# the .jars' sha1 sum.  If the .jar file's sha1 does not match the
+# sha1 that archiva expects, the file will not be symlinked.
+#
+
+
+usage () {
+    script_name=$(basename ${0})
+    echo "
+${script_name} <artifact-repository-path> <git-fat-path>
+  Creates symlinks from all .jars found in <artifact-repository-path>
+  to sha1 filenames in <git-fat-path>.
+
+  Example: ${script_name} /var/lib/archiva/repositories 
/var/lib/git-fat/archiva
+"
+}
+
+# Prints absolute realpath of a file.
+# This works on OS X using python and Linux using readlink -f.
+real_path () {
+    # if on OS X, use python.  OS X doesn't have readlink -f
+    if [ $(uname) = 'Darwin' ]; then
+        echo $(python -c "import os,sys; print os.path.realpath(sys.argv[1])" 
"${1}")
+    # else just use readlink -f
+    else
+        echo $(readlink -f "${1}")
+    fi
+}
+
+# symlinks $1 target from $2 link_name ($2 -> $1)
+symlink () {
+    # if on OS X, use python.  OS X doesn't have readlink -f
+    if [ $(uname) = 'Darwin' ]; then
+        target=$(python -c "import os,sys; print 
os.path.realpath(sys.argv[1])" "${1}")
+    # else just use readlink -f
+    else
+        target=$(readlink -f "${1}")
+    fi
+    link_name="${2}"
+    /bin/ln -svf "${target}" "${link_name}"
+}
+
+
+if [ -z "${1}" -o -z "${2}" ]; then
+    usage
+    exit 1
+fi
+
+artifact_repository_path="${1}"
+git_fat_path="${2}"
+exitval=0
+
+
+# find all .jar files and symlink them
+find $artifact_repository_path -type f -name "*.jar" | xargs shasum | while 
read line; do
+    # get the filenames and their sha1 sums out of the shasum output
+    sha1=$(echo ${line} | awk '{print $1}');
+    file=$(echo ${line} | awk '{print $2}');
+
+    # If  no .jars were found, shasum will operate on empty stdin.
+    # We can stop now if file is ever '-'.
+    if [ "${file}" = '-' ]; then
+        echo "No .jar files found in ${artifact_repository_path} to symlink."
+        break
+    fi
+
+    # $archiva_file will be symlinked from $git_fat_file
+    archiva_file=$(real_path ${file})
+    git_fat_file="${git_fat_path}/${sha1}"
+
+    # Archiva keeps sha1s of every file it downloads in its repository.
+    # Make sure archiva's sha1 sum matches the sha1 we just computed.
+    archiva_sha1=$(awk '{print $1}' ${archiva_file}.sha1)
+    if [ "${sha1}" != "${archiva_sha1}" ]; then
+        echo "WARNING: ${archiva_file} sha1 does not match expected sha1 from 
archiva: ${sha1} != ${archiva_sha1}.  Not symlinking into git-fat store."
+        test -f "${git_fat_file}" && rm -fv "${git_fat_file}"
+        exitval=1
+        continue
+    fi
+
+    # symlink $git_fat_file -> $archiva_file
+    symlink "${archiva_file}" "${git_fat_file}"
+done
+
+exit $exitval
diff --git a/modules/archiva/manifests/gitfat.pp 
b/modules/archiva/manifests/gitfat.pp
new file mode 100644
index 0000000..9633f19
--- /dev/null
+++ b/modules/archiva/manifests/gitfat.pp
@@ -0,0 +1,38 @@
+# == Class: archiva::gitfat
+# Symlinks archiva artifacts to a git-fat store.
+# This symlinks .jars to their shasums in a directory
+# that git-fat can use as a source store.
+#
+class archiva::gitfat {
+    Class['::archiva'] -> Class['::archiva::gitfat']
+    
+    $archiva_repository_path = '/var/lib/archiva/repositories'
+    $gitfat_path             = '/var/lib/git-fat'
+    $gitfat_archiva_path     = "${gitfat_path}/archiva"
+
+    if !defined(File[$gitfat_path]) {
+        file { $gitfat_path:
+            ensure => 'directory',
+        }
+    }
+    file { $gitfat_archiva_path:
+        ensure => 'directory',
+        owner  => 'archiva',
+        group  => 'archiva',
+    }
+
+    # install script to symlink archiva .jars into a git-fat store
+    file { '/usr/local/bin/archiva-gitfat-link':
+        source => 'puppet:///modules/archiva/archiva-gitfat-link',
+        mode   => '0555',
+    }
+
+    # Periodically symlink .jar files
+    # in $archiva_repository_path so that git-fat
+    # can use them.
+    cron { 'archiva-gitfat-link':
+        command => "/usr/local/bin/archiva-gitfat-link 
${archiva_repository_path} ${gitfat_archiva_path} > /dev/null",
+        minute  => '*/5',
+        require => File['/usr/local/bin/archiva-gitfat-link'],
+    }
+}
\ No newline at end of file
diff --git a/modules/archiva/manifests/init.pp 
b/modules/archiva/manifests/init.pp
new file mode 100644
index 0000000..d47576f
--- /dev/null
+++ b/modules/archiva/manifests/init.pp
@@ -0,0 +1,24 @@
+# == Class: archiva
+#
+# Installs and runs Apache Archiva.
+# You must do any further configuration of Archiva
+# via the archiva web interface.  Archiva will save
+# its custom configurations to /var/lib/archiva/conf/archiva.xml.
+#
+class archiva($port = 8080)
+{
+    package { 'archiva':
+        ensure => 'installed',
+    }
+    file { '/etc/archiva/jetty.xml':
+        content => template('archiva/jetty.xml.erb'),
+        require => Package['archiva'],
+    }
+    service { 'archiva':
+        ensure     => 'running',
+        enable     => true,
+        hasstatus  => true,
+        hasrestart => true,
+        subscribe  => File['/etc/archiva/jetty.xml'],
+    }
+}
\ No newline at end of file
diff --git a/modules/archiva/templates/archiva.conf.erb 
b/modules/archiva/templates/archiva.conf.erb
new file mode 100644
index 0000000..fcdff34
--- /dev/null
+++ b/modules/archiva/templates/archiva.conf.erb
@@ -0,0 +1,101 @@
+#********************************************************************
+# Wrapper Properties
+#********************************************************************
+# Java Application
+wrapper.java.command=java
+wrapper.working.dir=/var/lib/archiva
+
+# Java Main class.  This class must implement the WrapperListener interface
+#  or guarantee that the WrapperManager class is initialized.  Helper
+#  classes are provided to do this for you.  See the Integration section
+#  of the documentation for details.
+wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp
+set.default.REPO_DIR=/usr/share/archiva/lib
+set.default.ARCHIVA_BASE=/var/lib/archiva
+set.default.ARCHIVA_CONF=/etc/archiva
+set.default.ARCHIVA_LOGS=/var/log/archiva
+set.default.ARCHIVA_TEMP=/var/cache/archiva
+
+# Java Classpath (include wrapper.jar)  Add class path elements as
+#  needed starting from 1
+wrapper.java.classpath.1=%REPO_DIR%/wrapper.jar
+wrapper.java.classpath.2=%REPO_DIR%/archiva-jetty-2.0.0.pom
+wrapper.java.classpath.3=%REPO_DIR%/jetty-server-8.1.14.v20131031.jar
+wrapper.java.classpath.4=%REPO_DIR%/javax.servlet-3.0.0.v201112011016.jar
+wrapper.java.classpath.5=%REPO_DIR%/jetty-continuation-8.1.14.v20131031.jar
+wrapper.java.classpath.6=%REPO_DIR%/jetty-http-8.1.14.v20131031.jar
+wrapper.java.classpath.7=%REPO_DIR%/jetty-io-8.1.14.v20131031.jar
+wrapper.java.classpath.8=%REPO_DIR%/jetty-jndi-8.1.14.v20131031.jar
+wrapper.java.classpath.9=%REPO_DIR%/javax.mail.glassfish-1.4.1.v201005082020.jar
+wrapper.java.classpath.10=%REPO_DIR%/javax.activation-1.1.0.v201105071233.jar
+wrapper.java.classpath.11=%REPO_DIR%/jetty-start-8.1.14.v20131031.jar
+wrapper.java.classpath.12=%REPO_DIR%/jetty-plus-8.1.14.v20131031.jar
+wrapper.java.classpath.13=%REPO_DIR%/javax.transaction-1.1.1.v201105210645.jar
+wrapper.java.classpath.14=%REPO_DIR%/jetty-webapp-8.1.14.v20131031.jar
+wrapper.java.classpath.15=%REPO_DIR%/jetty-servlet-8.1.14.v20131031.jar
+wrapper.java.classpath.16=%REPO_DIR%/jetty-security-8.1.14.v20131031.jar
+wrapper.java.classpath.17=%REPO_DIR%/jetty-deploy-8.1.14.v20131031.jar
+wrapper.java.classpath.18=%REPO_DIR%/jetty-xml-8.1.14.v20131031.jar
+wrapper.java.classpath.19=%REPO_DIR%/jetty-util-8.1.14.v20131031.jar
+wrapper.java.classpath.20=%REPO_DIR%/derby-10.10.1.1.jar
+wrapper.java.classpath.21=%REPO_DIR%/mail-1.4.jar
+wrapper.java.classpath.22=%REPO_DIR%/activation-1.1.jar
+wrapper.java.classpath.23=%REPO_DIR%/ant-1.8.3.jar
+wrapper.java.classpath.24=%REPO_DIR%/ant-launcher-1.8.3.jar
+wrapper.java.classpath.25=%REPO_DIR%/tomcat-jdbc-7.0.50.jar
+wrapper.java.classpath.26=%REPO_DIR%/tomcat-juli-7.0.50.jar
+
+# Java Library Path (location of Wrapper.DLL or libwrapper.so)
+wrapper.java.library.path.1=/usr/lib/archiva
+
+# Java Additional Parameters
+#wrapper.java.additional.1=
+wrapper.java.additional.1=-Dappserver.home=%ARCHIVA_CONF%
+wrapper.java.additional.2=-Dappserver.base=%ARCHIVA_BASE%
+wrapper.java.additional.3=-Djetty.logs=%ARCHIVA_LOGS%
+wrapper.java.additional.4=-Djava.io.tmpdir=%ARCHIVA_TEMP%
+wrapper.java.additional.5=-DAsyncLogger.WaitStrategy=Sleep
+wrapper.java.additional.6=-XX:MaxPermSize=128m
+
+# Initial Java Heap Size (in MB)
+#wrapper.java.initmemory=3
+wrapper.java.initmemory=512
+
+# Maximum Java Heap Size (in MB)
+#wrapper.java.maxmemory=64
+wrapper.java.maxmemory=512
+
+# Application parameters.  Add parameters as needed starting from 1
+wrapper.app.parameter.1=org.eclipse.jetty.start.Main
+wrapper.app.parameter.2=%ARCHIVA_CONF%/jetty.xml
+
+#********************************************************************
+# Wrapper Logging Properties
+#********************************************************************
+# Format of output for the console.  (See docs for formats)
+wrapper.console.format=PM
+
+# Log Level for console output.  (See docs for log levels)
+wrapper.console.loglevel=INFO
+
+# Log file to use for wrapper output logging.
+wrapper.logfile=%ARCHIVA_LOGS%/wrapper-YYYYMMDD.log
+
+# Format of output for the log file.  (See docs for formats)
+wrapper.logfile.format=LPTM
+
+# Log Level for log file output.  (See docs for log levels)
+wrapper.logfile.loglevel=INFO
+
+# Maximum size that the log file will be allowed to grow to before
+#  the log is rolled. Size is specified in bytes.  The default value
+#  of 0, disables log rolling.  May abbreviate with the 'k' (kb) or
+#  'm' (mb) suffix.  For example: 10m = 10 megabytes.
+wrapper.logfile.maxsize=256m
+
+# Maximum number of rolled log files which will be allowed before old
+#  files are deleted.  The default value of 0 implies no limit.
+wrapper.logfile.maxfiles=2
+
+# Log Level for sys/event log output.  (See docs for log levels)
+wrapper.syslog.loglevel=NONE
\ No newline at end of file
diff --git a/modules/archiva/templates/jetty.xml.erb 
b/modules/archiva/templates/jetty.xml.erb
new file mode 100644
index 0000000..c6899b9
--- /dev/null
+++ b/modules/archiva/templates/jetty.xml.erb
@@ -0,0 +1,343 @@
+<?xml version="1.0"?>
+<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" 
"http://www.eclipse.org/jetty/configure.dtd";>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<!-- =============================================================== -->
+<!-- Configure the Jetty Server                                      -->
+<!--                                                                 -->
+<!-- Documentation of this file format can be found at:              -->
+<!-- http://docs.codehaus.org/display/JETTY/jetty.xml                -->
+<!--                                                                 -->
+<!-- =============================================================== -->
+
+
+<Configure id="Server" class="org.eclipse.jetty.server.Server">
+
+    <!-- =========================================================== -->
+    <!-- Server Thread Pool                                          -->
+    <!-- =========================================================== -->
+    <Set name="ThreadPool">
+      <!-- Default bounded blocking threadpool
+      -->
+      <New class="org.eclipse.jetty.util.thread.QueuedThreadPool">
+        <Set name="minThreads">10</Set>
+        <Set name="maxThreads">250</Set>
+      </New>
+
+      <!-- Optional Java 5 bounded threadpool with job queue
+      <New class="org.eclipse.jetty.util.thread.ExecutorThreadPool">
+        <Set name="corePoolSize">250</Set>
+        <Set name="maximumPoolSize">250</Set>
+      </New>
+      -->
+    </Set>
+
+    <!-- =========================================================== -->
+    <!-- Set connectors                                              -->
+    <!-- =========================================================== -->
+    <!-- One of each type!                                           -->
+    <!-- =========================================================== -->
+
+    <!-- Use this connector for many frequently idle connections
+         and for threadless continuations.
+    -->
+    <Call name="addConnector">
+      <Arg>
+          <New class="org.eclipse.jetty.server.nio.SelectChannelConnector">
+            <Set name="host"><SystemProperty name="jetty.host"/></Set>
+            <Set name="port"><SystemProperty name="jetty.port" default="<%= 
@port %>"/></Set>
+            <Set name="maxIdleTime">30000</Set>
+            <Set name="Acceptors">2</Set>
+            <Set name="statsOn">false</Set>
+            <Set name="confidentialPort">8443</Set>
+            <Set name="lowResourcesConnections">5000</Set>
+            <Set name="lowResourcesMaxIdleTime">5000</Set>
+          </New>
+      </Arg>
+    </Call>
+
+    <!-- Use this connector if NIO is not available.
+    <Call name="addConnector">
+      <Arg>
+          <New class="org.mortbay.jetty.bio.SocketConnector">
+            <Set name="port">8081</Set>
+            <Set name="maxIdleTime">50000</Set>
+            <Set name="lowResourceMaxIdleTime">1500</Set>
+          </New>
+      </Arg>
+    </Call>
+    -->
+
+    <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+    <!-- To add a HTTPS SSL listener                                     -->
+    <!-- see jetty-ssl.xml to add an ssl connector. use                  -->
+    <!-- java -jar start.jar etc/jetty.xml etc/jetty-ssl.xml             -->
+    <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+
+    <!-- =========================================================== -->
+    <!-- Set up global session ID manager                            -->
+    <!-- =========================================================== -->
+    <!--
+    <Set name="sessionIdManager">
+      <New class="org.mortbay.jetty.servlet.HashSessionIdManager">
+        <Set name="workerName">node1</Set>
+      </New>
+    </Set>
+    -->
+
+    <!-- =========================================================== -->
+    <!-- Set handler Collection Structure                            -->
+    <!-- =========================================================== -->
+    <Set name="handler">
+      <New id="Handlers" 
class="org.eclipse.jetty.server.handler.HandlerCollection">
+        <Set name="handlers">
+         <Array type="org.eclipse.jetty.server.Handler">
+           <Item>
+             <New id="Contexts" 
class="org.eclipse.jetty.server.handler.ContextHandlerCollection"/>
+           </Item>
+           <Item>
+             <New id="DefaultHandler" 
class="org.eclipse.jetty.server.handler.DefaultHandler"/>
+           </Item>
+           <Item>
+             <New id="RequestLog" 
class="org.eclipse.jetty.server.handler.RequestLogHandler"/>
+           </Item>
+         </Array>
+        </Set>
+      </New>
+    </Set>
+
+    <!-- =========================================================== -->
+    <!-- Configure the context deployer                              -->
+    <!-- A context deployer will deploy contexts described in        -->
+    <!-- configuration files discovered in a directory.              -->
+    <!-- The configuration directory can be scanned for hot          -->
+    <!-- deployments at the configured scanInterval.                 -->
+    <!--                                                             -->
+    <!-- This deployer is configured to deploy contexts configured   -->
+    <!-- in the $JETTY_HOME/contexts directory                       -->
+    <!--                                                             -->
+    <!-- =========================================================== -->
+    <Call name="addLifeCycle">
+      <Arg>
+        <New class="org.eclipse.jetty.deploy.ContextDeployer">
+          <Set name="contexts"><Ref id="Contexts"/></Set>
+          <Set name="configurationDir">/etc/archiva/jetty-contexts</Set>
+          <Set name="scanInterval">1</Set>
+        </New>
+      </Arg>
+    </Call>
+
+    <!-- =========================================================== -->
+    <!-- Configure the webapp deployer.                              -->
+    <!-- A webapp  deployer will deploy standard webapps discovered  -->
+    <!-- in a directory at startup, without the need for additional  -->
+    <!-- configuration files.    It does not support hot deploy or   -->
+    <!-- non standard contexts (see ContextDeployer above).          -->
+    <!--                                                             -->
+    <!-- This deployer is configured to deploy webapps from the      -->
+    <!-- $JETTY_HOME/webapps directory                               -->
+    <!--                                                             -->
+    <!-- Normally only one type of deployer need be used.            -->
+    <!--                                                             -->
+    <!-- =========================================================== -->
+    <Call name="addLifeCycle">
+      <Arg>
+        <New class="org.eclipse.jetty.deploy.WebAppDeployer">
+          <Set name="contexts"><Ref id="Contexts"/></Set>
+          <Set name="webAppDir">/usr/share/archiva/apps</Set>
+          <Set name="parentLoaderPriority">false</Set>
+          <Set name="extract">true</Set>
+          <Set name="allowDuplicates">false</Set>
+        </New>
+      </Arg>
+    </Call>
+
+    <!-- =========================================================== -->
+    <!-- Configure Request Log                                       -->
+    <!-- Request logs  may be configured for the entire server here, -->
+    <!-- or they can be configured for a specific web app in a       -->
+    <!-- contexts configuration (see $(jetty.home)/contexts/test.xml -->
+    <!-- for an example).                                            -->
+    <!-- =========================================================== -->
+    <Ref id="RequestLog">
+      <Set name="requestLog">
+        <New id="RequestLogImpl" 
class="org.eclipse.jetty.server.NCSARequestLog">
+          <Set name="filename">/var/log/archiva/request-yyyy_mm_dd.log</Set>
+          <Set name="filenameDateFormat">yyyyMMdd</Set>
+          <Set name="retainDays">7</Set>
+          <Set name="append">true</Set>
+          <Set name="extended">true</Set>
+          <Set name="logCookies">false</Set>
+          <Set name="LogTimeZone">GMT</Set>
+        </New>
+      </Set>
+    </Ref>
+
+    <!-- =========================================================== -->
+    <!-- extra options                                               -->
+    <!-- =========================================================== -->
+    <Set name="stopAtShutdown">true</Set>
+    <Set name="sendServerVersion">true</Set>
+    <Set name="sendDateHeader">true</Set>
+    <Set name="gracefulShutdown">1000</Set>
+
+
+
+ <!-- =========================================================== -->
+  <!-- JNDI java:comp/env                                          -->
+  <!-- To use JNDI with Jetty, you will need to tell your          -->
+  <!-- WebAppContext to process the naming related items in        -->
+  <!-- web.xml. For an example of how to do that, see the test     -->
+  <!-- webapp below. More information can be found at              -->
+  <!-- http://docs.codehaus.org/display/JETTY/Jetty+Wiki           -->
+  <!-- =========================================================== -->
+
+
+  <!-- Configuring <resource-ref> and <resource-env-ref>s          -->
+  <!--                                                             -->
+  <!-- The following are examples of setting up a resource that   -->
+  <!-- can be referenced in a web.xml file as a <resource-ref> or  -->
+  <!-- a <resource-env-ref>. The first argument is the name of the -->
+  <!-- resource relative to java:comp/env and must be the SAME as  -->
+  <!-- the <res-ref-name> or <resource-env-ref-name> in web.xml.   -->
+  <!-- The second argument is the construction of the resource     -->
+  <!-- object. Any object at all can be configured.                -->
+
+
+  <!-- These examples set up a javax.sql.DataSource around an      -->
+  <!-- XADataSource that is provided by the Derby relational db.   -->
+  <!-- The DataSource wrapper that is registered in JNDI is        -->
+  <!--  provided by Atomikos, and works with the Atomikos          -->
+  <!-- transaction manager configured further below. To use these  -->
+  <!-- examples, download Atomikos http://www.atomikos.com and     -->
+  <!-- Derby http://db.apache.org/derby                            -->
+
+
+  <!-- Configuring Transactions                                    -->
+  <!--                                                             -->
+  <!-- The following is a example of a setting up a JTA            -->
+  <!-- transaction manager that can be referenced by looking up    -->
+  <!-- java:comp/UserTransaction. Note that this is just an        -->
+  <!-- example and if you uncomment it, you will need to download  -->
+  <!-- the atomikos jar (see http://www.atomikos.com/download.html)-->
+  <!-- You can configure any transaction manager that implements   -->
+  <!-- javax.transaction.UserTransaction.                          -->
+
+
+  <Call name="setAttribute">
+    <Arg>org.eclipse.jetty.webapp.configuration</Arg>
+    <Arg>
+      <Array type="java.lang.String">
+        <Item>org.eclipse.jetty.webapp.WebInfConfiguration</Item>
+        <Item>org.eclipse.jetty.webapp.WebXmlConfiguration</Item>
+        <Item>org.eclipse.jetty.webapp.MetaInfConfiguration</Item>
+        <Item>org.eclipse.jetty.webapp.FragmentConfiguration</Item>
+        <Item>org.eclipse.jetty.plus.webapp.EnvConfiguration</Item>
+        <Item>org.eclipse.jetty.plus.webapp.PlusConfiguration</Item>
+        <Item>org.eclipse.jetty.webapp.JettyWebXmlConfiguration</Item>
+        <Item>org.eclipse.jetty.webapp.TagLibConfiguration</Item>
+      </Array>
+    </Arg>
+  </Call>
+
+
+  <!-- =========================================================== -->
+  <!-- Configurations for WebAppContexts                           -->
+  <!-- Sequence of configurations to be applied to a webapp.       -->
+  <!-- =========================================================== -->
+  <Array id="plusConfig" type="java.lang.String">
+    <Item>org.eclipse.jetty.webapp.WebInfConfiguration</Item>
+    <Item>org.eclipse.jetty.plus.webapp.EnvConfiguration</Item>
+    <Item>org.eclipse.jetty.webapp.Configuration</Item>
+    <Item>org.eclipse.jetty.webapp.JettyWebXmlConfiguration</Item>
+    <Item>org.mortbay.jetty.webapp.TagLibConfiguration</Item>
+  </Array>
+
+  <!-- ARCHIVA CONFIG -->
+
+  <New id="validation_mail" class="org.eclipse.jetty.plus.jndi.Resource">
+    <Arg>mail/Session</Arg>
+    <Arg>
+      <New class="org.eclipse.jetty.jndi.factories.MailSessionReference">
+        <Set name="user"></Set>
+        <Set name="password"></Set>
+        <Set name="properties">
+          <New class="java.util.Properties">
+            <Put name="mail.smtp.host">localhost</Put>
+          </New>
+        </Set>
+      </New>
+    </Arg>
+  </New>
+
+  <!-- Users / Security Database -->
+  <!--
+  <New id="users" class="org.eclipse.jetty.plus.jndi.Resource">
+    <Arg>jdbc/users</Arg>
+    <Arg>
+      <New class="org.apache.derby.jdbc.EmbeddedDataSource">
+        <Set name="DatabaseName">/var/lib/archiva/data/databases/users</Set>
+        <Set name="user">sa</Set>
+        <Set name="createDatabase">create</Set>
+      </New>
+    </Arg>
+  </New>
+
+  <New id="usersShutdown" class="org.eclipse.jetty.plus.jndi.Resource">
+    <Arg>jdbc/usersShutdown</Arg>
+    <Arg>
+      <New class="org.apache.derby.jdbc.EmbeddedDataSource">
+        <Set name="DatabaseName">/var/lib/archiva/data/databases/users</Set>
+        <Set name="user">sa</Set>
+        <Set name="shutdownDatabase">shutdown</Set>
+      </New>
+    </Arg>
+  </New>
+  -->
+  <New id="users" class="org.eclipse.jetty.plus.jndi.Resource">
+    <Arg>jdbc/users</Arg>
+    <Arg>
+      <New class="org.apache.tomcat.jdbc.pool.DataSource">
+        <Set name="driverClassName">org.apache.derby.jdbc.EmbeddedDriver</Set>
+        <Set 
name="url">jdbc:derby:/var/lib/archiva/data/databases/users;create=true</Set>
+        <Set name="username">sa</Set>
+        <Set name="maxActive">20</Set>
+        <Set name="removeAbandoned">true</Set>
+        <Set name="logAbandoned">true</Set>
+        <Set name="initialSize">5</Set>
+        <Set name="testOnBorrow">true</Set>
+        <!-- very rigourous sql query validation -->
+        <Set name="validationQuery">select 1</Set>
+      </New>
+    </Arg>
+  </New>
+
+  <New id="usersShutdown" class="org.eclipse.jetty.plus.jndi.Resource">
+    <Arg>jdbc/usersShutdown</Arg>
+    <Arg>
+      <New class="org.apache.tomcat.jdbc.pool.DataSource">
+        <Set name="driverClassName">org.apache.derby.jdbc.EmbeddedDriver</Set>
+        <Set name="url">jdbc:derby:/var/lib/archiva/data/databases/users</Set>
+        <Set name="username">sa</Set>
+      </New>
+    </Arg>
+  </New>
+
+</Configure>
\ No newline at end of file

-- 
To view, visit https://gerrit.wikimedia.org/r/117024
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib77056e035df677b004cee59d482fa0ac02c3411
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ottomata <o...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to