Setup Cronicle

# download cronicle sources
VERSION="$(curl -Ls https://api.github.com/repos/jhuckaby/Cronicle/tags | jq -r '.[0].name')"
curl -L "https://github.com/jhuckaby/Cronicle/archive/${VERSION}.tar.gz" -o ./cronicle.tgz

# extract sources
mkdir /opt/cronicle
tar -xf ./cronicle.tgz --strip-components 1 -C /opt/cronicle

# install dependencies
cd /opt/cronicle
npm install
node bin/build.js dist

# configure
cp /opt/cronicle/sample_conf/config.json /opt/cronicle/conf/config.json
jq --arg secret "$(dd if=/dev/urandom count=1 bs=16 status=none | xxd -p)" '.secret_key = $secret' < /opt/cronicle/conf/config.json | sponge /opt/cronicle/conf/config.json

# setup
/opt/cronicle/bin/control.sh setup

# run
/opt/cronicle/bin/control.sh start