Lenra Docs
Register on Lenra
  • Home
  • Getting started
    Open/Close
  • Guides
    Open/Close
  • Features
    Open/Close
  • References
    Open/Close
  • Contribute

    Use private repository

    Do you want to use a private git repository to version your app? Using an open-source solution doesn't mean that your app has to be one too.

    In this guide we will explain how to create a token and how to use it in our backoffice for the two main plateforms: GitLab and GitHub.

    GitLab

    GitLab offers several types of access tokens that can be used to get your app's source code:

    We will focus on the first one in this guide since it is the only free solution to use, but you should use project access tokens if possible, as they are more adapted to our needs and more secure.

    You can go to your personal access token settings by clicking this link or by following these steps:

    To create a personal access token follow these steps:

    Save the personal access token somewhere safe. After you leave the page, you will no longer have access to the token.

    Next, we will integrate our access token into the git HTTP URL of our Lenra app. Here's an example:

    https://gitlab.com/group/repo.git
    becomes
    https://oauth2:<access_token>@gitlab.com/group/repo.git
    

    GitHub

    GitHub only offers personal access tokens so we will use that. Actually GitHub also handles Fine-grained tokens while I'm writing this guide which are much more secure but they are still in beta version.

    You can go to your personal access token settings by clicking this link or by following these steps:

    To create a personal access token, follow these steps:

    https://github.com/username/repo.git
    becomes
    https://oauth2:<oauth-key-goes-here>@github.com/username/repo.git