Skip to content
Commits on Source (15)
# 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
......
# 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)
......@@ -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)
......@@ -91,15 +91,30 @@ libre start
## Applications
### List of supported applications
| Application | Latest Version | Comments |
|--------------|---------------------------|------------|
| 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 |
### Installation
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:
......
#!/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
......@@ -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
......@@ -145,3 +160,4 @@ EOF
chmod 644 /etc/profile.d/libre.sh
bash /etc/profile.d/libre.sh
#TODO : reload profile to use libre right away
#!/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
[Service]
Type=oneshot
ExecStart=/libre.sh/utils/mail-mon.sh
[Unit]
Description=Run mail mon hourly and on boot
[Timer]
OnBootSec=15min
OnUnitActiveSec=1h
[Install]
WantedBy=timers.target
[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
......@@ -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]
......
......@@ -37,6 +37,7 @@ function show_usage {
echo " - update: to update the current folder."
echo " - stats: show docker stats with names."
echo " - delete <domainname>: remove a libre.sh service."
echo " - getsize <domainname>: give you the size of the installed application"
exit 1
}
......@@ -100,6 +101,13 @@ 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
echo $(du -hs /data/domains/${2}) |cut -d ' ' -f 1;;
*)
show_usage
esac
#!/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
#!/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