From 51329bb84f9496853faa8ce51c3cf50a9c2791cf Mon Sep 17 00:00:00 2001 From: Benzidane Date: Thu, 9 Sep 2021 10:59:37 +0200 Subject: [PATCH 01/17] check docker-ce installed --- install.linux.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/install.linux.sh b/install.linux.sh index d48d8d3..d9ef393 100755 --- a/install.linux.sh +++ b/install.linux.sh @@ -88,13 +88,23 @@ echo "ADMIN_EMAIL=${ADMIN_EMAIL}" >> /etc/environment # STEP Install Docker -echo "-------- Install latest docker " -# TODO : Fix a version for docker ? +name="docker-ce" +# TODO : Fix a version for docker ? + dpkg -s $name &> /dev/null -curl -fsSL https://get.docker.com -o get-docker.sh -sh get-docker.sh + if [ $? -ne 0 ] + then + echo "$name not installed" + apt-get update + curl -fsSL https://get.docker.com -o get-docker.sh + sh get-docker.sh + echo "-------- Latest docker installed " + + else + echo "$name already installed" + fi # STEP "install docker-compose" echo "-------- Install latest docker-compose " -- GitLab From d5316710977041dcf1918806443397e49def3ae9 Mon Sep 17 00:00:00 2001 From: Michel Memeteau Date: Thu, 9 Sep 2021 15:25:17 +0200 Subject: [PATCH 02/17] Update install.linux.sh --- install.linux.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install.linux.sh b/install.linux.sh index d9ef393..6c678f0 100755 --- a/install.linux.sh +++ b/install.linux.sh @@ -9,6 +9,9 @@ LIBRE_VERSION=release/1.2 APP_REPO_URL="lab.libreho.st/libre.sh/compose" + + + ## domain handling ### CONFIG : change to your domain vendor ( namecheap, ovh , scaleway, ) -- GitLab From cbb834711128ed795c2e20ebad7fc2953033931d Mon Sep 17 00:00:00 2001 From: freechelmi Date: Fri, 3 Apr 2020 19:37:25 +0200 Subject: [PATCH 03/17] Update doc for 1.2 --- README.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 531872f..5cd3c83 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# libre.sh Version 1.1 +# libre.sh Version 1.2 [![Backers on Open Collective](https://opencollective.com/libresh/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/libresh/sponsors/badge.svg)](#sponsors) @@ -96,10 +96,17 @@ libre start To install application `wordpress` on `example.org`, first make point example.org to your server IP, and then, just run: ``` -libre provision -a github.com/indiehosters/wordpress -u example.org -s +libre provision -a wordpress -u example.org -s ``` -Run `libre provision` for more details on the capabilities of the script. +- -u [arg] URL to process. Required. +- -a [arg] Application to install. (wordpress in REPO_MODE) +- -t [arg] Checkout a specific tag or branch from the application repo. default to master +- -e [arg] Specify the email of the application admin +- -s Start the application right away. +- -b Buys the associated domain name. +- -i Configure OpenDKIM. +- -c Configures DNS if possible. ## To debug a module or an application: -- GitLab From 9d64e7b5de6bf85c6d86ae7e8ec94c29ac29e4c1 Mon Sep 17 00:00:00 2001 From: Michel Memeteau Date: Fri, 10 Apr 2020 17:28:19 +0200 Subject: [PATCH 04/17] Manual update of CHANGELOG.md for 1.2 --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 548f582..41d9786 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# 1.2.0 + +* Add app admin email as argument in provision #189 +* Handle git branches when provisioning #174 +* REPO mode to retrieve application recipe #187 + + # 0.3.0 * adds automation script for user provisionning -- GitLab From 6687e3e443861ac1f49fe9b38944a437f1f5c412 Mon Sep 17 00:00:00 2001 From: Michel Memeteau Date: Mon, 13 Apr 2020 22:33:37 +0200 Subject: [PATCH 05/17] Update install.linux.sh for 1.2 --- install.linux.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.linux.sh b/install.linux.sh index 6c678f0..15e44de 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=release/1.2 +LIBRE_VERSION=1.2 # System env vars : can be overrided by a values.env file next to this install file -- GitLab From ec91aa8bff280a217428694cae53471299831fee Mon Sep 17 00:00:00 2001 From: Michel Memeteau Date: Tue, 26 May 2020 14:56:06 +0200 Subject: [PATCH 06/17] Move from Riot to Indie RC chat --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5cd3c83..3e9094e 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ It contains 2 [unit-files](https://lab.libreho.st/libre.sh/compose.libre.sh/tree You can use the following channels to request community support: - [mailinglist/forum](https://forum.indie.host/t/about-the-libre-sh-category/71) - - [chat](https://riot.allmende.io/#/room/#libre.sh:matrix.allmende.io) + - [chat](https://chat.indie.host/channel/libre.sh) For paid support, just send an inquiry to support@libre.sh. @@ -72,8 +72,8 @@ All of this is hosted by libre.sh :) Here is a list of modules supported: - https proxy: - - [HAProxy](https://lab.libreho.st/libre.sh/compose/haproxy) - - [Nginx](https://lab.libreho.st/libre.sh/compose/nginx) + - [HAProxy](https://lab.libreho.st/libre.sh/compose/haproxy) + - [Nginx](https://lab.libreho.st/libre.sh/compose/nginx) - [monitoring](https://lab.libreho.st/libre.sh/compose/monitoring) - [git-puller](https://lab.libreho.st/libre.sh/compose/git-puller) -- GitLab From c61814fd43066746d247322ab3f0b087ede4864c Mon Sep 17 00:00:00 2001 From: Pierre Ozoux Date: Tue, 11 Aug 2020 13:21:54 +0200 Subject: [PATCH 07/17] Adds a basic mail monitoring. --- unit-files/mail-mon.service | 3 +++ unit-files/mail-mon.timer | 9 +++++++++ utils/mail-mon.sh | 3 +++ 3 files changed, 15 insertions(+) create mode 100644 unit-files/mail-mon.service create mode 100644 unit-files/mail-mon.timer create mode 100644 utils/mail-mon.sh diff --git a/unit-files/mail-mon.service b/unit-files/mail-mon.service new file mode 100644 index 0000000..9c61a3d --- /dev/null +++ b/unit-files/mail-mon.service @@ -0,0 +1,3 @@ +[Service] +Type=oneshot +ExecStart=/libre.sh/utils/mail-mon.sh diff --git a/unit-files/mail-mon.timer b/unit-files/mail-mon.timer new file mode 100644 index 0000000..2f1368d --- /dev/null +++ b/unit-files/mail-mon.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Run mail mon hourly and on boot + +[Timer] +OnBootSec=15min +OnUnitActiveSec=1h + +[Install] +WantedBy=timers.target diff --git a/utils/mail-mon.sh b/utils/mail-mon.sh new file mode 100644 index 0000000..7ff0b1a --- /dev/null +++ b/utils/mail-mon.sh @@ -0,0 +1,3 @@ +#!/bin/bash -eux + +/usr/bin/journalctl --since '1 hour ago' | grep postfix/cleanup | grep "from=" | sed -n 's/.*from=<\(.*\)> to=<\(.*\)> pro.*/\1/p' | sort |uniq -c | sort | awk 'BEGIN {FS=" ";} {printf "mail_sent{domain_name=\"%s\"} %s\n", $2, $1}' > /system/metrics-collection/textfiles/mail.prom -- GitLab From 6ec6b9330af4002357726a6a47d3221f33e9fbf1 Mon Sep 17 00:00:00 2001 From: Pierre Ozoux Date: Tue, 11 Aug 2020 13:23:05 +0200 Subject: [PATCH 08/17] Adds swap service. --- unit-files/swapon.service | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 unit-files/swapon.service diff --git a/unit-files/swapon.service b/unit-files/swapon.service new file mode 100644 index 0000000..70714dd --- /dev/null +++ b/unit-files/swapon.service @@ -0,0 +1,13 @@ +[Unit] +Description=Turn on swap +[Service] +Type=oneshot +RemainAfterExit=true +ExecStartPre=-/bin/bash -euxc ' \ + fallocate -l 8192m /swap &&\ + chmod 600 /swap &&\ + mkswap /swap' +ExecStart=/sbin/swapon /swap +ExecStop=/sbin/swapoff /swap +[Install] +WantedBy=local.target -- GitLab From 972c68fdb1d23f3393b8caa2a599bb5245bc2d63 Mon Sep 17 00:00:00 2001 From: Pierre Ozoux Date: Tue, 11 Aug 2020 13:29:45 +0200 Subject: [PATCH 09/17] Adds a script to test domains. --- utils/test-domain.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 utils/test-domain.sh diff --git a/utils/test-domain.sh b/utils/test-domain.sh new file mode 100644 index 0000000..223a5f3 --- /dev/null +++ b/utils/test-domain.sh @@ -0,0 +1,10 @@ +#!/bin/bash +cd /data/domains +my_ip=`curl http://ipv4.icanhazip.com/` +echo "My IP is $my_ip" +for domain in `ls .`; do + domain_ip=`host ${domain} | awk '/has address/ { print $4 }'` + if [[ "${domain_ip}" != "${my_ip}" ]]; then + echo "$domain has this IP: $domain_ip" + fi +done -- GitLab From 78b2e0d34bb8557817fb14190933451ee8c36dcf Mon Sep 17 00:00:00 2001 From: Pierre Ozoux Date: Thu, 19 Nov 2020 18:38:58 +0100 Subject: [PATCH 10/17] Adds LETSENCRYPT_HOST --- unit-files/u@.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unit-files/u@.service b/unit-files/u@.service index bead8bf..0d5f119 100644 --- a/unit-files/u@.service +++ b/unit-files/u@.service @@ -16,7 +16,7 @@ EnvironmentFile=-/data/domains/%i/env Environment=HOSTNAME=%H WorkingDirectory=/data/domains/%i/ ExecStartPre=-/opt/bin/docker-compose rm -f -ExecStart=/bin/bash -euxc "VIRTUAL_HOST=%i,www.%i /opt/bin/docker-compose up" +ExecStart=/bin/bash -euxc "LETSENCRYPT_HOST=%i VIRTUAL_HOST=%i,www.%i /opt/bin/docker-compose up" ExecStop=/opt/bin/docker-compose stop [Install] -- GitLab From 6dc3afb3c741d42db9ca0f8754ca150e63829f60 Mon Sep 17 00:00:00 2001 From: Michel Memeteau Date: Wed, 16 Dec 2020 14:32:10 +0100 Subject: [PATCH 11/17] Update install.linux.sh --- install.linux.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/install.linux.sh b/install.linux.sh index 15e44de..9067923 100755 --- a/install.linux.sh +++ b/install.linux.sh @@ -145,3 +145,5 @@ EOF chmod 644 /etc/profile.d/libre.sh bash /etc/profile.d/libre.sh +#TODO : reload profile to use libre right away + -- GitLab From 81d35c24c77c2a2013000f7eb5686431582b93f3 Mon Sep 17 00:00:00 2001 From: Benzidane Date: Thu, 9 Sep 2021 15:19:06 +0200 Subject: [PATCH 12/17] add get_size --- utils/libre | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/utils/libre b/utils/libre index 2399fa0..2d0e400 100755 --- a/utils/libre +++ b/utils/libre @@ -37,6 +37,7 @@ function show_usage { echo " - update: to update the current folder." echo " - stats: show docker stats with names." echo " - delete : remove a libre.sh service." + echo " - getsize : give you the size of the installed application" exit 1 } @@ -100,6 +101,16 @@ case "$1" in rm /system/haproxy/haproxy/certs/${2}.pem fi fi;; + getsize) + # check the current size + if [ $# -ne 2 ]; then + echo "getsize requires a domainname argument." + exit 1 + fi + +SIZE="`du -hs ${2}`" +#SIZE=${SIZE%G*} +echo $(du -hs ${2}) |cut -d ' ' -f 1;; *) show_usage esac -- GitLab From eb2a6bb153166a28352d59188befdf922abbb23c Mon Sep 17 00:00:00 2001 From: Michel Memeteau Date: Thu, 9 Sep 2021 16:57:07 +0200 Subject: [PATCH 13/17] Use /data/domains root dir for domains --- utils/libre | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/utils/libre b/utils/libre index 2d0e400..3628281 100755 --- a/utils/libre +++ b/utils/libre @@ -101,16 +101,13 @@ case "$1" in rm /system/haproxy/haproxy/certs/${2}.pem fi fi;; - getsize) + getsize) # check the current size if [ $# -ne 2 ]; then echo "getsize requires a domainname argument." exit 1 fi - -SIZE="`du -hs ${2}`" -#SIZE=${SIZE%G*} -echo $(du -hs ${2}) |cut -d ' ' -f 1;; + echo $(du -hs /data/domains/${2}) |cut -d ' ' -f 1;; *) show_usage esac -- GitLab From 57c2d4388f7eb7068939af6933f2cee56990f1e0 Mon Sep 17 00:00:00 2001 From: Pierre Ozoux Date: Fri, 24 Sep 2021 18:47:34 +0200 Subject: [PATCH 14/17] Adds migration to update all only-office. --- migrations/update-oo.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 migrations/update-oo.sh diff --git a/migrations/update-oo.sh b/migrations/update-oo.sh new file mode 100644 index 0000000..54c74c7 --- /dev/null +++ b/migrations/update-oo.sh @@ -0,0 +1,17 @@ +#!/bin/bash -eux + +# Verify they are all in sync with git, if not, print the domain name. +for oo in `ls -d ./oo-*`;do + cd $oo + if ! git diff --exit-code --quiet; then + echo $oo + fi + cd .. +done + +# Update all oo +for oo in `ls -d ./oo-*`;do + cd $oo + libre update + cd .. +done -- GitLab From 3dd91ae8cf65c7a58dd5f1f856d0d943baef7871 Mon Sep 17 00:00:00 2001 From: Michel Memeteau Date: Fri, 9 Sep 2022 09:07:50 +0000 Subject: [PATCH 15/17] Add a list of supported apps and their latest version --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 3e9094e..f52f3c3 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,14 @@ libre start ## Applications +### List of supported applications + +| Application | Latest Version | Comments | +|--------------|---------------------------|------------| +| wordpress | 5.9-fpm | Includes the support of SMTP email though libresh variables | +| dolibarr | 15.0.3 | need manual deletion of the install.lock to upgrade | + + ### Installation To install application `wordpress` on `example.org`, first make point example.org to your server IP, and then, just run: -- GitLab From c04a57c5f010657c482aaa66b9e1910d1c43a971 Mon Sep 17 00:00:00 2001 From: Michel Memeteau Date: Fri, 9 Sep 2022 09:09:26 +0000 Subject: [PATCH 16/17] Show real tag for wordpress --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f52f3c3..7205058 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ libre start | Application | Latest Version | Comments | |--------------|---------------------------|------------| -| wordpress | 5.9-fpm | Includes the support of SMTP email though libresh variables | +| wordpress | 5.9 | Includes the support of SMTP email though libresh variables | | dolibarr | 15.0.3 | need manual deletion of the install.lock to upgrade | -- GitLab From aa3d978b5fa010470d0cf9a57847f02881c401d3 Mon Sep 17 00:00:00 2001 From: COURCELLE Date: Wed, 21 Jun 2023 11:53:36 +0200 Subject: [PATCH 17/17] fix libresh install & add git install --- install.linux.sh | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/install.linux.sh b/install.linux.sh index 9067923..a684659 100755 --- a/install.linux.sh +++ b/install.linux.sh @@ -119,13 +119,28 @@ dockerComposeVersion=$(curl -s https://api.github.com/repos/docker/compose/relea curl -L https://github.com/docker/compose/releases/download/$dockerComposeVersion/docker-compose-`uname -s`-`uname -m` > /opt/bin/docker-compose &&\ chmod +x /opt/bin/docker-compose - +# STEP "install git" + +echo "-------- Install git" + +distro=$( ( lsb_release -ds || cat /etc/*release || uname -om ) 2>/dev/null | head -n1 | cut -d " " -f1) +if [[ "$distro" == "Ubuntu" || "$distro" == "Debian" ]]; then +sudo apt-get install -y git +elif [[ "$distro" == "CentOS" || "$distro" == "AlmaLinux" || "$distro" == "Rocky" || "$distro" == "Fedora" ]]; then +yum install -y git +elif [[ "$distro" == "openSUSE" ]]; then +zypper install git +elif [[ "$distro" == "Arch" ]]; then +pacman -S git +elif [[ "$distro" == "Mageia" ]]; then +urpmi git +fi # STEP install Libre.sh echo "-------- installing libre.sh" -git clone https://lab.libreho.st/libre.sh/compose.libre.sh -b $LIBRE_VERSION /libre.sh +git clone https://lab.libreho.st/libre.sh/compose.libre.sh.git /libre.sh mkdir -p /{data,system} mkdir -p /data/trash cp /libre.sh/unit-files/* /etc/systemd/system && systemctl daemon-reload @@ -146,4 +161,3 @@ chmod 644 /etc/profile.d/libre.sh bash /etc/profile.d/libre.sh #TODO : reload profile to use libre right away - -- GitLab