Top Menu

Jump to content
Home
    • Projects
    • Work packages
    • News
    • Getting started
    • Introduction video
      Welcome to OpenProject Community
      Get a quick overview of project management and team collaboration with OpenProject. You can restart this video from the help menu.

    • Help and support
    • User guides
    • Videos
    • Shortcuts
    • Community forum
    • Professional support

    • Additional resources
    • Data privacy and security policy
    • Digital accessibility (DE)
    • OpenProject website
    • Security alerts / Newsletter
    • OpenProject blog
    • Release notes
    • Report a bug
    • Development roadmap
    • Add and edit translations
    • API documentation
  • Sign in
      Forgot your password?
      Create a new account

      or sign in with your existing account

      Google

Side Menu

  • Overview
  • Activity
  • Roadmap
  • Work packages
  • Calendars
  • Team planners
  • Boards
  • Forums
  • Wiki
    • Table of contents
      • Expanded. Click to collapseCollapsed. Click to showDeveloper
        • Hierarchy leafAccessibility Checklist
        • Hierarchy leafCode Review Guidelines
        • Expanded. Click to collapseCollapsed. Click to showContribution
          • Hierarchy leafGit Workflow
          • Hierarchy leafTranslations
        • Expanded. Click to collapseCollapsed. Click to showDeveloping Plugins
          • Hierarchy leafDeveloping an OmniAuth Authentication Plugin
        • Hierarchy leafRelease Process
        • Hierarchy leafReport a bug
        • Hierarchy leafSecurity
        • Hierarchy leafSetting up an OpenLDAP server for testing
        • Hierarchy leafTheme Features
      • Hierarchy leafDownload
      • Expanded. Click to collapseCollapsed. Click to showFeature tour
        • Hierarchy leafRelease Notes OpenProject 30
        • Expanded. Click to collapseCollapsed. Click to showRelease Notes OpenProject 30 - Overview
          • Hierarchy leafGlossary
          • Hierarchy leafRelease Notes - Accessibility
          • Hierarchy leafRelease Notes - Accessibility changes
          • Hierarchy leafRelease Notes - Add work package queries as menu items to sidebar
          • Hierarchy leafRelease Notes - Copy projects based on Templates
          • Hierarchy leafRelease Notes - Design changes
          • Hierarchy leafRelease Notes - Fixed Bugs
          • Hierarchy leafRelease Notes - Keyboard Shortcuts
          • Hierarchy leafRelease Notes - Project settings
          • Hierarchy leafRelease Notes - Ruby&Rails Update
          • Hierarchy leafRelease Notes - Security
          • Hierarchy leafRelease Notes - Timelines
          • Hierarchy leafRelease Notes - Work packages
      • Hierarchy leafHowto create animated gifs
      • Hierarchy leafMigration Squashing
      • Hierarchy leafMod security
      • Hierarchy leafNew work package page
      • Hierarchy leafOP3 to OP4 Debian upgrade
      • Hierarchy leafOP4 Ubuntu1404 Stable with MySQL in production
      • Hierarchy leafOpenProject 40 Development Setup
      • Expanded. Click to collapseCollapsed. Click to showOpenProject Foundation
        • Hierarchy leafBoards
        • Hierarchy leafMembers
        • Hierarchy leafOPF-Meetings
        • Hierarchy leafStatutes
      • Expanded. Click to collapseCollapsed. Click to showRelease Notes
        • Hierarchy leafOpenProject released on Bitnami
      • Expanded. Click to collapseCollapsed. Click to showRelease Notes OpenProject 40 - Overview
        • Hierarchy leafRelease Notes OpenProject 40 - Accessibility improvements
        • Hierarchy leafRelease Notes OpenProject 40 - Column header functions in work package table
        • Hierarchy leafRelease Notes OpenProject 40 - Improved Design
        • Hierarchy leafRelease Notes OpenProject 40 - Integrated query title on work package page
        • Hierarchy leafRelease Notes OpenProject 40 - Integrated toolbar on work package page
        • Hierarchy leafRelease Notes OpenProject 40 - OmniAuth integration for OpenProject
        • Hierarchy leafRelease Notes OpenProject 40 - Work package details pane
      • Expanded. Click to collapseCollapsed. Click to showSecurity and privacy
        • Hierarchy leafFAQ
      • Expanded. Click to collapseCollapsed. Click to showSupport
        • Expanded. Click to collapseCollapsed. Click to showDownload and Installation
          • Hierarchy leafInstallation MacOS
          • Expanded. Click to collapseCollapsed. Click to showInstallation OpenProject 3 0
            • Hierarchy leafDebian Stable with MySQL in production
            • Hierarchy leafInstallation Ubuntu
            • Hierarchy leafInstallation Windows
            • Hierarchy leafInstallation on Centos 65 x64 with Apache and PostgreSQL 93
          • Expanded. Click to collapseCollapsed. Click to showInstallation OpenProject 40
            • Hierarchy leafOP4 Debian Stable with MySQL in production
          • Expanded. Click to collapseCollapsed. Click to showMigration paths
            • Hierarchy leafFrom Chilliproject to OpenProject
            • Hierarchy leafMigration 15 to 30
            • Hierarchy leafMigration 24 to 30
            • Hierarchy leafMigration Redmine 2x › OpenProject 30
            • Hierarchy leafOpenProject 3 Migration
          • Hierarchy leafOpenProject 40
        • Expanded. Click to collapseCollapsed. Click to showNews
          • Hierarchy leafNew OpenProject Translations Plugin
          • Hierarchy leafNew Plugin on OpenProjectorg Local Avatars
          • Hierarchy leafNew design for OpenProject
          • Hierarchy leafNews Accessibility workshop for OpenProject
          • Hierarchy leafNews Glossary for OpenProject
          • Hierarchy leafNews Heartbleed fixed
          • Hierarchy leafNews Icon Fonts
          • Hierarchy leafNews OpenProject 30 Release
          • Hierarchy leafNews Release GitHub Integration Plugin
          • Hierarchy leafNews Success Story Deutsche Telekom
          • Hierarchy leafNews Timelines
          • Hierarchy leafOpenProject 3013 released
          • Hierarchy leafOpenProject 3017 released
          • Hierarchy leafOpenProject 40 released
          • Hierarchy leafOpenProject 40 will be coming soon
          • Hierarchy leafOpenProject 405 released
          • Hierarchy leafOpenProject and pkgrio
          • Hierarchy leafOpenProject news moved to a new blog
          • Hierarchy leafOpenProjectBitnami
          • Hierarchy leafPackager version with plugins released ("Community edition")
          • Hierarchy leafRegistration OpenProject-Foundation
          • Hierarchy leafRelease OpenProject AuthPlugins
          • Hierarchy leafUpdates on OpenProject
          • Hierarchy leafWe need your feedback for the the new fullscreen view for work packages
        • Hierarchy leafOpenProject Plug-Ins
      • Hierarchy leafWiki
