Skip to content
This repository has been archived by the owner on Dec 6, 2024. It is now read-only.

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Lakr233 committed Dec 28, 2023
1 parent e8da9c9 commit cb89aaf
Showing 1 changed file with 63 additions and 4 deletions.
67 changes: 63 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,66 @@
# GitLab-License-Generator
# GitLab License Generator

Generator GitLab License For Self-Hosted/Private Instances.
This project aims to generate a GitLab License for development purpose. If you encounter any problem, please solve them yourself.

Last tested: 16.4.0-ee
Last tested on GitLab v16.7.0-ee .

**THIS IS NOT A CRACK WHICH MEANS YOU CAN NOT USE IT DIRECTLY**
## Principles

**src/generator.keys.rb**

The GitLab uses public/private key pair to encrypt the license. The public key is shipped with the GitLab distro and the private key is kept privately. The license it self is just a json dictionary. Since GitLab made their code open source, we can easily generate a license by our own.

**src/generator.license.rb**

The `lib` folder is extracted from GitLab's source. It is used for building and validating the license. Script `src/generator.license.rb` will load it.

**src/scan.features.rb**

The features is extracted from a object full of constant. The most powerful plan for a license is ultimate, but features like geo mirror is not included in any type of the plan. So here by we add them manually.

## Usage

Follow the procedure below to generate and install a license for your development use.

### Get License

**GitHub Action**

Navigate to GitHub Action to download an artifact.

**make.sh**

This script is only tested on macOS. To build on Linux or other platform, you need to setup ruby with gem.

### Install Test Key

You will need to replace the public key shipped within GitLab distro. It is located at `/opt/gitlab/embedded/service/gitlab-rails/.license_encryption_key.pub` most of the time.

If you are using Docker, there is a easy way to do this.

```yml
image: "gitlab/gitlab-ee:latest"
# ...
volumes:
- "public.key:/opt/gitlab/embedded/service/gitlab-rails/.license_encryption_key.pub"
```
### Install License
See [GitLab Document](https://archives.docs.gitlab.com/16.3/ee/administration/license_file.html). Follow are part of the document.
- Sign in to GitLab as an administrator.
- On the left sidebar, expand the top-most chevron.
- Select Admin Area.
- Select Settings > General.
- or entering the key.
- Select the Terms of Service checkbox.
- Select Add license.
> In GitLab 14.7.x to 14.9.x, you can add the license file with the UI. In GitLab 14.1.x to 14.7, if you have already activated your subscription with an activation code, you cannot access Add License from the Admin Area. You must access Add License directly from the URL, <YourGitLabURL>/admin/license/new.
## LICENSE
This project is licensed under the WTFPL License.
Copyrigth (c) 2023, Tim Cook, All Rights Not Reserved.

0 comments on commit cb89aaf

Please sign in to comment.