forked from 0k/0k-charms
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
969 B
52 lines
969 B
#!/bin/bash
|
|
|
|
|
|
RSTED_USER=${RSTED_USER:-rsted}
|
|
RSTED_GROUP=${RSTED_GROUP:-rsted}
|
|
|
|
##
|
|
## Installation code
|
|
##
|
|
|
|
source /srv/virtualenv/default/bin/activate
|
|
set -eux # -x for verbose logging to juju debug-log
|
|
|
|
|
|
mkdir -p /opt/apps
|
|
(
|
|
cd /opt/apps &&
|
|
git clone https://github.com/vaab/rsted &&
|
|
adduser --system --home=/home/"$RSTED_USER" --group "$RSTED_GROUP" &&
|
|
#chown "$RSTED_USER":"$RSTED_GROUP" /opt/apps/rsted -R &&
|
|
## -H is to force HOME environment variable to change to etherpad one.
|
|
mkdir /var/run/rsted && chown "$RSTED_USER" /var/run/rsted &&
|
|
cd rsted &&
|
|
pip install -r pip-requirements.txt
|
|
)
|
|
|
|
|
|
##
|
|
## Config file
|
|
##
|
|
|
|
config_file="/etc/rsted/settings.py"
|
|
|
|
[ -e "$config_file" ] || cp "src/etc/rsted/settings.py" "$config_file"
|
|
|
|
ln -sf "$config_file" /opt/apps/rsted/settings_local.py
|
|
|
|
|
|
##
|
|
## Startup file
|
|
##
|
|
|
|
cp src/etc/init/rsted.conf /etc/init/rsted.conf
|
|
|
|
##
|
|
## Logrotate
|
|
##
|
|
|
|
cp src/etc/logrotate.d/rsted /etc/logrotate.d/rsted
|
|
|
|
|
|
|