go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
44.96k stars 5.48k forks source link

REVERSE_PROXY_AUTHENTICATION - email and fullname not being applied #20949

Closed davama closed 2 years ago

davama commented 2 years ago

Description

Hello,

When a new user signs in to gitea via proxy, his profile settings are not complete.

Specifically, his "Full Name" and "Email" are empty or incorrect.

No issue with the username getting populated.

Hope i did this repo correctly.

Thanks!

Gitea Version

1.17.1 built with GNU Make 4.3, go1.18.5 : bindata, timetzdata, sqlite, sqlite_unlock_notify

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

https://pastebin.com/raw/vbF0AKXn

Screenshots

image

Git Version

2.31.1

Operating System

Rocky Linux release 8.6 (Green Obsidian)

How are you running Gitea?

Running gitea via docker. below is docker-compose for gitea

  gitea:
    container_name: gitea
    image: gitea/gitea
    restart: unless-stopped
    volumes:
      - ./gitea:/data
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    ports:
      - 3000:3000
      - 2222:22
    depends_on:
      - db
      - ipv6nat
    environment:
     - GITEA__log__LEVEL=Trace
     - GITEA__database__DB_TYPE=postgres
     - GITEA__database__HOST="db:5432"
     - GITEA__database__NAME=gitea
     - GITEA__database__USER=gitea
     - GITEA__database__PASSWD=gitea
     - GITEA__server__DOMAIN=gitea.domain.net
     - GITEA__server__SSH_PORT=2222
     - GITEA__server__SSH_DOMAIN=gitea.domain.net
     - GITEA__server__ROOT_URL=https://gitea.domain.net
     - GITEA__service__DISABLE_REGISTRATION=false
     - GITEA__service__REQUIRE_SIGNIN_VIEW=true
     - GITEA__service__ENABLE_NOTIFY_MAIL=true
     - GITEA__service__ALLOW_ONLY_EXTERNAL_REGISTRATION=false
     - GITEA__service__ENABLE_CAPTCHA=false
     - GITEA__service__DEFAULT_ALLOW_CREATE_ORGANIZATION=true
     - GITEA__service__DEFAULT_ENABLE_TIMETRACKING=true
     - GITEA__service__NO_REPLY_ADDRESS=domain.net
     - GITEA__service__REGISTER_EMAIL_CONFIRM=true
     - GITEA__service__ENABLE_REVERSE_PROXY_AUTHENTICATION=true
     - GITEA__service__ENABLE_REVERSE_PROXY_AUTO_REGISTRATION=true
     - GITEA__security__PASSWORD_HASH_ALGO=argon2
     - GITEA__security__REVERSE_PROXY_AUTHENTICATION_USER=Remote-User
     - GITEA__security__REVERSE_PROXY_AUTHENTICATION_EMAIL=Remote-Email
     - GITEA__security__REVERSE_PROXY_AUTHENTICATION_FULL_NAME=Remote-Name
     - GITEA__security__REVERSE_PROXY_TRUSTED_PROXIES=172.20.0.0/16,fd00:dead:beef::/48
     - GITEA__mailer__ENABLED=true
     - GITEA__mailer__FROM=donotreply-gitea@domain.net
     - GITEA__mailer__MAILER_TYPE=smtp
     - GITEA__mailer__HOST="gitea-postfix:25"
     - GITEA__mailer__IS_TLS_ENABLED=false
     - GITEA__webhook__ALLOWED_HOST_LIST=webhook.domain.net
     - GITEA__webhook__SKIP_TLS_VERIFY=true
     - GITEA__admin__DISABLE_REGULAR_ORG_CREATION=true

Database

PostgreSQL

KN4CK3R commented 2 years ago

Fullname support is in 1.18 (#20776)

davama commented 2 years ago

Thank you for the reply @KN4CK3R

guess thats half the battle.

The only question left is the email field. Any input on that?

Thank you, Dave

davama commented 2 years ago

Ok,

i think i figure out the issue. was missing

     - GITEA__service__ENABLE_REVERSE_PROXY_EMAIL=true

Now i see email field being applied when a new user signs in via proxy.

Thank you for the support! looking forward to v1.18

Closing