fix: template white spaces

This commit is contained in:
Bexanderthebex 2022-11-16 17:32:49 +08:00
parent 4ed811a931
commit 9f51debc82
No known key found for this signature in database
GPG Key ID: 4B385F6608A1FA8B
1 changed files with 7 additions and 9 deletions

View File

@ -39,22 +39,20 @@ const (
Add to your {{.Home}}/.ssh/config: Add to your {{.Home}}/.ssh/config:
{{- if .ShortLivedCerts}} {{- if .ShortLivedCerts}}
{{- if eq .OS "windows"}} {{- if eq .OS "windows"}}
ProxyCommand {{.Cloudflared}} access ssh-gen --hostname %h && ssh -tt %r@cfpipe-{{.Hostname}} >&2 <&1 ProxyCommand {{.Cloudflared}} access ssh-gen --hostname %h && ssh -tt %r@cfpipe-{{.Hostname}} >&2 <&1
{{- else}} {{- else}}
ProxyCommand bash -c '{{.Cloudflared}} access ssh-gen --hostname %h; ssh -tt %r@cfpipe-{{.Hostname}} >&2 <&1' ProxyCommand bash -c '{{.Cloudflared}} access ssh-gen --hostname %h; ssh -tt %r@cfpipe-{{.Hostname}} >&2 <&1'
{{end}} {{end}}
Host cfpipe-{{.Hostname}} Host cfpipe-{{.Hostname}}
HostName {{.Hostname}} HostName {{.Hostname}}
ProxyCommand {{.Cloudflared}} access ssh --hostname %h ProxyCommand {{.Cloudflared}} access ssh --hostname %h
{{- if eq .OS "windows"}} {{- if eq .OS "windows"}} IdentityFile {{.CurrWorkingDir}}/{{.Hostname}}-cf_key
IdentityFile {{.CurrWorkingDir}}/{{.Hostname}}-cf_key
CertificateFile {{.CurrWorkingDir}}/{{.Hostname}}-cf_key-cert.pub CertificateFile {{.CurrWorkingDir}}/{{.Hostname}}-cf_key-cert.pub
{{- else}} {{- else}} IdentityFile ~/.cloudflared/{{.Hostname}}-cf_key
IdentityFile ~/.cloudflared/{{.Hostname}}-cf_key
CertificateFile ~/.cloudflared/{{.Hostname}}-cf_key-cert.pub CertificateFile ~/.cloudflared/{{.Hostname}}-cf_key-cert.pub
{{end}} {{end}}
{{- else}} {{- else}}
Host {{.Hostname}} Host {{.Hostname}}
ProxyCommand {{.Cloudflared}} access ssh --hostname %h ProxyCommand {{.Cloudflared}} access ssh --hostname %h