You are here:
  • Forums
  • Plugins

Content

OpenProject Git Hosting / Git Repositories Management through Gitolite

Added by Oliver Günther over 8 years ago

This plugin aims to provide extensive features for managing Git repositories within OpenProject.

Find it at: https://github.com/oliverguenther/openproject-git_hosting

Its forked from jbox-web’s version of the long-lived, often-forked redmine-git_hosting plugin (formerly redmine-gitosis).

As OpenProject has diverted quite a bit in terms of project management (e.g., redmine allows multiple repositories per project), some features have been removed in the fork.

High-level overview:

  • Depends on Gitolite (v2/v3)
  • Acts as a wrapper to the gitolite-admin to feed gitolite with SSH keys, repository information
  • Employs libgit2/rugged through my gitolite-rugged wrapper gem

I’m currently working on providing the following features, more may follow, depending on demand and my time:

SSH Public-Key Management (Gitolite)

✓ Multiple keys per user

Gitolite Repository Management

✓ Managing repositories with Gitolite upon creation, update/deletion. (Async w/ delayed_jobs)
✓ Members/Roles access written to Gitolite.
✓ SSH-based access (through Gitolite).

Planned / Forked, but non-functional / non-tested features

Ordered by importance for our use case.

  • Git Smart-HTTP (Access through https in OpenProject)
  • Post-Receive Hooks
  • Repository Mirrors
  • Deployment Keys
  • Initialize Repositories with Readme

