mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-24 23:33:33 +01:00
[ssh] fix the config specification in the authorized_keys template (#8031)
The gitea flags must appear in front of the gitea command. Otherwise they are ignored. Signed-off-by: Jakob Ackermann <das7pad@outlook.com>
This commit is contained in:
parent
4959bf1c09
commit
89648746a5
1 changed files with 2 additions and 2 deletions
|
@ -36,7 +36,7 @@ import (
|
||||||
|
|
||||||
const (
|
const (
|
||||||
tplCommentPrefix = `# gitea public key`
|
tplCommentPrefix = `# gitea public key`
|
||||||
tplPublicKey = tplCommentPrefix + "\n" + `command="%s serv key-%d --config='%s'",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty %s` + "\n"
|
tplPublicKey = tplCommentPrefix + "\n" + `command="%s --config='%s' serv key-%d",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty %s` + "\n"
|
||||||
)
|
)
|
||||||
|
|
||||||
var sshOpLocker sync.Mutex
|
var sshOpLocker sync.Mutex
|
||||||
|
@ -81,7 +81,7 @@ func (key *PublicKey) OmitEmail() string {
|
||||||
|
|
||||||
// AuthorizedString returns formatted public key string for authorized_keys file.
|
// AuthorizedString returns formatted public key string for authorized_keys file.
|
||||||
func (key *PublicKey) AuthorizedString() string {
|
func (key *PublicKey) AuthorizedString() string {
|
||||||
return fmt.Sprintf(tplPublicKey, setting.AppPath, key.ID, setting.CustomConf, key.Content)
|
return fmt.Sprintf(tplPublicKey, setting.AppPath, setting.CustomConf, key.ID, key.Content)
|
||||||
}
|
}
|
||||||
|
|
||||||
func extractTypeFromBase64Key(key string) (string, error) {
|
func extractTypeFromBase64Key(key string) (string, error) {
|
||||||
|
|
Loading…
Reference in a new issue