]> source.dussan.org Git - gitblit.git/commitdiff
Implemented a Federation Client. Bare clone tweaks. Documentation.
authorJames Moger <james.moger@gitblit.com>
Mon, 26 Sep 2011 19:33:19 +0000 (15:33 -0400)
committerJames Moger <james.moger@gitblit.com>
Mon, 26 Sep 2011 19:33:19 +0000 (15:33 -0400)
19 files changed:
.gitignore
NOTICE
build.xml
distrib/federation.properties [new file with mode: 0644]
distrib/gitblit.properties
docs/01_setup.mkd
docs/02_federation.mkd
docs/04_design.mkd
src/com/gitblit/FederationClient.java [new file with mode: 0644]
src/com/gitblit/FederationClientLauncher.java [new file with mode: 0644]
src/com/gitblit/FederationPullExecutor.java
src/com/gitblit/GitBlit.java
src/com/gitblit/GitBlitServer.java
src/com/gitblit/build/Build.java
src/com/gitblit/models/FederationModel.java
src/com/gitblit/utils/FederationUtils.java
src/com/gitblit/utils/JGitUtils.java
tests/com/gitblit/tests/GitBlitSuite.java
tools/GenJar.jar [new file with mode: 0644]

index 5236c647d71d51201df9706e8621366df81b8999..389f6635964bec3c0b3bae385263ee83cd6e60d9 100644 (file)
@@ -13,3 +13,5 @@
 /war
 /*.war
 /proposals
+/*.jar
+/federation.properties
\ No newline at end of file
diff --git a/NOTICE b/NOTICE
index 8c8a2a90ddbfce5c1ce7116ee7420c11f137502f..41b61f12cca691f90312c1d62f3d6d638d35331a 100644 (file)
--- a/NOTICE
+++ b/NOTICE
@@ -142,6 +142,14 @@ ant-googlecode
    New BSD License\r
    \r
    http://code.google.com/p/ant-googlecode\r
+\r
+---------------------------------------------------------------------------\r
+GenJar\r
+---------------------------------------------------------------------------\r
+   GenJar, released under the\r
+   Apache Software License, Version 1.1.\r
+   \r
+   http://genjar.sourceforge.net\r
    \r
 ---------------------------------------------------------------------------\r
 Fancybox image viewer\r
index 102594340f9d8e0d25cf606a52b11885d14b4767..da0dee09ff8a6d3fd5e44df95628fdcf8ce559b1 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -5,6 +5,9 @@
        <taskdef classname="net.bluecow.googlecode.ant.GoogleCodeUploadTask" \r
                classpath="${basedir}/tools/ant-googlecode-0.0.3.jar" name="gcupload"/>\r
 \r
+       <!-- GenJar task -->\r
+       <taskdef resource="genjar.properties" classpath="${basedir}/tools/GenJar.jar" />\r
+\r
        <!-- Project Properties -->\r
        <property name="project.jar" value="gitblit.jar" />\r
        <property name="project.mainclass" value="com.gitblit.Launcher" />\r
@@ -81,6 +84,7 @@
                </loadfile>     \r
                <property name="distribution.zipfile" value="gitblit-${gb.version}.zip" />\r
                <property name="distribution.warfile" value="gitblit-${gb.version}.war" />\r
+               <property name="fedclient.zipfile" value="fedclient-${gb.version}.zip" />\r
        </target>\r
        \r
        \r
 \r
                <delete dir="${project.build.dir}" />\r
                <mkdir dir="${project.build.dir}" />\r
-               <javac srcdir="${basedir}/src" destdir="${project.build.dir}">\r
+               <javac debug="true" srcdir="${basedir}/src" destdir="${project.build.dir}">\r
                        <include name="com/gitblit/build/Build.java" />                 \r
                        <include name="com/gitblit/Constants.java" />\r
                        <include name="com/gitblit/utils/StringUtils.java" />                   \r
                        <fileset dir="${basedir}/ext">\r
                                <include name="*.jar" />\r
                        </fileset>\r
+                       <pathelement path="${project.build.dir}" />                             \r
                </path>\r
-               <javac destdir="${project.build.dir}" failonerror="false">\r
+               <javac debug="true" destdir="${project.build.dir}" failonerror="false">\r
                        <src path="${basedir}/src" />\r
                        <classpath refid="master-classpath" />\r
                </javac>\r
                <copy todir="${project.deploy.dir}">\r
                        <fileset dir="${basedir}/distrib">\r
                                <include name="**/*" />\r
+                               <exclude name="federation.properties" />\r
                        </fileset>\r
                        <fileset dir="${basedir}">\r
                                <include name="LICENSE" />\r
                                <arg value="--substitute" />\r
                                <arg value="%WAR%=${distribution.warfile}" />\r
 \r
+                               <arg value="--substitute" />\r
+                               <arg value="%FEDCLIENT%=${fedclient.zipfile}" />\r
+\r
                                <arg value="--substitute" />\r
                                <arg value="%BUILDDATE%=${gb.versionDate}" />\r
 \r
        </target>\r
 \r
        \r
+       <!-- \r
+               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r
+               Build the stand-alone, command-line Gitblit Federation Client\r
+               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r
+       -->\r
+       <target name="buildFederationClient" depends="compile" description="Builds the stand-alone Gitblit federation client">\r
+               <echo>Building Gitblit Federation Client ${gb.version}</echo>\r
+       \r
+               <genjar jarfile="fedclient.jar">\r
+                       <class name="com.gitblit.FederationClientLauncher" />\r
+                       <resource file="${project.build.dir}/log4j.properties" />\r
+                       <classfilter>\r
+                               <exclude name="org.apache." />\r
+                               <exclude name="org.bouncycastle." />\r
+                               <exclude name="org.eclipse." />\r
+                               <exclude name="org.slf4j." />\r
+                               <exclude name="com.beust." />\r
+                               <exclude name="com.google." />\r
+                       </classfilter>\r
+                       <classpath refid="master-classpath" />\r
+                       <manifest>\r
+                               <attribute name="Main-Class" value="com.gitblit.FederationClientLauncher" />\r
+                               <attribute name="Specification-Version" value="${gb.version}" />                                \r
+                               <attribute name="Release-Date" value="${gb.versionDate}" />\r
+                       </manifest>\r
+               </genjar>\r
+               \r
+               <!-- Build the federation client zip file -->\r
+               <zip destfile="${fedclient.zipfile}">\r
+                       <fileset dir="${basedir}">\r
+                               <include name="fedclient.jar" />                                \r
+                       </fileset>\r
+                       <fileset dir="${basedir}/distrib">\r
+                               <include name="federation.properties" />                                \r
+                       </fileset>\r
+               </zip>\r
+       </target>\r
+\r
+               \r
        <!-- \r
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r
                Build the Gitblit Website\r
                        <arg value="--substitute" />\r
                        <arg value="%WAR%=${distribution.warfile}" />\r
 \r
