Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
b2016dc
Update README.md
Lakr233 Jan 24, 2022
6795844
Update for 15.3.1+
Lakr233 Aug 24, 2022
d54f5c1
updated validation
Lakr233 Sep 2, 2022
f374153
updated validation
Lakr233 Sep 2, 2022
2ff7464
updated validation
Lakr233 Sep 2, 2022
5988594
updated validation
Lakr233 Sep 2, 2022
4fd7395
updated validation
Lakr233 Sep 2, 2022
a0db30f
Update README.md
Lakr233 Aug 28, 2023
d76d4cd
Update README.md
Lakr233 Sep 25, 2023
f0a18ba
Auto Update
Lakr233 Dec 26, 2023
83f34a8
Done Feature Scanning
Lakr233 Dec 26, 2023
668d9c5
Update License Name
Lakr233 Dec 26, 2023
20f084e
Update generator.license.rb
Lakr233 Dec 26, 2023
c5edcd6
Put Back Old Keys
Lakr233 Dec 26, 2023
1f3d986
Update build.yml
Lakr233 Dec 26, 2023
5a71b73
Update build.yml
Lakr233 Dec 26, 2023
f9307fb
Update build.yml
Lakr233 Dec 26, 2023
4ee5aab
Update build.yml
Lakr233 Dec 26, 2023
f3f16cb
Update make.sh
Lakr233 Dec 28, 2023
4f72903
Update make.sh
Lakr233 Dec 28, 2023
3d42c64
Update README.md
Lakr233 Dec 28, 2023
23530f8
Update README.md
Lakr233 Jan 18, 2024
e8c2e26
Update README.md
Lakr233 Jan 18, 2024
1165537
Update README.md
Lakr233 Jan 18, 2024
20ad844
Update README.md
Lakr233 Jan 23, 2024
95b17b7
Update README.md
Lakr233 Feb 22, 2024
a53c3c2
Update README.md
Lakr233 Mar 21, 2024
06e26ed
Update README.md
Lakr233 Mar 24, 2024
b3a013d
changed tested version
gabrielecabrini Apr 22, 2024
cdecd56
Merge pull request #9 from gabrielecabrini/patch-1
Lakr233 Apr 22, 2024
84fc4da
Update test compatibility to v17.0.1
gabrielecabrini Jun 9, 2024
197d254
Merge pull request #10 from gabrielecabrini/patch-2
Lakr233 Jun 9, 2024
16e597f
Update last tested version on README
gabrielecabrini Jul 3, 2024
cfb26f0
Fix make.sh linux support
gabrielecabrini Jul 3, 2024
67c8f20
Merge pull request #11 from gabrielecabrini/patch-3
Lakr233 Jul 3, 2024
114d659
Merge pull request #12 from gabrielecabrini/patch-4
Lakr233 Jul 3, 2024
48e1087
Update tested version
gabrielecabrini Aug 23, 2024
e7fdff7
Merge pull request #13 from gabrielecabrini/patch-5
Lakr233 Aug 23, 2024
545dbd2
tested version
RootShell-coder Aug 30, 2024
bfd9e08
Merge pull request #14 from RootShell-coder/main
Lakr233 Aug 31, 2024
c3df471
docs: update last tested version in README.md
gabrielecabrini Sep 17, 2024
e1e04a9
Merge pull request #15 from gabrielecabrini/patch-6
Lakr233 Sep 18, 2024
2bd45c8
Update | 'README.md' Tested version
OverStyleFR Oct 2, 2024
35f18d8
Merge pull request #16 from OverStyleFR/main
Lakr233 Oct 2, 2024
b7e2311
Update | 'README.md' improve guide tutorial
OverStyleFR Oct 2, 2024
d7fca25
Add | 'README_FR.md' Readme for FR language
OverStyleFR Oct 2, 2024
40ba6c5
Update | 'README.md' Add language select
OverStyleFR Oct 2, 2024
3652c1b
Update | 'README_FR.md' Add language select
OverStyleFR Oct 2, 2024
ee29381
Merge pull request #17 from OverStyleFR/main
Lakr233 Oct 2, 2024
6f67bc0
tested ver 17.4.2-ee
RootShell-coder Oct 11, 2024
ddb0870
Merge pull request #18 from RootShell-coder/main
Lakr233 Oct 12, 2024
7c92103
minor: updated the latest version to 17.5.1-ee
fmotalleb Oct 29, 2024
eb436ed
minor: updated the latest version to 17.5.1-ee
fmotalleb Oct 29, 2024
4291bd1
feat: added more parameters to cli
fmotalleb Oct 29, 2024
284a103
fix: license_plan condition
fmotalleb Oct 29, 2024
7117fd4
Update generator.license.rb
fmotalleb Oct 29, 2024
66e0073
minor: optimized arg help messages
fmotalleb Oct 29, 2024
9a70dab
fix: added year and user count validations
fmotalleb Oct 29, 2024
e2579df
Merge pull request #1 from FMotalleb/patch-1
fmotalleb Oct 29, 2024
83721a1
Merge pull request #2 from FMotalleb/patch-2
fmotalleb Oct 29, 2024
7096804
Merge pull request #19 from FMotalleb/patch-1
Lakr233 Oct 30, 2024
0f99a8f
Merge pull request #20 from FMotalleb/patch-2
Lakr233 Oct 30, 2024
ca69219
fix: disable the need to download full gitlab source code during make…
fmotalleb Oct 31, 2024
6199945
feat: added envvars for optional fields in make.sh
fmotalleb Oct 31, 2024
0edb66e
fix: optional flag issue
fmotalleb Oct 31, 2024
abac7cd
Merge branch 'Lakr233:main' into main
fmotalleb Oct 31, 2024
2435514
Merge pull request #21 from FMotalleb/main
Lakr233 Oct 31, 2024
47ba50d
fix: removed redundant `chmod`
fmotalleb Oct 31, 2024
949d5ed
Merge branch 'Lakr233:main' into main
fmotalleb Oct 31, 2024
0242f4f
Merge pull request #22 from FMotalleb/main
Lakr233 Oct 31, 2024
67979fa
fix,minor: safely handle env vars
fmotalleb Oct 31, 2024
fbb51de
feat: docker image
fmotalleb Oct 31, 2024
1d80441
fix: failed `exec` in `find` cmd
fmotalleb Oct 31, 2024
8332c45
docs: added docker usage
fmotalleb Oct 31, 2024
ba60714
feat: added build image method
fmotalleb Oct 31, 2024
502a6c0
Merge pull request #23 from FMotalleb/main
Lakr233 Oct 31, 2024
9191b28
add a script that can modify existing licenses
Nov 4, 2024
51f33d4
Merge pull request #24 from codemaker219/modify_existing_licenses
Lakr233 Nov 4, 2024
8cd929f
offline cloud license
Nov 18, 2024
7b97141
Merge pull request #25 from bryibeats/offline-cloud
Lakr233 Nov 18, 2024
6360865
Update README.md
FifoF Nov 23, 2024
a427111
Merge pull request #26 from FifoF/patch-1
Lakr233 Nov 23, 2024
ab54764
Put Empty scan.features.rb
Lakr233 Dec 6, 2024
c512add
Update README
Lakr233 Dec 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
langs/
README.md
LICENSE
.github/
Dockerfile
.*ignore
Empty file added .github/.gitkeep
Empty file.
25 changes: 25 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Ruby Gem

