首页 > 其他分享 >如何在极狐GitLab 配置 邮件功能

如何在极狐GitLab 配置 邮件功能

时间:2024-03-29 18:11:51浏览次数:12  
标签:ago gitlab anolis GitLab 192.168 极狐 Running my 邮件

本文作者:徐晓伟

GitLab 是一个全球知名的一体化 DevOps 平台,很多人都通过私有化部署 GitLab 来进行源代码托管。极狐GitLab GitLab 在中国的发行版,专门为中国程序员服务。可以一键式部署极狐GitLab。

本文主要讲述了在极狐GitLab 用户找回密码、流水线失败等需要提醒时发送邮件。

说明

启用前查看后台任务,查看已停滞历史邮件

  • 如果不进行干预,当邮件配置生效后,可以重试历史邮件
    file
  • 如果不想发送大量历史电子邮件,可删除未发送的电子邮件
    file

文档

  1. 电子邮件
  2. 电子邮件配置

配置

  1. 以下配置使用 Microsoft Office 365 IMAP 配置,其他配置雷同,参见: 电子邮件

  2. 创建 Microsoft Office 365 IMAP 密码 secret

    kubectl -n gitlab-test create secret generic smtp-password --from-literal=password=你的密码
    
  3. 导出 helm gitlab 配置

    helm -n gitlab-test get values my-gitlab > my-gitlab.yaml
    
  4. 修改 helm gitlab 配置

    global:
      smtp:
        address: smtp.office365.com
        authentication: login
        domain: test.helm.xuxiaowei.cn
        enabled: true
        openssl_verify_mode: peer
        password:
          key: password
          secret: smtp-password
        port: 587
        starttls_auto: true
        user_name: [email protected]
    
  5. 更新 helm gitlab 配置

    helm upgrade -n gitlab-test --install my-gitlab gitlab/gitlab -f my-gitlab.yaml --timeout 600s --version 7.7.0
    
  6. 等待所有 pod 更新完成

    [root@anolis-7-9 ~]# kubectl -n gitlab-test get pod -o wide
    NAME                                                 READY   STATUS      RESTARTS       AGE     IP                NODE         NOMINATED NODE   READINESS GATES
    cm-acme-http-solver-2ldtp                            1/1     Running     14 (24m ago)   2d10h   192.168.210.255   anolis-7-9   <none>           <none>
    cm-acme-http-solver-94dv5                            1/1     Running     14 (24m ago)   2d10h   192.168.210.194   anolis-7-9   <none>           <none>
    cm-acme-http-solver-klkpz                            1/1     Running     14 (24m ago)   2d10h   192.168.210.253   anolis-7-9   <none>           <none>
    my-gitlab-certmanager-8457bfdc8-w858k                1/1     Running     14 (24m ago)   2d10h   192.168.240.118   anolis-7-7   <none>           <none>
    my-gitlab-certmanager-cainjector-74df787cf4-j7cfc    1/1     Running     14 (24m ago)   2d10h   192.168.240.66    anolis-7-7   <none>           <none>
    my-gitlab-certmanager-webhook-7b86db4c96-dhcxl       1/1     Running     14 (24m ago)   2d10h   192.168.240.98    anolis-7-7   <none>           <none>
    my-gitlab-gitaly-0                                   1/1     Running     14 (24m ago)   2d10h   192.168.210.196   anolis-7-9   <none>           <none>
    my-gitlab-gitlab-exporter-55dcfcb595-gl6nm           1/1     Running     14 (24m ago)   2d10h   192.168.210.230   anolis-7-9   <none>           <none>
    my-gitlab-gitlab-pages-f65879869-c9kxd               1/1     Running     1 (24m ago)    21h     192.168.210.236   anolis-7-9   <none>           <none>
    my-gitlab-gitlab-runner-5f6ff5994c-wdw5l             1/1     Running     4 (19m ago)    25h     192.168.210.216   anolis-7-9   <none>           <none>
    my-gitlab-gitlab-shell-55fdc9cb9f-52gnr              1/1     Running     14 (21h ago)   2d10h   192.168.240.125   anolis-7-7   <none>           <none>
    my-gitlab-gitlab-shell-55fdc9cb9f-cfhsh              1/1     Running     14 (24m ago)   2d10h   192.168.210.219   anolis-7-9   <none>           <none>
    my-gitlab-issuer-38-h4pdv                            0/1     Completed   0              8m41s   192.168.240.114   anolis-7-7   <none>           <none>
    my-gitlab-kas-688dc97ddd-28gr7                       1/1     Running     38 (24m ago)   2d10h   192.168.240.95    anolis-7-7   <none>           <none>
    my-gitlab-kas-688dc97ddd-tvkvd                       1/1     Running     45 (18m ago)   2d10h   192.168.210.243   anolis-7-9   <none>           <none>
    my-gitlab-migrations-38-8fnqg                        0/1     Completed   0              8m41s   192.168.240.81    anolis-7-7   <none>           <none>
    my-gitlab-minio-66f584f746-t6qwb                     1/1     Running     7 (19m ago)    2d2h    192.168.210.237   anolis-7-9   <none>           <none>
    my-gitlab-minio-create-buckets-38-nfs8t              0/1     Completed   0              8m41s   192.168.240.78    anolis-7-7   <none>           <none>
    my-gitlab-nginx-ingress-controller-6bdd56c45-ch57n   1/1     Running     14 (24m ago)   2d10h   192.168.240.124   anolis-7-7   <none>           <none>
    my-gitlab-nginx-ingress-controller-6bdd56c45-cm2lz   1/1     Running     15 (19m ago)   2d10h   192.168.210.193   anolis-7-9   <none>           <none>
    my-gitlab-postgresql-0                               2/2     Running     30 (19m ago)   2d10h   192.168.210.250   anolis-7-9   <none>           <none>
    my-gitlab-prometheus-server-646489c599-8mgc9         2/2     Running     30 (19m ago)   2d10h   192.168.210.248   anolis-7-9   <none>           <none>
    my-gitlab-redis-master-0                             2/2     Running     30 (19m ago)   2d10h   192.168.210.252   anolis-7-9   <none>           <none>
    my-gitlab-registry-78fc549f8d-d2zjv                  1/1     Running     14 (24m ago)   2d10h   192.168.240.67    anolis-7-7   <none>           <none>
    my-gitlab-registry-78fc549f8d-xbkvh                  1/1     Running     14 (24m ago)   2d10h   192.168.210.247   anolis-7-9   <none>           <none>
    my-gitlab-sidekiq-all-in-1-v2-7b6d5575fb-kwvtf       1/1     Running     0              8m41s   192.168.240.77    anolis-7-7   <none>           <none>
    my-gitlab-toolbox-658f8894ff-tzlct                   1/1     Running     0              8m40s   192.168.240.79    anolis-7-7   <none>           <none>
    my-gitlab-webservice-default-fd8948f47-jkm44         2/2     Running     0              7m45s   192.168.240.73    anolis-7-7   <none>           <none>
    my-gitlab-webservice-default-fd8948f47-mxjz6         2/2     Running     0              8m41s   192.168.210.195   anolis-7-9   <none>           <none>
    [root@anolis-7-9 ~]#
    
  7. 重试一个历史任务或者重试一个异常流水线,即可发送邮件

    1. 发送邮件
      file
    2. 接收邮件
      file

