#!/sbin/openrc-run
# Copyright 2022-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# Environment variables for Redlib
export ADDRESS=${ADDRESS:-80}
export PORT=${PORT:-8080}
export REDLIB_DEFAULT_THEME=${REDLIB_DEFAULT_THEME:-system}
export REDLIB_DEFAULT_FRONT_PAGE=${REDLIB_DEFAULT_FRONT_PAGE:-default}
export REDLIB_DEFAULT_LAYOUT=${REDLIB_DEFAULT_LAYOUT:-card}
export REDLIB_DEFAULT_WIDE=${REDLIB_DEFAULT_WIDE:-off}
export REDLIB_DEFAULT_POST_SORT=${REDLIB_DEFAULT_POST_SORT:-hot}
export REDLIB_DEFAULT_COMMENT_SORT=${REDLIB_DEFAULT_COMMENT_SORT:-confidence}
export REDLIB_DEFAULT_SHOW_NSFW=${REDLIB_DEFAULT_SHOW_NSFW:-off}
export REDLIB_DEFAULT_BLUR_NSFW=${REDLIB_DEFAULT_BLUR_NSFW:-off}
export REDLIB_DEFAULT_USE_HLS=${REDLIB_DEFAULT_USE_HLS:-off}
export REDLIB_DEFAULT_HIDE_HLS_NOTIFICATION=${REDLIB_DEFAULT_HIDE_HLS_NOTIFICATION:-off}
export REDLIB_DEFAULT_AUTOPLAY_VIDEOS=${REDLIB_DEFAULT_AUTOPLAY_VIDEOS:-off}
export REDLIB_DEFAULT_SUBSCRIPTIONS=${REDLIB_DEFAULT_SUBSCRIPTIONS:-}
export REDLIB_HIDE_AWARDS=${REDLIB_HIDE_AWARDS:-off}
export REDLIB_DISABLE_VISIT_REDDIT_CONFIRMATION=${REDLIB_DISABLE_VISIT_REDDIT_CONFIRMATION:-off}
export REDLIB_HIDE_SCORE=${REDLIB_HIDE_SCORE:-off}
export REDLIB_FIXED_NAVAR=${REDLIB_FIXED_NAVAR:-on}

name="Redlib"
description="Private front-end for Reddit"
command=/usr/bin/redlib
pidfile="/var/run/${RC_SVCNAME}.pid"
command_user="redlib"
command_background=true
