Adding an extra setting/feature in Gogs

Hello guys,

I am trying to add an extra setting in gogs user setting.
I have added a tab to setting successfully (figure1).Screen Shot 2020-04-08 at 4.52.49 PM

I create a jira.tmpl
I change href="{{AppSubURL}}/user/settings/jira" like others. But when i click the jira tab. It just pop up 404.

Another challange I am facing is, I can’t seems to find the file where sqlite queries is made to db. Cause I want to add a extra table too.

Any help is greatly appreciate

Thanks guys

Hi, one thing at a time, to serve a new page, you need create a route besides the HTML file, since it’s under repo settings, so you probably want to add the route here: https://github.com/gogs/gogs/blob/master/internal/route/repo/setting.go

Then register this route somewhere around here: https://github.com/gogs/gogs/blob/master/internal/cmd/web.go#L458

Then recompile Gogs and restart it.

Helle Unknown,

Thanks for the info, i dint know we have to edit in go and recompile. Hehe.

Thank you.

As for database, all code lives in internal/db directory. We’re in the transition from XORM to GORM, but you’re free to choose either.