号外号外!
极狐GitLab 正在推出DevSecOps 成熟度测评!链接:https://gitlab.cn/devsecops-assessment/ 测评非常全面并提供了可靠建议,即使不付费买产品,对自己想要落地 DevSecOps 的用户具有很高的参考意义!快来动手试试吧!
file

标签:ago,gitlab,anolis,GitLab,192.168,极狐,Running,my,邮件
From: https://www.cnblogs.com/jihugitlab/p/18104374

相关文章

  • 如何防范邮件泄密风险来保护企业敏感信息
    邮件系统作为企业内部通信的主要载体,其安全性直接决定了企业信息的安全。于此同时,随着大数据和云计算的发展,数据对网站至关重要,尤其是基于云端存储的数据,一旦泄露,将给企业和用户带来巨大损失。根据调研,24%的企业电子邮件用户曾接收到过其他企业的机密信息。这直接触发了一系列关......
  • docker 安装jenkins和gitlab
    安装jenkins#下载镜像dockerpulljenkins/jenkins#创建文件夹mkdir-p/home/jenkins_home#权限chmod777/home/jenkins_home#启动dockerrun-d-uroot-p9095:8080-p50000:50000--namejenkins-v/home/jenkins_home:/var/jenkins_home-v/etc/localtime:/etc......
  • gitlab私有化搭建
    记录一下,防止忘记前置依赖安装:sudoyuminstallcurlpolicycoreutilsopenssh-serveropenssh-clientssudosystemctlenablesshdsudosystemctlstartsshdsudoyuminstallpostfixsudosystemctlenablepostfixsudosystemctlstartpostfix1、安装命令(在线下载)......
  • Gitlab 实现仓库完全迁移,包括所有提交记录、分支、标签
    1方案一:命令cd<项目目录>gitfetch--allgitfetch--tagsgitremoterenameoriginold-origin#可以不保留gitremoteaddoriginhttp://***(项目的新仓库地址)#gitremoteset-urlorigin<项目的新仓库地址>gitpushorigin--allgitpush--tags有多个分支的话......
  • Python Flask-Mail实现邮件发送
    使用falsk-mail发送邮件一、邮件发送的扩展二、根据文档,总结发送邮件的流程三、实现邮件发送功能3.1、安装扩展3.2、配置3.3、发送邮件(创建mail、message实例并发送)3.4、发送带附件的邮件3.5、批量发送邮件3.6、异步发送邮件四、写在最后一、邮件发送的扩展关于......
  • Docker Gitlab使用方法
    下载dockerpullgitlab/gitlab-ce运行dockerrun\--publish443:443--publish80:80--publish22:22\--namegitlab\-v/data/gitlab/config:/etc/gitlab\-v/data/gitlab/logs:/var/log/gitlab\-v/data/gitlab/data:/var/opt/gitlab\gitla......
  • Java 发送邮件(2024-03)
    1\2\packageorg.jeecg.common.util.io;importcom.sun.mail.util.MailSSLSocketFactory;importlombok.extern.slf4j.Slf4j;importorg.jeecg.common.util.DateUtils;importjavax.activation.DataHandler;importjavax.activation.DataSource;importjavax.acti......
  • 如何使用极狐GitLab 自定义 Pages 根域名
    本文作者:徐晓伟GitLab是一个全球知名的一体化DevOps平台,很多人都通过私有化部署GitLab来进行源代码托管。极狐GitLab是GitLab在中国的发行版,专门为中国程序员服务。可以一键式部署极狐GitLab。本文主要讲述了极狐GitLabPages使用独立于极狐GitLab的根域名。配置......
  • gitlab 集成runner
    要在CentOS上安装GitLabRunner,可以按照以下步骤进行操作:添加GitLabRunner软件仓库:首先,需要添加GitLabRunner的软件仓库。打开终端并执行以下命令:curl-Lhttps://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.rpm.sh|sudobash安......
  • 如何极狐GitLab Runner 使用特权身份运行
    本文作者:徐晓伟GitLab是一个全球知名的一体化DevOps平台,很多人都通过私有化部署GitLab来进行源代码托管。极狐GitLab是GitLab在中国的发行版,专门为中国程序员服务。可以一键式部署极狐GitLab。本文主要讲述了如何使用极狐GitLabRunner使用特权身份运行。问题安......