http://code.google.com/p/google-code-prettify\r
\r
---------------------------------------------------------------------------\r
-JavaService\r
+Commons Daemon\r
---------------------------------------------------------------------------\r
- JavaService, released under the\r
- BSD License and the Lesser GNU Public License.\r
+ Commons Daemon, released under the\r
+ Apache Software License, Version 2.0.\r
\r
- http://forge.ow2.org/projects/javaservice\r
+ http://commons.apache.org/daemon\r
\r
---------------------------------------------------------------------------\r
JGit\r
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r
-->\r
<target name="buildinfo">\r
- <!-- build date -->\r
- <tstamp>\r
- <format property="gb.buildDate" pattern="yyyy-MM-dd" />\r
- </tstamp>\r
\r
<!-- extract Gitblit version number from source code -->\r
<loadfile property="gb.version" srcfile="${basedir}/src/com/gitblit/Constants.java">\r
</tokenfilter>\r
</filterchain>\r
</loadfile>\r
- \r
+\r
+ <!-- extract Gitblit version date from source code -->\r
+ <loadfile property="gb.versionDate" srcfile="${basedir}/src/com/gitblit/Constants.java">\r
+ <filterchain>\r
+ <linecontains>\r
+ <contains value="public static final String VERSION_DATE = " />\r
+ </linecontains>\r
+ <striplinebreaks />\r
+ <tokenfilter>\r
+ <replacestring from="public static final String VERSION_DATE = "" to="" />\r
+ <replacestring from="";" to="" />\r
+ <trim />\r
+ </tokenfilter>\r
+ </filterchain>\r
+ </loadfile>\r
+ \r
<!-- extract JGit version number from source code -->\r
<loadfile property="jgit.version" srcfile="${basedir}/src/com/gitblit/Constants.java">\r
<filterchain>\r
<arg value="%WAR%=${distribution.warfile}" />\r
\r
<arg value="--substitute" />\r
- <arg value="%BUILDDATE%=${gb.buildDate}" />\r
+ <arg value="%BUILDDATE%=${gb.versionDate}" />\r
\r
<arg value="--substitute" />\r
<arg value="%JGIT%=${jgit.version}" />\r
<arg value="%WAR%=${distribution.warfile}" />\r
\r
<arg value="--substitute" />\r
- <arg value="%BUILDDATE%=${gb.buildDate}" />\r
+ <arg value="%BUILDDATE%=${gb.versionDate}" />\r
\r
<arg value="--substitute" />\r
<arg value="%JGIT%=${jgit.version}" />\r
# functions. \r
web.allowAdministration = true\r
\r
-# Allow dyanamic zip downloads. \r
+# Allow dynamic zip downloads. \r
web.allowZipDownloads = true\r
\r
# Default number of entries to include in RSS Syndication links\r
-set JVM=C:\Program Files\Java\jdk1.6.0_26\r
-JavaService.exe -install gitblit "%JVM%\jre\bin\server\jvm.dll" -Xmx1024M -Djava.class.path=%CD%\gitblit.jar;"%JVM%\lib\tools.jar" -start com.gitblit.Launcher -params --storePassword gitblit -stop com.gitblit.Launcher -params --stop -out %CD%\logs\stdout.log -err %CD%\logs\stderr.log -current %CD%
\ No newline at end of file
+@REM Install Gitblit as a Windows service.\r
+\r
+@REM gitblitw.exe (prunmgr.exe) is a GUI application for monitoring \r
+@REM and configuring the Gitblit procrun service.\r
+@REM\r
+@REM By default this tool launches the service properties dialog\r
+@REM but it also has some other very useful functionality.\r
+@REM\r
+@REM http://commons.apache.org/daemon/procrun.html\r
+\r
+@REM arch = x86, amd64, or ia32\r
+SET ARCH=amd64\r
+\r
+@REM Be careful not to introduce trailing whitespace after the ^ characters.\r
+@REM Use ; or # to separate values in the --StartParams parameter.\r
+"%CD%\%ARCH%\prunsrv.exe" //IS//gitblit ^\r
+ --DisplayName="gitblit" ^\r
+ --Description="a pure Java Git solution" ^\r
+ --Startup=auto ^\r
+ --LogPath="%CD%\logs" ^\r
+ --LogLevel=INFO ^\r
+ --LogPrefix=gitblit ^\r
+ --StdOutput=auto ^\r
+ --StdError=auto ^\r
+ --StartPath="%CD%" ^\r
+ --StartClass=com.gitblit.Launcher ^\r
+ --StartMethod=main ^\r
+ --StartParams="--storePassword;gitblit" ^\r
+ --StartMode=jvm ^\r
+ --StopPath="%CD%" ^\r
+ --StopClass=com.gitblit.Launcher ^\r
+ --StopMethod=main ^\r
+ --StopParams="--stop" ^\r
+ --StopMode=jvm ^\r
+ --Classpath="%CD%\gitblit.jar" ^\r
+ --Jvm=auto ^\r
+ --JvmMx=1024\r
+
\ No newline at end of file
+++ /dev/null
-set JVM=C:\Program Files\Java\jdk1.6.0_26\r
-JavaService64.exe -install gitblit "%JVM%\jre\bin\server\jvm.dll" -Djava.class.path=%CD%\gitblit.jar;"%JVM%\lib\tools.jar" -start com.gitblit.Launcher -params --storePassword gitblit -stop com.gitblit.Launcher -params --stop -out %CD%\logs\stdout.log -err %CD%\logs\stderr.log -current %CD%
\ No newline at end of file
+@REM --------------------------------------------------------------------------\r
+@REM Set HOSTNAME to the server's hostname\r
+@REM --------------------------------------------------------------------------\r
+@SET HOSTNAME=localhost\r
@del keystore\r
-@java -cp gitblit.jar;"%CD%\ext\*" com.gitblit.MakeCertificate --alias localhost --subject "CN=localhost, OU=Gitblit, O=Gitblit, L=Some Town, ST=Some State, C=US"\r
+@java -cp gitblit.jar;"%CD%\ext\*" com.gitblit.MakeCertificate --hostname %HOSTNAME% --subject "CN=%HOSTNAME%, OU=Gitblit, O=Gitblit, L=Some Town, ST=Some State, C=US"\r
+@REM --------------------------------------------------------------------------\r
+@REM Set HOSTNAME to the server's hostname\r
+@REM --------------------------------------------------------------------------\r
+@SET HOSTNAME=localhost\r
@del keystore\r
-@keytool -keystore keystore -alias localhost -genkey -keyalg RSA -dname "CN=localhost, OU=Gitblit, O=Gitblit, L=Some Town, ST=Some State, C=US"
\ No newline at end of file
+@keytool -keystore keystore -alias %HOSTNAME% -genkey -keyalg RSA -dname "CN=%HOSTNAME%, OU=Gitblit, O=Gitblit, L=Some Town, ST=Some State, C=US"
\ No newline at end of file
-javaservice -uninstall gitblit
\ No newline at end of file
+@REM arch = x86, amd64, or ia32\r
+SET ARCH=amd64\r
+\r
+@REM Delete the gitblit service\r
+"%CD%\%ARCH%\prunsrv.exe" //DS//gitblit
\ No newline at end of file
+++ /dev/null
-javaservice64 -uninstall gitblit
\ No newline at end of file
\r
## Gitblit GO Features\r
- Out-of-the-box integrated stack requiring minimal configuration\r
-- Automatically generates a self-signed certificate for https communications\r
+- Automatically generates a self-signed certificate for *localhost* https communications<br/>(includes script to generate a self-signed certificate for *your hostname*, see [setup](/setup.html) for details)\r
- Single text file for configuring server and gitblit\r
+- A Windows service installation script and configuration tool\r
\r
## Limitations\r
- HTTP/HTTPS are the only supported protocols\r
- Access controls are not path-based, they are repository-based\r
- Only Administrators can create, rename or delete repositories\r
- Only Administrators can create, modify or delete users\r
+- Native Git may be needed to periodically run git-gc as [JGit][jgit] does not fully support the git-gc featureset.\r
\r
### Caveats\r
- Gitblit may eat your data. Use at your own risk.\r
## Todo List\r
- Code documentation\r
- Unit testing\r
-- Update to JGit 1.0.0 when JGit team provides Maven artifacts\r
\r
### Under Consideration\r
- Clone remote repository feature\r
- activity/timeline\r
- query feature with paging support\r
- change history\r
-- Ticgit write integration
\ No newline at end of file
+- Ticgit write integration\r
+\r
+[jgit]: http://eclipse.org/jgit "Eclipse JGit Site"
\ No newline at end of file
## Gitblit WAR Setup\r
\r
1. Download [Gitblit WAR %VERSION%](http://code.google.com/p/gitblit/downloads/detail?name=%WAR%) to the webapps folder of your servlet container.<br/>\r
-2. You may have to manually extract the WAR (zip file) to a folder within your webapps folder. Manual extraction depends on if your servlet container is configured to automatically deploy WAR files.\r
-3. Copy the `WEB-INF/users.properties` file to a location outside the webapps folder but accessible by your servlet container. \r
+2. You may have to manually extract the WAR (zip file) to a folder within your webapps folder.\r
+3. Copy the `WEB-INF/users.properties` file to a location outside the webapps folder that is accessible by your servlet container. \r
4. The Gitblit webapp is configured through its `web.xml` file.<br/>\r
Open `web.xml` in your favorite text editor and make sure to review and set:\r
- <context-parameter> *git.repositoryFolder* (set the full path to your repositories folder)\r
5. You may have to restart your servlet container. \r
6. Open your browser to <http://localhost/gitblit> or whatever the url should be.\r
7. Click the *Login* link and enter the default administrator credentials: **admin / admin**<br/>\r
-**NOTE:** Make sure to change the administrator username and/or password!! \r
+ **NOTE:** Make sure to change the administrator username and/or password!! \r
\r
## Gitblit GO Setup\r
\r
*Its best to eliminate spaces in the path name.* \r
2. The server itself is configured through a simple text file.<br/>\r
Open `gitblit.properties` in your favorite text editor and make sure to review and set:\r
- - *git.repositoryFolder* (path my be relative or absolute)\r
- - *server.tempFolder* (path my be relative or absolute)\r
+ - *git.repositoryFolder* (path may be relative or absolute)\r
+ - *server.tempFolder* (path may be relative or absolute)\r
- *server.httpBindInterface* and *server.httpsBindInterface*<br/>\r
-**NOTE:** Consider using **https** exclusively because passwords for authentication are transmitted as clear text! \r
- - *server.storePassword*<br/>\r
-**NOTE:** If you manually generate an ssl certificate, the certificate password AND the keystore password must match! \r
+ **https** is strongly recommended because passwords are insecurely transmitted form your browser/git client using Basic authentication! \r
3. Execute `gitblit.cmd` or `java -jar gitblit.jar` from a command-line\r
-4. Wait a minute or two while all dependencies are downloaded and your self-signed certificate is generated.\r
+4. Wait a minute or two while all dependencies are downloaded and your self-signed *localhost* certificate is generated.<br/>Please see the section titled **Creating your own Self-Signed Certificate** to generate a certificate for *your hostname*.\r
5. Open your browser to <http://localhost> or <https://localhost> depending on your chosen configuration.\r
6. Click the *Login* link and enter the default administrator credentials: **admin / admin**<br/>\r
-**NOTE:** Make sure to change the administrator username and/or password!! \r
+ **NOTE:** Make sure to change the administrator username and/or password!! \r
\r
### Creating your own Self-Signed Certificate\r
-Gitblit GO automatically generates an ssl certificate for you that contains generic, non-personalized information.\r
+Gitblit GO automatically generates an ssl certificate for you that is bound to *localhost*.\r
\r
-Should you want to include more personal or server-specific information in your self-signed certificate you will have to generate a new one.\r
+Remote Eclipse/EGit/JGit clients (<= 1.0.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.\r
+\r
+The EGit failure message is something like:\r
+\r
+ Cannot get remote repository refs.\r
+ Reason: https:/myserver.com/git/myrepo.git: cannot open git-upload-pack\r
+\r
+If you want to serve your repositories to another machine over https then you will want to generate your own certificate.\r
+\r
+1. Review the contents of `makekeystore.cmd` or `makekeystore_jdk.cmd`\r
+2. Set *your hostname* into the *HOSTNAME* variable.\r
+3. Execute the script.<br/>This will generate a new certificate and keystore for *your hostname* protected by *server.storePassword*.\r
\r
-Review the contents of the `makekeystore.cmd` or `makekeystore_jdk.cmd` script and execute it.<br/>\r
-**NOTE:** If you manually generate an ssl certificate, the certificate password AND the keystore password must match!\r
+**NOTE:**<br/>If you use `makekeystore_jdk.cmd`, the certificate password AND the keystore password must match and must be set as *server.storePassword* or specified with the *storePassword* command-line parameter!\r
+\r
+Additionally, if you want to change the value of *server.storePassword* (recommended) you will have to generate a new certificate afterwards.\r
\r
### Running as a Windows Service\r
-Review the contents of the `installService.cmd` or `installService64.cmd`, as appropriate for your installed Java Virtual Machine.<br/>\r
-Set the *JVM* variable in the script to the location of your Java Virtual Machine, add any necessary start parameters, and execute the script.\r
+Gitblit uses [Apache Commons Daemon](http://commons.apache.org/daemon) to install and configure its Windows service.\r
+\r
+1. Review the contents of the `installService.cmd`\r
+2. Set the *ARCH* value as appropriate for your installed Java Virtual Machine.<br/>\r
+3. Add any necessary *--StartParams* as enumerated below in **Command-Line Parameters**.\r
+4. Execute the script.\r
+\r
+After service installation you can use the `gitblitw.exe` utility to control and modify the runtime settings of the service.<br/>\r
+Additional service definition options and runtime capabilities of `gitblitw.exe` (prunmgr.exe) are documented [here](http://commons.apache.org/daemon/procrun.html).\r
+\r
+**NOTE:**<br/>\r
+If you change the name of the service from *gitblit* you must also change the name of `gitblitw.exe` to match the new service name otherwise the connection between the service and the utility is lost, at least to double-click execution. \r
\r
#### Command-Line Parameters\r
Command-Line parameters override the values in `gitblit.properties` at runtime.\r
\r
## Client Setup and Configuration\r
### Https with Self-Signed Certificates\r
-You must tell Git not to verify the self-signed certificate in order to perform any remote Git operations.\r
+You must tell Git/JGit not to verify the self-signed certificate in order to perform any remote Git operations.\r
\r
-- Eclipse/EGit\r
+**NOTE:**<br/>\r
+The default self-signed certificate generated by Gitlbit GO is bound to *localhost*.<br/>\r
+If you are using Eclipse/EGit/JGit clients, you will have to generate your own certificate that specifies the exact hostname used in your clone/push url.<br/>\r
+You must do this because Eclipse/EGit/JGit (<= 1.0.0) always verifies certificate hostnames, regardless of the *http.sslVerify=false* client-side setting. \r
+ \r
+- Eclipse/EGit/JGit\r
1. Window->Preferences->Team->Git->Configuration\r
2. Click the *New Entry* button\r
3. <pre>Key = *http.sslVerify* \r
<pre>git config --global --bool --add http.sslVerify false</pre>\r
\r
### Cloning an Access Restricted Repository \r
-- Eclipse/Egit<br/>Nothing special to configure, EGit figures out everything.\r
+- Eclipse/EGit/JGit<br/>Nothing special to configure, EGit figures out everything.\r
<pre>https://yourserver/git/your/repository</pre>\r
- Command-line Git<br/>*My testing indicates that your username must be embedded in the url. YMMV.*\r
<pre>https://username@yourserver/git/your/repository</pre>\r
## Troubleshooting\r
\r
-### Eclipse/Egit/Git complains that it "can't open upload pack"?\r
+### Eclipse/Egit/JGit complains that it "can't open upload pack"?\r
There are a few ways this can occur:\r
\r
1. You are using https with a self-signed certificate and you **did not** configure *http.sslVerify=false*\r
2. Click the *New Entry* button\r
3. <pre>Key = *http.sslVerify* \r
Value = *false*</pre>\r
-2. The repository is clone-restricted and you don't have access.\r
-3. The repository is clone-restricted and your password changed.\r
-4. A regression in Gitblit. :(\r
+2. Gitblit GO's default self-signed certificate is bound to *localhost* and you are trying to clone/push between machines.\r
+ 1. Review the contents of `makekeystore.cmd`\r
+ 2. Set *your hostname* in the *HOSTNAME* variable.\r
+ 3. Execute the script.<br/>This will generate a new certificate and keystore for *your hostname* protected by *server.storePassword*. \r
+3. The repository is clone-restricted and you don't have access.\r
+4. The repository is clone-restricted and your password changed.\r
+5. A regression in Gitblit. :(\r
\r
### Why can't I access Gitblit GO from another machine?\r
-Please check *server.httpBindInterface* and *server.httpsBindInterface* in `gitblit.properties`, you may be binding only to localhost.\r
-\r
-And of course ensure that any firewall you may have running either has an exception for your ports or for the running process.\r
+1. Please check *server.httpBindInterface* and *server.httpsBindInterface* in `gitblit.properties`, you may be only be serving on *localhost*.\r
+2. Please see the above answer about "**can't open upload pack**".\r
+3. Ensure that any firewall you may have running on the Gitblit server either has an exception for your specified ports or for the running process.\r
\r
### How do I run Gitblit GO on port 80 or 443 in Linux?\r
Linux requires root permissions to serve on ports < 1024.<br/>\r
Run the server as *root* (security concern) or change the ports you are serving to 8080 (http) and/or 8443 (https). \r
\r
### Gitblit GO does not list my repositories?!\r
-Confirm that the value *git.repositoriesFolder* in `gitblit.properties` actually points to your repositories folder.\r
+1. Confirm that the value *git.repositoriesFolder* in `gitblit.properties` actually points to your repositories folder.\r
+2. Confirm that the Gitblit GO process has full read-write-execute permissions to your *git.repositoriesFolder*. \r
\r
### Gitblit WAR does not list my repositories?!\r
-Confirm that the <context-param> *git.repositoriesFolder* value in your `web.xml` file actually points to your repositories folder.\r
+1. Confirm that the <context-param> *git.repositoriesFolder* value in your `web.xml` file actually points to your repositories folder.\r
+2. Confirm that the servlet container process has full read-write-execute permissions to your *git.repositoriesFolder*.\r
\r
### Gitblit WAR will not authenticate any users?!\r
Confirm that the <context-param> *realm.userService* value in your `web.xml` file actually points to a `users.properties` file.\r
Additionally, Git and Gitweb do not offer repository creation or user management.\r
\r
### Do I need real Git?\r
-No. Gitblit is based on [JGit][jgit] which is a pure Java implementation of the [Git version control system][git].<br/>\r
+No (mostly). Gitblit is based on [JGit][jgit] which is a pure Java implementation of the [Git version control system][git].<br/>\r
Everything you need for Gitblit (except Java) is either bundled in the distribution file or automatically downloaded on execution.\r
\r
+**mostly**<br/>\r
+JGit does not fully support the git-gc featureset (garbage collection) so you may want native Git to periodically run git-gc until [JGit][jgit] fully supports this feature.\r
+\r
### Can I run Gitblit in conjunction with my existing Git tooling?\r
Yes.\r
\r
### Can I manually edit users.properties, gitblit.properties, or .git/config?\r
Yes. You can manually manipulate all of them and (most) changes will be immediately available to Gitblit.<br/>Exceptions to this are noted in `gitblit.properties`.\r
\r
-*NOTE:* Care must be taken to preserve the relationship between user roles and repository names.<br/>Please see the *User Roles* section of the [setup](/setup.html) page for details.\r
+**NOTE:**<br/>Care must be taken to preserve the relationship between user roles and repository names.<br/>Please see the *User Roles* section of the [setup](/setup.html) page for details.\r
\r
### Can I restrict access to paths within a repository?\r
No. Access restrictions apply to the repository as a whole.\r
The following dependencies are bundled with Gitblit.\r
\r
- [google-code-prettify](http://code.google.com/p/google-code-prettify) (Apache 2.0)\r
-- [JavaService](http://forge.ow2.org/projects/javaservice) (BSD and LGPL)\r
+- [Commons Daemon](http://commons.apache.org/daemon) (Apache 2.0)\r
- magnifying glass search icon courtesy of [Gnome](http://gnome.org) (Creative Commons CC-BY)\r
- modified Git logo originally designed by [Henrik Nyh](http://henrik.nyh.se/2007/06/alternative-git-logo-and-favicon)\r
- other icons courtesy of [FatCow Hosting](http://www.fatcow.com/free-icons) (Creative Commons CC-BY)\r
### Current Release\r
%VERSION% ([go](http://code.google.com/p/gitblit/downloads/detail?name=%GO%)|[war](http://code.google.com/p/gitblit/downloads/detail?name=%WAR%)) based on [%JGIT%][jgit] *released %BUILDDATE%*\r
\r
+- clarified SSL certificate generation and configuration for both server-side and client-side\r
+- added some more troubleshooting information to documentation\r
+- replaced JavaService with Apache Commons Daemon\r
+\r
### Older Releases\r
-none\r
+0.5.0 ([go](http://code.google.com/p/gitblit/downloads/detail?name=gitblit-0.5.0.zip)|[war](http://code.google.com/p/gitblit/downloads/detail?name=gitblit-0.5.0.war)) based on [JGit 1.0.0 (201106090707-r)][jgit] *released 2006-06-26*\r
\r
[jgit]: http://eclipse.org/jgit "Eclipse JGit Site"
\ No newline at end of file
\r
// The build script extracts this exact line so be careful editing it\r
// and only use A-Z a-z 0-9 .-_ in the string.\r
- public static final String VERSION = "0.5.0";\r
+ public static final String VERSION = "0.5.1";\r
+\r
+ // The build script extracts this exact line so be careful editing it\r
+ // and only use A-Z a-z 0-9 .-_ in the string.\r
+ public static final String VERSION_DATE = "2011-06-28";\r
\r
// The build script extracts this exact line so be careful editing it\r
// and only use A-Z a-z 0-9 .-_ in the string.\r
jc.usage();\r
}\r
File keystore = new File("keystore");\r
- generateSelfSignedCertificate(params.alias, keystore, params.storePassword, params.subject);\r
+ generateSelfSignedCertificate(params.hostname, keystore, params.storePassword, params.subject);\r
}\r
\r
public static void generateSelfSignedCertificate(String hostname, File keystore,\r
\r
private static final FileSettings FILESETTINGS = new FileSettings(Constants.PROPERTIES_FILE);\r
\r
- @Parameter(names = { "--alias" }, description = "Server alias", required = true)\r
- public String alias;\r
+ @Parameter(names = { "--hostname" }, description = "Server Hostname", required = true)\r
+ public String hostname;\r
\r
@Parameter(names = { "--subject" }, description = "Certificate subject", required = true)\r
public String subject;\r