on:
workflow_dispatch:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: "0 1 * * *"

jobs:
rebuild:
runs-on: macos-latest
steps:
- name: Checkout Source Code
uses: actions/checkout@v4
- name: Build
run: |
./make.sh
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: build
path: build
47 changes: 47 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.

name: Publish Container to Github at dev

on:
push:
branches:
- 'main'

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,11 @@ build-iPhoneSimulator/

# Used by RuboCop. Remote config files pulled in from inherit_from directive.
# .rubocop-https?--*

temp/
output/
license_key
license_key.pub
result.gitlab-license
features.list
.DS_Store
Empty file added .root
Empty file.
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM ruby:bookworm
WORKDIR /license-generator
COPY ./ ./
RUN <<EOF
gem install gitlab-license
EOF
VOLUME /license-generator/build
ENV LICENSE_NAME="Tim Cook"
ENV LICENSE_COMPANY="Apple Computer, Inc."
ENV LICENSE_EMAIL="tcook@apple.com"
ENV LICENSE_PLAN="ultimate"
ENV LICENSE_USER_COUNT="2147483647"
ENV LICENSE_EXPIRE_YEAR="2500"

CMD [ "./make.sh" ]
212 changes: 210 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,210 @@
# GitLab-License-Generator
Generator GitLab License For Self-Hosted/Private Instances
<div align="center">

