Skip to content

Commit b299d7b

Browse files
Fluflunny
Fluf
authored andcommitted
Add Environment Variables to Docker template (#4012)
* Add disable registration as an environment variable for docker * Add REQUIRE_SIGNIN_VIEW as env var to docker * Add variables to template * Update docker docs
1 parent 60d95a0 commit b299d7b

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

docker/etc/s6/gitea/setup

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ if [ ! -f /data/gitea/conf/app.ini ]; then
3535
DB_USER=${DB_USER:-"root"} \
3636
DB_PASSWD=${DB_PASSWD:-""} \
3737
INSTALL_LOCK=${INSTALL_LOCK:-"false"} \
38+
DISABLE_REGISTRATION=${DISABLE_REGISTRATION:-"false"} \
39+
REQUIRE_SIGNIN_VIEW=${REQUIRE_SIGNIN_VIEW:-"false"} \
3840
SECRET_KEY=${SECRET_KEY:-""} \
3941
envsubst < /etc/templates/app.ini > /data/gitea/conf/app.ini
4042
fi

docker/etc/templates/app.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,7 @@ ROOT_PATH = /data/gitea/log
3838
[security]
3939
INSTALL_LOCK = $INSTALL_LOCK
4040
SECRET_KEY = $SECRET_KEY
41+
42+
[service]
43+
DISABLE_REGISTRATION = $DISABLE_REGISTRATION
44+
REQUIRE_SIGNIN_VIEW = $REQUIRE_SIGNIN_VIEW

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,8 @@ You can configure some of Gitea's settings via environment variables:
243243
* `DB_PASSWD`: **"<empty>"**: Database user password. Use \`your password\` for quoting if you use special characters in the password.
244244
* `INSTALL_LOCK`: **false**: Disallow access to the install page.
245245
* `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`.
246+
* `DISABLE_REGISTRATION`: **false**: Disable registration, after which only admin can create accounts for users.
247+
* `REQUIRE_SIGNIN_VIEW`: **false**: Enable this to force users to log in to view any page.
246248

247249
# Customization
248250

0 commit comments

Comments
 (0)