Gogs: Add option for disable explore when not logined

Created on 23 Jun 2017  路  3Comments  路  Source: gogs/gogs

Description

for security reason, need configuration options for disabling explore navigation when not login status.

I searched manual. but not such options. :) Thanks.

low 馃敤 enhancement

Most helpful comment

I did achieve this by creating: custom/templates/explore/users.tmpl with the following code.
Note that the key is to add: {{if .IsSigned}}. Once Gogs is restarted, it takes the templates to recreate the pages and you should be good.

tmpl.txt

You can see this live here: https://git.hps.vi4io.org/explore/users

All 3 comments

custom/conf/app.ini

[service]
REQUIRE_SIGNIN_VIEW = true

I know already that options. and tested.
That's different what I want to do.

I just want to block only explore menu. it shows all users and repos.

I want to use public repo as public even if not logined. so, I want to use public repo's raw files, even not login. That option block all pages if not logined.

I did achieve this by creating: custom/templates/explore/users.tmpl with the following code.
Note that the key is to add: {{if .IsSigned}}. Once Gogs is restarted, it takes the templates to recreate the pages and you should be good.

tmpl.txt

You can see this live here: https://git.hps.vi4io.org/explore/users

Was this page helpful?
0 / 5 - 0 ratings