Add testing section to gitea

This commit is contained in:
LordMathis 2023-02-13 22:11:23 +01:00
parent ec42485c6f
commit fd32c6e935
1 changed files with 18 additions and 2 deletions

View File

@ -1,5 +1,5 @@
---
title: "Replicating Gitea Docker SSH Passthrough on k8s"
title: "Replicating Gitea Docker SSH Passthrough on K8s"
date: "2023-02-12"
---
@ -49,5 +49,21 @@ Match User git
AuthorizedKeysCommand /usr/local/bin/kubectl exec -i -n gitea gitea-0 -c gitea -- /usr/local/bin/gitea keys -e git -u %u -t %t -k %k
{{< / highlight >}}
If you are using AllowUsers directive don't forget to add user git
If you are using `AllowUsers` directive don't forget to add user git
## Testing
Open Gitea in web browser and add you SSH key. Then try to SSH into the Gitea container.
{{< highlight bash >}}
ssh git@<your gitea url>
{{< / highlight >}}
You should get a message like this:
> PTY allocation request failed on channel 0
> Hi there, test! You've successfully authenticated with the key named <your ssh key>, but Gitea does not provide shell access.
> If this is unexpected, please log in with password and setup Gitea under another user.
> Connection to <your gitea url> closed.
Now you can create a repo and you should be able to clone and push via SSH.