+                       <arg value="--substitute" />\r
+                       <arg value="%FEDCLIENT%=${fedclient.zipfile}" />\r
+\r
                        <arg value="--substitute" />\r
                        <arg value="%BUILDDATE%=${gb.versionDate}" />\r
 \r
                Compile from source, publish binaries, and build & deploy site\r
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r
        -->\r
-       <target name="buildAll" depends="buildGO,buildWAR,buildSite">           \r
+       <target name="buildAll" depends="buildGO,buildWAR,buildFederationClient,buildSite">             \r
                <!-- Cleanup -->\r
                <delete dir="${project.build.dir}" />\r
                <delete dir="${project.war.dir}" />\r
                     targetfilename="gitblit-${gb.version}.war"\r
                     summary="Gitblit WAR v${gb.version} (standard WAR webapp for servlet containers)"\r
                     labels="Featured, Type-Package, OpSys-All" />\r
+               \r
+               <!-- Upload FedClient -->\r
+               <gcupload \r
+                       username="${googlecode.user}" \r
+                       password="${googlecode.password}" \r
+                       projectname="gitblit" \r
+                       filename="${fedclient.zipfile}" \r
+                       targetfilename="fedclient-${gb.version}.zip"\r
+                       summary="Gitblit Federation Client v${gb.version} (command-line tool to clone data from federated Gitblit instances)"\r
+                       labels="Featured, Type-Package, OpSys-All" />\r
        </target>\r
 \r
        \r
diff --git a/distrib/federation.properties b/distrib/federation.properties
new file mode 100644 (file)
index 0000000..e7e17f7
--- /dev/null
@@ -0,0 +1,69 @@
+#\r
+# Git Repository Settings\r
+#\r
+\r
+# Base folder for repositories\r
+# Use forward slashes even on Windows!!\r
+# e.g. c:/gitrepos\r
+#\r
+# SINCE 0.5.0\r
+# RESTART REQUIRED\r
+git.repositoriesFolder = git\r
+\r
+# Search the repositories folder subfolders for other repositories.\r
+# Repositories MAY NOT be nested (i.e. one repository within another)\r
+# but they may be grouped together in subfolders.\r
+# e.g. c:/gitrepos/libraries/mylibrary.git\r
+#      c:/gitrepos/libraries/myotherlibrary.git\r
+#\r
+# SINCE 0.5.0\r
+git.searchRepositoriesSubfolders = true\r
+\r
+# Your federation name is used for federation status acknowledgments.  If it is\r
+# unset, and you elect to send a status acknowledgment, your Gitblit instance\r
+# will be identified by its hostname, if available, else your internal ip address.\r
+# The source Gitblit instance will also append your external IP address to your\r
+# identification to differentiate multiple pulling systems behind a single proxy.\r
+#\r
+# SINCE 0.6.0\r
+federation.name =\r
+\r
+# Federation pull registrations\r
+# Registrations are read once, at startup.\r
+#\r
+# RESTART REQUIRED\r
+#\r
+# frequency:\r
+#   The shortest frequency allowed is every 5 minutes\r
+#   Decimal frequency values are cast to integers\r
+#   Frequency values may be specified in mins, hours, or days\r
+#   Values that can not be parsed default to *federation.defaultFrequency*\r
+#\r
+# folder:\r
+#   if blank, the folder is *git.repositoriesFolder*\r
+#   if specified, the folder is relative to *git.repositoriesFolder*\r
+#\r
+# mergeAccounts:\r
+#   if true, remote accounts and their permissions are merged into your \r
+#   users.properties file \r
+#\r
+# notifyOnError:\r
+#   if true and the mail configuration is properly set, administrators will be\r
+#   notified by email of pull failures\r
+#\r
+# include and exclude:\r
+#   space-separated list of repositories to include or exclude from pull\r
+#   may be * wildcard to include or exclude all\r
+#   may use fuzzy match (e.g. org.eclipse.*)\r
+\r
+#\r
+# (Nearly) Perfect Mirror example\r
+#\r
+\r
+#federation.example1.url = https://go.gitblit.com\r
+#federation.example1.token = 6f3b8a24bf970f17289b234284c94f43eb42f0e4\r
+#federation.example1.frequency = 120 mins\r
+#federation.example1.folder =\r
+#federation.example1.bare = true\r
+#federation.example1.mirror = true \r
+#federation.example1.mergeAccounts = true\r
index 734dddd0ddf38a61396f62c309db8087abe40015..e8acfa9337ac3a1f05af4b40eb702f534d070303 100644 (file)
@@ -419,6 +419,7 @@ federation.sets =
 #federation.example1.token = 6f3b8a24bf970f17289b234284c94f43eb42f0e4\r
 #federation.example1.frequency = 120 mins\r
 #federation.example1.folder =\r
+#federation.example1.bare = true \r
 #federation.example1.mirror = true \r
 #federation.example1.mergeAccounts = true\r
 \r
index 1c8db122ac6c429c5b4bae19d5f694d8e660ccc5..91900e1e62e2b65001bd01a2b994bd2f423f7c30 100644 (file)
@@ -130,7 +130,7 @@ All repository settings are stored within the repository `.git/config` file unde
            accessRestriction = clone\r
            isFrozen = false\r
            showReadme = false\r
-           excludeFromFederation = false\r
+           federationStrategy = FEDERATE_THIS\r
            isFederated = false\r
            federationSets = \r
            \r
