feat: inline public ssh key in verification command

This makes it easier for people to verify their SSH key with various
setups. People with a key stored in a file won't have to manually
substitute the correct file path anymore. People who store their SSH
key in a password manager and access it via an ssh-agent won't have
to copy the private key to a temporary file or figure out the process
substitution thing anymore.

A slight disadvantage is that the fish shell doesn't have the same
syntax for process substitution as POSIX shells. For that reason, a
default-collapsed box with a custom command for fish users is provided,
just like for the Windows shells.

The Windows shells do not have an equivalent to process substitution, so
those commands remain unchanged.
This commit is contained in:
Remo Senekowitsch 2025-04-10 20:13:41 +02:00
parent eb3feaad45
commit 4e4862a427
No known key found for this signature in database

View file

@ -78,7 +78,12 @@
<input readonly="" value="{{$.TokenToSign}}"> <input readonly="" value="{{$.TokenToSign}}">
<div class="help"> <div class="help">
<p>{{ctx.Locale.Tr "settings.ssh_token_help"}}</p> <p>{{ctx.Locale.Tr "settings.ssh_token_help"}}</p>
<p><code>echo -n '{{$.TokenToSign}}' | ssh-keygen -Y sign -n gitea -f /path_to_PrivateKey_or_RelatedPublicKey</code></p> <p><code>echo -n '{{$.TokenToSign}}' | ssh-keygen -Y sign -n gitea -f <(echo "{{.Content}}")</code></p>
<details>
<summary>Fish shell</summary>
<p><code>echo -n '{{$.TokenToSign}}' | ssh-keygen -Y sign -n gitea -f (echo "{{.Content}}" | psub)</code></p>
</details>
<br>
<details> <details>
<summary>Windows PowerShell</summary> <summary>Windows PowerShell</summary>
<p><code>cmd /c "&lt;NUL set /p=`"{{$.TokenToSign}}`"| ssh-keygen -Y sign -n gitea -f /path_to_PrivateKey_or_RelatedPublicKey"</code></p> <p><code>cmd /c "&lt;NUL set /p=`"{{$.TokenToSign}}`"| ssh-keygen -Y sign -n gitea -f /path_to_PrivateKey_or_RelatedPublicKey"</code></p>