Skip to content
install.linux.sh 2.6 KiB
Newer Older
#Current version of libre.sh to be installed 
Michel Memeteau's avatar
Michel Memeteau committed
LIBRE_VERSION=187-repo-mode-to-retrieve-application-recipe
# System env vars 

## domain handling 

### TODO : Specify you template repo ROOT without training slash
APP_REPO_URL=lab.libreho.st/libre.sh/compose
Michel Memeteau's avatar
Michel Memeteau committed

### TODO : change to your domain vendor ( ovh , online, )
DOMAIN_SERVER=namecheap

###  Namecheap specific
NAMECHEAP_URL="namecheap.com"
NAMECHEAP_API_USER="pierreo"
NAMECHEAP_API_KEY=

### ovh specific 
OVH_URL="eu.api.ovh.com"
OVH_API_USER=""
OVH_API_KEY=

Michel Memeteau's avatar
Michel Memeteau committed
### TODO :  change your settings 
IP="curl -s http://icanhazip.com/"
FirstName="Pierre"
LastName="Ozoux"
Address=""
PostalCode=""
Country="Portugal"
Phone="+351.967184553"
EmailAddress="pierre@ozoux.net"
City="Lisbon"
CountryCode="PT"
## Backup
BACKUP_DESTINATION=root@xxxxx:port
Michel Memeteau's avatar
Michel Memeteau committed

### TODO : Change your mail settings.
## SMTP
MAIL_USER=
MAIL_PASS=
MAIL_HOST=mail.indie.host
MAIL_PORT=587

Michel Memeteau's avatar
Michel Memeteau committed
### TODO : source a setting file is present to override defaults
Michel Memeteau's avatar
Michel Memeteau committed
echo "-------- Welcome to libre.sh $LIBRE_VERSION installer"
Michel Memeteau's avatar
Michel Memeteau committed
# STEP add kernel parameter
Michel Memeteau's avatar
Michel Memeteau committed
# STEP Define environnement

Michel Memeteau's avatar
Michel Memeteau committed
echo "-------- setting up system variables"

Michel Memeteau's avatar
Michel Memeteau committed
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

Michel Memeteau's avatar
Michel Memeteau committed

# STEP Install Docker 

echo "-------- Install latest docker "
# TODO : Fix a version for docker  ? 


curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh 
Michel Memeteau's avatar
Michel Memeteau committed
# STEP "install docker-compose" 
Michel Memeteau's avatar
Michel Memeteau committed
echo "-------- Install latest docker-compose "

Michel Memeteau's avatar
Michel Memeteau committed
# TODO : Fix a version for docker compose ? 

mkdir -p /opt/bin &&\
dockerComposeVersion=$(curl -s https://api.github.com/repos/docker/compose/releases/latest|grep tag_name|cut -d'"' -f4) &&\
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
Michel Memeteau's avatar
Michel Memeteau committed



# STEP install Libre.sh
Michel Memeteau's avatar
Michel Memeteau committed
echo "-------- installing libre.sh" 
git clone https://lab.libreho.st/libre.sh/compose.libre.sh -b $LIBRE_VERSION /libre.sh 
mkdir -p /{data,system}
Michel Memeteau's avatar
Michel Memeteau committed
mkdir -p /data/trash 
cp /libre.sh/unit-files/* /etc/systemd/system && systemctl daemon-reload 
systemctl enable web-net.service 
systemctl start web-net.service 
mkdir -p /opt/bin 
cp /libre.sh/utils/* /opt/bin/


Michel Memeteau's avatar
Michel Memeteau committed
# STEP add /opt/bin path
Michel Memeteau's avatar
Michel Memeteau committed
echo "-------- updating PATH" 
cat > /etc/profile.d/libre.sh <<EOF
export PATH=$PATH:/opt/bin
EOF
Michel Memeteau's avatar
Michel Memeteau committed
chmod 644 /etc/profile.d/libre.sh