index e5cc797f7c6a08ea75ebe9bc6e054d94c4883f7a..e004a27a874ce3741336f1a9f5ae7dfd7fe1b02b 100644 (file)
@@ -37,7 +37,7 @@ Changing your *federation.passphrase* will break any registrations you have esta
 \r
 If you want your repositories (and optionally users accounts and settings) to be pulled by another Gitblit instance, you need to register your origin Gitblit instance with a pulling Gitblit instance by providing the url of your Gitblit instance and a federation token.\r
 \r
-Gitblit generates the following federation tokens:\r
+Gitblit generates the following standard federation tokens:\r
 %BEGINCODE%\r
 String allToken = SHA1(passphrase + "-ALL");\r
 String usersAndRepositoriesToken = SHA1(passphrase + "-USERS_AND_REPOSITORIES");\r
@@ -52,9 +52,11 @@ Individual Gitblit repository configurations such as *description* and *accessRe
 \r
 If *federation.passphrase* has a non-empty value, the federation tokens are displayed in the log file and are visible, to administrators, in the web ui.\r
 \r
+The three standard tokens grant access to ALL your non-excluded repositories.  However, if you only want to specify different groups of repositories to be federated then you need to define *federation sets*. \r
+\r
 #### Federation Sets\r
 \r
-Federation Sets (*federation.sets*) are named groups of repositories.  The Federation Sets are defined in `gitblit.properties` and are available for selection in the repository settings page.  You can assign a repository to one or more sets and then distribute the token for the set.  This allows you to grant federation pull access to a subset of your available repositories.  Tokens for federation sets only grant pull access for the member repositories.\r
+Federation Sets (*federation.sets*) are named groups of repositories.  The Federation Sets are defined in `gitblit.properties` and are available for selection in the repository settings page.  You can assign a repository to one or more sets and then distribute the federation token for the set.  This allows you to grant federation pull access to a subset of your available repositories.  Tokens for federation sets only grant pull access for the member repositories.\r
 \r
 ### Federation Proposals (Origin Gitblit Instance)\r
 \r
@@ -91,7 +93,7 @@ You may view the details of a proposal by scrolling down to the bottom of the re
 \r
 ### Excluding Repositories (Origin Gitblit Instance)\r
 \r
-You may exclude a repository from being pulled by a federated Gitblit instance by setting its *federation strategy* to EXCLUDE in the repository's settings page.\r
+You may exclude a repository from being pulled by any federated Gitblit instance by setting its *federation strategy* to EXCLUDE in the repository's settings page.\r
 \r
 ### Excluding Repositories (Pulling Gitblit Instance)\r
 \r
@@ -286,4 +288,25 @@ The repositories will be put in *git.repositoriesFolder*/example4.
     federation.example4.bare = true\r
     federation.example4.mirror = true\r
     federation.example4.exclude = *\r
