Skip to content

Commit 2eb80ba

Browse files
authored
Merge pull request #1938 from aboutcode-org/altcha-key
Add Altcha hmac key to settings
2 parents 24224f3 + eafacc3 commit 2eb80ba

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ ACTIVATE?=. ${VENV}/bin/activate;
2929
VIRTUALENV_PYZ=etc/thirdparty/virtualenv.pyz
3030
# Do not depend on Python to generate the SECRET_KEY
3131
GET_SECRET_KEY=`base64 /dev/urandom | head -c50`
32+
GET_ALTCHA_HMAC_KEY=`head -c 32 /dev/urandom | xxd -p -c 32`
3233
# Customize with `$ make envfile ENV_FILE=/etc/vulnerablecode/.env`
3334
ENV_FILE=.env
3435
# Customize with `$ make postgres VULNERABLECODE_DB_PASSWORD=YOUR_PASSWORD`
@@ -63,6 +64,7 @@ envfile:
6364
@if test -f ${ENV_FILE}; then echo ".env file exists already"; exit 1; fi
6465
@mkdir -p $(shell dirname ${ENV_FILE}) && touch ${ENV_FILE}
6566
@echo SECRET_KEY=\"${GET_SECRET_KEY}\" > ${ENV_FILE}
67+
@echo ALTCHA_HMAC_KEY=\"${GET_ALTCHA_HMAC_KEY}\" >> ${ENV_FILE}
6668

6769
isort:
6870
@echo "-> Apply isort changes to ensure proper imports ordering"

vulnerablecode/settings.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838

3939
CSRF_TRUSTED_ORIGINS = env.list("CSRF_TRUSTED_ORIGINS", default=[])
4040

41+
# Altcha 32-byte hexadecimal key
42+
43+
ALTCHA_HMAC_KEY = env.str("ALTCHA_HMAC_KEY")
44+
4145
# SECURITY WARNING: do not run with debug turned on in production
4246
DEBUG = env.bool("VULNERABLECODE_DEBUG", default=False)
4347

0 commit comments

Comments
 (0)