###
# VIRL2 configuration
#
#  This file is part of VIRL2
#  Cisco (c) 2019
#
# and is installed into /etc/default/virl2
###

# if this is set, a controller will be started on this machine
RUN_CONTROLLER=1

# TODO: figure out if we want this via DNS instead of hosts
# At the moment, this MUST be an IP address that goes into
# /etc/hosts and is referenced in various places as
# as the name 'virl-controller'.
# see /usr/local/bin/virl2-configure.sh for additional
# detail!
VIRL_CONTROLLER="::1"

# this is used for various directory names
# there are some reference in the RPM to this
# so careful when changing this.
PROD_NAME=virl2

# this is the username we're using to run the system
USER_NAME=$PROD_NAME

# this is the base dir where the system lives
BASE_DIR=/var/local/$PROD_NAME

# this is where the controller state is stored
CFG_DIR=$BASE_DIR/config

# this is where nginx uploads images into
DROP_DIR=$BASE_DIR/dropfolder

# this is where the pid files are stored
RUN_DIR=/run/$PROD_NAME

# if this is set, the system is wiped at service start
WIPE_TRIGGER=$CFG_DIR/wipe

# this is where the libvirt images are stored
# (via overlay fs from REF_PLAT) plus the SE Linux context
CDROM_DEVICE=/dev/sr0
REF_PLAT_ISO_IMAGE=/opt/refplat_images.iso
REF_PLAT_DIR=/opt/refplat_images
REF_PLAT=$BASE_DIR/refplat
LIBVIRT_IMAGES=/var/lib/libvirt/images
CONTEXT="system_u:object_r:virt_content_t:s0"
STABILIZATION_TIME=3

# this is where the subsystems create their logfiles
# some hard reference on /var/log... so careful
# when moving the location (just sayin'...)
# Also when uninstalling, hard references in the
# RPM sciptlets.
LOG_DIR=/var/log/$PROD_NAME
# for production, this should be set to "WARNING"
LOG_LEVEL=WARNING
SMART_LOG_LEVEL=WARNING
CONSOLE_LOG_DIR=$LOG_DIR/consoles
CONTROLLER_LOG=$LOG_DIR/controller.log
LOWLEVEL_DRIVER_LOG=$LOG_DIR/lowlevel-driver.log
CORE_DRIVER_LOG=$LOG_DIR/core-driver.log

# Go subsystem log verbosity
# GO_LOGGING="-log_dir $LOG_DIR -v 2 -stderrthreshold INFO"
# needs a more general and also homogenous/consolidated
# log file approach.
# TODO: SIMPLE-714
[ "$LOG_LEVEL" = "INFO" ] && VERBOSITY="-v=2"
GO_LOGGING="$VERBOSITY -logtostderr -stderrthreshold=$LOG_LEVEL"
