From 208a8f60ff05450e33961dd9f3f006810c5b2bc9 Mon Sep 17 00:00:00 2001 From: Fluf <36822577+flufmonster@users.noreply.github.com> Date: Mon, 21 May 2018 20:56:04 -0400 Subject: [PATCH 1/4] Add disable registration as an environment variable for docker --- docker/etc/s6/gitea/setup | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/etc/s6/gitea/setup b/docker/etc/s6/gitea/setup index 6ca9b82123c3..bf738ce7ed4d 100755 --- a/docker/etc/s6/gitea/setup +++ b/docker/etc/s6/gitea/setup @@ -35,6 +35,7 @@ if [ ! -f /data/gitea/conf/app.ini ]; then DB_USER=${DB_USER:-"root"} \ DB_PASSWD=${DB_PASSWD:-""} \ INSTALL_LOCK=${INSTALL_LOCK:-"false"} \ + DISABLE_REGISTRATION=${DISABLE_REGISTRATION:-"false"} \ SECRET_KEY=${SECRET_KEY:-""} \ envsubst < /etc/templates/app.ini > /data/gitea/conf/app.ini fi From d2a5cf5f34e47afc37ffbf2be8885bf093f96f8c Mon Sep 17 00:00:00 2001 From: Fluf <36822577+flufmonster@users.noreply.github.com> Date: Mon, 21 May 2018 20:58:11 -0400 Subject: [PATCH 2/4] Add REQUIRE_SIGNIN_VIEW as env var to docker --- docker/etc/s6/gitea/setup | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/etc/s6/gitea/setup b/docker/etc/s6/gitea/setup index bf738ce7ed4d..500cca584c7c 100755 --- a/docker/etc/s6/gitea/setup +++ b/docker/etc/s6/gitea/setup @@ -36,6 +36,7 @@ if [ ! -f /data/gitea/conf/app.ini ]; then DB_PASSWD=${DB_PASSWD:-""} \ INSTALL_LOCK=${INSTALL_LOCK:-"false"} \ DISABLE_REGISTRATION=${DISABLE_REGISTRATION:-"false"} \ + REQUIRE_SIGNIN_VIEW=${REQUIRE_SIGNIN_VIEW:-"false"} \ SECRET_KEY=${SECRET_KEY:-""} \ envsubst < /etc/templates/app.ini > /data/gitea/conf/app.ini fi From eea43b9c5a1720e7d7dcb46542af2741707e95f9 Mon Sep 17 00:00:00 2001 From: Fluf <36822577+flufmonster@users.noreply.github.com> Date: Mon, 21 May 2018 21:02:00 -0400 Subject: [PATCH 3/4] Add variables to template --- docker/etc/templates/app.ini | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docker/etc/templates/app.ini b/docker/etc/templates/app.ini index 2375f8f533a9..9e0a3dd5c876 100644 --- a/docker/etc/templates/app.ini +++ b/docker/etc/templates/app.ini @@ -38,3 +38,7 @@ ROOT_PATH = /data/gitea/log [security] INSTALL_LOCK = $INSTALL_LOCK SECRET_KEY = $SECRET_KEY + +[service] +DISABLE_REGISTRATION = $DISABLE_REGISTRATION +REQUIRE_SIGNIN_VIEW = $REQUIRE_SIGNIN_VIEW From be4a94d4967bb8e4c2e1b6a35347be367905f7f5 Mon Sep 17 00:00:00 2001 From: Fluf <36822577+flufmonster@users.noreply.github.com> Date: Tue, 22 May 2018 13:36:33 -0400 Subject: [PATCH 4/4] Update docker docs --- docs/content/doc/installation/with-docker.en-us.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/content/doc/installation/with-docker.en-us.md b/docs/content/doc/installation/with-docker.en-us.md index 9494fd603744..8f393f16d0b4 100644 --- a/docs/content/doc/installation/with-docker.en-us.md +++ b/docs/content/doc/installation/with-docker.en-us.md @@ -243,6 +243,8 @@ You can configure some of Gitea's settings via environment variables: * `DB_PASSWD`: **""**: Database user password. Use \`your password\` for quoting if you use special characters in the password. * `INSTALL_LOCK`: **false**: Disallow access to the install page. * `SECRET_KEY`: **""**: Global secret key. This should be changed. If this has a value and `INSTALL_LOCK` is empty, `INSTALL_LOCK` will automatically set to `true`. +* `DISABLE_REGISTRATION`: **false**: Disable registration, after which only admin can create accounts for users. +* `REQUIRE_SIGNIN_VIEW`: **false**: Enable this to force users to log in to view any page. # Customization