From 63ca51010cbf027c6448e8a70300d01605f77bdc Mon Sep 17 00:00:00 2001 From: Guillaume Vincent Date: Sat, 29 Jul 2017 15:44:32 +0200 Subject: [PATCH] update Documentation --- lesspass.sh | 59 +++++++++++++++++++++++++++++++++++--------- letsencrypt.sh | 73 ------------------------------------------------------- nginx | 2 +- openssl | 2 +- readme.md | 6 ++--- scripts/deploy.sh | 11 --------- 6 files changed, 52 insertions(+), 101 deletions(-) delete mode 100755 letsencrypt.sh delete mode 100755 scripts/deploy.sh diff --git a/lesspass.sh b/lesspass.sh index 54f76d3..6002015 100755 --- a/lesspass.sh +++ b/lesspass.sh @@ -1,42 +1,77 @@ #!/usr/bin/env bash +set -e +######### +# Check # +######### OUTPUT_DIR=LessPass if [ -d "$OUTPUT_DIR" ] then echo "LessPass directory exists, move ./LessPass folder and re-run lesspass.sh script" exit 1 fi +docker --version +docker-compose --version +#################### +# Context creation # +#################### mkdir $OUTPUT_DIR cd $OUTPUT_DIR -curl -o docker-compose.yml https://raw.githubusercontent.com/lesspass/lesspass/master/docker-compose.prod.yml - -DATABASE_PASSWORD=$(LC_ALL=C tr -dc A-Za-z0-9_ > .env << EOF ALLOWED_HOSTS=.$DOMAIN DATABASE_PASSWORD=$DATABASE_PASSWORD SECRET_KEY=$SECRET_KEY DOMAIN=$DOMAIN +EMAIL=$EMAIL EOF -# pull new images +####################### +# Docker compose file # +####################### +curl -s -o docker-compose2.yml https://raw.githubusercontent.com/lesspass/lesspass/master/docker-compose.prod.yml docker-compose pull - -# restart container docker-compose down + +############### +# LetsEncrypt # +############### +echo "Create LetsEncrypt certificate..." +mkdir letsencrypt +docker run -it --rm -p 443:443 -p 80:80 -v $PWD/letsencrypt:/etc/letsencrypt/ certbot/certbot certonly --standalone --noninteractive --quiet --email $EMAIL --agree-tos -d $DOMAIN +docker run -it --rm -v $PWD/letsencrypt/live/:/certificates/ lesspass/openssl openssl dhparam -out /certificates/$DOMAIN/dhparam.pem 4096 + +############ +# LessPass # +############ +curl -s -o update.sh https://raw.githubusercontent.com/lesspass/lesspass/master/scripts/update.sh +chmod u+x update.sh docker-compose up -d +echo "--------------------------------------------" +echo "Congratulation LessPass Database is running!" +echo "--------------------------------------------" +echo "visit https://$DOMAIN" +echo +echo "## Create super user" +echo "see: https://github.com/lesspass/lesspass#create-super-user" +echo +echo "## Update LessPass" +echo "Just run ./update.sh" +echo "It renews the LestEncrypt certificate and updates LessPass" -echo "LessPass Database is now running on $DOMAIN" -echo "If you want to configure an email server for your LessPass Database see: https://github.com/lesspass/lesspass#configure-email" diff --git a/letsencrypt.sh b/letsencrypt.sh deleted file mode 100755 index e25b5cd..0000000 --- a/letsencrypt.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env bash - -######### -# Check # -######### -OUTPUT_DIR=LessPass -if [ -d "$OUTPUT_DIR" ] -then - echo "LessPass directory exists, move ./LessPass folder and re-run lesspass.sh script" - exit 1 -fi - -#################### -# Context creation # -#################### -mkdir $OUTPUT_DIR -cd $OUTPUT_DIR - -if [ "$#" -eq "2" ] -then - DOMAIN=$1 - EMAIL=$2 -else - echo "Please enter your domain name (e.g. example.org): " - read DOMAIN - echo - echo "Please enter your email (Used to generate an HTTPS certificate with LetsEncrypt):" - read EMAIL -fi - -DATABASE_PASSWORD=$(LC_ALL=C tr -dc A-Za-z0-9_ > .env << EOF -ALLOWED_HOSTS=.$DOMAIN -DATABASE_PASSWORD=$DATABASE_PASSWORD -SECRET_KEY=$SECRET_KEY -DOMAIN=$DOMAIN -EMAIL=$EMAIL -EOF - -####################### -# Docker compose file # -####################### -curl -s -o docker-compose.yml https://raw.githubusercontent.com/lesspass/lesspass/master/docker-compose.prod.yml > /dev/null -docker-compose pull -docker-compose down - -############### -# LetsEncrypt # -############### -echo "Create LetsEncrypt certificate..." -mkdir letsencrypt -docker run -it --rm -p 443:443 -p 80:80 -v $PWD/letsencrypt:/etc/letsencrypt/ certbot/certbot certonly --standalone --noninteractive --quiet --email $EMAIL --agree-tos -d $DOMAIN > /dev/null -docker run -it --rm -v $PWD/letsencrypt/live/:/certificates/ lesspass/openssl openssl dhparam -out /certificates/$DOMAIN/dhparam.pem 4096 - -############ -# LessPass # -############ -curl -s https://raw.githubusercontent.com/lesspass/lesspass/master/scripts/update.sh > /dev/null -docker-compose up -d -echo "--------------------------------------------" -echo "Congratulation LessPass Database is running!" -echo "--------------------------------------------" -echo "visit https://$DOMAIN" -echo -echo "## Create super user" -echo "see: https://github.com/lesspass/lesspass#create-super-user" -echo -echo "## Update LessPass" -echo "Just run ./update.sh" -echo "It renews the LestEncrypt certificate and updates LessPass" - diff --git a/nginx b/nginx index 14b33a2..ed80a2f 160000 --- a/nginx +++ b/nginx @@ -1 +1 @@ -Subproject commit 14b33a260f6be16cdf9aeb13ef8b363162953733 +Subproject commit ed80a2f89204c8c2c99eb1194586fcc5b3929135 diff --git a/openssl b/openssl index 5946535..dff766b 160000 --- a/openssl +++ b/openssl @@ -1 +1 @@ -Subproject commit 59465350039cda18e963410122884304d1c0e0a5 +Subproject commit dff766bc06a7447b8e9645956f9ec3768da32e16 diff --git a/readme.md b/readme.md index 0468413..c0c4a38 100644 --- a/readme.md +++ b/readme.md @@ -19,12 +19,13 @@ LessPass open source password manager (https://lesspass.com) - [frontend](https://github.com/lesspass/frontend) : https://lesspass.com source code - [move](https://github.com/lesspass/move) : password migration tool for LessPass - [nginx](https://github.com/lesspass/nginx) : configuration for nginx + - [openssl](https://github.com/lesspass/openssl) : configuration for openssl - [pure](https://github.com/lesspass/pure) : pure component in vuejs used by cozy, frontend and webextension - [snap](https://github.com/lesspass/snap) : snap for lesspass-cli - [web extension](https://github.com/lesspass/webextension) : chrome and firefox web extension for LessPass password manager -## Self Host your LessPass Database +## Self Host your LessPass Database (WIP) ### requirements @@ -35,10 +36,9 @@ LessPass open source password manager (https://lesspass.com) simply run - bash <(curl -s https://raw.githubusercontent.com/lesspass/lesspass/master/letsencrypt.sh) [DOMAIN] [EMAIL] + bash <(curl -s https://raw.githubusercontent.com/lesspass/lesspass/master/lesspass.sh) [DOMAIN] [EMAIL] `[DOMAIN]` and `[EMAIL]` are used to generate a LetsEncrypt certificate and configure LessPass. -If not provided, you'll be asked to enter it. ### create super user diff --git a/scripts/deploy.sh b/scripts/deploy.sh deleted file mode 100755 index 22a6f55..0000000 --- a/scripts/deploy.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -export COMPOSE_HTTP_TIMEOUT=600 - -# pull new images -docker-compose pull - -# restart container -docker-compose down -docker-compose up -d -docker images --quiet --filter=dangling=true | xargs --no-run-if-empty docker rmi