kind: ConfigMap
apiVersion: v1
metadata:
    name: gitlab-gitaly
    namespace: gitlab
    selfLink: /api/v1/namespaces/gitlab/configmaps/gitlab-gitaly
    uid: 980c4aaf-398b-11ea-b115-42010a8001d6
    resourceVersion: '2016127'
    creationTimestamp: '2020-01-18T00:43:50Z'
    labels:
        app: gitaly
        chart: gitaly-2.6.5
        heritage: Helm
        release: gitlab
data:
    config.toml.erb: >
        # The directory where Gitaly's executables are stored

        bin_dir = "/usr/local/bin"


        # listen on a TCP socket. This is insecure (no authentication)

        listen_addr = "0.0.0.0:8075"


        # Directory where internal sockets reside

        internal_socket_dir = "/home/git"


        # If metrics collection is enabled, inform gitaly about that

        prometheus_listen_addr = "localhost:9236"


        <% @storages = [ "default", ] %>

        <% @index=`echo ${HOSTNAME##*-}`.to_i %>

        <% if @storages.length > @index %>

        [[storage]]

        name = "<%= @storages[@index] %>"

        path = "/home/git/repositories"

        <% else %>

        <% raise Exception, "Storage for node #{@index} is not present in the
        storageNames array. Did you use kubectl to scale up ? You need to solely
        use helm for this purpose" %>

        <% end %>


        [logging]

        format = "json"

        dir = "/var/log/gitaly"


        [auth]

        token = "<%=
        File.read('/etc/gitlab-secrets/gitaly/gitaly_token').strip.dump[1..-2]
        %>"


        [git]


        [gitaly-ruby]

        # The directory where gitaly-ruby is installed

        dir = "/srv/gitaly-ruby"

        rugged_git_config_search_path = "/usr/local/etc"


        [gitlab-shell]

        # The directory where gitlab-shell is installed

        dir = "/srv/gitlab-shell"
    configure: >
        set -e

        mkdir -p /init-secrets/gitaly /init-secrets/shell

        cp -v -r -L /init-config/.gitlab_shell_secret 
        /init-secrets/shell/.gitlab_shell_secret

        cp -v -r -L /init-config/gitaly_token  /init-secrets/gitaly/gitaly_token

        mkdir -p /init-secrets/redis

        cp -v -r -L /init-config/redis_password 
        /init-secrets/redis/redis_password
    shell-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/redis_password").strip.dump[1..-2] %>"
          database: nil
          namespace: resque:gitlab

        # 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

