From 93d506581010cdb6308ae3d282a8bc513966d70d Mon Sep 17 00:00:00 2001 From: James Moger Date: Tue, 15 Jan 2013 22:17:08 -0500 Subject: [PATCH] Support --baseFolder parameter and small data reorganization --- .gitignore | 3 +- build.xml | 210 +++++++++++++----- distrib/authority.cmd | 2 +- distrib/gitblit | 5 +- distrib/gitblit-centos | 5 +- distrib/gitblit-stop.cmd | 2 +- distrib/gitblit-ubuntu | 3 +- distrib/gitblit.cmd | 2 +- distrib/gitblit.properties | 47 +++- {groovy => distrib/groovy}/.gitignore | 0 {groovy => distrib/groovy}/blockpush.groovy | 0 {groovy => distrib/groovy}/jenkins.groovy | 0 {groovy => distrib/groovy}/localclone.groovy | 0 .../groovy}/protect-refs.groovy | 0 .../groovy}/sendmail-html.groovy | 0 {groovy => distrib/groovy}/sendmail.groovy | 0 {groovy => distrib/groovy}/thebuggenie.groovy | 0 distrib/installService.cmd | 4 +- distrib/projects.conf | 3 + docs/01_setup.mkd | 134 ++++++----- docs/04_releases.mkd | 18 +- src/WEB-INF/web.xml | 24 ++ src/com/gitblit/Constants.java | 8 +- src/com/gitblit/FederationClient.java | 2 +- src/com/gitblit/GitBlit.java | 111 +++++---- src/com/gitblit/GitBlitServer.java | 54 +++-- src/com/gitblit/GitServlet.java | 2 +- src/com/gitblit/GitblitUserService.java | 2 +- src/com/gitblit/LdapUserService.java | 2 +- src/com/gitblit/RedmineUserService.java | 2 +- src/com/gitblit/RobotsTxtServlet.java | 10 +- .../gitblit/authority/GitblitAuthority.java | 38 +++- src/com/gitblit/build/Build.java | 2 +- src/com/gitblit/build/BuildWebXml.java | 64 +++--- src/com/gitblit/utils/FileUtils.java | 15 ++ .../wicket/pages/ChangePasswordPage.java | 2 +- .../gitblit/wicket/pages/EditUserPage.java | 2 +- .../wicket/pages/RepositoriesPage.java | 2 +- test-gitblit.properties | 6 +- tests/com/gitblit/tests/GitBlitSuite.java | 5 +- tests/com/gitblit/tests/GitBlitTest.java | 2 +- 41 files changed, 534 insertions(+), 259 deletions(-) rename {groovy => distrib/groovy}/.gitignore (100%) rename {groovy => distrib/groovy}/blockpush.groovy (100%) rename {groovy => distrib/groovy}/jenkins.groovy (100%) rename {groovy => distrib/groovy}/localclone.groovy (100%) rename {groovy => distrib/groovy}/protect-refs.groovy (100%) rename {groovy => distrib/groovy}/sendmail-html.groovy (100%) rename {groovy => distrib/groovy}/sendmail.groovy (100%) rename {groovy => distrib/groovy}/thebuggenie.groovy (100%) create mode 100644 distrib/projects.conf diff --git a/.gitignore b/.gitignore index e335123e..65b74abc 100644 --- a/.gitignore +++ b/.gitignore @@ -31,4 +31,5 @@ /deploy /*.jks /x509test -/certs \ No newline at end of file +/certs +/data diff --git a/build.xml b/build.xml index 200fc91c..4a4633c3 100644 --- a/build.xml +++ b/build.xml @@ -12,10 +12,11 @@ - + - + + @@ -106,22 +107,66 @@ --> - - + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -186,18 +231,45 @@ + + + + - + + + + + + + + + + + + + + + + + + + + + + + - - + + + @@ -234,20 +306,8 @@ - - - - - - - - - - - - - + @@ -383,9 +443,6 @@ - - - @@ -404,19 +461,28 @@ + + + + + + + + + + - - - + + + - - + @@ -426,8 +492,6 @@ - - @@ -467,7 +531,7 @@ - + @@ -554,7 +618,7 @@ Building Gitblit Federation Client ${gb.version} - + @@ -575,16 +639,21 @@ - + - + + + + + + @@ -619,10 +688,20 @@ + + + + + + + + + + - - - + + + @@ -663,6 +742,8 @@ + + @@ -680,7 +761,7 @@ - + @@ -695,7 +776,7 @@ Building Gitblit Manager ${gb.version} - + @@ -747,13 +828,18 @@ - + - + + + + + + @@ -765,7 +851,7 @@ Building Gitblit Authority ${gb.version} - + @@ -812,13 +898,15 @@ - + - - + + + + @@ -835,7 +923,7 @@ Building Gitblit API Library ${gb.version} - + @@ -850,7 +938,7 @@ - + @@ -862,7 +950,7 @@ - + @@ -872,18 +960,20 @@ - - + + - + + + + + - - @@ -892,6 +982,16 @@ + + + + + + + + + + diff --git a/distrib/authority.cmd b/distrib/authority.cmd index 145f5242..75cb0cf7 100644 --- a/distrib/authority.cmd +++ b/distrib/authority.cmd @@ -1 +1 @@ -@java -jar authority.jar +@java -jar authority.jar --baseFolder data diff --git a/distrib/gitblit b/distrib/gitblit index cd1f967e..6c74d547 100644 --- a/distrib/gitblit +++ b/distrib/gitblit @@ -3,6 +3,7 @@ set -e GITBLIT_PATH=/opt/gitblit +GITBLIT_BASE_FOLDER=/opt/gitblit/data GITBLIT_HTTP_PORT=0 GITBLIT_HTTPS_PORT=8443 source ${GITBLIT_PATH}/java-proxy-config.sh @@ -14,13 +15,13 @@ case "$1" in start) log_action_begin_msg "Starting gitblit server" cd $GITBLIT_PATH - $JAVA $GITBLIT_PATH/gitblit.jar --httpsPort $GITBLIT_HTTPS_PORT --httpPort $GITBLIT_HTTP_PORT > /dev/null & + $JAVA $GITBLIT_PATH/gitblit.jar --httpsPort $GITBLIT_HTTPS_PORT --httpPort $GITBLIT_HTTP_PORT --baseFolder $GITBLIT_BASE_FOLDER > /dev/null & log_action_end_msg $? ;; stop) log_action_begin_msg "Stopping gitblit server" cd $GITBLIT_PATH - $JAVA $GITBLIT_PATH/gitblit.jar --stop > /dev/null & + $JAVA $GITBLIT_PATH/gitblit.jar --baseFolder $GITBLIT_BASE_FOLDER --stop > /dev/null & log_action_end_msg $? ;; force-reload|restart) diff --git a/distrib/gitblit-centos b/distrib/gitblit-centos index c608097e..04c9a9b4 100644 --- a/distrib/gitblit-centos +++ b/distrib/gitblit-centos @@ -6,6 +6,7 @@ # change theses values (default values) GITBLIT_PATH=/opt/gitblit +GITBLIT_BASE_FOLDER=/opt/gitblit/data GITBLIT_HTTP_PORT=0 GITBLIT_HTTPS_PORT=8443 source ${GITBLIT_PATH}/java-proxy-config.sh @@ -19,7 +20,7 @@ case "$1" in then echo $"Starting gitblit server" cd $GITBLIT_PATH - $JAVA $GITBLIT_PATH/gitblit.jar --httpsPort $GITBLIT_HTTPS_PORT --httpPort $GITBLIT_HTTP_PORT > /dev/null & + $JAVA $GITBLIT_PATH/gitblit.jar --httpsPort $GITBLIT_HTTPS_PORT --httpPort $GITBLIT_HTTP_PORT --baseFolder $GITBLIT_BASE_FOLDER > /dev/null & echo "." exit $RETVAL fi @@ -30,7 +31,7 @@ case "$1" in then echo $"Stopping gitblit server" cd $GITBLIT_PATH - $JAVA $GITBLIT_PATH/gitblit.jar --stop > /dev/null & + $JAVA $GITBLIT_PATH/gitblit.jar --baseFolder $GITBLIT_BASE_FOLDER --stop > /dev/null & echo "." exit $RETVAL fi diff --git a/distrib/gitblit-stop.cmd b/distrib/gitblit-stop.cmd index c139d57b..5820c491 100644 --- a/distrib/gitblit-stop.cmd +++ b/distrib/gitblit-stop.cmd @@ -1 +1 @@ -@java -jar gitblit.jar --stop +@java -jar gitblit.jar --stop --baseFolder data diff --git a/distrib/gitblit-ubuntu b/distrib/gitblit-ubuntu index b047ed97..4ff275d0 100644 --- a/distrib/gitblit-ubuntu +++ b/distrib/gitblit-ubuntu @@ -8,9 +8,10 @@ PATH=/sbin:/bin:/usr/bin:/usr/sbin # change theses values (default values) GITBLIT_PATH=/opt/gitblit +GITBLIT_BASE_FOLDER=/opt/gitblit/data GITBLIT_USER="gitblit" source ${GITBLIT_PATH}/java-proxy-config.sh -ARGS="-server -Xmx1024M ${JAVA_PROXY_CONFIG} -Djava.awt.headless=true -jar gitblit.jar" +ARGS="-server -Xmx1024M ${JAVA_PROXY_CONFIG} -Djava.awt.headless=true -jar gitblit.jar --baseFolder $GITBLIT_BASE_FOLDER" RETVAL=0 diff --git a/distrib/gitblit.cmd b/distrib/gitblit.cmd index ce96a797..3006a687 100644 --- a/distrib/gitblit.cmd +++ b/distrib/gitblit.cmd @@ -1 +1 @@ -@java -jar gitblit.jar +@java -jar gitblit.jar --baseFolder data diff --git a/distrib/gitblit.properties b/distrib/gitblit.properties index 758137e3..f5cc19b6 100644 --- a/distrib/gitblit.properties +++ b/distrib/gitblit.properties @@ -1,4 +1,19 @@ # +# Gitblit Settings +# + +# This settings file supports parameterization from the command-line for the +# following command-line parameters: +# +# --baseFolder ${baseFolder} SINCE 1.2.1 +# +# Settings that support ${baseFolder} parameter substitution are indicated with the +# BASEFOLDER attribute. If the --baseFolder argument is unspecified, ${baseFolder} +# and it's trailing / will be discarded from the setting value leaving a relative +# path that is equivalent to pre-1.2.1 releases. +# +# e.g. "${baseFolder}/git" becomes "git", if --baseFolder is unspecified +# # Git Servlet Settings # @@ -10,7 +25,8 @@ # # SINCE 0.5.0 # RESTART REQUIRED -git.repositoriesFolder = git +# BASEFOLDER +git.repositoriesFolder = ${baseFolder}/git # Build the available repository list at startup and cache this list for reuse. # This reduces disk io when presenting the repositories page, responding to rpcs, @@ -299,14 +315,16 @@ git.packedGitMmap = false # # RESTART REQUIRED # SINCE 0.8.0 -groovy.scriptsFolder = groovy +# BASEFOLDER +groovy.scriptsFolder = ${baseFolder}/groovy # Specify the directory Grape uses for downloading libraries. # http://groovy.codehaus.org/Grape # # RESTART REQUIRED # SINCE 1.0.0 -groovy.grapeFolder = groovy/grape +# BASEFOLDER +groovy.grapeFolder = ${baseFolder}/groovy/grape # Scripts to execute on Pre-Receive. # @@ -437,7 +455,8 @@ web.allowCookieAuthentication = true # Config file for storing project metadata # # SINCE 1.2.0 -web.projectsFile = projects.conf +# BASEFOLDER +web.projectsFile = ${baseFolder}/projects.conf # Either the full path to a user config file (users.conf) # OR the full path to a simple user properties file (users.properties) @@ -451,7 +470,8 @@ web.projectsFile = projects.conf # # SINCE 0.5.0 # RESTART REQUIRED -realm.userService = users.conf +# BASEFOLDER +realm.userService = ${baseFolder}/users.conf # How to store passwords. # Valid values are plain, md5, or combined-md5. md5 is the hash of password. @@ -510,7 +530,8 @@ web.enableRpcAdministration = false # http://googlewebmastercentral.blogspot.com/2008/06/improving-on-robots-exclusion-protocol.html # # SINCE 1.0.0 -web.robots.txt = +# BASEFOLDER +web.robots.txt = ${baseFolder}/robots.txt # If true, the web ui layout will respond and adapt to the browser's dimensions. # if false, the web ui will use a 940px fixed-width layout. @@ -609,6 +630,7 @@ web.showFederationRegistrations = false # Specifying "gitblit" uses the internal login message. # # SINCE 0.7.0 +# BASEFOLDER web.loginMessage = gitblit # This is the message displayed above the repositories table. @@ -616,6 +638,7 @@ web.loginMessage = gitblit # Specifying "gitblit" uses the internal welcome message. # # SINCE 0.5.0 +# BASEFOLDER web.repositoriesMessage = gitblit # Ordered list of charsets/encodings to use when trying to display a blob. @@ -925,7 +948,8 @@ federation.allowProposals = false # Use forward slashes even on Windows!! # # SINCE 0.6.0 -federation.proposalsFolder = proposals +# BASEFOLDER +federation.proposalsFolder = ${baseFolder}/proposals # The default pull frequency if frequency is unspecified on a registration # @@ -1027,7 +1051,8 @@ realm.ldap.password = password # # SINCE 1.0.0 # RESTART REQUIRED -realm.ldap.backingUserService = users.conf +# BASEFOLDER +realm.ldap.backingUserService = ${baseFolder}/users.conf # Delegate team membership control to LDAP. # @@ -1123,7 +1148,8 @@ realm.ldap.email = email # default: users.conf # # RESTART REQUIRED -realm.redmine.backingUserService = users.conf +# BASEFOLDER +realm.redmine.backingUserService = ${baseFolder}/users.conf # URL of the Redmine. realm.redmine.url = http://example.com/redmine @@ -1136,7 +1162,8 @@ realm.redmine.url = http://example.com/redmine # # SINCE 0.5.0 # RESTART REQUIRED -server.tempFolder = temp +# BASEFOLDER +server.tempFolder = ${baseFolder}/temp # Use Jetty NIO connectors. If false, Jetty Socket connectors will be used. # diff --git a/groovy/.gitignore b/distrib/groovy/.gitignore similarity index 100% rename from groovy/.gitignore rename to distrib/groovy/.gitignore diff --git a/groovy/blockpush.groovy b/distrib/groovy/blockpush.groovy similarity index 100% rename from groovy/blockpush.groovy rename to distrib/groovy/blockpush.groovy diff --git a/groovy/jenkins.groovy b/distrib/groovy/jenkins.groovy similarity index 100% rename from groovy/jenkins.groovy rename to distrib/groovy/jenkins.groovy diff --git a/groovy/localclone.groovy b/distrib/groovy/localclone.groovy similarity index 100% rename from groovy/localclone.groovy rename to distrib/groovy/localclone.groovy diff --git a/groovy/protect-refs.groovy b/distrib/groovy/protect-refs.groovy similarity index 100% rename from groovy/protect-refs.groovy rename to distrib/groovy/protect-refs.groovy diff --git a/groovy/sendmail-html.groovy b/distrib/groovy/sendmail-html.groovy similarity index 100% rename from groovy/sendmail-html.groovy rename to distrib/groovy/sendmail-html.groovy diff --git a/groovy/sendmail.groovy b/distrib/groovy/sendmail.groovy similarity index 100% rename from groovy/sendmail.groovy rename to distrib/groovy/sendmail.groovy diff --git a/groovy/thebuggenie.groovy b/distrib/groovy/thebuggenie.groovy similarity index 100% rename from groovy/thebuggenie.groovy rename to distrib/groovy/thebuggenie.groovy diff --git a/distrib/installService.cmd b/distrib/installService.cmd index 77b641e8..d254d679 100644 --- a/distrib/installService.cmd +++ b/distrib/installService.cmd @@ -25,12 +25,12 @@ SET ARCH=amd64 --StartPath="%CD%" ^ --StartClass=com.gitblit.Launcher ^ --StartMethod=main ^ - --StartParams="--storePassword;gitblit" ^ + --StartParams="--storePassword;gitblit;--baseFolder;%CD%\data" ^ --StartMode=jvm ^ --StopPath="%CD%" ^ --StopClass=com.gitblit.Launcher ^ --StopMethod=main ^ - --StopParams="--stop" ^ + --StopParams="--stop;--baseFolder;%CD%\data" ^ --StopMode=jvm ^ --Classpath="%CD%\gitblit.jar" ^ --Jvm=auto ^ diff --git a/distrib/projects.conf b/distrib/projects.conf new file mode 100644 index 00000000..d43f4829 --- /dev/null +++ b/distrib/projects.conf @@ -0,0 +1,3 @@ +[project "main"] + title = Main Repositories + description = main group of repositories \ No newline at end of file diff --git a/docs/01_setup.mkd b/docs/01_setup.mkd index be0e191f..cea1d692 100644 --- a/docs/01_setup.mkd +++ b/docs/01_setup.mkd @@ -1,53 +1,55 @@ -## Gitblit WAR Setup +## Gitblit WAR Installation & Setup 1. Download [Gitblit WAR %VERSION%](http://code.google.com/p/gitblit/downloads/detail?name=%WAR%) to the webapps folder of your servlet container. 2. You may have to manually extract the WAR (zip file) to a folder within your webapps folder. -3. Copy the `WEB-INF/users.conf` file to a location outside the webapps folder that is accessible by your servlet container. -Optionally copy the example hook scripts in `WEB-INF/groovy` to a location outside the webapps folder that is accesible by your servlet container. -4. The Gitblit webapp is configured through its `web.xml` file. -Open `web.xml` in your favorite text editor and make sure to review and set: - - <context-parameter> *git.repositoryFolder* (set the full path to your repositories folder) - - <context-parameter> *groovy.scriptsFolder* (set the full path to your Groovy hook scripts folder) - - <context-parameter> *groovy.grapeFolder* (set the full path to your Groovy Grape artifact cache) - - <context-parameter> *web.projectsFile* (set the full path to your projects metadata file) - - <context-parameter> *realm.userService* (set the full path to `users.conf`) +3. By default, the Gitblit webapp is configured through `WEB-INF/data/gitblit.properties`.
+Open `WEB-INF/data/gitblit.properties` in your favorite text editor and make sure to review and set: - <context-parameter> *git.packedGitLimit* (set larger than the size of your largest repository) - <context-parameter> *git.streamFileThreshold* (set larger than the size of your largest committed file) -5. You may have to restart your servlet container. -6. Open your browser to or whatever the url should be. -7. Enter the default administrator credentials: **admin / admin** and click the *Login* button +4. You may have to restart your servlet container. +5. Open your browser to or whatever the url should be. +6. Enter the default administrator credentials: **admin / admin** and click the *Login* button **NOTE:** Make sure to change the administrator username and/or password!! -## Gitblit GO Setup +### WAR Data Location +By default, Gitblit WAR stores all data (users, settings, repositories, etc) in `${contextFolder}/WEB-INF/data`. This is fine for a quick setup, but there are many reasons why you don't want to keep your data within the webapps folder of your servlet container. You may specify an external location for your data by editing `WEB-INF/web.xml` and manipulating the *baseFolder* context parameter. Choose a location that is writeable by your servlet container. Your servlet container may be smart enough to recognize the change and to restart Gitblit. + +On the next restart of Gitblit, Gitblit will copy the contents of the `WEB-INF/data` folder to your specified *baseFolder* **IF** the file `${baseFolder}/gitblit.properties` does not already exist. This allows you to get going with minimal fuss. + +Specifying an alternate *baseFolder* also allows for simpler upgrades in the future. + +## Gitblit GO Installation & Setup 1. Download and unzip [Gitblit GO %VERSION%](http://code.google.com/p/gitblit/downloads/detail?name=%GO%). *Its best to eliminate spaces in the path name.* -2. The server itself is configured through a simple text file. -Open `gitblit.properties` in your favorite text editor and make sure to review and set: - - *git.repositoryFolder* (path may be relative or absolute) - - *groovy.scriptsFolder* (path may be relative or absolute) - - *groovy.grapeFolder* (path may be relative or absolute) - - *server.tempFolder* (path may be relative or absolute) +2. The server itself is configured through a simple text file.
+Open `data/gitblit.properties` in your favorite text editor and make sure to review and set: - *server.httpPort* and *server.httpsPort* - *server.httpBindInterface* and *server.httpsBindInterface* - *server.storePassword* **https** is strongly recommended because passwords are insecurely transmitted form your browser/git client using Basic authentication! - *git.packedGitLimit* (set larger than the size of your largest repository) - *git.streamFileThreshold* (set larger than the size of your largest committed file) -3. Execute `authority.cmd` or `java -jar authority.jar` from a command-line +3. Execute `authority.cmd` or `java -jar authority.jar --baseFolder data` from a command-line 1. fill out the fields in the *new certificate defaults* dialog 2. enter the store password used in *server.storePassword* when prompted. This generates an SSL certificate for **localhost**. 3. you may want to generate an SSL certificate for the hostname or ip address hostnames you are serving from
**NOTE:** You can only have **one** SSL certificate specified for a port. 5. exit the authority app -4. Execute `gitblit.cmd` or `java -jar gitblit.jar` from a command-line +4. Execute `gitblit.cmd` or `java -jar gitblit.jar --baseFolder data` from a command-line 5. Open your browser to or depending on your chosen configuration. 6. Enter the default administrator credentials: **admin / admin** and click the *Login* button **NOTE:** Make sure to change the administrator username and/or password!! +### GO Data Location + +By default, Gitblit GO stores all data (users, settings, repositories, etc) in the `data` subfolder of your GO installation. You may specify an external location for your data on the command-line by setting the *--baseFolder* argument. If you relocate the data folder then you must supply the *--baseFolder* argument to both GO and the Certificate Authority. + +If you are deploying Gitblit to a *nix platform, you might consider moving the data folder out of the GO installation folder and then creating a symlink named "data" that points to your moved folder. + ### Creating your own Self-Signed SSL Certificate Gitblit GO (and Gitblit Certificate Authority) automatically generates a Certificate Authority (CA) certificate and an ssl certificate signed by this CA certificate that is bound to *localhost*. -Remote Eclipse/EGit/JGit clients (<= 2.1.0) will fail to communicate using this certificate because JGit always verifies the hostname of the certificate, regardless of the *http.sslVerify=false* client-side setting. +Remote Eclipse/EGit/JGit clients (<= 2.2.0) will fail to communicate using this certificate because JGit always verifies the hostname of the certificate, regardless of the *http.sslVerify=false* client-side setting. The EGit failure message is something like: @@ -56,7 +58,7 @@ The EGit failure message is something like: If you want to serve your repositories to another machine over https then you will want to generate a new certificate for the hostname or ip address you are serving from. -1. `authority.cmd` or `java -jar authority.jar` +1. `authority.cmd` or `java -jar authority.jar --baseFolder data` 2. Click the *new ssl certificate* button (red rosette in the toolbar in upper left of window) 3. Enter the hostname or ip address 4. Make sure the checkbox *serve https with this certificate* is checked @@ -64,11 +66,11 @@ If you want to serve your repositories to another machine over https then you wi If you decide to change the value of *server.storePassword* (recommended) after you have already started Gitblit or Gitblit Certificate Authority, then you will have to delete the following files and then restart the Gitblit Certificate Authority app: -1. serverKeyStore.jks -2. serverTrustStore.jks -3. certs/caKeyStore.jks -4. certs/ca.crt -5. certs/caRevocationList.crl (optional) +1. data/serverKeyStore.jks +2. data/serverTrustStore.jks +3. data/certs/caKeyStore.jks +4. data/certs/ca.crt +5. data/certs/caRevocationList.crl (optional) ### Client SSL Certificates SINCE 1.2.0 @@ -84,6 +86,7 @@ Gitblit must be able to map the DN of the certificate to an *existing* account u How do you make your servlet container trust a client certificate? In the WAR variant, you will have to manually setup your servlet container to: + 1. want/need client certificates 2. trust a CA certificate used to sign your client certificates 3. generate client certificates signed by your CA certificate @@ -92,9 +95,9 @@ Alternatively, Gitblit GO is designed to facilitate use of client certificate au #### Creating SSL Certificates with Gitblit Certificate Authority -When you generate a new client certificate, a zip file bundle is created which includes a P12 keystore for browsers and a PEM keystore for Git. Both of these are password-protected. Additionally, a personalized README file is generated with setup instructions for popular browsers and Git. The README is generated from `certs\instructions.tmpl` and can be modified to suit your needs. +When you generate a new client certificate, a zip file bundle is created which includes a P12 keystore for browsers and a PEM keystore for Git. Both of these are password-protected. Additionally, a personalized README file is generated with setup instructions for popular browsers and Git. The README is generated from `data\certs\instructions.tmpl` and can be modified to suit your needs. -1. `authority.cmd` or `java -jar authority.jar` +1. `authority.cmd` or `java -jar authority.jar --baseFolder data` 2. Select the user for which to generate the certificate 3. Click the *new certificate* button and enter the expiration date of the certificate. You must also enter a password for the generated keystore. This password is *not* the same as the user's login password. This password is used to protect the privatekey and public certificate you will generate for the selected user. You must also enter a password hint for the user. 4. If your mail server settings are properly configured you will have a *send email* checkbox which you can use to immediately send the generated certificate bundle to the user. @@ -130,6 +133,7 @@ C:\Program Files\Java\jre6\bin\server\jvm.dll #### Command-Line Parameters Command-Line parameters override the values in `gitblit.properties` at runtime. + --baseFolder The default base folder for all relative file reference settings --repositoriesFolder Git Repositories Folder --userService Authentication and Authorization Service (filename or fully qualified classname) --useNio Use NIO Connector else use Socket Connector. @@ -143,7 +147,7 @@ Command-Line parameters override the values in `gitblit.properties` at runtime. **Example** - java -jar gitblit.jar --userService c:\myrealm.config --storePassword something + java -jar gitblit.jar --userService c:/myrealm.config --storePassword something --baseFolder c:/data #### Overriding Gitblit GO's Log4j Configuration @@ -221,9 +225,6 @@ ProxyPreserveHost On Alternatively, you can respecify *web.forwardSlashCharacter*. ## Upgrading Gitblit -Generally, upgrading is easy. - -Since Gitblit does not use a database the only files you have to worry about are your configuration file (`gitblit.properties` or `web.xml`) and possibly your `users.conf` or `users.properties` file. Any important changes to the setting keys or default values will always be mentioned in the [release log](releases.html). @@ -231,26 +232,47 @@ Gitblit v0.8.0 introduced a new default user service implementation which serial `users.properties` and its user service implementation are deprecated as of v0.8.0. -### Upgrading Gitblit WAR -1. Backup your `web.xml` file -Backup your `web.properties` file (if you have one, these are the setting overrides from using the RPC administration service) -2. Delete currently deployed gitblit WAR -3. Deploy new WAR and overwrite the `web.xml` file with your backup -4. Review and optionally apply any new settings as indicated in the [release log](releases.html). +### Upgrading Gitblit WAR (1.2.1+) +1. Make sure your `WEB-INF/web.xml` *baseFolder* context parameter is not `${contextFolder}/WEB-INF/data`!
+If it is, move your `WEB-INF/data` folder to a location writeable by your servlet container. +2. Deploy new WAR +3. Edit the new WAR's `WEB-INF/web.xml` file and set the *baseFolder* context parameter to your external baseFolder. +4. Review and optionally apply any new settings as indicated in the [release log](releases.html) to `${baseFolder}/gitblit.properties`. -### Upgrading Gitblit GO +### Upgrading Gitblit GO (1.2.1+) -1. Backup your `gitblit.properties` file -2. Backup your `users.properties` file *(if it is located in the Gitblit GO folder)* -OR -Backup your `users.conf` file *(if it is located in the Gitblit GO folder)* -3. Backup your Groovy hook scripts -4. Unzip Gitblit GO to a new folder -5. Overwrite the `gitblit.properties` file with your backup -6. Overwrite the `users.properties` file with your backup *(if it was located in the Gitblit GO folder)* -OR -Overwrite the `users.conf` file with your backup *(if it was located in the Gitblit GO folder)* -7. Review and optionally apply any new settings as indicated in the [release log](releases.html). +1. Unzip Gitblit GO to a new folder +2. Copy your `data` folder from your current Gitblit installation to the new folder and overwrite any conflicts +3. Review and optionally apply any new settings as indicated in the [release log](releases.html) to `data/gitblit.properties`. + +In *nix systems, there are other tricks you can play like symlinking the `data` folder or symlinking the GO folder. +All platforms support the *--baseFolder* command-line argument. + +### Upgrading Gitblit WAR (pre-1.2.1) + +1. Create a `data` as outlined in step 1 of *Upgrading Gitblit GO (pre-1.2.1)* +2. Copy your existing web.xml to your data folder +3. Deploy new WAR +4. Copy the new WAR's `WEB-INF/data/gitblit.properties` file to your data folder +5. Manually apply any changes you made to your original web.xml file to the gitblit.properties file you copied to your data folder +6. Edit the new WAR's `WEB-INF/web.xml` file and set the *baseFolder* context parameter to your external baseFolder. + +### Upgrading Gitblit GO (pre-1.2.1) +1. Create a `data` folder and copy the following files and folders to it: + - users.conf + - projects.conf *(if you have one)* + - gitblit.properties + - serverKeystore.jks + - serverTrustStore.jks + - certs folder + - groovy folder + - proposals folder + - and any other custom files (robots.txt, welcome/login markdown files, etc) +2. Unzip Gitblit GO to a new folder +3. Copy your `data` folder and overwrite the folder of the same name in the just-unzipped version +4. Review and optionally apply any new settings as indicated in the [release log](releases.html) to `data/gitblit.properties`. + +**NOTE:** You may need to adjust your service definitions to include the `--baseFolder data` argument. #### Upgrading Windows Service You may need to delete your old service definition and install a new one depending on what has changed in the release. @@ -277,7 +299,7 @@ All repository settings are stored within the repository `.git/config` file unde federationSets = #### Repository Names -Repository names must be unique and are CASE-SENSITIVE ON CASE-SENSITIVE FILESYSTEMS. The name must be composed of letters, digits, or `/ _ - . ~`
+Repository names must be case-insensitive-unique but are CASE-SENSITIVE ON CASE-SENSITIVE FILESYSTEMS. The name must be composed of letters, digits, or `/ _ - . ~`
Whitespace is illegal. Repositories can be grouped within subfolders. e.g. *libraries/mycoollib.git* and *libraries/myotherlib.git* @@ -366,6 +388,10 @@ All checks are case-insensitive. You can not use fast-forward merges on your client when using committer verification. You must specify *--no-ff* to ensure that a merge commit is created with your identity as the committer. Only the first parent chain is traversed when verifying commits. +#### Push Log + +Gitblit v1.2.1 introduces an incomplete push mechanism. All pushes are logged since 1.2.1, but the log has not yet been exposed through the web ui. This will be a feature of an upcoming release. + ### Teams Since v0.8.0, Gitblit supports *teams* for the original `users.properties` user service and the current default user service `users.conf`. Teams have assigned users and assigned repositories. A user can be a member of multiple teams and a repository may belong to multiple teams. This allows the administrator to quickly add a user to a team without having to keep track of all the appropriate repositories. diff --git a/docs/04_releases.mkd b/docs/04_releases.mkd index fa088b2a..a76e3c79 100644 --- a/docs/04_releases.mkd +++ b/docs/04_releases.mkd @@ -2,6 +2,14 @@ ### Current Release +
+

Update Note 1.2.1

+Because there are now several types of files and folders that must be considered Gitblit data, the default location for data has changed. +

You will need to move a few files around when upgrading. Please see the Upgrading section of the setup page for details.

+ +Express Users make sure to update your web.xml file with the ${baseFolder} values! +
+ **%VERSION%** ([go](http://code.google.com/p/gitblit/downloads/detail?name=%GO%) | [war](http://code.google.com/p/gitblit/downloads/detail?name=%WAR%) | [express](http://code.google.com/p/gitblit/downloads/detail?name=%EXPRESS%) | [fedclient](http://code.google.com/p/gitblit/downloads/detail?name=%FEDCLIENT%) | [manager](http://code.google.com/p/gitblit/downloads/detail?name=%MANAGER%) | [api](http://code.google.com/p/gitblit/downloads/detail?name=%API%)) based on [%JGIT%][jgit]   *released %BUILDDATE%* #### fixes @@ -10,7 +18,7 @@ - Added nullchecking when concurrently forking a repository and trying to display it's fork network (issue-187) - Fixed bug where permission changes were not visible in the web ui to a logged-in user until the user logged-out and then logged back in again (issue-186) - Fixed nullpointer on creating a repository with mixed case (issue 185) -- Fixed nullpointer when using web.allowForking = true && git.cacheRepositoryList = false (issue 182) +- Fixed nullpointer when using *web.allowForking = true* && *git.cacheRepositoryList = false* (issue 182) - Likely fix for commit and commitdiff page failures when a submodule reference changes (issue 178) - Build project models from the repository model cache, when possible, to reduce page load time (issue 172) - Fixed loading of Brazilian Portuguese translation from *nix server (github/inaiat) @@ -30,6 +38,10 @@ The push log is not currently visible in the ui, but the data will be collected #### changes +- Gitblit GO and Gitblit WAR are now both configured by `gitblit.properties`. WAR is no longer configured by `web.xml`.
+However, Express for OpenShift continues to be configured by `web.xml`. +- Support for a *--baseFolder* command-line argument for Gitblit GO and Gitblit Certificate Authority +- Support for specifying a *${baseFolder}* parameter in `gitblit.properties` and `web.xml` for several settings - Improve history display of a submodule link - Updated Korean translation (github/ds5apn) - Updated checkstyle definition (github/mystygage) @@ -37,7 +49,7 @@ The push log is not currently visible in the ui, but the data will be collected ### Older Releases
-

Update Note

+

Update Note 1.2.0

The permissions model has changed in the 1.2.0 release.

If you are updating your server, you must also update any Gitblit Manager and Federation Client installs to 1.2.0 as well. The data model used by the RPC mechanism has changed slightly for the new permissions infrastructure.

@@ -142,7 +154,7 @@ If *realm.ldap.maintainTeams==true* **AND** *realm.ldap.admins* is not empty, th
-

Update Note

+

Update Note 1.1.0

If you are updating from an earlier release AND you have indexed branches with the Lucene indexing feature, you need to be aware that this release will completely re-index your repositories. Please be sure to provide ample heap resources as appropriate for your installation.
diff --git a/src/WEB-INF/web.xml b/src/WEB-INF/web.xml index 85b24d55..75ccf9bd 100644 --- a/src/WEB-INF/web.xml +++ b/src/WEB-INF/web.xml @@ -3,6 +3,30 @@ xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> + + + baseFolder + ${contextFolder}/WEB-INF/data + +