diff --git a/install.linux.sh b/install.linux.sh index 24cce8ad5bd321d031a0634d54c2b37874114242..8b5051d9d18db1c929c9efb6db9386411822c6c2 100755 --- a/install.linux.sh +++ b/install.linux.sh @@ -1,16 +1,17 @@ #!/bin/bash #Current version of libre.sh to be installed -LIBRE_VERSION=1.1 -# System env vars +LIBRE_VERSION=187-repo-mode-to-retrieve-application-recipe +# System env vars : can be overrided by a values.env file next to this install file -## domain handling -### TODO : Specify you template repo ROOT +### 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" -TEMPLATES_ROOT=lab.libreho.st/libre.sh/compose/ +## domain handling -### TODO : change to your domain vendor ( ovh , online, ) +### CONFIG : change to your domain vendor ( namecheap, ovh , scaleway, ) DOMAIN_SERVER=namecheap ### Namecheap specific @@ -18,12 +19,19 @@ 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" LastName="Ozoux" @@ -36,16 +44,22 @@ City="Lisbon" CountryCode="PT" ## Backup BACKUP_DESTINATION=root@xxxxx:port + +### CONFIG : 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" +echo "---- sourcing local values.env file if present" + +source values.env + # STEP add kernel parameter @@ -53,6 +67,18 @@ echo "-------- Welcome to libre.sh $LIBRE_VERSION installer" echo "-------- setting up system variables" +echo "APP_REPO_URL=${APP_REPO_URL}" >> /etc/environment + +echo "LIBRE_VERSION=${LIBRE_VERSION}" >> /etc/environment + +echo "MAIL_USER=${MAIL_USER}" >> /etc/environment + +echo "MAIL_PASS=${MAIL_PASS}" >> /etc/environment + +echo "MAIL_HOST=${MAIL_HOST}" >> /etc/environment + +echo "MAIL_PORT=${MAIL_PORT}" >> /etc/environment + # STEP Install Docker @@ -98,3 +124,5 @@ cat > /etc/profile.d/libre.sh <<EOF export PATH=$PATH:/opt/bin EOF chmod 644 /etc/profile.d/libre.sh +bash /etc/profile.d/libre.sh + diff --git a/utils/provision b/utils/provision index eb9d772f1de57e4a212e85df052fc8544e0f7345..29293f938f1305764a8c06124f87203198292a7b 100755 --- a/utils/provision +++ b/utils/provision @@ -103,7 +103,18 @@ 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}