Service Desk email Rake tasks

  • Tier: Free, Premium, Ultimate
  • Offering: GitLab Self-Managed
History

The following are Service Desk email-related Rake tasks.

Secrets

GitLab can use Service Desk email secrets read from an encrypted file instead of storing them in plaintext in the file system. The following Rake tasks are provided for updating the contents of the encrypted file.

Show secret

Show the contents of the current Service Desk email secrets.

Copy to clipboard
sudo gitlab-rake gitlab:service_desk_email:secret:show

Example output

Copy to clipboard
password: 'examplepassword'
user: 'service-desk-email@mail.example.com'

Edit secret

Opens the secret contents in your editor, and writes the resulting content to the encrypted secret file when you exit.

Copy to clipboard
sudo gitlab-rake gitlab:service_desk_email:secret:edit EDITOR=vim

Write raw secret

Write new secret content by providing it on STDIN.

Copy to clipboard
echo -e "password: 'examplepassword'" | sudo gitlab-rake gitlab:service_desk_email:secret:write

Secrets examples

Editor example

The write task can be used in cases where the edit command does not work with your editor:

Copy to clipboard
# Write the existing secret to a plaintext file
sudo gitlab-rake gitlab:service_desk_email:secret:show > service_desk_email.yaml
# Edit the service_desk_email file in your editor
...
# Re-encrypt the file
cat service_desk_email.yaml | sudo gitlab-rake gitlab:service_desk_email:secret:write
# Remove the plaintext file
rm service_desk_email.yaml

KMS integration example

It can also be used as a receiving application for content encrypted with a KMS:

Copy to clipboard
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 secret integration example

It can also be used as a receiving application for secrets out of Google Cloud:

Copy to clipboard
gcloud secrets versions access latest --secret="my-test-secret" > $1 | sudo gitlab-rake gitlab:service_desk_email:secret:write