#!/bin/sh set -e echo "Box bootstrapping" BASEDIR=/home/yellowtent/box USER=yellowtent # we get the appstore origin from the caller which is baked into the image APPSTORE_ORIGIN=$1 echo "==== Setup /etc/yellowtent ====" mkdir -p /etc/yellowtent echo "==== Provision box with credentials ====" cat > /etc/yellowtent.json < /etc/sudoers.d/yellowtent < nginx/applications/admin.conf # TODO until I find a way to have a more dynamic nginx config # this will break if we ever do an update cp nginx/certificates.conf_deployed nginx/certificates.conf chown $USER:$USER -R /home/$USER/.yellowtent/ echo "==== Setup supervisord ====" supervisorctl shutdown || echo "supervisord not running" mv /etc/supervisor/ /etc/supervisor_save || echo "/etc/supervisor already moved" ln -sf $BASEDIR/supervisor /etc/supervisor echo "export NGINX_ROOT=$BASEDIR" >> /etc/default/supervisor sed -i -e "s/autostart=false/autostart=true/" /etc/supervisor/conf.d/box.conf /etc/init.d/supervisor start