Cannot enable 2FA #1881

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

Originally created by @vbrandl on GitHub (Jun 6, 2018).

  • Gitea version (or commit ref): e5fd43c
  • Git version: 2.15.2
  • Operating system: Debian9 (Gitea is running inside Docker)
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant

Description

I'm running a fresh install of the latest gitea Docker image behind a nginx reverse proxy (Using the docker-compose file posted below). When trying to enable 2FA for any user and entering the PIN the first time, there is no change (not even the message, that I entered the wrong PIN) and when I wait for a new 2FA code to be generated and enter that one, I get an error message, that my PIN is incorrect and I should try again.
I'm using FreeOTP+ as my 2FA app on my mobile phone and it works well with at least 2 other gitea instances (versions 1.4.1 and 1.1.0+1348-ge5fd43c23; both running not inside Docker as far as I know)

version: "2"
                                                                                                                                                                          
networks:                                                                                                                                                                 
        gitea:                                                                                                                                                            
                external: false                                                                                                                                           
                                                                                                                                                                          
services:
        server:
                image: gitea/gitea:latest
                environment:
                        - USER_UID=1000
                        - USER_GID=1000
                restart: always
                environment:
                        - DB_HOST="db:5432"
                        - DB_NAME=$DB_NAME
                        - DB_USER=$DB_USER
                        - DB_PASSWD=$DB_PASSWD
                        - ROOT_URL="https://<snip>"
                        - DB_TYPE=postgres
                        - SSH_DOMAIN=<snip>
                        - SSH_PORT=222
                        - RUN_MODE=prod
                        - APP_NAME="<snip>"
                networks:
                        - gitea
                volumes:
                        - ./gitea:/data
                ports:
                        - "127.0.0.1:3000:3000"
                        - "222:22"
                depends_on:
                        - db

        db:
                image: postgres:9.6
                restart: always
                environment:
                        - POSTGRES_USER=$DB_USER
                        - POSTGRES_PASSWORD=$DB_PASSWD
                        - POSTGRES_DB=$DB_NAME
                networks:
                        - gitea
                volumes:
                        - ./postgres:/var/lib/postgresql/data
Originally created by @vbrandl on GitHub (Jun 6, 2018). <!-- 1. Please speak English, this is the language all of us can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/NsatcWJ) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): e5fd43c - Git version: 2.15.2 - Operating system: Debian9 (Gitea is running inside Docker) - Database (use `[x]`): - [x] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No - [ ] Not relevant ## Description I'm running a fresh install of the latest gitea Docker image behind a nginx reverse proxy (Using the docker-compose file posted below). When trying to enable 2FA for any user and entering the PIN the first time, there is no change (not even the message, that I entered the wrong PIN) and when I wait for a new 2FA code to be generated and enter that one, I get an error message, that my PIN is incorrect and I should try again. I'm using FreeOTP+ as my 2FA app on my mobile phone and it works well with at least 2 other gitea instances (versions 1.4.1 and 1.1.0+1348-ge5fd43c23; both running _not_ inside Docker as far as I know) ```yml version: "2" networks: gitea: external: false services: server: image: gitea/gitea:latest environment: - USER_UID=1000 - USER_GID=1000 restart: always environment: - DB_HOST="db:5432" - DB_NAME=$DB_NAME - DB_USER=$DB_USER - DB_PASSWD=$DB_PASSWD - ROOT_URL="https://<snip>" - DB_TYPE=postgres - SSH_DOMAIN=<snip> - SSH_PORT=222 - RUN_MODE=prod - APP_NAME="<snip>" networks: - gitea volumes: - ./gitea:/data ports: - "127.0.0.1:3000:3000" - "222:22" depends_on: - db db: image: postgres:9.6 restart: always environment: - POSTGRES_USER=$DB_USER - POSTGRES_PASSWORD=$DB_PASSWD - POSTGRES_DB=$DB_NAME networks: - gitea volumes: - ./postgres:/var/lib/postgresql/data ```
GiteaMirror added the type/questionissue/stale labels 2025-11-02 04:16:21 -06:00
Author
Owner

@stale[bot] commented on GitHub (Jan 10, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Jan 10, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Author
Owner

@vbrandl commented on GitHub (Jan 10, 2019):

I don't know why, but it works with the current release.

@vbrandl commented on GitHub (Jan 10, 2019): I don't know why, but it works with the current release.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1881