Description
Description
When verifying an SSH key, the Gitea settings page gives a command that (after adjusting for the correct key path) does not work in Windows, because the output produced by the command is different than on other OSes such as Linux
The same command given the same exact private key and token will produce 2 different outputs, depending on whether the command is run under PowerShell on Windows, or the terminal on Linux (in my case, via WSL). Included are screenshots showing the same command producing two different outputs, then the public key file being echoed to show that it is the same. When pasting the given signature into Gitea (including the 'BEGIN' and 'END' parts of the output), the output from Linux will be accepted, but the output from Windows will be rejected.
I'm not sure what command would work natively in Windows, but the UI should be adjusted to show either 1 command that does work for all operating systems, or multiple commands for each operating system.
Also a QOL fix i'd like to see, instead of /path_to_your_pubkey
in the command, it should use the path where the public key is stored at by default, such as ~\.ssh\id_rsa.pub
on powershell and linux. Where you currently always have to modify the command, this would allow not having to modify the command in the majority of cases.
Gitea Version
1.17.3 on docker installs, 1.18.0+dev-602-g6a0330979 on demo site
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Screenshots
The problematic command in question:
Running the given command (with token replaced with "sample" for demonstration purposes) with adjusted path under PowerShell, then cat-ing the public key:
Running the given command (with token replaced with "sample" for demonstration purposes) with adjusted path under WSL, then cat-ing the public key:
Error given when pasting from Windows:
Success message when pasting from Linux:
Git Version
No response
Operating System
Windows 10 21H2 & 21H1
How are you running Gitea?
This was tested via a Docker and Docker-Compose based install, as well as the try.gitea.io demo site
Database
No response