-    federation.example4.include = somerepo.git
\ No newline at end of file
+    federation.example4.include = somerepo.git\r
+    \r
+## Federation Client\r
+\r
+Instead of setting up a full-blown pulling Gitblit instance, you can also use the [federation client](http://code.google.com/p/gitblit/downloads/detail?name=%FEDCLIENT%) command-line utility.  This is a packaged subset of the federation feature in a smaller, simpler command-line only tool.\r
+\r
+The *federation client* relies on many of the same dependencies as Gitblit and will download them on first execution.\r
+\r
+### federation.properties\r
+You may use the `federation.properties` file to configure one or more Gitblit instances that you want to pull from.  This file is a subset of the standard `gitblit.properties` file.\r
+\r
+By default this tool does not daemonize itself; it executes and then quits.  This allows you to use the native scheduling feature of your OS.  Of course, if you'd rather use Gitblit's scheduler you may use that by specifying the `--daemon` parameter.\r
+\r
+### Command-Line Parameters\r
+Instead of using `federation.properties` you may directly specify a Gitblit instance to pull from with command-line parameters.\r
+\r
+    java -jar fedclient.jar --url https://go.gitblit.com --mirror --bare --token 123456789\r
+         --repositoriesFolder c:/mymirror\r
+    \r
+    java -jar fedclient.jar --url https://go.gitblit.com --mirror --bare --token 123456789\r
+         --repositoriesFolder c:/mymirror --daemon --frequency "24 hours"\r
+    \r
index 70cea7c7dcc45db6b90ac324d81ad1b7775ad349..523d31b938daf6c1fb53fe8a6f66954dd56ff41d 100644 (file)
@@ -39,6 +39,7 @@ The following dependencies are automatically downloaded by Gitblit GO (or alread
 - [JUnit](http://junit.org) (Common Public License)\r
 - [commons-net](http://commons.apache.org/net) (Apache 2.0)\r
 - [ant-googlecode](http://code.google.com/p/ant-googlecode) (New BSD)\r
+- [GenJar](http://genjar.sourceforge.net) (Apache 1.1)\r
 \r
 ## Building from Source\r
 [Eclipse](http://eclipse.org) is recommended for development as the project settings are preconfigured.\r
diff --git a/src/com/gitblit/FederationClient.java b/src/com/gitblit/FederationClient.java
new file mode 100644 (file)
index 0000000..daa9bfb
--- /dev/null
@@ -0,0 +1,133 @@
+/*\r
+ * Copyright 2011 gitblit.com.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *     http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package com.gitblit;\r
+\r
+import java.io.File;\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+\r
+import com.beust.jcommander.JCommander;\r
+import com.beust.jcommander.Parameter;\r
+import com.beust.jcommander.ParameterException;\r
+import com.beust.jcommander.Parameters;\r
+import com.gitblit.models.FederationModel;\r
+import com.gitblit.utils.FederationUtils;\r
+import com.gitblit.utils.StringUtils;\r
+\r
+/**\r
+ * Command-line client to pull federated Gitblit repositories.\r
+ * \r
+ * @author James Moger\r
+ * \r
+ */\r
+public class FederationClient {\r
+\r
+       public static void main(String[] args) {\r
+               Params params = new Params();\r
+               JCommander jc = new JCommander(params);\r
+               try {\r
+                       jc.parse(args);\r
+               } catch (ParameterException t) {\r
+                       usage(jc, t);\r
+               }\r
+\r
+               IStoredSettings settings = new FileSettings(params.registrationsFile);\r
+               List<FederationModel> registrations = new ArrayList<FederationModel>();\r
+               if (StringUtils.isEmpty(params.url)) {\r
+                       registrations.addAll(FederationUtils.getFederationRegistrations(settings));\r
+               } else {\r
+                       if (StringUtils.isEmpty(params.token)) {\r
+                               System.out.println("Must specify --token parameter!");\r
+                               System.exit(0);\r
+                       }\r
+                       FederationModel model = new FederationModel("Gitblit");\r
+                       model.url = params.url;\r
+                       model.token = params.token;\r
+                       model.mirror = params.mirror;\r
+                       model.bare = params.bare;\r
+                       model.frequency = params.frequency;\r
+                       model.folder = "";\r
+                       registrations.add(model);\r
+               }\r
+               if (registrations.size() == 0) {\r
+                       System.out.println("No Federation Registrations!  Nothing to do.");\r
+                       System.exit(0);\r
+               }\r
+               \r
+               System.out.println("Gitblit Federation Client v" + Constants.VERSION + " (" + Constants.VERSION_DATE + ")");\r
+\r
+               // command-line specified repositories folder\r
+               if (!StringUtils.isEmpty(params.repositoriesFolder)) {\r
+                       settings.overrideSetting(Keys.git.repositoriesFolder, new File(\r
+                                       params.repositoriesFolder).getAbsolutePath());\r
+               }\r
+\r
+               // configure the Gitblit singleton for minimal, non-server operation\r
+               GitBlit.self().configureContext(settings, false);\r
+               FederationPullExecutor executor = new FederationPullExecutor(registrations, params.isDaemon);\r
+               executor.run();\r
+               if (!params.isDaemon) {\r
+                       System.out.println("Finished.");\r
+                       System.exit(0);\r
+               }\r
+       }\r
+\r
+       private static void usage(JCommander jc, ParameterException t) {\r
+               System.out.println(Constants.getGitBlitVersion());\r
+               System.out.println();\r
+               if (t != null) {\r
+                       System.out.println(t.getMessage());\r
+                       System.out.println();\r
+               }\r
+\r
+               if (jc != null) {\r
+                       jc.usage();\r
+               }\r
+               System.exit(0);\r
+       }\r
+\r
+       /**\r
+        * JCommander Parameters class for FederationClient.\r
+        */\r
+       @Parameters(separators = " ")\r
+       private static class Params {\r
+\r
+               @Parameter(names = { "--registrations" }, description = "Gitblit Federation Registrations File", required = false)\r
+               public String registrationsFile = "federation.properties";\r
+\r
+               @Parameter(names = { "--daemon" }, description = "Runs in daemon mode to schedule and pull repositories", required = false)\r
+               public boolean isDaemon;\r
+\r
+               @Parameter(names = { "--url" }, description = "URL of Gitblit instance to mirror from", required = false)\r
+               public String url;\r
+\r
+               @Parameter(names = { "--mirror" }, description = "Mirror repositories", required = false)\r
+               public boolean mirror;\r
+\r
+               @Parameter(names = { "--bare" }, description = "Create bare repositories", required = false)\r
+               public boolean bare;\r
+\r
+               @Parameter(names = { "--token" }, description = "Federation Token", required = false)\r
+               public String token;\r
+\r
+               @Parameter(names = { "--frequency" }, description = "Period to wait between pull attempts (requires --daemon)", required = false)\r
+               public String frequency = "60 mins";\r
+\r
+               @Parameter(names = { "--repositoriesFolder" }, description = "Destination folder for cloned repositories", required = false)\r
+               public String repositoriesFolder;\r
+\r
+       }\r
+}\r
diff --git a/src/com/gitblit/FederationClientLauncher.java b/src/com/gitblit/FederationClientLauncher.java
new file mode 100644 (file)
index 0000000..80f5a3d
--- /dev/null
@@ -0,0 +1,54 @@
+/*\r
+ * Copyright 2011 gitblit.com.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *     http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package com.gitblit;\r
+\r
+import java.io.File;\r
+import java.io.IOException;\r
+import java.util.Collections;\r
+import java.util.List;\r
+\r
+import com.gitblit.build.Build;\r
+\r
+/**\r
+ * Downloads dependencies and launches command-line Federation client.\r
+ * \r
+ * @author James Moger\r
+ * \r
+ */\r
+public class FederationClientLauncher {\r
+\r
+       public static void main(String[] args) {\r
+               // download federation client runtime dependencies\r
+               Build.federationClient();\r
+\r
+               File libFolder = new File("ext");\r
+               List<File> jars = Launcher.findJars(libFolder.getAbsoluteFile());\r
+               \r
+               // sort the jars by name and then reverse the order so the newer version\r
+               // of the library gets loaded in the event that this is an upgrade\r
+               Collections.sort(jars);\r
+               Collections.reverse(jars);\r
+               for (File jar : jars) {\r
+                       try {\r
+                               Launcher.addJarFile(jar);\r
+                       } catch (IOException e) {\r
+\r
+                       }\r
+               }\r
+               \r
+               FederationClient.main(args);\r
+       }\r
+}\r
index f27ea3c22d86ae3171dc570729d306d6f4ff3ade..ef089d037a43b39b3c8afd51069c3fe653051251 100644 (file)
@@ -15,6 +15,8 @@
  */\r
 package com.gitblit;\r
 \r
+import static org.eclipse.jgit.lib.Constants.DOT_GIT_EXT;\r
+\r
 import java.io.File;\r
 import java.io.FileOutputStream;\r
 import java.net.InetAddress;\r
@@ -23,14 +25,17 @@ import java.util.ArrayList;
 import java.util.Arrays;\r
 import java.util.Collection;\r
 import java.util.Date;\r
+import java.util.HashSet;\r
 import java.util.List;\r
 import java.util.Map;\r
 import java.util.Properties;\r
+import java.util.Set;\r
 import java.util.concurrent.TimeUnit;\r
 \r
 import org.eclipse.jgit.lib.Ref;\r
 import org.eclipse.jgit.lib.Repository;\r
 import org.eclipse.jgit.lib.StoredConfig;\r
+import org.eclipse.jgit.revwalk.RevCommit;\r
 import org.eclipse.jgit.transport.CredentialsProvider;\r
 import org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider;\r
 import org.slf4j.Logger;\r
@@ -57,6 +62,8 @@ public class FederationPullExecutor implements Runnable {
 \r
        private final List<FederationModel> registrations;\r
 \r
+       private final boolean isDaemon;\r
+\r
        /**\r
         * Constructor for specifying a single federation registration. This\r
         * constructor is used to schedule the next pull execution.\r
@@ -64,7 +71,7 @@ public class FederationPullExecutor implements Runnable {
         * @param registration\r
         */\r
        private FederationPullExecutor(FederationModel registration) {\r
-               this(Arrays.asList(registration));\r
+               this(Arrays.asList(registration), true);\r
        }\r
 \r
        /**\r
@@ -73,9 +80,13 @@ public class FederationPullExecutor implements Runnable {
         * on each registrations frequency setting.\r
         * \r
         * @param registrations\r
+        * @param isDaemon\r
+        *            if true, registrations are rescheduled in perpetuity. if false,\r
+        *            the federation pull operation is executed once.\r
         */\r
-       public FederationPullExecutor(List<FederationModel> registrations) {\r
+       public FederationPullExecutor(List<FederationModel> registrations, boolean isDaemon) {\r
                this.registrations = registrations;\r
+               this.isDaemon = isDaemon;\r
        }\r
 \r
        /**\r
@@ -109,7 +120,9 @@ public class FederationPullExecutor implements Runnable {
                                                "Failed to pull from federated gitblit ({0} @ {1})", registration.name,\r
                                                registration.url), t);\r
                        } finally {\r
-                               schedule(registration);\r
+                               if (isDaemon) {\r
+                                       schedule(registration);\r
+                               }\r
                        }\r
                }\r
        }\r
@@ -149,12 +162,25 @@ public class FederationPullExecutor implements Runnable {
                                continue;\r
                        }\r
 \r
+                       // Determine local repository name\r
                        String repositoryName;\r
                        if (StringUtils.isEmpty(registrationFolder)) {\r
                                repositoryName = repository.name;\r
                        } else {\r
                                repositoryName = registrationFolder + "/" + repository.name;\r
                        }\r
+                       \r
+                       if (registration.bare) {\r
+                               // bare repository, ensure .git suffix\r
+                               if (!repositoryName.toLowerCase().endsWith(DOT_GIT_EXT)) {\r
+                                       repositoryName += DOT_GIT_EXT;\r
+                               }\r
+                       } else {\r
+                               // normal repository, strip .git suffix\r
+                               if (repositoryName.toLowerCase().endsWith(DOT_GIT_EXT)) {\r
+                                       repositoryName = repositoryName.substring(0, repositoryName.indexOf(DOT_GIT_EXT));\r
+                               }\r
+                       }\r
 \r
                        // confirm that the origin of any pre-existing repository matches\r
                        // the clone url\r
@@ -164,8 +190,10 @@ public class FederationPullExecutor implements Runnable {
                                StoredConfig config = existingRepository.getConfig();\r
                                config.load();\r
                                String origin = config.getString("remote", "origin", "url");\r
-                               fetchHead = JGitUtils.getCommit(existingRepository, "refs/remotes/origin/master")\r
-                                               .getName();\r
+                               RevCommit commit = JGitUtils.getCommit(existingRepository, "refs/remotes/origin/master");\r
+                               if (commit != null) {\r
+                                       fetchHead = commit.getName();\r
+                               }\r
                                existingRepository.close();\r
                                if (!origin.startsWith(registration.url)) {\r
                                        logger.warn(MessageFormat\r
@@ -181,6 +209,7 @@ public class FederationPullExecutor implements Runnable {
                                        Constants.FEDERATION_USER, registration.token);\r
                        logger.info(MessageFormat.format("Pulling federated repository {0} from {1} @ {2}",\r
                                        repository.name, registration.name, registration.url));\r
+                                               \r
                        CloneResult result = JGitUtils.cloneRepository(registrationFolderFile, repository.name,\r
                                        cloneUrl, registration.bare, credentials);\r
                        Repository r = GitBlit.self().getRepository(repositoryName);\r
@@ -196,8 +225,9 @@ public class FederationPullExecutor implements Runnable {
                        } else {\r
                                // fetch and update\r
                                boolean fetched = false;\r
-                               String origin = JGitUtils.getCommit(r, "refs/remotes/origin/master").getName();\r
-                               fetched = !fetchHead.equals(origin);\r
+                               RevCommit commit = JGitUtils.getCommit(r, "refs/remotes/origin/master");\r
+                               String origin = commit.getName();\r
+                               fetched = fetchHead == null || !fetchHead.equals(origin);\r
 \r
                                if (registration.mirror) {\r
                                        // mirror\r
@@ -225,6 +255,16 @@ public class FederationPullExecutor implements Runnable {
                                // preserve local settings\r
                                repository.isFrozen = rm.isFrozen;\r
                                repository.federationStrategy = rm.federationStrategy;\r
+                               \r
+                               // merge federation sets\r
+                               Set<String> federationSets = new HashSet<String>();\r
+                               if (rm.federationSets != null) {\r
+                                       federationSets.addAll(rm.federationSets);\r
+                               }\r
+                               if (repository.federationSets != null) {\r
+                                       federationSets.addAll(repository.federationSets);\r
+                               }\r
+                               repository.federationSets = new ArrayList<String>(federationSets);\r
                        }\r
                        // only repositories that are actually _cloned_ from the origin\r
                        // Gitblit repository are marked as federated. If the origin\r
index c2b214b4938b9770d5007fc1d9ac3370c0626fb4..62b93e7c9c58b9db48e7eef7ea9d4194b0f371d9 100644 (file)
@@ -61,6 +61,7 @@ import com.gitblit.models.FederationModel;
 import com.gitblit.models.FederationProposal;\r
 import com.gitblit.models.RepositoryModel;\r
 import com.gitblit.models.UserModel;\r
+import com.gitblit.utils.FederationUtils;\r
 import com.gitblit.utils.JGitUtils;\r
 import com.gitblit.utils.StringUtils;\r
 import com.google.gson.Gson;\r
@@ -830,8 +831,8 @@ public class GitBlit implements ServletContextListener {
                // Schedule the federation executor\r
                List<FederationModel> registrations = getFederationRegistrations();\r
                if (registrations.size() > 0) {\r
-                       scheduledExecutor.schedule(new FederationPullExecutor(registrations), 1,\r
-                                       TimeUnit.MINUTES);\r
+                       FederationPullExecutor executor = new FederationPullExecutor(registrations, true);\r
+                       scheduledExecutor.schedule(executor, 1, TimeUnit.MINUTES);\r
                }\r
        }\r
 \r
@@ -843,79 +844,7 @@ public class GitBlit implements ServletContextListener {
         */\r
        public List<FederationModel> getFederationRegistrations() {\r
                if (federationRegistrations.isEmpty()) {\r
-                       List<String> keys = settings.getAllKeys(Keys.federation._ROOT);\r
-                       keys.remove(Keys.federation.name);\r
-                       keys.remove(Keys.federation.passphrase);\r
-                       keys.remove(Keys.federation.allowProposals);\r
-                       keys.remove(Keys.federation.proposalsFolder);\r
-                       keys.remove(Keys.federation.defaultFrequency);\r
-                       keys.remove(Keys.federation.sets);\r
-                       Collections.sort(keys);\r
-                       Map<String, FederationModel> federatedModels = new HashMap<String, FederationModel>();\r
-                       for (String key : keys) {\r
-                               String value = key.substring(Keys.federation._ROOT.length() + 1);\r
-                               List<String> values = StringUtils.getStringsFromValue(value, "\\.");\r
-                               String server = values.get(0);\r
-                               if (!federatedModels.containsKey(server)) {\r
-                                       federatedModels.put(server, new FederationModel(server));\r
-                               }\r
-                               String setting = values.get(1);\r
-                               if (setting.equals("url")) {\r
-                                       // url of the origin Gitblit instance\r
-                                       federatedModels.get(server).url = settings.getString(key, "");\r
-                               } else if (setting.equals("token")) {\r
-                                       // token for the origin Gitblit instance\r
-                                       federatedModels.get(server).token = settings.getString(key, "");\r
-                               } else if (setting.equals("frequency")) {\r
-                                       // frequency of the pull operation\r
-                                       federatedModels.get(server).frequency = settings.getString(key, "");\r
-                               } else if (setting.equals("folder")) {\r
-                                       // destination folder of the pull operation\r
-                                       federatedModels.get(server).folder = settings.getString(key, "");\r
-                               } else if (setting.equals("bare")) {\r
-                                       // whether pulled repositories should be bare\r
-                                       federatedModels.get(server).bare = settings.getBoolean(key, true);\r
-                               } else if (setting.equals("mirror")) {\r
-                                       // are the repositories to be true mirrors of the origin\r
-                                       federatedModels.get(server).mirror = settings.getBoolean(key, true);\r
-                               } else if (setting.equals("mergeAccounts")) {\r
-                                       // merge remote accounts into local accounts\r
-                                       federatedModels.get(server).mergeAccounts = settings.getBoolean(key, false);\r
-                               } else if (setting.equals("sendStatus")) {\r
-                                       // send a status acknowledgment to source Gitblit instance\r
-                                       // at end of git pull\r
-                                       federatedModels.get(server).sendStatus = settings.getBoolean(key, false);\r
-                               } else if (setting.equals("notifyOnError")) {\r
-                                       // notify administrators on federation pull failures\r
-                                       federatedModels.get(server).notifyOnError = settings.getBoolean(key, false);\r
-                               } else if (setting.equals("exclude")) {\r
-                                       // excluded repositories\r
-                                       federatedModels.get(server).exclusions = settings.getStrings(key);\r
-                               } else if (setting.equals("include")) {\r
-                                       // included repositories\r
-                                       federatedModels.get(server).inclusions = settings.getStrings(key);\r
-                               }\r
-                       }\r
-\r
-                       // verify that registrations have a url and a token\r
-                       for (FederationModel model : federatedModels.values()) {\r
-                               if (StringUtils.isEmpty(model.url)) {\r
-                                       logger.warn(MessageFormat.format(\r
-                                                       "Dropping federation registration {0}. Missing url.", model.name));\r
-                                       continue;\r
-                               }\r
-                               if (StringUtils.isEmpty(model.token)) {\r
-                                       logger.warn(MessageFormat.format(\r
-                                                       "Dropping federation registration {0}. Missing token.", model.name));\r
-                                       continue;\r
-                               }\r
-                               // set default frequency if unspecified\r
-                               if (StringUtils.isEmpty(model.frequency)) {\r
-                                       model.frequency = settings.getString(Keys.federation.defaultFrequency,\r
-                                                       "60 mins");\r
-                               }\r
-                               federationRegistrations.add(model);\r
-                       }\r
+                       federationRegistrations.addAll(FederationUtils.getFederationRegistrations(settings));\r
                }\r
                return federationRegistrations;\r
        }\r
@@ -1239,7 +1168,7 @@ public class GitBlit implements ServletContextListener {
         * \r
         * @param settings\r
         */\r
-       public void configureContext(IStoredSettings settings) {\r
+       public void configureContext(IStoredSettings settings, boolean startFederation) {\r
                logger.info("Reading configuration from " + settings.toString());\r
                this.settings = settings;\r
                repositoriesFolder = new File(settings.getString(Keys.git.repositoriesFolder, "git"));\r
@@ -1268,13 +1197,15 @@ public class GitBlit implements ServletContextListener {
                        loginService = new FileUserService(realmFile);\r
                }\r
                setUserService(loginService);\r
-               configureFederation();\r
                mailExecutor = new MailExecutor(settings);\r
                if (mailExecutor.isReady()) {\r
                        scheduledExecutor.scheduleAtFixedRate(mailExecutor, 1, 2, TimeUnit.MINUTES);\r
                } else {\r
                        logger.warn("Mail server is not properly configured.  Mail services disabled.");\r
                }\r
+               if (startFederation) {\r
+                       configureFederation();\r
+               }\r
        }\r
 \r
        /**\r
@@ -1288,7 +1219,7 @@ public class GitBlit implements ServletContextListener {
                if (settings == null) {\r
                        // Gitblit WAR is running in a servlet container\r
                        WebXmlSettings webxmlSettings = new WebXmlSettings(contextEvent.getServletContext());\r
-                       configureContext(webxmlSettings);\r
+                       configureContext(webxmlSettings, true);\r
                }\r
        }\r
 \r
index d2164f18d4b505130933a9745596e7bdd7ee8532..039f59d3a78e168c75fa14a71a585ce7139ffbab 100644 (file)
@@ -237,7 +237,7 @@ public class GitBlitServer {
 \r
                // Setup the GitBlit context\r
                GitBlit gitblit = GitBlit.self();\r
-               gitblit.configureContext(settings);\r
+               gitblit.configureContext(settings, true);\r
                rootContext.addEventListener(gitblit);\r
 \r
                try {\r
index 403422691886775aa8d70ae65b527a7f3514fcf4..684f2787fb52c07e8f40738791e955c4522943bc 100644 (file)
@@ -115,6 +115,19 @@ public class Build {
                // needed for site publishing\r
                downloadFromApache(MavenObject.COMMONSNET, BuildType.RUNTIME);\r
        }\r
+       \r
+       public static void federationClient() {\r
+               downloadFromApache(MavenObject.JCOMMANDER, BuildType.RUNTIME);\r
+               downloadFromApache(MavenObject.SERVLET, BuildType.RUNTIME);\r
+               downloadFromApache(MavenObject.MAIL, BuildType.RUNTIME);\r
+               downloadFromApache(MavenObject.SLF4JAPI, BuildType.RUNTIME);\r
+               downloadFromApache(MavenObject.SLF4LOG4J, BuildType.RUNTIME);\r
+               downloadFromApache(MavenObject.LOG4J, BuildType.RUNTIME);\r
+               downloadFromApache(MavenObject.GSON, BuildType.RUNTIME);\r
+               downloadFromApache(MavenObject.JSCH, BuildType.RUNTIME);\r
+               \r
+               downloadFromEclipse(MavenObject.JGIT, BuildType.RUNTIME);\r
+       }\r
 \r
        /**\r
         * Builds the Keys class based on the gitblit.properties file and inserts\r
index efb1b32281c192505f09801d1dd08e97ccf6647c..d67ae561bba2f71379d32fc00f8a46d35926b33e 100644 (file)
@@ -73,6 +73,8 @@ public class FederationModel implements Serializable, Comparable<FederationModel
         */\r
        public FederationModel(String serverName) {\r
                this.name = serverName;\r
+               bare = true;\r
+               mirror = true;\r
                this.lastPull = new Date(0);\r
                this.nextPull = new Date(0);\r
        }\r
index 4cb6881a117525169299ec8d42047e9ac2961514..9fd8817371108bdfdfa6e06b2536c37823000838 100644 (file)
@@ -26,7 +26,10 @@ import java.net.URLConnection;
 import java.security.SecureRandom;\r
 import java.security.cert.CertificateException;\r
 import java.security.cert.X509Certificate;\r
+import java.text.MessageFormat;\r
+import java.util.ArrayList;\r
 import java.util.Collection;\r
+import java.util.Collections;\r
 import java.util.HashMap;\r
 import java.util.List;\r
 import java.util.Map;\r
@@ -39,8 +42,13 @@ import javax.net.ssl.TrustManager;
 import javax.net.ssl.X509TrustManager;\r
 import javax.servlet.http.HttpServletResponse;\r
 \r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
+\r
 import com.gitblit.Constants.FederationRequest;\r
 import com.gitblit.FederationServlet;\r
+import com.gitblit.IStoredSettings;\r
+import com.gitblit.Keys;\r
 import com.gitblit.models.FederationModel;\r
 import com.gitblit.models.FederationProposal;\r
 import com.gitblit.models.RepositoryModel;\r
@@ -74,6 +82,8 @@ public class FederationUtils {
        private static final SSLContext SSL_CONTEXT;\r
 \r
        private static final DummyHostnameVerifier HOSTNAME_VERIFIER;\r
+       \r
+       private static final Logger LOGGER = LoggerFactory.getLogger(FederationUtils.class);\r
 \r
        static {\r
                SSLContext context = null;\r
@@ -88,6 +98,89 @@ public class FederationUtils {
                CHARSET = "UTF-8";\r
        }\r
 \r
+       /**\r
+        * Returns the list of federated gitblit instances that this instance will\r
+        * try to pull.\r
+        * \r
+        * @return list of registered gitblit instances\r
+        */\r
+       public static List<FederationModel> getFederationRegistrations(IStoredSettings settings) {\r
+               List<FederationModel> federationRegistrations = new ArrayList<FederationModel>();\r
+               List<String> keys = settings.getAllKeys(Keys.federation._ROOT);\r
+               keys.remove(Keys.federation.name);\r
+               keys.remove(Keys.federation.passphrase);\r
+               keys.remove(Keys.federation.allowProposals);\r
+               keys.remove(Keys.federation.proposalsFolder);\r
+               keys.remove(Keys.federation.defaultFrequency);\r
+               keys.remove(Keys.federation.sets);\r
+               Collections.sort(keys);\r
+               Map<String, FederationModel> federatedModels = new HashMap<String, FederationModel>();\r
+               for (String key : keys) {\r
+                       String value = key.substring(Keys.federation._ROOT.length() + 1);\r
+                       List<String> values = StringUtils.getStringsFromValue(value, "\\.");\r
+                       String server = values.get(0);\r
+                       if (!federatedModels.containsKey(server)) {\r
+                               federatedModels.put(server, new FederationModel(server));\r
+                       }\r
+                       String setting = values.get(1);\r
+                       if (setting.equals("url")) {\r
+                               // url of the origin Gitblit instance\r
+                               federatedModels.get(server).url = settings.getString(key, "");\r
+                       } else if (setting.equals("token")) {\r
+                               // token for the origin Gitblit instance\r
+                               federatedModels.get(server).token = settings.getString(key, "");\r
+                       } else if (setting.equals("frequency")) {\r
+                               // frequency of the pull operation\r
+                               federatedModels.get(server).frequency = settings.getString(key, "");\r
+                       } else if (setting.equals("folder")) {\r
+                               // destination folder of the pull operation\r
+                               federatedModels.get(server).folder = settings.getString(key, "");\r
+                       } else if (setting.equals("bare")) {\r
+                               // whether pulled repositories should be bare\r
+                               federatedModels.get(server).bare = settings.getBoolean(key, true);\r
+                       } else if (setting.equals("mirror")) {\r
+                               // are the repositories to be true mirrors of the origin\r
+                               federatedModels.get(server).mirror = settings.getBoolean(key, true);\r
+                       } else if (setting.equals("mergeAccounts")) {\r
+                               // merge remote accounts into local accounts\r
+                               federatedModels.get(server).mergeAccounts = settings.getBoolean(key, false);\r
+                       } else if (setting.equals("sendStatus")) {\r
+                               // send a status acknowledgment to source Gitblit instance\r
+                               // at end of git pull\r
+                               federatedModels.get(server).sendStatus = settings.getBoolean(key, false);\r
+                       } else if (setting.equals("notifyOnError")) {\r
+                               // notify administrators on federation pull failures\r
+                               federatedModels.get(server).notifyOnError = settings.getBoolean(key, false);\r
+                       } else if (setting.equals("exclude")) {\r
+                               // excluded repositories\r
+                               federatedModels.get(server).exclusions = settings.getStrings(key);\r
+                       } else if (setting.equals("include")) {\r
+                               // included repositories\r
+                               federatedModels.get(server).inclusions = settings.getStrings(key);\r
+                       }\r
+               }\r
+\r
+               // verify that registrations have a url and a token\r
+               for (FederationModel model : federatedModels.values()) {\r
+                       if (StringUtils.isEmpty(model.url)) {\r
+                               LOGGER.warn(MessageFormat.format(\r
+                                               "Dropping federation registration {0}. Missing url.", model.name));\r
+                               continue;\r
+                       }\r
+                       if (StringUtils.isEmpty(model.token)) {\r
+                               LOGGER.warn(MessageFormat.format(\r
+                                               "Dropping federation registration {0}. Missing token.", model.name));\r
+                               continue;\r
+                       }\r
+                       // set default frequency if unspecified\r
+                       if (StringUtils.isEmpty(model.frequency)) {\r
+                               model.frequency = settings.getString(Keys.federation.defaultFrequency, "60 mins");\r
+                       }\r
+                       federationRegistrations.add(model);\r
+               }\r
+               return federationRegistrations;\r
+       }\r
+\r
        /**\r
         * Sends a federation proposal to the Gitblit instance at remoteUrl\r
         * \r
index faca9cb670b30cde9cf6b69005d9c1442df8c928..bfbc62400f86a17bdd9363500c4348e3f6372a63 100644 (file)
@@ -37,8 +37,6 @@ import java.util.zip.ZipOutputStream;
 import org.eclipse.jgit.api.CloneCommand;\r
 import org.eclipse.jgit.api.FetchCommand;\r
 import org.eclipse.jgit.api.Git;\r
-import org.eclipse.jgit.api.PullCommand;\r
-import org.eclipse.jgit.api.PullResult;\r
 import org.eclipse.jgit.api.ResetCommand;\r
 import org.eclipse.jgit.api.ResetCommand.ResetType;\r
 import org.eclipse.jgit.diff.DiffEntry;\r
@@ -142,6 +140,7 @@ public class JGitUtils {
         * Encapsulates the result of cloning or pulling from a repository.\r
         */\r
        public static class CloneResult {\r
+               public String name;\r
                public FetchResult fetchResult;\r
                public boolean createdRepository;\r
        }\r
@@ -175,12 +174,22 @@ public class JGitUtils {
         * @return CloneResult\r
         * @throws Exception\r
         */\r
-       public static CloneResult cloneRepository(File repositoriesFolder, String name, String fromUrl, boolean bare,\r
-                       CredentialsProvider credentialsProvider) throws Exception {\r
+       public static CloneResult cloneRepository(File repositoriesFolder, String name, String fromUrl,\r
+                       boolean bare, CredentialsProvider credentialsProvider) throws Exception {\r
                CloneResult result = new CloneResult();\r
-               if (bare && !name.toLowerCase().endsWith(Constants.DOT_GIT_EXT)) {\r
-                       name += Constants.DOT_GIT_EXT;\r
+               if (bare) {\r
+                       // bare repository, ensure .git suffix\r
+                       if (!name.toLowerCase().endsWith(Constants.DOT_GIT_EXT)) {\r
+                               name += Constants.DOT_GIT_EXT;\r
+                       }\r
+               } else {\r
+                       // normal repository, strip .git suffix\r
+                       if (name.toLowerCase().endsWith(Constants.DOT_GIT_EXT)) {\r
+                               name = name.substring(0, name.indexOf(Constants.DOT_GIT_EXT));\r
+                       }\r
                }\r
+               result.name = name;\r
+\r
                File folder = new File(repositoriesFolder, name);\r
                if (folder.exists()) {\r
                        File gitDir = FileKey.resolve(new File(repositoriesFolder, name), FS.DETECTED);\r
index 2908383ef1ee8b1d8f4d7da8cba3858a4c20d496..52a1d0bfca45228d0f7c0e3e8dae981d7e402f60 100644 (file)
@@ -73,7 +73,7 @@ public class GitBlitSuite extends TestSetup {
        @Override\r
        protected void setUp() throws Exception {\r
                FileSettings settings = new FileSettings("distrib/gitblit.properties");\r
-               GitBlit.self().configureContext(settings);\r
+               GitBlit.self().configureContext(settings, true);\r
                FileUserService loginService = new FileUserService(new File("distrib/users.properties"));\r
                GitBlit.self().setUserService(loginService);\r
 \r
diff --git a/tools/GenJar.jar b/tools/GenJar.jar
new file mode 100644 (file)
index 0000000..6f225cb
Binary files /dev/null and b/tools/GenJar.jar differ