# GitLab License Generator

<p align="center">
<a href="README.md">English</a> |
<a href="lang/README_FR.md">Français</a> |
<a href="lang/README_RU.md">Russian</a>
</p>

</div>

## Description

**GitLab License Generator** This project generates a GitLab license for **development purposes**. If you encounter any problems, please troubleshoot them on your own.

> Last tested on GitLab v17.6.0-ee.

## Principles

### **src/generator.keys.rb**

GitLab uses a public/private key pair to encrypt its license. The public key is shipped with the GitLab distribution, while the private key is kept secure. The license itself is simply a JSON dictionary. Since GitLab has made its code open-source, we can easily generate our own license.

### **src/generator.license.rb**

The `lib` folder is extracted from GitLab's source code. It is used to build and validate the license. The script `src/generator.license.rb` loads this functionality.

### **src/scan.features.rb**

Removed with a script to generate empty json file due to DMCA takedown request.

~~Features are extracted from an object filled with constants. The most comprehensive plan for a license is **Ultimate**, but features like Geo Mirroring are not included in any standard plan. Therefore, we manually add these features.~~

## Usage

### Using Docker image (Zero setup)

Using this method license files are generated under `./license` directory
> Please note that in standard docker installations, owner of the files generated in license directory will be root

#### Method (1): Pull image

```bash
docker run --rm -it \
-v "./license:/license-generator/build" \
-e LICENSE_NAME="Tim Cook" \
-e LICENSE_COMPANY="Apple Computer, Inc." \
-e LICENSE_EMAIL="tcook@apple.com" \
-e LICENSE_PLAN="ultimate" \
-e LICENSE_USER_COUNT="2147483647" \
-e LICENSE_EXPIRE_YEAR="2500" \
ghcr.io/lakr233/gitlab-license-generator:main
```

#### Method (2): Build image

```bash
git clone https://github.com/Lakr233/GitLab-License-Generator.git
docker build GitLab-License-Generator -t gitlab-license-generator:main
docker run --rm -it \
-v "./license:/license-generator/build" \
-e LICENSE_NAME="Tim Cook" \
-e LICENSE_COMPANY="Apple Computer, Inc." \
-e LICENSE_EMAIL="tcook@apple.com" \
-e LICENSE_PLAN="ultimate" \
-e LICENSE_USER_COUNT="2147483647" \
-e LICENSE_EXPIRE_YEAR="2500" \
gitlab-license-generator:main
```

### Manual: Prerequisites

Before starting, ensure your environment is properly configured.

#### 1. Install Ruby and gem

To run this project, you need **Ruby** and the **gem** package manager.

- **On Linux (Ubuntu/Debian)**:

```bash
sudo apt update
sudo apt install ruby-full
```

- **On macOS** (via Homebrew):

```bash
brew install ruby
```

#### 2. Install Bundler and necessary gems

After installing Ruby, you need to install **Bundler** to manage Ruby dependencies.

```bash
gem install bundler
```

#### 3. Install the `gitlab-license` gem

The project requires the `gitlab-license` gem, which will be automatically downloaded and used by the script.

```bash
gem install gitlab-license
```

### Steps to Generate the GitLab License

#### 1. Clone the project repository

Clone this project to your local machine.

```bash
git clone https://github.com/Lakr233/GitLab-License-Generator.git
cd GitLab-License-Generator
```

#### 2. Run the `make.sh` script

Once all the prerequisites are met, run the script:

```bash
./make.sh
```

The script will perform the following actions:

- Download and extract the `gitlab-license` gem.
- Copy and modify the required files.
- Clone the GitLab source code from GitLab.com.
- Generate a public/private key pair.
- Generate a GitLab license.

