diff --git a/bootstrap.sh b/bootstrap.sh index 56373cf..05d2d8c 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,5 +1,11 @@ #!/bin/bash +# Force users to login before seeing any pins. +if [ "$ALLOW_NEW_REGISTRATIONS" == "" ]; then + ALLOW_NEW_REGISTRATIONS=true +fi + + sudo docker images |grep pinry || echo "No docker image found, building..." || ./build_docker.sh echo "==================================================================================" @@ -18,14 +24,18 @@ echo "" echo ${SECRET_KEY} echo "==================================================================================" -if [ ! -f ./pinry/local_settings.py ] +if [ ! -f ./pinry/local_settings.py ]; then cp ./pinry/local_settings.example.py ./pinry/local_settings.py sed -i "s/secret\_key\_place\_holder/${SECRET_KEY}/" ./pinry/local_settings.py fi -if [ ! -f ./pinry/local_settings.py ] -then - cp ./pinry/local_settings.example.py ./pinry/local_settings.py - sed -i "s/secret\_key\_place\_holder/${SECRET_KEY}/" ./pinry/local_settings.py +# Force users to login before seeing any pins. +if [ -n "$PRIVATE" ]; then + sed -i "s/PUBLIC = True/PUBLIC = False/" ./pinry/local_settings.py +fi + +# Enable people from creating new accounts. +if [ -n "$ALLOW_NEW_REGISTRATIONS" ]; then + sed -i "s/ALLOW_NEW_REGISTRATIONS = False/ALLOW_NEW_REGISTRATIONS = True/" ./pinry/local_settings.py fi diff --git a/pinry/local_settings.example.py b/pinry/local_settings.example.py index 7c71f77..d66ba5a 100644 --- a/pinry/local_settings.example.py +++ b/pinry/local_settings.example.py @@ -28,7 +28,7 @@ } # Allow users to register by themselves -ALLOW_NEW_REGISTRATIONS = True +ALLOW_NEW_REGISTRATIONS = False # Delete image files once you remove your pin IMAGE_AUTO_DELETE = True