diff --git a/CHANGELOG.md b/CHANGELOG.md index 59407b73c..e303061a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Changelog Fab-manager +- Improved setup script for installations without nginx - Changed some default values for new installations - Updated documentation - Fix a bug: installation without nginx does not remove the service from the docker-compose file diff --git a/env.example b/env.example index 9891a3ac6..0a2d05588 100644 --- a/env.example +++ b/env.example @@ -13,7 +13,7 @@ STRIPE_PUBLISHABLE_KEY= STRIPE_CURRENCY=eur # Invoices -INVOICE_PREFIX=Demo-FabLab-facture +INVOICE_PREFIX=Demo-FabLab_facture # FabLab optional modules FABLAB_WITHOUT_PLANS=false diff --git a/setup/env.example b/setup/env.example index 7b469b532..37a2edd57 100644 --- a/setup/env.example +++ b/setup/env.example @@ -8,7 +8,7 @@ STRIPE_API_KEY= STRIPE_PUBLISHABLE_KEY= STRIPE_CURRENCY=eur -INVOICE_PREFIX=Demo-FabLab-facture +INVOICE_PREFIX=Demo-FabLab_facture FABLAB_WITHOUT_PLANS=false FABLAB_WITHOUT_SPACES=false FABLAB_WITHOUT_ONLINE_PAYMENT=false diff --git a/setup/setup.sh b/setup/setup.sh index 7850d9f2b..8abb2f615 100755 --- a/setup/setup.sh +++ b/setup/setup.sh @@ -50,12 +50,6 @@ system_requirements() echo -e "\e[91m[ ❌ ] $_command was not found, exiting...\e[39m" && exit 1 fi done - echo "detecting gawk..." - if ! command -v awk || ! [[ $(awk -W version) =~ ^GNU ]] - then - echo "Please install GNU Awk before running this script." - echo "\e[91m[ ❌ ] GNU awk was not found, exiting...\e[39m" && exit 1 - fi printf "\e[92m[ ✔ ] All requirements successfully checked.\e[39m \n\n" } @@ -152,6 +146,10 @@ prepare_files() \curl -sSL https://raw.githubusercontent.com/sleede/fab-manager/master/setup/docker-compose.yml > "$FABMANAGER_PATH/docker-compose.yml" } +yq() { + docker run --rm -i -v "${FABMANAGER_PATH}:/workdir" mikefarah/yq yq "$@" +} + prepare_nginx() { if [ "$NGINX" != "n" ]; then @@ -162,7 +160,17 @@ prepare_nginx() else # if nginx is not installed, remove its associated block from docker-compose.yml echo "Removing nginx..." - awk '$1 == "nginx:"{t=1; next};t==1{t=1;next};t==1 && /:[[:blank:]]*$/{t=0};t != 1' "$FABMANAGER_PATH/docker-compose.yml" > "$FABMANAGER_PATH/.awktmpfile" && mv "$FABMANAGER_PATH/.awktmpfile" "$FABMANAGER_PATH/docker-compose.yml" + yq d -i docker-compose.yml services.nginx + read -rp "Do you want to map the Fab-manager's service to an external network? (Y/n) " confirm