forked from expo/troggle
sanitize passwords before push to git on server
This commit is contained in:
11
pre-push.sh
11
pre-push.sh
@@ -1,6 +1,7 @@
|
||||
#! /bin/sh
|
||||
# create and sanitise files for pushing to repo
|
||||
# Philip Sargent 2021/04/06
|
||||
# catatrophically forgot to sanitize localsettingsWSL.py - oops.
|
||||
# Philip Sargent 2021/10/23
|
||||
echo deprecations.
|
||||
python -Wall manage.py check -v 3 2>deprecations.txt >/dev/null
|
||||
echo diffsettings.
|
||||
@@ -14,18 +15,22 @@ python manage.py inspectdb > troggle-inspectdb.py
|
||||
echo remove passwords.
|
||||
cp localsettings.py localsettingsWSL.py
|
||||
sed -i '/EXPOUSERPASS/ s/^.*$/EXPOUSERPASS = "nnn:gggggg - real-expo-password---imported-from-localsettings.py"/' diffsettings.txt
|
||||
sed -i '/EXPOUSERPASS/ s/^.*$/EXPOUSERPASS = "nnn:gggggg - real-expo-password---imported-from-localsettings.py"/' localsettingsWSL.py
|
||||
echo " reset: EXPOUSERPASS = \"nnn:gggggg\" - real-expo-password---imported-from-localsettings.py"
|
||||
|
||||
sed -i '/EXPOADMINUSERPASS/ s/^.*$/EXPOADMINUSERPASS = "nnn:gggggg - real-expo-password---imported-from-localsettings.py"/' diffsettings.txt
|
||||
sed -i '/EXPOADMINUSERPASS/ s/^.*$/EXPOADMINUSERPASS = "gggggg:nnn - real-expo-password---imported-from-localsettings.py"/' diffsettings.txt
|
||||
sed -i '/EXPOADMINUSERPASS/ s/^.*$/EXPOADMINUSERPASS = "gggggg:nnn - real-expo-password---imported-from-localsettings.py"/' localsettingsWSL.py
|
||||
echo " reset: EXPOUSERPASS = \"gggggg:nnn\" - real-expo-password---imported-from-localsettings.py"
|
||||
|
||||
sed -i '/EMAIL_HOST_PASSWORD/ s/^.*$/EMAIL_HOST_PASSWORD = "real-email-password---imported-from-localsettings.py"/' diffsettings.txt
|
||||
sed -i '/EMAIL_HOST_PASSWORD/ s/^.*$/EMAIL_HOST_PASSWORD = "real-email-password---imported-from-localsettings.py"/' localsettingsWSL.py
|
||||
echo " reset: EMAIL_HOST_PASSWORD = \"real-email-password--imported-from-localsettings.py\""
|
||||
|
||||
sed -i '/SECRET_KEY/ s/^.*$/SECRET_KEY = "real-SECRET_KEY--imported-from-localsettings.py"/' diffsettings.txt
|
||||
sed -i '/SECRET_KEY/ s/^.*$/SECRET_KEY = "real-SECRET_KEY--imported-from-localsettings.py"/' localsettingsWSL.py
|
||||
echo " reset: SECRET_KEY = \"real-SECRET_KEY--imported-from-localsettings.py\""
|
||||
|
||||
|
||||
mv localsettingsWSL.py _deploy/wsl
|
||||
#
|
||||
# Do these before final testing, *not* just before pushing:
|
||||
# in ./pre-run.sh
|
||||
|
||||
Reference in New Issue
Block a user