You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

43 rivejä
1017 B

  1. #!/usr/bin/env bash
  2. OUTPUT_DIR=LessPass
  3. if [ -d "$OUTPUT_DIR" ]
  4. then
  5. echo "LessPass directory exists, move ./LessPass folder and re-run lesspass.sh script"
  6. exit 1
  7. fi
  8. mkdir $OUTPUT_DIR
  9. cd $OUTPUT_DIR
  10. curl -o docker-compose.yml https://raw.githubusercontent.com/lesspass/lesspass/master/docker-compose.prod.yml
  11. DATABASE_PASSWORD=$(LC_ALL=C tr -dc A-Za-z0-9_ </dev/urandom | head -c 32)
  12. SECRET_KEY=$(LC_ALL=C tr -dc A-Za-z0-9_ </dev/urandom | head -c 32)
  13. if [ "$#" -eq "1" ]
  14. then
  15. DOMAIN=$1
  16. else
  17. echo "Please enter your domain name (e.g. example.org): "
  18. read DOMAIN
  19. fi
  20. # create env file
  21. cat >> .env << EOF
  22. ALLOWED_HOSTS=.$DOMAIN
  23. DATABASE_PASSWORD=$DATABASE_PASSWORD
  24. SECRET_KEY=$SECRET_KEY
  25. DOMAIN=$DOMAIN
  26. EOF
  27. # pull new images
  28. docker-compose pull
  29. # restart container
  30. docker-compose down
  31. docker-compose up -d
  32. echo "LessPass Database is now running on $DOMAIN"
  33. echo "If you want to configure an email server for your LessPass Database see: https://github.com/lesspass/lesspass#configure-email"