Today I’m going to show you hav to setup you own internal Free Git server in five minutes
Make sure that you have java version 7 installed in you windows server. JRE or JDK any version works. If you don’t have one goto java.com and install the a java jre.
Goto the java download page scroll down to the bottom of the page and download the JCE
Open up the downloaded zip file and copy the 2 selected files
To the folder lib\security below your java installation folder in my case it was
C:\Program Files\Java\jre7\lib\security you might need to replace existing files nothing to worry about.
This is needed to be able to create the certificates later.
Next step is to gitblit.com wher your download the Go Git Blit Server for Windows or if you are using Linux or Macosx use that version.
Unzip the zip file in the root to a folder called gitblit or a suitable sub folder, if you change the folder you might need to change url:s in the .cmd files.
Configure GitBlit
We are now going to configure gitblit to use LDAP as authentication method
Open up the file gitblit.properties in the data folder, search for the keyword realm.userService edit this line so the line should look like this realm.userService = com.gitblit.LdapUserService
Setup the connection to the LDAP server
realm.ldap.server=ldap://localhost change the row if your LDAP server isn’t on localhost remember if you want to connect to a domino server and it’s hosted on a windows machine that has AD LDAP on it you need to change the port for the Domino LDAP service.
The syntax if you want to change ip or port is like this ldap://192.168.10.10:399
You also need to change the login user to be able to use the domino LDAP Service
realm.ldap.username = LDAP Manager
realm.ldap.password = your password
To a Domino user and password
Clear the accountBase so it will search all Nodes
realm.ldap.accountBase=
Change the accountPattern to
realm.ldap.accountPattern = (&(objectClass=person)(cn=${username}))
Empty the groupBase to search all nodes for groupsrealm.ldap.groupBase =
And the groupMemberPattern to find groups
realm.ldap.groupMemberPattern = (&(objectClass=group)(member=${dn}))
realm.ldap.admins can be edited to add a admin group from LDAP
change the row realm.ldap.email from email to mail
And the row realm.ldap.uid also to mail
Important last step, search the file for localhost and remove that otherwise gitblit will only operate on localhost and you can access it from another machine
Save the file
Generate SSL Certificate
In the Gitblit folder in my case c:\GitBlit there is a cmd file called authority.cmd (if you have another url you might need to modify the file)
start authority.cmd add the information about your certificate
Write the password for your keystore, write gitblit if you don’t want that password you need to edit the gitblit config file so the password match.
The keystore is generated and the cert admin is opened
Close the Window
Start the Git Blit Server using the gitblit.cmd the server will now start in the window.
Your Git server should be up and running now. Let’s access it thru a browser.
Write https://servername or ipadress or localhost and end the adress with :8443
but if you want to use http instead you need to edit the gitblit.properties and change the row
server.httpPort =0 to have the port for the http server i.e. server.httpPort = 8080
The GitBlit interface will load.
Try to login using your Domino credentials
When you have logged in, logout again and login using the standard admin user
username: admin password: admin
and assign yourself as an administrator and change the password of the default admin
Login with your user again
Now your ready to create your first repository
Next step is to connect your git client to the repository. Some clients like sourcetree needs a special setup to accept ssl that is created using a self cert. But that is for the next post.
😀 Wonderful! This is exactly what I had been wondering. All the talk of Github was using their servers. I wanted to implement something at work as we would have never been allowed to store our code outside of our firewall.
As always, excellent informative and useful post. Thank you.
Great that you like the post
Nice! LDAP is one of those Domino features that probably goes underused except in specific “enterprise”-y situations, but I’ve used it to host a Mumble server and to allow logins on my Linux systems. It’s one more way to make Domino the vital core of an otherwise-open-source system.
LDAP can be used for lot’s of great things. like supplying user information (phone number, email, location, cost accounts between systems in the corporate environment.
The Atlassian stack is another good option. It allows you to define authentication through an external LDAP server so you could point it at Domino to allow for that. We use JIRA and Stash for ticketing and a GIT “server”.
Atlassian Stash is a very good alternative yo gitblit as a internal sc environment with lots of extra integrated products and support 😛
At the “start authority.cmd add the information about your certificate” step, nothing opens to enter certificate information. I see an Unsupported major.minor version 51.0 exception in thread main when run from a command prompt. Any suggestions?
Exception in thread “main” java.lang.UnsupportedClassVersionError: com/gitblit/a
uthority/Launcher : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: com.gitblit.authority.Launcher. Program will exit.
the problem is probably that you don’t have java 1.7 on you machine. open up a console cmd window and type java -version to check java version.
install java 1.7 from http://www.java.com
Thanks, I did but it wasn’t showing 1.7 until after I uninstalled 1.6 and 1.7 and installed jdk 1.7. Jre 1.7 wasn’t enough for the version command. Currently having trouble at the https://localhost:8443 point due to previous installation of svn. I’ll probably end up doing the install on another machine instead. Thanks again.
But that is the https port you can change the port for gitblit in the setup file to another port 9443 i.e