首页
关于
壁纸
直播
留言
友链
统计
Search
1
《三国志英杰传》攻略
6,034 阅读
2
Emby客户端IOS破解
5,767 阅读
3
白嫖Emby
5,764 阅读
4
《吞食天地1》金手指代码
4,691 阅读
5
破解emby-server
4,039 阅读
moonjerx
game
age-of-empires
zx3
san-guo-zhi
尼尔:机械纪元
net
emby
learn-video
docker
torrent
photoshop
route
minio
git
ffmpeg
im
vue
gitlab
typecho
svn
alipay
nasm
srs
mail-server
tailscale
kkfileview
aria2
webdav
synology
redis
oray
chemical
mxsite
math
π
x-ui
digital-currency
server
nginx
baota
k8s
http
cloud
linux
shell
database
vpn
esxi
rancher
domain
k3s
ewomail
os
android
windows
ios
app-store
macos
develop
java
javascript
uniapp
nodejs
hbuildx
maven
android-studio
jetbrain
jenkins
css
mybatis
php
python
hardware
hard-disk
pc
RAM
software
pt
calibre
notion
office
language
literature
philosophy
travel
登录
Search
标签搜索
ubuntu
mysql
openwrt
zerotier
springboot
centos
openvpn
jdk
吞食天地2
synology
spring
idea
windows11
吞食天地1
transmission
google-play
Japanese
xcode
群晖
kiftd
MoonjerX
累计撰写
370
篇文章
累计收到
459
条评论
首页
栏目
moonjerx
game
age-of-empires
zx3
san-guo-zhi
尼尔:机械纪元
net
emby
learn-video
docker
torrent
photoshop
route
minio
git
ffmpeg
im
vue
gitlab
typecho
svn
alipay
nasm
srs
mail-server
tailscale
kkfileview
aria2
webdav
synology
redis
oray
chemical
mxsite
math
π
x-ui
digital-currency
server
nginx
baota
k8s
http
cloud
linux
shell
database
vpn
esxi
rancher
domain
k3s
ewomail
os
android
windows
ios
app-store
macos
develop
java
javascript
uniapp
nodejs
hbuildx
maven
android-studio
jetbrain
jenkins
css
mybatis
php
python
hardware
hard-disk
pc
RAM
software
pt
calibre
notion
office
language
literature
philosophy
travel
页面
关于
壁纸
直播
留言
友链
统计
搜索到
4
篇与
gitlab
的结果
2023-11-20
gitlab忘记密码
一、背景由于公司在公司内部服务新装一台Gitlab服务器,长期未登录导致密码忘记。二、邮箱方式找回1.在gitlab登录窗口如果密码忘记了登录不进入,可以先尝试点击登录框下方的Forgot your password来通过邮箱的方式找回,如果邮箱不可以使用了,则看下面的强制找回方法.2.输入邮箱账号找回输入当初设置的邮箱帐号,这一步前提是邮箱可以正常使用的情况下才可以使用的方法3.重设密码输入正确的邮箱后,点击邮箱会受到一封重设密码邮件,点击Reset password进入浏览器重新输入新密码确定重新登录即可。三、Bash命令方式找回1.切换到git用户[root@staging ~]# su git2.查看gitlab命令文件sh-4.2$ ls alertmanager gitaly gitlab-exporter gitlab-workhorse nginx postgresql redis backups git-data gitlab-rails grafana node-exporter prometheus trusted-certs-directory-hash bootstrapped gitlab-ci gitlab-shell logrotate postgres-exporter public_attributes.json3.进入gitlab控制台sh-4.2$ gitlab-rails console -------------------------------------------------------------------------------- GitLab: 13.0.3 (e2397fc2acb) FOSS GitLab Shell: 13.2.0 PostgreSQL: 11.7 -------------------------------------------------------------------------------- Loading production environment (Rails 6.0.3)4.查询gitlab超级管理员信息irb(main):001:0> user = User.where(id:1).first => #<User id:1 @root>5.重置密码并报存用户对象irb(main):004:0> user.password='*******' irb(main):005:0> user.save! Enqueued ActionMailer::DeliveryJob (Job ID: a5a683e2-9d9c-402f-8187-3902f3380ced) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", #<GlobalID:0x00007fb8d13bcbd0 @uri=#<URI::GID gid://gitlab/User/1>> => true irb(main):008:0> quit
2023年11月20日
50 阅读
0 评论
0 点赞
2023-01-04
破解Gitlab EE
一、docker安装gitlab-ee1.执行安装脚本docker run -d --name gitlabee \ --restart always \ --privileged \ -e GITLAB_SKIP_UNMIGRATED_DATA_CHECK=true \ -p 40001:40001 \ -p 40002:40002 \ -p 40003:40003 \ -v /home/$USER/dockerfile/gitlabee/data/etc:/etc/gitlab \ -v /home/$USER/dockerfile/gitlabee/data/logs:/var/log/gitlab \ -v /home/$USER/dockerfile/gitlabee/data/data:/var/opt/gitlab \ gitlab/gitlab-ee:15.7.0-ee.02.获取root用户登录密码docker exec gitlabee grep 'Password:' /etc/gitlab/initial_root_password得到root用户密码:Password: dwFJvE5IctiBAYiG8jzA0COgEqdu/KDxg8HmSl73rX8=二、修改配置修改 /etc/gitlab.rb 配置文件即可,以下为快速修改脚本命令。记得将IP地址192.168.0.100修改为自己服务器的实际IP本攻略以 192.168.0.100 为例1.修改http访问地址sudo sed -i "s|# external_url 'GENERATED_EXTERNAL_URL'|external_url 'http://192.168.0.100:40002'|g" /home/$USER/dockerfile/gitlabee/data/etc/gitlab.rb2.修改ssh请求地址sudo sed -i "s|# gitlab_rails\['gitlab_ssh_host'\] = 'ssh.host_example.com'|gitlab_rails\['gitlab_ssh_host'\] = '192.168.0.100:40001'|g" /home/$USER/dockerfile/gitlabee/data/etc/gitlab.rb3.重载配置docker exec gitlabee gitlab-ctl reconfigure三、破解gitlab-ee1.使用docker运行rubydocker run -it --rm ruby /bin/bash或者本地安装ruby,需要2.3或以上sudo apt-get install ruby2.使用ruby生成许可证gem install gitlab-license注: docker容器内执行该命令后不会自动结束并换行,按 Ctrl+C 结束3.创建证书文件1.创建license.rb文件,并输入脚本内容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" => "Your Company", "Company" => "Your Company", "Email" => "example@test.com", } license.starts_at = Date.new(2023, 1, 1) # 开始时间 license.expires_at = Date.new(2053, 1, 1) # 结束时间 license.notify_admins_at = Date.new(2052, 12, 1) license.notify_users_at = Date.new(2052, 12, 1) license.block_changes_at = Date.new(2053, 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然后 Ctrl + C 退出输入2.生成许可证和公钥文件ruby license.rb执行命令后会在当前目录下生成 三个文件 GitLabBV.gitlab-license 、 license_key 、 license_key.pub4.使用许可证1.读取公钥和许可证密钥读取公钥:cat license_key.pub得到一串公钥-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwMq1zZocqfF3M2g4ReXJ UYgQ5QOCeLVGrvUpqfcAU7xCmA6lMOH5XqzuT/5hntMWYtQin26BL1n0nvDV1Mkz obAVNms9bK9KLRHaihLugjOWUh3aiF2vgXU+5Hq1+pXKiePDNNKf/l0xBGsuYBLG c/d+AjqmUJueHJYjtRUQsEpIF3jpjEQFkp5pJCOViGkU3MXbUGtFi5GCyS3WEYEY GMoz+joGiVjIJVA3uPIAZnkNouccHNrNZY6Ryh/KrPqTmBC/brVYbgqsuY7O89Mb 2xBcm84u9rdfm1WnsRQeNGhQTjz5Y8V3XvFiYi6FKl+PCx4Ppw88VCpQynGejB2Q vwIDAQAB -----END PUBLIC KEY-----读取许可证密钥:cat GitLabBV.gitlab-license得到一串密钥eyJkYXRhIjoiR1BESmQ3SzFTTmVXTmRGR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k2NTZDUjNoXG5JWDRKcTBQVUlFeW5ydkQ0RmswQnZmaVBS bVI0Ky9nVS9wY1NwKzR5UllVdDluM0c5aUFzbnFpd3NreGdcbk12ek5zbG02 eEFDbXU5RmIwaWs3OTJCdWlXeFloU2cxdUpyelBXNDd2M2t5M1lGVzU3UXRQ eldyZUp5TFxuSnNRRXc1U3I5YzlFRHh5ZDNXUVdvUnErYWdRckhmNmJla2xt REovQ2trdGQyVU9MNC94VmgwSjF0SHloXG45SlVSRlZQRWFUL3VQWHc1N3ZG eW1hQ2NoeTEvY1grRnJMc29qV2VwcEE9PVxuIiwiaXYiOiJmdTY4WU1neFha LzJJWnRDMU1RTDNBPT1cbiJ92.替换 gitlab-ee 公钥内容docker exec -it gitlabee /bin/shvi /opt/gitlab/embedded/service/gitlab-rails/.license_encryption_key.pubvi打开文本后非编辑状态下,先清空旧文本,再输入上一步公钥内容清空文本命令:%d3.重启gitlab-eedocker exec gitlabee gitlab-ctl restart4.上传许可证,激活订阅先打开浏览器,登录root账户。http://192.168.0.100:40002然后转到许可证上传界面http://192.168.0.100:40002/admin/application_settings/general填入许可证,激活订阅激活成功后四、其他问题从url导入项目提示错误:Url is blocked: Requests to the local network are not allowed摘自: https://www.lizhiqiang.name/archives/2190.html https://www.cnblogs.com/guoapeng/p/16816476.html
2023年01月04日
1,160 阅读
8 评论
0 点赞
2022-06-06
git常用命令
1.检出远程代码git clone https://www.xxxcode.com/program-test.git2.增加文件(预提交)git add test.txtgit add .3.提交到本地版本库git commit -m 'Add a test.txt file'4.推送到远程版本库git push origin mastergit push origin branch15.列出所有分支git branch -a6.创建分支git branch branch1git checkout -b branch17.切换分支git checkout branch18.合并分支(先切换到主分支,然后pull更新代码,再执行合并分支命令)git merge branch19.冲突处理使用vi命令或者idea编辑器修改冲突文件然后执行 git add 和 git commit 命令即可解决冲突
2022年06月06日
97 阅读
0 评论
0 点赞
2021-10-12
docker安装gitlab
一、直接运行docker命令docker run -d --name gitlab \ --restart always \ -p 30001:30001 \ -p 30002:30002 \ -p 30003:22 \ -v /home/$USER/dockerfile/gitlab/etc:/etc/gitlab \ -v /home/$USER/dockerfile/gitlab/logs:/var/log/gitlab \ -v /home/$USER/dockerfile/gitlab/data:/var/opt/gitlab \ gitlab/gitlab-ce:latest额外参数:--hostname 192.168.1.8 \官方文档里有加这一条 --hostname 192.168.1.8 ,实测可以不写,只需手动改配置若要运行企业版,只需把最后 gitlab/gitlab-ce:latest 改成 gitlab/gitlab-ee:latest等安装完成后运行命令获取管理员账号root密码sudo docker exec -it gitlab grep 'Password:' /etc/gitlab/initial_root_password会返回一串密码: Password: akYzRtsctNfxnvVL2EFkK7wwvYXcQOi/spm2Yn/y77Y=二、修改配置:安装完成后,新建项目后,使用git-clone的时候会发现http和ssh的地址都不正确。所以要修改访问地址配置。1、http访问地址修改80端口的修改,我们需要在 gitlab.rb 文件中搜索 external_url :sudo vim /home/$USER/dockerfile/gitlab/etc/gitlab.rb在后续文本中搜索输入命令 ?external_url 回车?external_url## GitLab URL ##! URL on which GitLab will be reachable. ##! For more details on configuring external_url see: ##! https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab ##! ##! Note: During installation/upgrades, the value of the environment variable ##! EXTERNAL_URL will be used to populate/replace this value. ##! On AWS EC2 instances, we also attempt to fetch the public hostname/IP ##! address from AWS. For more details, see: ##! https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html # external_url 'GENERATED_EXTERNAL_URL' external_url 'http://192.168.1.8:30002' ## Roles for multi-instance GitLab{callout color="#f0ad4e"}此处有30002端口,在网页端点击clone按钮的时候才会显示。前面docker运行命令的时候 30002:30002 两个端口号,后面那个端口号为镜像内部nginx自动配置的端口号,所以docker运行安装命令的时候,想要修改端口就必须前后两个端口都对应修改相同。否则clone的时候不会正确显示,也无法正确使用。{/callout}2、ssh访问地址修改在 gitlab.rb 文件中搜索 _ssh_portsudo vim /home/$USER/dockerfile/gitlab/etc/gitlab.rb在后续文本中搜索输入命令 ?_ssh_port 回车?_ssh_port### Wait for file system to be mounted ###! Docs: https://docs.gitlab.com/omnibus/settings/configuration.html#only-start-omnibus-gitlab-services-after-a-given-file-system-is-mounted # high_availability['mountpoint'] = ["/var/opt/gitlab/git-data", "/var/opt/gitlab/gitlab-rails/shared"] ### GitLab Shell settings for GitLab # gitlab_rails['gitlab_shell_ssh_port'] = 22 gitlab_rails['gitlab_ssh_host'] = '192.168.1.8' gitlab_rails['gitlab_shell_ssh_port'] = 30001 # gitlab_rails['gitlab_shell_git_timeout'] = 800 ### Extra customization # gitlab_rails['extra_google_analytics_id'] = '_your_tracking_id' # gitlab_rails['extra_google_tag_manager_id'] = '_your_tracking_id' # gitlab_rails['extra_one_trust_id'] = '_your_one_trust_id'3.生效配置:进入gitlab容器sudo docker exec -it gitlab /bin/sh重载配置和重启gitlabgitlab-ctl reconfigure && gitlab-ctl restart也可以直接重启容器。三、避坑实测直接运行官方文档带有 --hostname 192.168.1.8 的docker run命令后,使用git-clone会报错404。不带 --hostname 192.168.1.8 安装后修改配置,再重启时gitlab运行不起来。此时进行如下操作可行:隐藏内容,请前往内页查看详情
2021年10月12日
152 阅读
0 评论
0 点赞
您的IP: