harness / gitness

Gitness is an Open Source developer platform with Source Control management, Continuous Integration and Continuous Delivery.
https://gitness.com
Apache License 2.0
31.96k stars 2.79k forks source link

[BUG] Always redirect to signin page. #3460

Closed Ns2Kracy closed 6 months ago

Ns2Kracy commented 6 months ago

I depoly a instance with docker with this:

sudo docker run -d \
  -e GITNESS_HTTP_PROTO=https \
  -e GITNESS_URL_BASE=https://gitness.company.com \
  -e GITNESS_DATABASE_DRIVER=postgres \
  -e GITNESS_DATABASE_DATASOURCE="host=1.2.3.4 port=5678 sslmode=disable dbname=gitness user=$USER password=$PASSWORD" \
  -e GITNESS_PRINCIPAL_ADMIN_EMAIL=mail@example.com \
  -e GITNESS_PRINCIPAL_ADMIN_PASSWORD=correct-horse-battery-staple \
  -e GITNESS_USER_SIGNUP_ENABLED=false \
  -p 3000:3000 \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v $HOME/gitness:/data \
  --name gitness \
  --restart always \
  harness/gitness

I can access the deployed instance normally, but when I log in with an administrator account, I am always redirected to the signin page, which is completely unusable.

johannesHarness commented 6 months ago

@Ns2Kracy thanks for trying out gitness. I see that you are running it under a custom domain - I've seen before that a collision of the auth cookie with other existing cookies can cause such a behavior. To see if that's the case, can you start it with the following environment variable and see if that solves the issue?

GITNESS_TOKEN_COOKIE_NAME=gitness-token

In case you still experience the same behavior, it would be good if you can include the gitness logs from the container (and possibly the request that caused the 401)

Ns2Kracy commented 6 months ago

GITNESS_TOKEN_COOKIE_NAME=gitness-token

Fixed! Thanks.

Bouts2019 commented 6 months ago

GITNESS_TOKEN_COOKIE_NAME=gitness-token

Not work, still redirect to login page.