Customizing gitea pages

Hi,

I would like to find out what has to be done in order for me to customize gitea pages to do only the following

  1. Upon accessing the gitea URL, it would automatically login base on OS User login credential.

  2. Display a list of repositories available for the user to download.

  3. Upon selecting any given repository, the options available are exploring the folder and download the repo as zip

All other features should be hidden or removed. I understand that we have to change the existing go templates. However, it seems like it quite complex and tedious of changing templates like home.tmpl, base\head_navbar.tmpl etc.

Thanks.

I am not sure that Gitea is the best solution to your problem, and I think your custom template solution may be somewhat annoying to maintain given that things are guaranteed to change from release to release. cgit sounds like a much better alternative, you can just put it behind a reverse proxy that requires SSO to access.

  1. You will want either reverse proxy authentication or SPNEGO with SSPI (Kerberos/NTLM) which is Windows only. See Authentication - Docs.

  2. You should be able to modify the user dashboard page templates/user/dashboard/dashboard.tmpl and just wipe anything besides the {{template "user/dashboard/repolist" .}} call.

  3. For just viewing the repo code, I would modify templates/repo/header.tmpl and wipe everything except for “Code” tab. You can also find the template that generates the SSH/HTTP URLs and wipe those, although I think there is a config option for one or maybe both of them.

If you are still interested in something like this and have funding, it’s possible the newly founded Gitea company can support your endeavour. You could reach out to lunny on Gitea’s Discord for more info.

1 Like