Clone instructions do not respect SSH_DOMAIN variable when set as an environment variable #8849

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

Originally created by @darth-veitcher on GitHub (Apr 21, 2022).

Description

I'm running with the docker image and have the following set as environment variables. The idea being to have a separate domain for ssh cloning of repositories as the primary domain goes via Cloudflare proxy (and therefore blocks the SSH protocol).

# file: docker-compose.yaml
gitea:
    image: gitea/gitea
    container_name: gitea
    hostname: git.mydomain.tld
    restart: always
    environment:
      - USER_UID=1000
      - USER_GID=1000
      - DB_TYPE=postgres
      - DB_HOST=db:5432
      - DB_NAME=gitea
      - DB_USER=gitea
      - DB_PASSWD=gitea
      # Customise
      - GITEA____APP_NAME="My Gitea Instance"
      - GITEA__server__DOMAIN="git.mydomain.tld"
      - GITEA__server__ROOT_URL="https://git.mydomain.tld"
      - GITEA__server__SSH_DOMAIN="clone.mydomain.tld"
    networks:
      - gitea
    volumes:
      - ./data/gitea:/data
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    depends_on:
      - db
      - redis
      - minio

On creating a new repository however I'm getting presenting with a SSH clone url which reflects the DOMAIN as opposed to the SSH_DOMAIN.

On investigation it seems as though this environment variable has not been respected and passed through to the underlying app.ini. If login into the container and inspect the file it shows the following:

# file: /data/gitea/conf/app.ini
...
[server]
APP_DATA_PATH    = /data/gitea
DOMAIN           = git.mydomain.tld
SSH_DOMAIN       = git.mydomain.tld
...

If I manually edit this file inside the container to adjust the SSH_DOMAIN variable and restart it then the setting is respected.

Gitea Version

1.16.5 built with GNU Make 4.3, go1.18 : 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

No response

Operating System

No response

How are you running Gitea?

Gitea is running with docker and docker-compose using image: gitea/gitea

Database

PostgreSQL

Originally created by @darth-veitcher on GitHub (Apr 21, 2022). ### Description I'm running with the docker image and have the following set as environment variables. The idea being to have a separate domain for ssh cloning of repositories as the primary domain goes via Cloudflare proxy (and therefore blocks the SSH protocol). ```yaml # file: docker-compose.yaml gitea: image: gitea/gitea container_name: gitea hostname: git.mydomain.tld restart: always environment: - USER_UID=1000 - USER_GID=1000 - DB_TYPE=postgres - DB_HOST=db:5432 - DB_NAME=gitea - DB_USER=gitea - DB_PASSWD=gitea # Customise - GITEA____APP_NAME="My Gitea Instance" - GITEA__server__DOMAIN="git.mydomain.tld" - GITEA__server__ROOT_URL="https://git.mydomain.tld" - GITEA__server__SSH_DOMAIN="clone.mydomain.tld" networks: - gitea volumes: - ./data/gitea:/data - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro depends_on: - db - redis - minio ``` On creating a new repository however I'm getting presenting with a SSH clone url which reflects the `DOMAIN` as opposed to the `SSH_DOMAIN`. On investigation it seems as though this environment variable has not been respected and passed through to the underlying `app.ini`. If login into the container and inspect the file it shows the following: ```ini # file: /data/gitea/conf/app.ini ... [server] APP_DATA_PATH = /data/gitea DOMAIN = git.mydomain.tld SSH_DOMAIN = git.mydomain.tld ... ``` If I manually edit this file inside the container to adjust the `SSH_DOMAIN` variable and restart it then the setting is respected. ### Gitea Version 1.16.5 built with GNU Make 4.3, go1.18 : 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 _No response_ ### Operating System _No response_ ### How are you running Gitea? Gitea is running with docker and docker-compose using `image: gitea/gitea` ### Database PostgreSQL
GiteaMirror added the type/bug label 2025-11-02 08:20:43 -06:00
Author
Owner

@mike1936 commented on GitHub (Sep 29, 2022):

Voting up this issue.
Neither [server] DOMAIN nor [server] SSH_DOMAIN.
Version 1.17.1

@mike1936 commented on GitHub (Sep 29, 2022): Voting up this issue. Neither `[server] DOMAIN` nor `[server] SSH_DOMAIN`. Version 1.17.1
Author
Owner

@zeripath commented on GitHub (Feb 8, 2023):

The only way this could not be working is if you're running the install page.

Why are you running the install page on every container restart?

@zeripath commented on GitHub (Feb 8, 2023): The only way this could not be working is if you're running the install page. Why are you running the install page on every container restart?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#8849