|
@ -0,0 +1,51 @@ |
|
|
|
|
|
#!/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/anru/rsted.git && |
|
|
|
|
|
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. |
|
|
|
|
|
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 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|