Skip to content

Commit 9c62ca5

Browse files
authored
Fix default value for LocalURL (#25426)
Fix #23769
1 parent 326df0f commit 9c62ca5

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

custom/conf/app.example.ini

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,13 @@ RUN_USER = ; git
119119
;; Permission for unix socket
120120
;UNIX_SOCKET_PERMISSION = 666
121121
;;
122-
;; Local (DMZ) URL for Gitea workers (such as SSH update) accessing web service.
123-
;; In most cases you do not need to change the default value.
124-
;; Alter it only if your SSH server node is not the same as HTTP node.
125-
;; Do not set this variable if PROTOCOL is set to 'unix'.
122+
;; Local (DMZ) URL for Gitea workers (such as SSH update) accessing web service. In
123+
;; most cases you do not need to change the default value. Alter it only if
124+
;; your SSH server node is not the same as HTTP node. For different protocol, the default
125+
;; values are different. If `PROTOCOL` is `http+unix`, the default value is `http://unix/`.
126+
;; If `PROTOCOL` is `fcgi` or `fcgi+unix`, the default value is `%(PROTOCOL)s://%(HTTP_ADDR)s:%(HTTP_PORT)s/`.
127+
;; If listen on `0.0.0.0`, the default value is `%(PROTOCOL)s://localhost:%(HTTP_PORT)s/`, Otherwise the default
128+
;; value is `%(PROTOCOL)s://%(HTTP_ADDR)s:%(HTTP_PORT)s/`.
126129
;LOCAL_ROOT_URL = %(PROTOCOL)s://%(HTTP_ADDR)s:%(HTTP_PORT)s/
127130
;;
128131
;; When making local connections pass the PROXY protocol header.

docs/content/doc/administration/config-cheat-sheet.en-us.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,11 @@ The following configuration set `Content-Type: application/vnd.android.package-a
314314
- `LOCAL_ROOT_URL`: **%(PROTOCOL)s://%(HTTP_ADDR)s:%(HTTP_PORT)s/**: Local
315315
(DMZ) URL for Gitea workers (such as SSH update) accessing web service. In
316316
most cases you do not need to change the default value. Alter it only if
317-
your SSH server node is not the same as HTTP node. Do not set this variable
318-
if `PROTOCOL` is set to `http+unix`.
317+
your SSH server node is not the same as HTTP node. For different protocol, the default
318+
values are different. If `PROTOCOL` is `http+unix`, the default value is `http://unix/`.
319+
If `PROTOCOL` is `fcgi` or `fcgi+unix`, the default value is `%(PROTOCOL)s://%(HTTP_ADDR)s:%(HTTP_PORT)s/`.
320+
If listen on `0.0.0.0`, the default value is `%(PROTOCOL)s://localhost:%(HTTP_PORT)s/`, Otherwise the default
321+
value is `%(PROTOCOL)s://%(HTTP_ADDR)s:%(HTTP_PORT)s/`.
319322
- `LOCAL_USE_PROXY_PROTOCOL`: **%(USE_PROXY_PROTOCOL)s**: When making local connections pass the PROXY protocol header.
320323
This should be set to false if the local connection will go through the proxy.
321324
- `PER_WRITE_TIMEOUT`: **30s**: Timeout for any write to the connection. (Set to -1 to

0 commit comments

Comments
 (0)