docker安装gitlab-ee并破解

简介: 本文介绍docker安装和gitlab-ee的破解方法

1 利用docker-compose安装


version: '3.7'
services:
  web:
    image: 'gitlab/gitlab-ee:latest'
    #restart: always
    hostname: 'gitlab.example.com'
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'https://gitlab.example.com'
    ports:
      - '22:22'
      - '80:80'
      - '443:443'
    volumes:
      - '/data/docker-compose/gitlab/config:/etc/gitlab'
      - '/data/docker-compose/gitlab/logs:/var/log/gitlab'
      - '/data/docker-compose/gitlab/data:/var/opt/gitlab'ssf


2 创建 ruby docker 镜像


docker run -it --rm ruby /bin/bash


3 生成许可证


gem install gitlab-license


cat > license.rb


注意修改下面的开始和结束时间


require "openssl"
require "gitlab/license"
key_pair = OpenSSL::PKey::RSA.generate(2048)
File.open("license_key", "w") { |f| f.write(key_pair.to_pem) }
public_key = key_pair.public_key
File.open("license_key.pub", "w") { |f| f.write(public_key.to_pem) }
private_key = OpenSSL::PKey::RSA.new File.read("license_key")
Gitlab::License.encryption_key = private_key
license = Gitlab::License.new
license.licensee = {
  "Name" => "none",
  "Company" => "none",
  "Email" => "example@test.com",
}
license.starts_at = Date.new(2020, 1, 1) # 开始时间
license.expires_at = Date.new(2050, 1, 1) # 结束时间
license.notify_admins_at = Date.new(2049, 12, 1)
license.notify_users_at = Date.new(2049, 12, 1)
license.block_changes_at = Date.new(2050, 1, 1)
license.restrictions = {
  active_user_count: 10000,
}
puts "License:"
puts license
data = license.export
puts "Exported license:"
puts data
File.open("GitLabBV.gitlab-license", "w") { |f| f.write(data) }
public_key = OpenSSL::PKey::RSA.new File.read("license_key.pub")
Gitlab::License.encryption_key = public_key
data = File.read("GitLabBV.gitlab-license")
$license = Gitlab::License.import(data)
puts "Imported license:"
puts $license
unless $license
  raise "The license is invalid."
end
if $license.restricted?(:active_user_count)
  active_user_count = 10000
  if active_user_count > $license.restrictions[:active_user_count]
    raise "The active user count exceeds the allowed amount!"
  end
end
if $license.notify_admins?
  puts "The license is due to expire on #{$license.expires_at}."
end
if $license.notify_users?
  puts "The license is due to expire on #{$license.expires_at}."
end
module Gitlab
  class GitAccess
    def check(cmd, changes = nil)
      if $license.block_changes?
        return build_status_object(false, "License expired")
      end
    end
  end
end
puts "This instance of GitLab Enterprise Edition is licensed to:"
$license.licensee.each do |key, value|
  puts "#{key}: #{value}"
end
if $license.expired?
  puts "The license expired on #{$license.expires_at}"
elsif $license.will_expire?
  puts "The license will expire on #{$license.expires_at}"
else
  puts "The license will never expire."
end
ruby license.rb


生成 GitLabBV.gitlab-license license_key license_key.pub 这三个文件。


4 使用许可证


  • 用 license_key.pub 文件替换 /opt/gitlab/embedded/service/gitlab-rails/.license_encryption_key.pub 中的内容
  • GitLabBV.gitlab-license 即是许可证,填入 ${address}/admin/license 地址并重启。


5 搞定收工


60.jpg

相关文章
|
4天前
|
前端开发 jenkins 持续交付
新的centos7.9安装docker版本的jenkins2.436.1最新版本-前端项目发布(五)
新的centos7.9安装docker版本的jenkins2.436.1最新版本-前端项目发布(五)
20 1
|
4天前
|
jenkins 网络安全 持续交付
新的centos7.9安装docker版本的jenkins2.436.1最新版本-后端项目发布(四)
新的centos7.9安装docker版本的jenkins2.436.1最新版本-后端项目发布(四)
18 3
|
4天前
|
网络协议 Linux Docker
在centos7下通过docker 安装onlyoffice
在centos7下通过docker 安装onlyoffice
29 0
|
2天前
|
Linux 网络安全 数据安全/隐私保护
centos7安装gitlab-ce社区版全过程,详细到爆炸,这些面试官常问的开发面试题你都掌握好了吗
centos7安装gitlab-ce社区版全过程,详细到爆炸,这些面试官常问的开发面试题你都掌握好了吗
|
2天前
|
jenkins 持续交付 数据安全/隐私保护
Docker 安装 Jenkins
Jenkins 是一个独立的开源自动化服务器,可用于自动化与构建、测试、交付或部署软件相关的各种任务。
17 1
|
3天前
|
Linux Docker 容器
安装新版本Docker报错container-selinux >= 2:2.74 - 蓝易云
以上步骤应该能够帮助你解决遇到的问题。如果问题仍然存在,你可能需要寻求专业的技术支持。
11 0
|
3天前
|
Ubuntu Linux Docker
window10下安装ubuntu系统以及docker使用
window10下安装ubuntu系统以及docker使用
|
4天前
|
并行计算 Ubuntu Docker
Docker环境Ubuntu20.04安装Python3.10版本
Docker环境Ubuntu20.04安装Python3.10版本
28 0
|
4天前
|
Ubuntu Docker 容器
Ubuntu 22.04.3 LTS_安装Docker
Ubuntu 22.04.3 LTS_安装Docker
45 1
|
4天前
|
应用服务中间件 PHP nginx
安装基于docker的php运行环境
安装基于docker的php运行环境
10 0