{{< details >}}
- Tier: 基础版, 专业版, 旗舰版
- Offering: 私有化部署
{{< /details >}}
{{< history >}}
- 引入于极狐GitLab 15.9。
{{< /history >}}
以下是与服务台电子邮件相关的 Rake 任务。
密钥
极狐GitLab 可以使用从加密文件中读取的服务台电子邮件密钥,而不是将它们以明文形式存储在文件系统中。以下 Rake 任务用于更新加密文件的内容。
显示密钥
显示当前服务台电子邮件密钥的内容。
{{< tabs >}}
{{< tab title=”Linux package (Omnibus)” >}}
sudo gitlab-rake gitlab:service_desk_email:secret:show
{{< /tab >}}
{{< tab title=”Helm chart (Kubernetes)” >}}
使用 Kubernetes 密钥来存储服务台电子邮件密码。有关更多信息,请阅读Helm IMAP 密钥。
{{< /tab >}}
{{< tab title=”Docker” >}}
sudo docker exec -t <container name> gitlab:service_desk_email:secret:show
{{< /tab >}}
{{< tab title=”Self-compiled (source)” >}}
bundle exec rake gitlab:service_desk_email:secret:show RAILS_ENV=production
{{< /tab >}}
{{< /tabs >}}
示例输出
password: 'examplepassword'
user: 'service-desk-email@mail.example.com'
编辑密钥
在编辑器中打开密钥内容,并在退出时将结果内容写入加密密钥文件。
{{< tabs >}}
{{< tab title=”Linux package (Omnibus)” >}}
sudo gitlab-rake gitlab:service_desk_email:secret:edit EDITOR=vim
{{< /tab >}}
{{< tab title=”Helm chart (Kubernetes)” >}}
使用 Kubernetes 密钥来存储服务台电子邮件密码。有关更多信息,请阅读Helm IMAP 密钥。
{{< /tab >}}
{{< tab title=”Docker” >}}
sudo docker exec -t <container name> gitlab:service_desk_email:secret:edit EDITOR=editor
{{< /tab >}}
{{< tab title=”Self-compiled (source)” >}}
bundle exec rake gitlab:service_desk_email:secret:edit RAILS_ENV=production EDITOR=vim
{{< /tab >}}
{{< /tabs >}}
写入原始密钥
通过 STDIN
提供新密钥内容。
{{< tabs >}}
{{< tab title=”Linux package (Omnibus)” >}}
echo -e "password: 'examplepassword'" | sudo gitlab-rake gitlab:service_desk_email:secret:write
{{< /tab >}}
{{< tab title=”Helm chart (Kubernetes)” >}}
使用 Kubernetes 密钥来存储服务台电子邮件密码。有关更多信息,请阅读Helm IMAP 密钥。
{{< /tab >}}
{{< tab title=”Docker” >}}
sudo docker exec -t <container name> /bin/bash
echo -e "password: 'examplepassword'" | gitlab-rake gitlab:service_desk_email:secret:write
{{< /tab >}}
{{< tab title=”Self-compiled (source)” >}}
echo -e "password: 'examplepassword'" | bundle exec rake gitlab:service_desk_email:secret:write RAILS_ENV=production
{{< /tab >}}
{{< /tabs >}}
密钥示例
编辑器示例
在编辑命令与编辑器不兼容的情况下,可以使用写入任务:
# 将现有密钥写入明文文件
sudo gitlab-rake gitlab:service_desk_email:secret:show > service_desk_email.yaml
# 在编辑器中编辑 service_desk_email 文件
...
# 重新加密文件
cat service_desk_email.yaml | sudo gitlab-rake gitlab:service_desk_email:secret:write
# 删除明文文件
rm service_desk_email.yaml
KMS 集成示例
它也可以用作接收使用 KMS 加密的内容的应用程序:
gcloud kms decrypt --key my-key --keyring my-test-kms --plaintext-file=- --ciphertext-file=my-file --location=us-west1 | sudo gitlab-rake gitlab:service_desk_email:secret:write
Google Cloud 密钥集成示例
它也可以用作从 Google Cloud 获取密钥的接收应用程序:
gcloud secrets versions access latest --secret="my-test-secret" > $1 | sudo gitlab-rake gitlab:service_desk_email:secret:write