首页
留言
友链
关于
Search
1
思源笔记docker私有化部署及使用体验分享
2,421 阅读
2
windows11 远程提示:为安全考虑,已锁定该用户帐户,原因是登录尝试或密码更改尝试过多。
1,110 阅读
3
Pointer-Focus:一款功能强大的教学、录屏辅助软件
615 阅读
4
解决 nginxProxyManager 申请证书时的SSL失败问题
610 阅读
5
使用cspell对项目做拼写规范检查
581 阅读
Web前端
CSS
JavaScript
交互
Vue
小程序
后端
运维
项目
生活
其他
转载
软件
职场
登录
Search
标签搜索
docker
DevOps
magic-boot
Linux
酷壳
RabbitMQ
gitlab
Node
git
工具
MybatisPlus
clickhouse
Syncthing
规范
前端
产品
nginx
markdown
axios
H5
朱治龙
累计撰写
139
篇文章
累计收到
7
条评论
首页
栏目
Web前端
CSS
JavaScript
交互
Vue
小程序
后端
运维
项目
生活
其他
转载
软件
职场
页面
留言
友链
关于
搜索到
3
篇与
gitlab
的结果
2024-11-22
docker 版 gitlab 配置邮件推送
背景介绍作为一个老派程序员,偶尔能接到一些私单,不少私单涉及到代码安全问题,就不是很适合用Gitlab、Gitee 等在线代码托管服务了,于是在我的开发服务器上自己搭建了一个 git 服务,可选的git 服务有很多,如::Gitea、Gogs、Gitlab 等,由于公司环境基本上用 Gitlab,且Gitlab 功能足够强大,所以便选择了 Gitlab 作为服务端,Gitlab 在国内成立了极狐公司(https://gitlab.cn/)专门运营国内的 Gitlab,在部署的时候也就选择了 Gitlab 的极狐版本,部署的完整 docker-compose.yml 如下:services: gitlab: image: 'registry.gitlab.cn/omnibus/gitlab-jh:latest' # image: 'registry.gitlab.cn/omnibus/gitlab-jh:16.11.3' #image: 'registry.gitlab.cn/omnibus/gitlab-jh:16.7.7' restart: always container_name: gitlab hostname: 'git.work.zhuzhilong.com' environment: GITLAB_OMNIBUS_CONFIG: | external_url 'http://git.work.zhuzhilong.com' # Add any other gitlab.rb configuration here, each on its own line alertmanager['enable']=false networks: - net-zzl ports: - '8007:80' - '2223:22' volumes: - './config:/etc/gitlab' - './logs:/var/log/gitlab' - './data:/var/opt/gitlab' - ../hosts:/etc/hosts - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro shm_size: '256m' networks: net-zzl: name: bridge_zzl external: true在开发过程中,涉及多成员协作,而 Gitlab 自带的邮件服务还是很有必要的,所以本次我们就将我们的 gitlab 服务搭上邮件的快车。配置过程如下:1、进入 docker 容器docker exec -it gitlab /bin/bash2、编辑 /etc/gitlab/gitlab.rb 文件{alert type="info"}为避免出错,可在更改配置前备份系统,备份命令为:gitlab-rake gitlab:backup:create{/alert}修改涉及邮件发送相关的服务,主要配置信息如下:### GitLab email server settings ###! Docs: https://docs.gitlab.com/omnibus/settings/smtp.html ###! **Use smtp instead of sendmail/postfix.** gitlab_rails['smtp_enable'] = true gitlab_rails['smtp_address'] = "smtp.feishu.cn" gitlab_rails['smtp_port'] = 465 gitlab_rails['smtp_user_name'] = "sender@zhuzhilong.com" gitlab_rails['smtp_password'] = "xxxxxxxx" gitlab_rails['smtp_domain'] = "mail.feishu.cn" gitlab_rails['smtp_authentication'] = "login" # gitlab_rails['smtp_enable_starttls_auto'] = true gitlab_rails['smtp_tls'] = true gitlab_rails['smtp_pool'] = false ###! **Can be: 'none', 'peer', 'client_once', 'fail_if_no_peer_cert'** ###! Docs: http://api.rubyonrails.org/classes/ActionMailer/Base.html # gitlab_rails['smtp_openssl_verify_mode'] = 'none' # gitlab_rails['smtp_ca_path'] = "/etc/ssl/certs" # gitlab_rails['smtp_ca_file'] = "/etc/ssl/certs/ca-certificates.crt" ### Email Settings gitlab_rails['gitlab_email_enabled'] = true ##! If your SMTP server does not like the default 'From: gitlab@gitlab.example.com' ##! can change the 'From' with this setting. gitlab_rails['gitlab_email_from'] = 'xxxx@zhuzhilong.com' gitlab_rails['gitlab_email_display_name'] = '朱治龙git' gitlab_rails['gitlab_email_reply_to'] = 'reply@zhuzhilong.com' # gitlab_rails['gitlab_email_subject_suffix'] = '' # gitlab_rails['gitlab_email_smime_enabled'] = false # gitlab_rails['gitlab_email_smime_key_file'] = '/etc/gitlab/ssl/gitlab_smime.key' # gitlab_rails['gitlab_email_smime_cert_file'] = '/etc/gitlab/ssl/gitlab_smime.crt' # gitlab_rails['gitlab_email_smime_ca_certs_file'] = '/etc/gitlab/ssl/gitlab_smime_cas.crt' 3、使配置生效并重启服务gitlab-ctl reconfigure && gitlab-ctl restart4、验证邮件发送服务可在个人资料 -> 电子邮件 中添加新的邮件地址:添加后,对应的邮箱会收到如下验证邮件即表示配置成功了:
2024年11月22日
8 阅读
0 评论
0 点赞
2024-09-11
记一次升级gitlab的记录(16.3.3~17.3.1)
开发服务器的 gitlab 使用 docker 搭建,docker-compose.yml 文件内容如下:services: gitlab: image: 'registry.gitlab.cn/omnibus/gitlab-jh:latest' restart: always container_name: gitlab hostname: 'git.work.zhuzhilong.com' environment: GITLAB_OMNIBUS_CONFIG: | external_url 'http://git.work.zhuzhilong.com' # Add any other gitlab.rb configuration here, each on its own line networks: - net-zzl ports: - '8007:80' - '2223:22' volumes: - './config:/etc/gitlab' - './logs:/var/log/gitlab' - './data:/var/opt/gitlab' - ../hosts:/etc/hosts shm_size: '256m' networks: net-zzl: name: bridge_zzl external: true由于该 gitlab 搭建后一直未更新过,今天尝试个升级,升级前,我们先看看系统环境信息:由于 gitlab 用的镜像是 registry.gitlab.cn/omnibus/gitlab-jh:latest,我先尝试直接拉取一下最新的镜像看是否可以直接升级,拉取命令:docker compose pull,拉取过程如下:zhuzl@zhuzl-M9-PRO:/data/dockerRoot/apps/gitlab$ docker compose pull [+] Pulling 10/10 ✔ gitlab 9 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿] 0B/0B Pulled 62.1s ✔ 857cc8cb19c0 Already exists 0.0s ✔ d388127601d7 Pull complete 1.0s ✔ c973ce60899e Pull complete 1.6s ✔ d47067d54097 Pull complete 1.2s ✔ b37f526cb6d4 Pull complete 1.4s ✔ e3e25c0883d4 Pull complete 6.6s ✔ 38326bc1340c Pull complete 7.6s ✔ dc916e282a43 Pull complete 6.6s ✔ 84388f622dc9 Pull complete 44.1s zhuzl@zhuzl-M9-PRO:/data/dockerRoot/apps/gitlab$ 然后,我们使用 docker compose up -d 启动服务,启动服务后,使用docker logs -f gitlab命令看看日志: zhuzl@zhuzl-M9-PRO:/data/dockerRoot/apps/gitlab$ docker logs -f gitlab Thank you for using GitLab Docker Image! Current version: gitlab-jh=17.3.1-jh.0 Configure GitLab for your system by editing /etc/gitlab/gitlab.rb file And restart this container to reload settings. To do it use docker exec: docker exec -it gitlab editor /etc/gitlab/gitlab.rb docker restart gitlab For a comprehensive list of configuration options please see the Omnibus GitLab readme https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md If this container fails to start due to permission problems try to fix it by executing: docker exec -it gitlab update-permissions docker restart gitlab Cleaning stale PIDs & sockets It seems you are upgrading from 16.3.3-jh to 17.3.1. It is required to upgrade to the latest 16.11.x version first before proceeding. Please follow the upgrade documentation at https://docs.gitlab.com/ee/update/index.html#upgrading-to-a-new-major-version Thank you for using GitLab Docker Image! Current version: gitlab-jh=17.3.1-jh.0 Configure GitLab for your system by editing /etc/gitlab/gitlab.rb file And restart this container to reload settings. To do it use docker exec: docker exec -it gitlab editor /etc/gitlab/gitlab.rb docker restart gitlab For a comprehensive list of configuration options please see the Omnibus GitLab readme https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md If this container fails to start due to permission problems try to fix it by executing: docker exec -it gitlab update-permissions docker restart gitlab Cleaning stale PIDs & sockets It seems you are upgrading from 16.3.3-jh to 17.3.1. It is required to upgrade to the latest 16.11.x version first before proceeding. Please follow the upgrade documentation at https://docs.gitlab.com/ee/update/index.html#upgrading-to-a-new-major-version Thank you for using GitLab Docker Image! Current version: gitlab-jh=17.3.1-jh.0 Configure GitLab for your system by editing /etc/gitlab/gitlab.rb file And restart this container to reload settings. To do it use docker exec: docker exec -it gitlab editor /etc/gitlab/gitlab.rb docker restart gitlab For a comprehensive list of configuration options please see the Omnibus GitLab readme https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md If this container fails to start due to permission problems try to fix it by executing: docker exec -it gitlab update-permissions docker restart gitlab Cleaning stale PIDs & sockets It seems you are upgrading from 16.3.3-jh to 17.3.1. It is required to upgrade to the latest 16.11.x version first before proceeding. Please follow the upgrade documentation at https://docs.gitlab.com/ee/update/index.html#upgrading-to-a-new-major-version zhuzl@zhuzl-M9-PRO:/data/dockerRoot/apps/gitlab$ 从日志中的提示可知,系统检测到了,我们是从16.3.3-jh 升级到 17.3.1.但是要升级到17.x 必须先升级到 16.11.x 。于是将 docker-compose.yaml 文件中的image值改为:registry.gitlab.cn/omnibus/gitlab-jh:16.11.3,重新拉取,然后运行,观察日志:zhuzl@zhuzl-M9-PRO:/data/dockerRoot/apps/gitlab$ docker logs -f gitlab Thank you for using GitLab Docker Image! Current version: gitlab-jh=16.11.3-jh.0 Configure GitLab for your system by editing /etc/gitlab/gitlab.rb file And restart this container to reload settings. To do it use docker exec: docker exec -it gitlab editor /etc/gitlab/gitlab.rb docker restart gitlab For a comprehensive list of configuration options please see the Omnibus GitLab readme https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md If this container fails to start due to permission problems try to fix it by executing: docker exec -it gitlab update-permissions docker restart gitlab Cleaning stale PIDs & sockets It seems you are upgrading from 16.3.3-jh to 16.11.3. It is required to upgrade to the latest 16.7.x version first before proceeding. Please follow the upgrade documentation at https://docs.gitlab.com/ee/update/#upgrade-paths Thank you for using GitLab Docker Image! Current version: gitlab-jh=16.11.3-jh.0 Configure GitLab for your system by editing /etc/gitlab/gitlab.rb file And restart this container to reload settings. To do it use docker exec: docker exec -it gitlab editor /etc/gitlab/gitlab.rb docker restart gitlab For a comprehensive list of configuration options please see the Omnibus GitLab readme https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md If this container fails to start due to permission problems try to fix it by executing: docker exec -it gitlab update-permissions docker restart gitlab Cleaning stale PIDs & sockets It seems you are upgrading from 16.3.3-jh to 16.11.3. It is required to upgrade to the latest 16.7.x version first before proceeding. Please follow the upgrade documentation at https://docs.gitlab.com/ee/update/#upgrade-paths zhuzl@zhuzl-M9-PRO:/data/dockerRoot/apps/gitlab$根据日志提示,要升级到16.11.3 的话,需要先升级到 16.7.x , 于是我们继续修改docker-compose.yaml 中的 image 为:registry.gitlab.cn/omnibus/gitlab-jh:16.11.3,继续拉取镜像并启动服务,经过漫长等待后,登录gitlab,查看版本发现第一步升级到16.7.x已完成:然后继续升级到16.11.x,修改docker 镜像后,重启服务,经过漫长的等待后,成功升级到16.11.3:然后我们将image 修改为:registry.gitlab.cn/omnibus/gitlab-jh:latest`,重新启动服务,登录后,已经升级到最新的 17.3.1 版本:升级完成后,查看容器日志,发现大量类似这样的错误日志输出:2024-09-11_04:05:55.21146 ts=2024-09-11T04:05:55.211Z caller=main.go:181 level=info msg="Starting Alertmanager" version="(version=0.27.0, branch=master, revision=0aa3c2aad14cff039931923ab16b26b7481783b5)" 2024-09-11_04:05:55.21148 ts=2024-09-11T04:05:55.211Z caller=main.go:182 level=info build_context="(go=go1.22.5, platform=linux/amd64, user=GitLab-Omnibus, date=, tags=unknown)" 2024-09-11_04:05:55.21183 ts=2024-09-11T04:05:55.211Z caller=cluster.go:179 level=warn component=cluster err="couldn't deduce an advertise address: no private IP found, explicit advertise addr not provided" 2024-09-11_04:05:55.21286 ts=2024-09-11T04:05:55.212Z caller=main.go:221 level=error msg="unable to initialize gossip mesh" err="create memberlist: Failed to get final advertise address: No private IP address found, and explicit IP not provided"简单搜了下,找到这个网址:https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/4556按照提示,配置信息添加如下信息即可:alertmanager['enable'] = false。由此,我进一步调整 docker-compose.yml,文件,最终的内容如下:services: gitlab: image: 'registry.gitlab.cn/omnibus/gitlab-jh:latest' # image: 'registry.gitlab.cn/omnibus/gitlab-jh:16.11.3' # image: 'registry.gitlab.cn/omnibus/gitlab-jh:16.7.7' restart: always container_name: gitlab hostname: 'git.work.zhuzhilong.com' environment: GITLAB_OMNIBUS_CONFIG: | external_url 'http://git.work.zhuzhilong.com' # Add any other gitlab.rb configuration here, each on its own line alertmanager['enable']=false networks: - net-zzl ports: - '8007:80' - '2223:22' volumes: - './config:/etc/gitlab' - './logs:/var/log/gitlab' - './data:/var/opt/gitlab' - ../hosts:/etc/hosts shm_size: '256m' networks: net-zzl: name: bridge_zzl external: true
2024年09月11日
94 阅读
2 评论
1 点赞
2023-08-27
修改gitlab账号密码
由于本人的gitlab为个人所用,隔久了未用,之前设置的密码不能登录了,便试着在数据库层面重置密码,本文主要对重置gitlab管理员密码的过程进行记录
2023年08月27日
17 阅读
0 评论
0 点赞