Skip to content

Config validation disallows wildcard as subdomain in URL host

When setting Gitaly's gitconfig configuration, Gitaly's regex validation disallows wildcards in place of subdomain label as part of the host name. This was introduced in !4952 (merged).

Example configuration:

gitaly['gitconfig'] = [
  {'key': 'http.proxy', value: 'http://user:pass@proxy.REDACTED.gov:80'},
  {'key': 'https.proxy', value: 'http://user:pass@proxy.REDACTED.gov:80'},
  {'key': 'http.http://*.REDACTED.gov.proxy', value: ''},
  {'key': 'http.https://*.REDACTED.gov.proxy', value: ''},
  {'key': 'http.http://localhost.proxy', value: ''},
  {'key': 'http.https://localhost.proxy', value: ''},
]

Error:

{"correlation_id":"01GQ6744PDF59JFB5HH9R2T3A2","error":"config key \"http.http://*.REDACTED.gov.proxy\" failed regexp validation: invalid argument","grpc.code":"Internal","grpc.meta.auth_version":"v2","grpc.meta.client_name":"gitlab-web","grpc.meta.deadline_type":"regular","grpc.meta.method_type":"unary","grpc.method":"FindDefaultBranchName","grpc.request.deadline":"2023-01-19T16:52:09.096","grpc.request.fullMethod":"/gitaly.RefService/FindDefaultBranchName","grpc.request.glProjectPath":"REDACTED","grpc.request.glRepository":"REDACTED","grpc.request.payload_bytes":128,"grpc.request.repoPath":"REDACTED.git","grpc.request.repoStorage":"default","grpc.response.payload_bytes":0,"grpc.service":"gitaly.RefService","grpc.start_time":"2023-01-19T16:51:49.097","grpc.time_ms":0.24,"level":"error","msg":"finished unary call with code Internal","peer.address":"@","pid":20354,"remote_ip":"REDACTED","span.kind":"server","system":"grpc","time":"2023-01-19T23:51:49.097Z","user_id":"XXXX","username":"REDACTED"}
Edited by David Coy
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information