Customizing Gitea login page so the only option is Cloudron
-
Per the title, I'd like to customize the Gitea login page so that the only option is "Sign in with Cloudron".
Now, I would try to follow the instructions for Customizing Gitea, but my first problem is that Cloudron's gitea instance is already using a custom login page, and I need to modify that further. Then I assume I will drop that modified signin_inner.tmpl.tmpl file into my custom/ directory (but please correct me if I'm wrong).
So my questions are, please,
- Where can I find the template for Cloudron's custom login page?
- Am I taking the correct/best approach to solving the problem I want to solve, i.e. have users only option be to login with Cloudron?
-
You can find a
custom
folder in the app's data directory. If you carefully create the mentioned paths and files there, gitea will pick those up. For example to change thelogo.svg
you have to drop it into/app/data/custom/public/assets/img/
The package currently does not ship the source itself, thus also not the
Makefile
somake generate-images
will not work, but manually created versions of the logo or images will work, if the names match what the docs mention. -
Thank you for the reply!
I've never used these gitea templates, so I don't know how to make a "Log in with Cloudron" button. I was hoping to just copy the source for the current page and delete the part of the page with the local login. It sounds like you are saying I need to learn how to make a "Log in with Cloudron" button myself in gitea templates. -
I am not sure about that login button, but I was testing only the logo basics. Generally unless an app has a solid customization (ideally via the admin UI) framework, it is not advised to do all this, as future app updates may not work well or even break the app if upstream code changes.
-
Solved
This turned out to be easier than I expected, oops. I modified signin_inner.tmpl to only have the small OAuth2 portion of the signin page, i.e. I deleted lines 13-54 and 56-58 from that file (as it exists now), and put my version in gitea's folder custom/templates/user/auth/. As desired, it still displays "Login with cloudron", but not the main login option. -
-