Stripped features (irrelevant for our use case, may be included later on)

  • Sidekiq (OP uses delayed_jobs instead)
  • SELinux (unfamiliar, can’t provide a good fork)
  • GitHub features (Issues), should be separate plugin
  • Git access cache ( belongs in the core )
  • Repository Recycle bin after deletion (Just use your filesystem backups)
  • Notifications / Mailing lists

Pitfalls / Disclaimer

This plugin is by no means stable yet.
It traditionally depends heavily on patches in the core, especially hooking methods in repository creation / management and the Git adapter.
However, feel free to try and report any issues to me, either here, or (preferably) on Github

Quite some work is to be done in the core / moved into gems, I will try to work on that as the plugin matures. There exists an epic to improve repository adapters: https://www.openproject.org/work_packages/12808.
Feel free to join the discussion around adapters there.

Installation (OP 3.0.8)

0. Setup gitolite v2/v3

I’m assuming you have some basic knowledge of Gitolite and:

  • are in possession of an SSH key pair set up for use with gitolite.
  • have cloned the gitolite-admin.git repository.

1. Add a Gemfile.plugins to your OpenProject root with the following contents:

gem "openproject-plugins", :git => "https://github.com/opf/openproject-plugins.git", :branch => "stable" 
gem "openproject-git_hosting", :git => "https://github.com/oliverguenther/openproject-git_hosting.git", :branch => "dev"

2. Ensure the user running OpenProject can sudo to the gitolite user. Assuming that user is called openproject and the gitolite user is git, open visudo and add:

openproject        ALL=(git)      NOPASSWD:ALL

3. Make sure you can ssh into gitolite from the openproject user. If you run the following command, the output below (or similar for gitolite2) should appear.
If not, this is a gitolite configuration error.

openproject$ ssh -i <gitolite-admin SSH key> git@localhost info
hello openproject, this is git@dev running gitolite3 v3.x-x on git x.x.x
    R W  gitolite-admin
    R W  testing

4. Run OpenProject, go to Admin > Plugins > OpenProject Git Hosting (click on configure)

Set your values on Gitolite accordingly and click save. Check that the output on the tab ‘Config Test’ looks good.
Note that many of the settings are not yet functional, and some values on config test are thus irrelevant (Hooks, for example).

Adding SSH keys

  • Log in, go to My Account (top right).
  • Select ‘Public Keys’ in the menu on the left.
  • Add your public key using the form.

Adding repositories

  • Create project. Go to repositories settings and select Git + click create.
  • This will (should) automatically create the corresponding entry in the gitolite configuration.
  • Use members to add a member to the repository. If that user has a public key on record, the corresponding access rights will be written to Gitolite.

Replies (3)

RE: OpenProject Git Hosting / Git Repositories Management through Gitolite - Added by Robin Wagner over 8 years ago

Hi Oliver,

wow, thanks for your hard work and the detailed instructions. :)
This looks really great!
Do you mind if we include this plugin in the list of plugins

Best,
Robin

RE: OpenProject Git Hosting / Git Repositories Management through Gitolite - Added by Oliver Günther over 8 years ago

Here again, I would appreciate adding the Plugin to the list. However, as this plugin is still under heavy development, could you (if you decide to add it) append a small note to the description concerning its status?

I don’t want someone to eagerly install it and then be disappointed by its development status ;)

RE: OpenProject Git Hosting / Git Repositories Management through Gitolite - Added by Robin Wagner over 8 years ago

This is a good point.
I added the plugin to a separate section and a note that it is still in development.

Thank you very much again for your hard work. :)
This is a great addition to OpenProject!

Best,
Robin

  • (1 - 3/3)
Loading...