hcaptcha is not working for gitea running in rootless docker #9822

Closed
opened 2025-11-02 08:50:30 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @Lumysia on GitHub (Nov 11, 2022).

Description

  • hcaptcha config is not working for gitea running in rootless docker.
  • No matter how I configure it, only the graphical CAPTCHA will be displayed.
  • I tested the other configuration items and they all work fine.

Gitea Version

Gitea version 1.18.0+rc0 built with GNU Make 4.3, go1.19.2 : bindata, timetzdata, sqlite, sqlite_unlock_notify

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

git version 2.36.3

Operating System

Linux a84b36c87539 5.4.0-131-generic #147-Ubuntu SMP Fri Oct 14 17:07:22 UTC 2022 x86_64 Linux

How are you running Gitea?

docker-compose.yml

version: "2.1"
services:
  gitea:
    image: gitea/gitea:latest-rootless
    container_name: gitea
    environment:
      - TZ=Asia/Shanghai
    volumes:
      - gitea_data:/var/lib/gitea
      - gitea_config:/etc/gitea
    ports:
      - "53440:3000"
      - "63471:22"
    restart: always

volumes:
  gitea_data:
  gitea_config:

docker compose exec -it gitea cat /etc/gitea/app.ini

[server]
APP_DATA_PATH           = /var/lib/gitea
SSH_DOMAIN              = CORRECT
HTTP_PORT               = 3000
ROOT_URL                = CORRECT
ENABLE_CAPTCHA		= true
DISABLE_SSH             = false
; In rootless gitea container only internal ssh server is supported
START_SSH_SERVER        = true
SSH_PORT                = 2222
SSH_LISTEN_PORT         = 2222
BUILTIN_SSH_SERVER_USER = git
LFS_START_SERVER        = true
DOMAIN                  = CORRECT
LFS_JWT_SECRET          = CORRECT
OFFLINE_MODE            = false
CAPTCHA_TYPE		= hcaptcha
HCAPTCHA_SECRET		= 0xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
HCAPTCHA_SITEKEY	= aaaaaaaa-aaaa-412d-9f5d-aaaaaaaaaaaa

Database

SQLite

Originally created by @Lumysia on GitHub (Nov 11, 2022). ### Description - hcaptcha config is not working for gitea running in rootless docker. - No matter how I configure it, only the graphical CAPTCHA will be displayed. - I tested the other configuration items and they all work fine. ### Gitea Version Gitea version 1.18.0+rc0 built with GNU Make 4.3, go1.19.2 : bindata, timetzdata, sqlite, sqlite_unlock_notify ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version git version 2.36.3 ### Operating System Linux a84b36c87539 5.4.0-131-generic #147-Ubuntu SMP Fri Oct 14 17:07:22 UTC 2022 x86_64 Linux ### How are you running Gitea? > docker-compose.yml ```docker-compose.yml version: "2.1" services: gitea: image: gitea/gitea:latest-rootless container_name: gitea environment: - TZ=Asia/Shanghai volumes: - gitea_data:/var/lib/gitea - gitea_config:/etc/gitea ports: - "53440:3000" - "63471:22" restart: always volumes: gitea_data: gitea_config: ``` > docker compose exec -it gitea cat /etc/gitea/app.ini ```app.ini [server] APP_DATA_PATH = /var/lib/gitea SSH_DOMAIN = CORRECT HTTP_PORT = 3000 ROOT_URL = CORRECT ENABLE_CAPTCHA = true DISABLE_SSH = false ; In rootless gitea container only internal ssh server is supported START_SSH_SERVER = true SSH_PORT = 2222 SSH_LISTEN_PORT = 2222 BUILTIN_SSH_SERVER_USER = git LFS_START_SERVER = true DOMAIN = CORRECT LFS_JWT_SECRET = CORRECT OFFLINE_MODE = false CAPTCHA_TYPE = hcaptcha HCAPTCHA_SECRET = 0xxxxxxxxxxxxxxxxxxxxxxxxxxxxx HCAPTCHA_SITEKEY = aaaaaaaa-aaaa-412d-9f5d-aaaaaaaaaaaa ``` ### Database SQLite
GiteaMirror added the type/bug label 2025-11-02 08:50:30 -06:00
Author
Owner

@jolheiser commented on GitHub (Nov 11, 2022):

captcha settings are found under the service section rather than server.
https://docs.gitea.io/en-us/config-cheat-sheet/#service-service

@jolheiser commented on GitHub (Nov 11, 2022): captcha settings are found under the `service` section rather than `server`. https://docs.gitea.io/en-us/config-cheat-sheet/#service-service
Author
Owner

@Lumysia commented on GitHub (Nov 11, 2022):

Sorry, I wrote the wrong location

@Lumysia commented on GitHub (Nov 11, 2022): Sorry, I wrote the wrong location
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#9822