-
-
Notifications
You must be signed in to change notification settings - Fork 503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DietPi-Software | Gitea: Run as system user with SSH key option #4620
Comments
Hi, There wouldn't be a need to open the issue on GitHub as well. Forum as well as GitHub are maintained by same people 😉 |
Many thanks for your suggestion. So it's basically two separate things:
|
The key pair is made on the client side and the public key is added to Gitea through the Gitea GUI. You can either make it repo specific (repo settings > deploy keys) or account wide (account settings > SSH/GPG keys). It works the exact same way as GitHub if you have ever used SSH access on that. As far as I know, no key pair was made on the server (in my case, RPi) side of things. But I am a complete novice on these things and trying to learn how everything works. |
Ah nice, I didn't know that. Makes it even easier and a good thing to add to our documentation 👍. |
So, I am not fully understanding what needs to be done. I am willing to work on this and to try and make a PR. (Again, new at all of this and trying to learn.) On the forums, there is a post by @Joulinar that states:
My understanding is that the general consensus on adding a new user (either Another thought I am wondering about is the different locations for the |
I'll postpone this for v7.6. I'll apply the same change to all Git servers we have, to get some consistency. |
Sorry that it took a while. A PR is now up to apply this change: #5015 I recognised that we set Another thing I recognised is that we remove all repositories together when uninstalling Gitea. Not sure whether this is something we should preserve, to prevent data loss when users uninstall and reinstall Gitea in attempt to resolve issues or so? Gogs has it's repository directory at a dedicated place, and it is left there on uninstall, which sounds more reasonable. |
+ CHANGELOG | Gitea: The service runs now as dedicated user "gitea" with its home directory "/mnt/dietpi_userdata/gitea" to allow easy transfer and usage of SSH keys for remote access. This applies to newly installed or reinstalled Gitea instances. Many thanks to @LilTrublMakr for reporting the related limitation with the previously used "dietpi" user: #4620
Okay it seems to work fine now. Also public keys can be added to the interface, which was previously not possible if the OpenSSH client was not installed. This has now become a dependency. @LilTrublMakr G_CONFIG_INJECT 'DEV_GITBRANCH=' 'DEV_GITBRANCH=dev' /boot/dietpi.txt
dietpi-update 1
dietpi-software reinstall 165 To revert to stable branch (and get the next update one v7.9 has been released at December 11th): G_CONFIG_INJECT 'DEV_GITBRANCH=' 'DEV_GITBRANCH=master' /boot/dietpi.txt |
I will test this tomorrow. I am thinking making a VM with the current image and setup Gitea and then run the commands above. Can I also simulate a new installation by running the commands above (but install instead of reinstall) with a fresh DietPi installation? |
Yes exactly, |
Creating a bug report/issue
Required Information
DietPi version |
G_DIETPI_VERSION_CORE=7
G_DIETPI_VERSION_SUB=4
G_DIETPI_VERSION_RC=2
G_GITBRANCH='master'
G_GITOWNER='MichaIng'
G_LIVE_PATCH_STATUS[0]='not applied'
Distro version |
buster 10.10
Kernel version |
Linux DietPi 5.10.52-v8+ 1440 SMP PREEMPT Tue Jul 27 09:56:40 BST 2021 aarch64 GNU/Linux
SBC model |
RPi 4 Model B (aarch64)
Power supply used |
Ofiicial power supply
SDcard used |
Samsung 128GB
Additional Information (if applicable)
Software title |
Gitea
Was the software title installed freshly or updated/migrated?
Fresh install
Can this issue be replicated on a fresh installation of DietPi?
Yes
Steps to reproduce
Expected behaviour
Actual behaviour
(Should not be asking for a password and using SSH)
Extra details
After posting this issue on the forums, I spoke with the Gitea devs on their discord server. They said that it is strongly suggested and basically required to create a separate user for git operations. I spent a little bit of time with them to get a proposed fix that should be decently easy to implement. I have not tested this on a new installation (meaning that I have not edited dietpi_software with the fixes and tried installing it) but would be able to early next week if needed.
Forum post with needed changes to fix: https://dietpi.com/phpbb/viewtopic.php?p=36607#p36607
The text was updated successfully, but these errors were encountered: