#!/bin/bash set -e if [ -z "$HOME" ]; then HOME=/root/ fi SREC_DIR=$HOME/.sessionrecord mkdir -p $SREC_DIR/data if [ -f $SREC_DIR/config ] then echo -e "Loading configuration from $SREC_DIR/config\n" else echo "*********************" echo "No configuration found. Creating new configuration file at $SREC_DIR/config" echo "*********************" curl -o $SREC_DIR/config https://uxlens.com/self-host/config-template fi source $SREC_DIR/config # Default configuration if [ -z "$RECORDER_DATA" ]; then RECORDER_DATA=$SREC_DIR/data mkdir -p $RECORDER_DATA fi [[ -z $VERSION ]] && VERSION=0.8.7 IMAGE_NAME="recorder-release:$VERSION" docker pull docker.sessionrecord.com/$IMAGE_NAME docker stop recorder || true docker rm recorder || true docker run -d --name recorder \ --cap-add sys_nice \ -v $RECORDER_DATA:/home/jarvis/data \ -v $SREC_DIR:/home/jarvis/host \ -e "SITE_URL=$SITE_URL" \ -e "SMTP_URL=$SMTP_URL" \ -e "APP_SECRET=$APP_SECRET" \ -e "RECORDER_CSD_MAX_HEAP_SIZE=$RECORDER_CSD_MAX_HEAP_SIZE" \ -e "RECORDER_ES_MAX_HEAP_SIZE=$RECORDER_ES_MAX_HEAP_SIZE" \ -p 80:80 \ -p 443:443 \ docker.sessionrecord.com/$IMAGE_NAME