kind: ConfigMap
apiVersion: v1
metadata:
    name: gitlab-gitlab-shell
    namespace: gitlab
    selfLink: /api/v1/namespaces/gitlab/configmaps/gitlab-gitlab-shell
    uid: 980db610-398b-11ea-b115-42010a8001d6
    resourceVersion: '2016130'
    creationTimestamp: '2020-01-18T00:43:50Z'
    labels:
        app: gitlab-shell
        chart: gitlab-shell-2.6.5
        heritage: Helm
        release: gitlab
data:
    config.yml.erb: >
        # GitLab user. git by default

        user: git


        # Url to gitlab instance. Used for api calls. Should end with a slash.

        gitlab_url: "http://gitlab-unicorn:8080/"


        secret_file: /etc/gitlab-secrets/shell/.gitlab_shell_secret


        http_settings:
          self_signed_cert: false

        # File used as authorized_keys for gitlab user

        auth_file: "/home/git/.ssh/authorized_keys"


        # Redis settings used for pushing commit notices to gitlab

        redis:
          host: gitlab-redis
          port: 6379
          pass: "<%= File.read("/etc/gitlab-secrets/redis/password").strip.dump[1..-2] %>"
          database: nil
          namespace: resque:gitlab

        # Log file.

        # Default is gitlab-shell.log in the root directory.

        log_file: "/var/log/gitlab-shell/gitlab-shell.log"


        # Log level. INFO by default

        log_level: INFO


        # Audit usernames.

        # Set to true to see real usernames in the logs instead of key ids,
        which is easier to follow, but

        # incurs an extra API call on every gitlab-shell command.

        audit_usernames: false
    configure: |
        set -e
        config_dir="/init-config"
        secret_dir="/init-secrets"

        for secret in shell ; do
          mkdir -p "${secret_dir}/${secret}"
          cp -v -r -L "${config_dir}/${secret}/." "${secret_dir}/${secret}/"
        done
        for secret in redis minio objectstorage ldap omniauth smtp ; do
          if [ -e "${config_dir}/${secret}" ]; then
            mkdir -p "${secret_dir}/${secret}"
            cp -v -r -L "${config_dir}/${secret}/." "${secret_dir}/${secret}/"
          fi
        done
        mkdir -p /${secret_dir}/ssh
        cp -v -r -L /${config_dir}/ssh_host_* /${secret_dir}/ssh/
        chmod 0400 /${secret_dir}/ssh/ssh_host_*

