From d52e0f77f33091c163df3adaeab0775bd3897c44 Mon Sep 17 00:00:00 2001 From: Krishnan Shankar Date: Fri, 9 Feb 2024 23:44:19 -0500 Subject: [PATCH] feat: make setup easier (#225) * feat: add run.sh and deploy.sh scripts for Director * feat: add prod defaults to secret.sample.py --- deploy.sh | 8 ++++++++ run.sh | 3 +++ tjdests/settings/secret.sample.py | 25 +++++++++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100755 deploy.sh create mode 100755 run.sh diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..e15f355 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +cd /site/public +git pull +TMPDIR=/site/tmp pipenv sync +pipenv run ./manage.py migrate +pipenv run ./manage.py collectstatic --no-input +echo "Deploy complete. Restart the site process to wrap up." diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..a821564 --- /dev/null +++ b/run.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +pipenv run gunicorn -b $HOST:$PORT --workers 4 tjdests.wsgi diff --git a/tjdests/settings/secret.sample.py b/tjdests/settings/secret.sample.py index 76d5c1b..c2eb718 100644 --- a/tjdests/settings/secret.sample.py +++ b/tjdests/settings/secret.sample.py @@ -18,9 +18,34 @@ SECRET_KEY = "supersecret" SOCIAL_AUTH_ION_KEY = "ionkey" SOCIAL_AUTH_ION_SECRET = "ionsecret" +# Database +# DATABASES = { +# "default": { +# "ENGINE": "django.db.backends.postgresql", +# "NAME": os.environ["DIRECTOR_DATABASE_NAME"], +# "USER": os.environ["DIRECTOR_DATABASE_USERNAME"], +# "PASSWORD": os.environ["DIRECTOR_DATABASE_PASSWORD"], +# "HOST": os.environ["DIRECTOR_DATABASE_HOST"], +# "PORT": os.environ["DIRECTOR_DATABASE_PORT"], +# }, +# } + +# Axes +# AXES_META_PRECEDENCE_ORDER = [ +# 'HTTP_X_REAL_IP', +# ] +# AXES_NEVER_LOCKOUT_WHITELIST = True +# AXES_IP_WHITELIST = ["151.188.227.237"] + # Message blast - treated as HTML safe text # type is str GLOBAL_MESSAGE = None +# GLOBAL_MESSAGE = "WARNING: This is not ready for production usage! Any and all data may be deleted at any time without warning!" # Login lock: if True, restrict login to superusers only LOGIN_LOCKED = False + +TIME_ZONE = "America/New_York" + +# To prevent Git issues +MAINTAINER = "First Last (20XXusername)"