REQUIRE_SIGNIN_VIEW no longer working #2035

Closed
opened 2025-11-02 04:21:50 -06:00 by GiteaMirror · 17 comments
Owner

Originally created by @mircolino on GitHub (Jul 9, 2018).

[service]
REQUIRE_SIGNIN_VIEW = true

In version 1.4.3 the above would redirect to the login page.
In version 1.5 this no longer works and the home page is always displayed.

Gitea version: c784ac5 (1.5)
Git version: 2.18
Operating System: Windows 10
Database: SQLite

Originally created by @mircolino on GitHub (Jul 9, 2018). ``` [service] REQUIRE_SIGNIN_VIEW = true ``` In version 1.4.3 the above would redirect to the login page. In version 1.5 this no longer works and the home page is always displayed. Gitea version: c784ac5 (1.5) Git version: 2.18 Operating System: Windows 10 Database: SQLite
GiteaMirror added the type/question label 2025-11-02 04:21:50 -06:00
Author
Owner

@spantaleev commented on GitHub (Jul 10, 2018):

Not only that, but repositories (those that haven't been marked as "private") also seem to be accessible by non-logged-in users.

@spantaleev commented on GitHub (Jul 10, 2018): Not only that, but repositories (those that haven't been marked as "private") also seem to be accessible by non-logged-in users.
Author
Owner

@johanhugg commented on GitHub (Jul 11, 2018):

Can you give an example of urls that don't work as expected? I can't seem to reproduce this..

@johanhugg commented on GitHub (Jul 11, 2018): Can you give an example of urls that don't work as expected? I can't seem to reproduce this..
Author
Owner

@mircolino commented on GitHub (Jul 11, 2018):

I attached our (redacted) app.ini. You can replicate the problem with a fresh 1.5 installation.
We use a real CA signed certificate, not sure if that makes any difference.

app.zip

@mircolino commented on GitHub (Jul 11, 2018): I attached our (redacted) app.ini. You can replicate the problem with a fresh 1.5 installation. We use a real CA signed certificate, not sure if that makes any difference. [app.zip](https://github.com/go-gitea/gitea/files/2184922/app.zip)
Author
Owner

@johanhugg commented on GitHub (Jul 12, 2018):

Just fired up an instance using the commit hash specified in your original comment, created a repository called test under the user master, so the url was: http://localhost:3000/master/test. I enabled REQUIRE_SIGNIN_VIEW, logged out and tried to access the URL, I got redirected to the login screen. I also tried to clone the repository using HTTP, and it required a username and password which I entered nothing and got access denied. Clicking explore on the top bar also redirected me to the login screen.

@johanhugg commented on GitHub (Jul 12, 2018): Just fired up an instance using the commit hash specified in your original comment, created a repository called test under the user master, so the url was: http://localhost:3000/master/test. I enabled REQUIRE_SIGNIN_VIEW, logged out and tried to access the URL, I got redirected to the login screen. I also tried to clone the repository using HTTP, and it required a username and password which I entered nothing and got access denied. Clicking explore on the top bar also redirected me to the login screen.
Author
Owner

@spantaleev commented on GitHub (Jul 12, 2018):

I've observed the problem with the gitea/gitea:1.5 Docker image, if that helps.

@spantaleev commented on GitHub (Jul 12, 2018): I've observed the problem with the `gitea/gitea:1.5` Docker image, if that helps.
Author
Owner

@daviian commented on GitHub (Jul 12, 2018):

AFAIK the home screen is shown on purpose despite setting REQUIRE_SIGNIN_VIEW (https://github.com/go-gitea/gitea/pull/4040)

But nonetheless every other link should redirect to the login page.

@daviian commented on GitHub (Jul 12, 2018): AFAIK the home screen is shown on purpose despite setting REQUIRE_SIGNIN_VIEW (https://github.com/go-gitea/gitea/pull/4040) But nonetheless every other link should redirect to the login page.
Author
Owner

@mircolino commented on GitHub (Jul 12, 2018):

Yes, accessing the http://localhost:3000/master/test repo directly works.
Try accessing the http://localhost:3000 home page. If all the repos are private (like in our case) it's nice to be redirected to the login page and then to the user's dashboard.

@mircolino commented on GitHub (Jul 12, 2018): Yes, accessing the [http://localhost:3000/master/test](http://localhost:3000/master/test) repo directly works. Try accessing the [http://localhost:3000](http://localhost:3000) home page. If all the repos are private (like in our case) it's nice to be redirected to the login page and then to the user's dashboard.
Author
Owner

@johanhugg commented on GitHub (Jul 12, 2018):

Ok, then this is not a bug, and instead changed behaviour of the configuration value. Some people use the home page for showing information about the service, but still wanting people to have to sign up if they want to explore the service's repos and organizations.

@johanhugg commented on GitHub (Jul 12, 2018): Ok, then this is not a bug, and instead changed behaviour of the configuration value. Some people use the home page for showing information about the service, but still wanting people to have to sign up if they want to explore the service's repos and organizations.
Author
Owner

@lafriks commented on GitHub (Jul 12, 2018):

Default behavior should not have changed

@lafriks commented on GitHub (Jul 12, 2018): Default behavior should not have changed
Author
Owner

@d3473r commented on GitHub (Jul 25, 2018):

With the gitea/gitea:1.5 Docker Image in Rancher neither DISABLE_REGISTRATION nor REQUIRE_SIGNIN_VIEW seems to be working.

The variables are set in the Container:

ubuntu@machine:~$ docker exec 00e102859dbd bash -c 'echo "$DISABLE_REGISTRATION"'
true
ubuntu@machine:~$ docker exec 00e102859dbd bash -c 'echo "$REQUIRE_SIGNIN_VIEW"'
true

The registration is open
2018-07-25 14_42_35-registrieren - critalog-gitea

And i can browse public repos
2018-07-25 14_42_50-erkunden - critalog-gitea

@d3473r commented on GitHub (Jul 25, 2018): With the `gitea/gitea:1.5` Docker Image in Rancher neither `DISABLE_REGISTRATION` nor `REQUIRE_SIGNIN_VIEW` seems to be working. The variables are set in the Container: ``` ubuntu@machine:~$ docker exec 00e102859dbd bash -c 'echo "$DISABLE_REGISTRATION"' true ubuntu@machine:~$ docker exec 00e102859dbd bash -c 'echo "$REQUIRE_SIGNIN_VIEW"' true ``` The registration is open ![2018-07-25 14_42_35-registrieren - critalog-gitea](https://user-images.githubusercontent.com/10356892/43201572-2a49194e-9019-11e8-8eaa-3c896ec95469.png) And i can browse public repos ![2018-07-25 14_42_50-erkunden - critalog-gitea](https://user-images.githubusercontent.com/10356892/43201573-2a63c44c-9019-11e8-9528-3ca1a235c0b4.png)
Author
Owner

@lafriks commented on GitHub (Jul 25, 2018):

Check app.ini if these values are set there

@lafriks commented on GitHub (Jul 25, 2018): Check app.ini if these values are set there
Author
Owner

@d3473r commented on GitHub (Jul 25, 2018):

Theay are not set there

[service]
DISABLE_REGISTRATION              = false
REQUIRE_SIGNIN_VIEW               = false
@d3473r commented on GitHub (Jul 25, 2018): Theay are not set there ``` [service] DISABLE_REGISTRATION = false REQUIRE_SIGNIN_VIEW = false ```
Author
Owner

@lafriks commented on GitHub (Jul 25, 2018):

Did you set them when creating that instance initially or only later? app.ini values will be set only when creating and that file does not exists yet

@lafriks commented on GitHub (Jul 25, 2018): Did you set them when creating that instance initially or only later? app.ini values will be set only when creating and that file does not exists yet
Author
Owner

@d3473r commented on GitHub (Jul 25, 2018):

I did set them later.
For persistence i have mounted a ec2 volume: gitea-storage:/data

@d3473r commented on GitHub (Jul 25, 2018): I did set them later. For persistence i have mounted a ec2 volume: gitea-storage:/data
Author
Owner

@lafriks commented on GitHub (Jul 25, 2018):

That is why it is not working. Just update app.ini file manually and restart container

@lafriks commented on GitHub (Jul 25, 2018): That is why it is not working. Just update app.ini file manually and restart container
Author
Owner

@d3473r commented on GitHub (Jul 25, 2018):

Thanks, working fine now.
I used

docker exec -it 00e102859dbd bash
apk update
apk add nano
nano /data/gitea/conf/app.ini

to update the config

@d3473r commented on GitHub (Jul 25, 2018): Thanks, working fine now. I used ``` docker exec -it 00e102859dbd bash apk update apk add nano nano /data/gitea/conf/app.ini ``` to update the config
Author
Owner

@lunny commented on GitHub (Nov 23, 2018):

The default behaviour has been changed by https://github.com/go-gitea/gitea/pull/4040, but that's not a bug.

@lunny commented on GitHub (Nov 23, 2018): The default behaviour has been changed by https://github.com/go-gitea/gitea/pull/4040, but that's not a bug.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2035