From b275794ca694d861d77c4a1710374ed695a17a04 Mon Sep 17 00:00:00 2001 From: Michel Memeteau Date: Sun, 22 Mar 2020 17:56:16 +0100 Subject: [PATCH 1/5] Update utils/provision, install.linux.sh files --- install.linux.sh | 4 ++-- utils/provision | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/install.linux.sh b/install.linux.sh index 24cce8a..21fb324 100755 --- a/install.linux.sh +++ b/install.linux.sh @@ -6,9 +6,9 @@ LIBRE_VERSION=1.1 ## domain handling -### TODO : Specify you template repo ROOT +### TODO : Specify you template repo ROOT without training slash -TEMPLATES_ROOT=lab.libreho.st/libre.sh/compose/ +APP_REPO_URL=lab.libreho.st/libre.sh/compose ### TODO : change to your domain vendor ( ovh , online, ) DOMAIN_SERVER=namecheap diff --git a/utils/provision b/utils/provision index eb9d772..deee495 100755 --- a/utils/provision +++ b/utils/provision @@ -103,7 +103,17 @@ function buy_domain_name () { } function application () { - git clone https://${arg_a}.git /data/domains/${arg_u} + #We check if a APP_REPO_URL was specified + + if[ -z ${APP_REPO_URL:-} ]; then + warning "NO repo URL specified, using argument as full URL" + git_url=https://${arg_a}.git + else + warning "REPO specified, using argument as app name" + git_url=https://${APP_REPO_URL}/${arg_a}.git + fi + + git clone ${git_url} /data/domains/${arg_u} cd /data/domains/${arg_u} if [ -f ./scripts/install ]; then export URL=${arg_u} -- GitLab From 8aea5b59146b6285a01f79549850a0a02f569cb6 Mon Sep 17 00:00:00 2001 From: Michel Memeteau Date: Sun, 22 Mar 2020 18:10:38 +0100 Subject: [PATCH 2/5] Set up variables --- install.linux.sh | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/install.linux.sh b/install.linux.sh index 21fb324..07c8cd2 100755 --- a/install.linux.sh +++ b/install.linux.sh @@ -1,7 +1,7 @@ #!/bin/bash #Current version of libre.sh to be installed -LIBRE_VERSION=1.1 +LIBRE_VERSION=187-repo-mode-to-retrieve-application-recipe # System env vars ## domain handling @@ -23,7 +23,7 @@ OVH_URL="eu.api.ovh.com" OVH_API_USER="" OVH_API_KEY= - +### TODO : change your settings IP="curl -s http://icanhazip.com/" FirstName="Pierre" LastName="Ozoux" @@ -36,13 +36,15 @@ City="Lisbon" CountryCode="PT" ## Backup BACKUP_DESTINATION=root@xxxxx:port + +### TODO : Change your mail settings. ## SMTP MAIL_USER= MAIL_PASS= MAIL_HOST=mail.indie.host MAIL_PORT=587 - +### TODO : source a setting file is present to override defaults echo "-------- Welcome to libre.sh $LIBRE_VERSION installer" @@ -53,6 +55,18 @@ echo "-------- Welcome to libre.sh $LIBRE_VERSION installer" echo "-------- setting up system variables" +echo "APP_REPO_URL=${APP_REPO_URL}" >> /etc/environnement + +echo "LIBRE_VERSION=${LIBRE_VERSION}" >> /etc/environnement + +echo "MAIL_USER=${MAIL_USER}" >> /etc/environnement + +echo "MAIL_PASS=${MAIL_PASS}" >> /etc/environnement + +echo "MAIL_HOST=${MAIL_HOST}" >> /etc/environnement + +echo "MAIL_PORT=${MAIL_PORT}" >> /etc/environnement + # STEP Install Docker -- GitLab From ba58e277dd091e872d06a679a274ea7e0e25f3e2 Mon Sep 17 00:00:00 2001 From: Michel Memeteau Date: Sun, 22 Mar 2020 18:35:44 +0100 Subject: [PATCH 3/5] Fix variables --- install.linux.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/install.linux.sh b/install.linux.sh index 07c8cd2..f2ba021 100755 --- a/install.linux.sh +++ b/install.linux.sh @@ -8,7 +8,7 @@ LIBRE_VERSION=187-repo-mode-to-retrieve-application-recipe ### TODO : Specify you template repo ROOT without training slash -APP_REPO_URL=lab.libreho.st/libre.sh/compose +APP_REPO_URL="lab.libreho.st/libre.sh/compose" ### TODO : change to your domain vendor ( ovh , online, ) DOMAIN_SERVER=namecheap @@ -55,17 +55,17 @@ echo "-------- Welcome to libre.sh $LIBRE_VERSION installer" echo "-------- setting up system variables" -echo "APP_REPO_URL=${APP_REPO_URL}" >> /etc/environnement +echo "APP_REPO_URL=${APP_REPO_URL}" >> /etc/environment -echo "LIBRE_VERSION=${LIBRE_VERSION}" >> /etc/environnement +echo "LIBRE_VERSION=${LIBRE_VERSION}" >> /etc/environment -echo "MAIL_USER=${MAIL_USER}" >> /etc/environnement +echo "MAIL_USER=${MAIL_USER}" >> /etc/environment -echo "MAIL_PASS=${MAIL_PASS}" >> /etc/environnement +echo "MAIL_PASS=${MAIL_PASS}" >> /etc/environment -echo "MAIL_HOST=${MAIL_HOST}" >> /etc/environnement +echo "MAIL_HOST=${MAIL_HOST}" >> /etc/environment -echo "MAIL_PORT=${MAIL_PORT}" >> /etc/environnement +echo "MAIL_PORT=${MAIL_PORT}" >> /etc/environment # STEP Install Docker @@ -112,3 +112,5 @@ cat > /etc/profile.d/libre.sh < Date: Wed, 25 Mar 2020 17:03:00 +0100 Subject: [PATCH 4/5] Fix typo , repo mode works now --- utils/provision | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/provision b/utils/provision index deee495..29293f9 100755 --- a/utils/provision +++ b/utils/provision @@ -103,9 +103,10 @@ function buy_domain_name () { } function application () { + #We check if a APP_REPO_URL was specified - if[ -z ${APP_REPO_URL:-} ]; then + if [ -z ${APP_REPO_URL:-} ]; then warning "NO repo URL specified, using argument as full URL" git_url=https://${arg_a}.git else -- GitLab From 41d64fb51339089b3f2ab15b16fc9f7a6e696bf0 Mon Sep 17 00:00:00 2001 From: Michel Memeteau Date: Wed, 25 Mar 2020 17:10:53 +0100 Subject: [PATCH 5/5] sourcing values.env file --- install.linux.sh | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/install.linux.sh b/install.linux.sh index f2ba021..8b5051d 100755 --- a/install.linux.sh +++ b/install.linux.sh @@ -2,15 +2,16 @@ #Current version of libre.sh to be installed LIBRE_VERSION=187-repo-mode-to-retrieve-application-recipe -# System env vars +# System env vars : can be overrided by a values.env file next to this install file -## domain handling -### TODO : Specify you template repo ROOT without training slash +### CONFIG : Specify you template repo ROOT without training slash (Optional) or comment if you want to supply full url for apps APP_REPO_URL="lab.libreho.st/libre.sh/compose" -### TODO : change to your domain vendor ( ovh , online, ) +## domain handling + +### CONFIG : change to your domain vendor ( namecheap, ovh , scaleway, ) DOMAIN_SERVER=namecheap ### Namecheap specific @@ -18,11 +19,18 @@ NAMECHEAP_URL="namecheap.com" NAMECHEAP_API_USER="pierreo" NAMECHEAP_API_KEY= -### ovh specific +### ovh specific (WIP) OVH_URL="eu.api.ovh.com" OVH_API_USER="" OVH_API_KEY= + +### Scaleway specific (WIP) +SCALEWAY_URL="" +SCALEWAY_API_USER="" +SCALEWAY_API_KEY= + + ### TODO : change your settings IP="curl -s http://icanhazip.com/" FirstName="Pierre" @@ -37,7 +45,7 @@ CountryCode="PT" ## Backup BACKUP_DESTINATION=root@xxxxx:port -### TODO : Change your mail settings. +### CONFIG : Change your mail settings. ## SMTP MAIL_USER= MAIL_PASS= @@ -48,6 +56,10 @@ MAIL_PORT=587 echo "-------- Welcome to libre.sh $LIBRE_VERSION installer" +echo "---- sourcing local values.env file if present" + +source values.env + # STEP add kernel parameter -- GitLab