#### 3. Replace the public key in GitLab

The script generates a public key located in `build/public.key`. You need to replace GitLab’s existing public key with this newly generated one to ensure the license is accepted.

- **If GitLab is installed on your server**:

```bash
sudo cp ./build/public.key /opt/gitlab/embedded/service/gitlab-rails/.license_encryption_key.pub
sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart
```

- **If GitLab is installed via Docker**:
Modify your `docker-compose.yml` file to mount the new public key inside the container:

```yaml
volumes:
- "./build/public.key:/opt/gitlab/embedded/service/gitlab-rails/.license_encryption_key.pub"
```

Then restart the container:

```bash
docker-compose down
docker-compose up -d
```

#### 4. Install the license in GitLab

Once the public key is replaced, log in to GitLab’s admin interface to install the generated license.

1. Log in to GitLab as an administrator.
2. Navigate to the **Admin Area** from the bottom-left corner.
3. Go to **Settings > General** and upload the generated license file (`build/result.gitlab-license`).
4. Check the **Terms of Service** checkbox and click **Add License**.

If necessary, you can directly access the license upload page via:

```
<YourGitLabURL>/admin/license/new
```

#### 5. Disable Service Ping (optional)

If you want to disable GitLab’s usage data collection (Service Ping), modify GitLab’s configuration file:

- Open the configuration file:

```bash
sudo nano /etc/gitlab/gitlab.rb
```

- Add the following line:

```bash
gitlab_rails['usage_ping_enabled'] = false
```

- Reconfigure and restart GitLab:

```bash
sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart
```

### Troubleshooting

- **HTTP 502 Error**:
If you encounter this error, wait for GitLab to finish starting up (it may take some time).

## LICENSE

This project is licensed under the **WTFPL License**.

Copyright (c) 2023, Tim Cook, All Rights Not Reserved.
10 changes: 0 additions & 10 deletions generate_keys.rb

This file was deleted.

27 changes: 27 additions & 0 deletions keys/private.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEAreEfP/ncA1A5cuxBz7rS0Z9DDxdSymLwt2OUSM5WJa+dVB3z
SpQjinifdNZq+iHVt8toZBZZ02H3unbn8td0rIifoj4oVpLhvnOAVjUn5tZeUX17
tWMA+yyBpf6w6IFxeYBXFd14WOKEarS05U9B59DjBxNqSm+GzhljHO7vvTKy2xXQ
Q7Fa702DZ7jwr4DJnL87bDXfarnYksuawqtKwQbFHAOvxFj8ghBh1Gshap1abExD
4l7QWxFM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oFQaNe2BCW
6cqZYw8giiFYUieAP+HKVKcujmInPbOHcoq6dKqglvQFExDVD56w5axoL8dW4Eme
H/OGkQKBgHgQeK29Ntz7LcKlXYhQPkmYn+DWAmEq4J6XjjXyCV82HgEMmhIiAKKI
UURKt4j6c7KSiAhnyITz9JeVRoAFVB3y/tSSc5E+CH3jG/G0YlToW20Itf6o8hwD
XERkPPwsXVoZWR2FcUzcO7Bspm/JvkuaL+4u1fi+eNl7uF7RRaD1
-----END RSA PRIVATE KEY-----
9 changes: 9 additions & 0 deletions keys/public.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAreEfP/ncA1A5cuxBz7rS
0Z9DDxdSymLwt2OUSM5WJa+dVB3zSpQjinifdNZq+iHVt8toZBZZ02H3unbn8td0
rIifoj4oVpLhvnOAVjUn5tZeUX17tWMA+yyBpf6w6IFxeYBXFd14WOKEarS05U9B
59DjBxNqSm+GzhljHO7vvTKy2xXQQ7Fa702DZ7jwr4DJnL87bDXfarnYksuawqtK
wQbFHAOvxFj8ghBh1Gshap1abExD4l7QWxFMTCVOkLJmXiqfOi5KuMiaMsSUsCBN
QDE3A5aKvpwLGozsvpGRMy5Tt4SgHC7ZbgerBNe75olOoPDxZf7bBt0+O5A/UjK/
HwIDAQAB
-----END PUBLIC KEY-----
Loading