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.

51 lines
907 B

  1. #!/bin/bash
  2. RSTED_USER=${RSTED_USER:-rsted}
  3. RSTED_GROUP=${RSTED_GROUP:-rsted}
  4. ##
  5. ## Installation code
  6. ##
  7. source /srv/virtualenv/default/bin/activate
  8. set -eux # -x for verbose logging to juju debug-log
  9. mkdir -p /opt/apps
  10. (
  11. cd /opt/apps &&
  12. git clone https://github.com/anru/rsted.git &&
  13. adduser --system --home=/home/"$RSTED_USER" --group "$RSTED_GROUP" &&
  14. #chown "$RSTED_USER":"$RSTED_GROUP" /opt/apps/rsted -R &&
  15. ## -H is to force HOME environment variable to change to etherpad one.
  16. cd rsted &&
  17. pip install -r pip-requirements.txt
  18. )
  19. ##
  20. ## Config file
  21. ##
  22. config_file="/etc/rsted/settings.py"
  23. [ -e "$config_file" ] || cp "src/etc/rsted/settings.py" "$config_file"
  24. ln -sf "$config_file" /opt/apps/rsted/settings_local.py
  25. ##
  26. ## Startup file
  27. ##
  28. cp src/etc/init/rsted.conf /etc/init/rsted.conf
  29. ##
  30. ## Logrotate
  31. ##
  32. cp src/etc/logrotate.d/rsted /etc/logrotate.d/rsted