From ce9ff10f672c3ba9327db1cf1b907b7e1ad2574a Mon Sep 17 00:00:00 2001 From: Xavier Logerais Date: Sun, 11 Feb 2018 16:09:27 +0100 Subject: [PATCH] Added scripts --- README.md | 2 +- install-gogs.bash | 58 +++++++++++ install-pydio.bash | 115 ++++++++++++++++++++++ install-rainloop.bash | 100 +++++++++++++++++++ install-roundcubemail.bash | 120 +++++++++++++++++++++++ install-shinken.bash | 13 +++ install-tick.bash | 14 +++ install-wallabag.bash | 101 +++++++++++++++++++ install-wordpress-multisite.bash | 160 +++++++++++++++++++++++++++++++ install-wordpress.bash | 157 ++++++++++++++++++++++++++++++ install-xpra.bash | 17 ++++ 11 files changed, 856 insertions(+), 1 deletion(-) create mode 100755 install-gogs.bash create mode 100755 install-pydio.bash create mode 100755 install-rainloop.bash create mode 100755 install-roundcubemail.bash create mode 100755 install-shinken.bash create mode 100755 install-tick.bash create mode 100755 install-wallabag.bash create mode 100755 install-wordpress-multisite.bash create mode 100755 install-wordpress.bash create mode 100755 install-xpra.bash diff --git a/README.md b/README.md index 7fe35eb..43b11d6 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ # lxd-selfhosting-scripts -Provisionning bash scripts collection used to deploy some self hosted applications in LXD containers \ No newline at end of file +Provisionning bash scripts collection used to deploy some self hosted applications in LXD containers diff --git a/install-gogs.bash b/install-gogs.bash new file mode 100755 index 0000000..13b82bf --- /dev/null +++ b/install-gogs.bash @@ -0,0 +1,58 @@ +#!/bin/bash + +CONTAINER=$1 + +APPNAME="gogs" +APPURL="wget https://cdn.gogs.io/0.11.4/linux_amd64.tar.gz" + +DOMAIN="logerais.com" +TIMEZONE="Europe/Paris" + +if [ -z "$CONTAINER" ]; then echo "Missing parameter"; exit 1 ; fi + +# Set container timezone +lxc file edit "$CONTAINER/etc/timezone" <<< "${TIMEZONE}" + +# Install packages +lxc exec $CONTAINER -- apt update + +lxc exec $CONTAINER -- apt install -y curl wget git + +lxc exec $CONTAINER -- apt install -y nginx +lxc exec $CONTAINER -- apt install -y postgresql + +lxc exec $CONTAINER -- su --login postgres <<< "createuser ${APPNAME}" +lxc exec $CONTAINER -- su --login postgres <<< "createdb --owner=${APPNAME} ${APPNAME}" +lxc exec $CONTAINER -- su --login postgres --shell /usr/bin/psql <<< "ALTER USER \"${APPNAME}\" WITH PASSWORD \'${APPNAME}\';" + +lxc exec $CONTAINER -- useradd -m --shell /bin/bash ${APPNAME} +lxc exec $CONTAINER -- usermod --groups sudo --append ${APPNAME} + +lxc exec $CONTAINER -- su --login ${APPNAME} --command "wget ${APPURL}" +lxc exec $CONTAINER -- su --login ${APPNAME} --command "tar vxzf linux_amd64.tar.gz" + +lxc file edit $CONTAINER/etc/systemd/system/${APPNAME}.service <