localhost or 127.0.0.1 in code text is altered to the gitea hostname #14594

Closed
opened 2025-11-02 11:17:04 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @teknowill on GitHub (Jun 12, 2025).

Description

if someone adds localhost or 127.0.0.1 to a text or python file and do not use a .env variable
they commit and push
gitea changes the value to the hostname of gitea
git pull after other folks commit and push
the hostname of gitea has been replaced

Gitea Version

1.23.8

Can you reproduce the bug on the Gitea demo site?

do not have time to try, just reporting

Log Gist

not authorized

Screenshots

Image

Git Version

2.43.0

Operating System

ubuntu 24.04.2 LTS kernel 6.6.87

How are you running Gitea?

docker-compose.yml
services:
server:
image: docker.io/gitea/gitea:latest-rootless
environment:
- GITEA__database__DB_TYPE=postgres
- GITEA__database__HOST=db:5432
- GITEA__database__NAME=gitea
- GITEA__database__USER=gitea
- GITEA__database__PASSWD=${dbpass}
restart: always
volumes:
- gitea-data:/var/lib/gitea
- gitea-config:/etc/gitea
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "80:3000"
- "2222:2222"
depends_on:
- db

db:
image: docker.io/library/postgres:16
restart: always
environment:
- POSTGRES_USER=gitea
- POSTGRES_PASSWORD=${dbpass}
- POSTGRES_DB=gitea
volumes:
- postgres-db:/var/lib/postgresql/data

volumes:
gitea-data:
driver: local
gitea-config:
driver: local
postgres-db:
driver: local

Database

PostgreSQL

Originally created by @teknowill on GitHub (Jun 12, 2025). ### Description if someone adds localhost or 127.0.0.1 to a text or python file and do not use a .env variable they commit and push gitea changes the value to the hostname of gitea git pull after other folks commit and push the hostname of gitea has been replaced ### Gitea Version 1.23.8 ### Can you reproduce the bug on the Gitea demo site? do not have time to try, just reporting ### Log Gist not authorized ### Screenshots ![Image](https://github.com/user-attachments/assets/ad66a437-e290-4d8c-9fc4-4d901f7db727) ### Git Version 2.43.0 ### Operating System ubuntu 24.04.2 LTS kernel 6.6.87 ### How are you running Gitea? docker-compose.yml services: server: image: docker.io/gitea/gitea:latest-rootless environment: - GITEA__database__DB_TYPE=postgres - GITEA__database__HOST=db:5432 - GITEA__database__NAME=gitea - GITEA__database__USER=gitea - GITEA__database__PASSWD=${dbpass} restart: always volumes: - gitea-data:/var/lib/gitea - gitea-config:/etc/gitea - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro ports: - "80:3000" - "2222:2222" depends_on: - db db: image: docker.io/library/postgres:16 restart: always environment: - POSTGRES_USER=gitea - POSTGRES_PASSWORD=${dbpass} - POSTGRES_DB=gitea volumes: - postgres-db:/var/lib/postgresql/data volumes: gitea-data: driver: local gitea-config: driver: local postgres-db: driver: local ### Database PostgreSQL
GiteaMirror added the issue/needs-feedback label 2025-11-02 11:17:05 -06:00
Author
Owner

@wxiaoguang commented on GitHub (Jun 12, 2025):

I guess you have some incorrect "content rewrite" rules in your reverse proxy.

@wxiaoguang commented on GitHub (Jun 12, 2025): I guess you have some incorrect "content rewrite" rules in your reverse proxy.
Author
Owner

@teknowill commented on GitHub (Jun 13, 2025):

Could be, if would be gcp's api reverse proxy, we can't alter it. I'll pass the feedback,Thanks

@teknowill commented on GitHub (Jun 13, 2025): Could be, if would be gcp's api reverse proxy, we can't alter it. I'll pass the feedback,Thanks
Author
Owner

@wxiaoguang commented on GitHub (Jun 14, 2025):

GCP: https://cloud.google.com/load-balancing/docs/https/traffic-management#rewrites

do NOT use "rewrite"

@wxiaoguang commented on GitHub (Jun 14, 2025): GCP: https://cloud.google.com/load-balancing/docs/https/traffic-management#rewrites do **NOT** use "rewrite"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#14594