From 3e029ee932c950d8b1f28b04d68583b13b05008b Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 24 May 2018 22:40:50 +0000 Subject: [PATCH] improve install script --- examples/telebitd.yml | 5 ++++- installer/get.sh | 33 +++++++++++++++++++++++++++++---- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/examples/telebitd.yml b/examples/telebitd.yml index 8726841..ac347da 100644 --- a/examples/telebitd.yml +++ b/examples/telebitd.yml @@ -1,5 +1,8 @@ -servernames: [] email: 'jon@example.com' agree_tos: true community_member: true +servernames: [] vhost: /srv/www/:hostname +greenlock: + store: le-store-certbot + config_dir: /opt/telebitd/acme diff --git a/installer/get.sh b/installer/get.sh index 92b33d5..9972d3f 100644 --- a/installer/get.sh +++ b/installer/get.sh @@ -64,12 +64,25 @@ echo "" echo "" echo "" +my_email=${1:-} my_user="telebit" my_app="telebitd" my_bin="telebitd.js" my_name="Telebit Relay" my_repo="telebitd.js" +if [ -z "${my_email}" ]; then + echo "" + echo "" + echo "Telebit uses Greenlock for free automated ssl through Let's Encrypt." + echo "" + echo "To accept the Terms of Service for Telebit, Greenlock and Let's Encrypt," + echo "please enter your email." + echo "" + echo "What's your email?" + my_email= +fi + if [ -z "${TELEBITD_PATH:-}" ]; then echo 'TELEBITD_PATH="'${TELEBITD_PATH:-}'"' TELEBITD_PATH=/opt/$my_app @@ -153,8 +166,6 @@ echo "Adding $my_app is a system service" echo "sudo rsync -av $TELEBITD_PATH/dist/etc/systemd/system/$my-app.service /etc/systemd/system/$my-app.service" sudo rsync -av $TELEBITD_PATH/dist/etc/systemd/system/$my-app.service /etc/systemd/system/$my-app.service sudo systemctl daemon-reload -sudo systemctl enable $my_app -sudo systemctl restart $my_app echo "Adding example config" echo "sudo rsync -av examples/$my_app.yml /etc/$my_user/$my_app.yml" @@ -162,10 +173,24 @@ sudo rsync -av examples/$my_app.yml /etc/$my_user/$my_app.yml echo "" echo "" -echo "Installed successfully. Try it out:" +echo "The example config file /etc/telebit/telebitd.yml demonstrates how to" +echo "contribute telemetrics and receive other rare but relevant updates" +echo "(probably once per quarter or less) such as important notes on" +echo "a new release, an important API change, etc - no spam." echo "" -echo " $my_app --help" +echo "Please edit the config file to meet your needs before starting." echo "" + +echo "" +echo "" +echo "Installed successfully. Last step, start the service:" +echo "" +echo " sudo systemctl enable $my_app" +echo " sudo systemctl start $my_app" +echo "" +echo "Or manually" +echo "" +echo " $my_app --config /etc/telebit/telebitd.yml" echo "" #sudo setcap cap_net_bind_service=+ep $TELEBITD_PATH/bin/node