Skip to content

Commit eb57c94

Browse files
committed
allow binding gitea to privileged port, gated behind environment variable
Signed-off-by: Clint Armstrong <[email protected]>
1 parent 8d3bb86 commit eb57c94

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ RUN apk --no-cache add \
3434
s6 \
3535
sqlite \
3636
su-exec \
37-
tzdata
37+
tzdata \
38+
libcap
3839

3940
RUN addgroup \
4041
-S -g 1000 \

docker/etc/s6/gitea/setup

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,4 @@ if ! [[ $(ls -ld /data/gitea | awk '{print $3}') = ${USER} ]]; then chown -R ${U
4444
if ! [[ $(ls -ld /app/gitea | awk '{print $3}') = ${USER} ]]; then chown -R ${USER}:git /app/gitea; fi
4545
if ! [[ $(ls -ld /data/git | awk '{print $3}') = ${USER} ]]; then chown -R ${USER}:git /data/git; fi
4646
chmod 0755 /data/gitea /app/gitea /data/git
47+
if [[ "${ALLOW_PRIVILEGED_PORT}" = 1 ]]; then setcap 'cap_net_bind_service=+ep' /app/gitea/gitea; fi

docs/content/doc/installation/with-docker.en-us.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ You can configure some of Gitea's settings via environment variables:
259259
* `REQUIRE_SIGNIN_VIEW`: **false**: Enable this to force users to log in to view any page.
260260
* `USER_UID`: **1000**: The UID (Unix user ID) of the user that runs Gitea within the container. Match this to the UID of the owner of the `/data` volume if using host volumes (this is not necessary with named volumes).
261261
* `USER_GID`: **1000**: The GID (Unix group ID) of the user that runs Gitea within the container. Match this to the GID of the owner of the `/data` volume if using host volumes (this is not necessary with named volumes).
262+
* `ALLOW_PRIVILEGED_PORT`: **0**: Set to 1 to allow the gitea service to run on a port < 1024.
262263

263264
# Customization
264265

0 commit comments

Comments
 (0)