From 98b181c607f6be7f10ccace1877eff7b55a5dba5 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Thu, 2 Feb 2023 12:21:50 +0100 Subject: [PATCH] Add proxy config to ssh & git --- private_dot_gitconfig.tmpl | 6 ++++++ private_dot_ssh/config.tmpl | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/private_dot_gitconfig.tmpl b/private_dot_gitconfig.tmpl index 333d531..5385919 100644 --- a/private_dot_gitconfig.tmpl +++ b/private_dot_gitconfig.tmpl @@ -12,6 +12,12 @@ autoSetupRemote = true [help] autocorrect = immediate +{{ if hasKey . "proxy" }} +[http] + proxy = {{ .proxy.protocol }}://{{ .proxy.address }}:{{ .proxy.port }} +[https] + proxy = {{ .proxy.protocol }}://{{ .proxy.address }}:{{ .proxy.port }} +{{ end }} [alias] ci = commit cp = cherry-pick diff --git a/private_dot_ssh/config.tmpl b/private_dot_ssh/config.tmpl index ac3d494..7f1ad0c 100644 --- a/private_dot_ssh/config.tmpl +++ b/private_dot_ssh/config.tmpl @@ -35,6 +35,14 @@ Host hyperhdr hostname hyperhdr.local user pi +Host github.com +{{ if hasKey . "proxy" }} + Hostname ssh.github.com + Port 443 + User git + ProxyCommand nc -X connect -x {{ .proxy.address }}:{{ .proxy.port }} %h %p +{{ end }} + Host * AddKeysToAgent yes {{ if eq .chezmoi.os "darwin" }}