Browse Source

feat(docker): Auto check valid sentry commands in entrypoint (#16417)

A take on https://github.com/getsentry/sentry/pull/16415#pullrequestreview-342090375
Burak Yigit Kaya 5 years ago
parent
commit
86c69daf4a
1 changed files with 3 additions and 5 deletions
  1. 3 5
      docker/docker-entrypoint.sh

+ 3 - 5
docker/docker-entrypoint.sh

@@ -8,11 +8,9 @@ if [ "${1:0:1}" = '-' ]; then
 	set -- sentry "$@"
 fi
 
-case "$1" in
-	celery|cleanup|config|createuser|devserver|django|exec|export|help|import|init|permissions|plugins|queues|repair|run|shell|start|tsdb|upgrade)
-		set -- sentry "$@"
-	;;
-esac
+if [[ $1 =~ ^[[:alnum:]]+$ ]] && [ -f "/usr/local/lib/python2.7/site-packages/sentry/runner/commands/$1.py" ]; then
+	set -- sentry "$@";
+fi
 
 if [ "$1" = 'sentry' ]; then
 	set -- tini -- "$@"