From b6423420cc1ecf9933ebddd5d0a141c082821097 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs?= Date: Fri, 13 Aug 2021 19:34:49 -0500 Subject: improve variables and added timeout to gunicorn --- core/entrypoint.sh | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'core/entrypoint.sh') diff --git a/core/entrypoint.sh b/core/entrypoint.sh index 1d6f394..e482274 100644 --- a/core/entrypoint.sh +++ b/core/entrypoint.sh @@ -10,67 +10,67 @@ if [ ! -d "/root/.youtube-local" ]; then # 0 - Off # 1 - On, except video # 2 - On, including video (see warnings) -route_tor = $ROUTE_TOR +route_tor = ${ROUTE_TOR:-0} -tor_port = $TOR_PORT +tor_port = ${TOR_PORT:-9050} -tor_control_port = TOR_CONTROL_PORT +tor_control_port = ${TOR_CONTROL_PORT:-9151} -port_number = 8080 +port_number = ${PORT_NUMBER:-8080} # This will allow others to connect to your Youtube Local instance as a website. # For security reasons, enabling this is not recommended. -allow_foreign_addresses = $ALLOW_FOREIGN_ADDRESSES +allow_foreign_addresses = ${ALLOW_FOREIGN_ADDRESSES:-True} # 0 - off by default # 1 - only manually created subtitles on by default # 2 - enable even if automatically generated is all that's available -subtitles_mode = $SUBTITLES_MODE +subtitles_mode = ${SUBTITLES_MODE:-0} # ISO 639 language code: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes -subtitles_language = $SUBTITLES_LANG +subtitles_language = ${SUBTITLES_LANG:-en} # 0 - Related videos disabled # 1 - Related videos always shown # 2 - Related videos hidden; shown by clicking a button -related_videos_mode = $RELATED_VIDEOS_MODE +related_videos_mode = ${RELATED_VIDEOS_MODE:-1} # 0 - Video comments disabled # 1 - Video comments always shown # 2 - Video comments hidden; shown by clicking a button -comments_mode = $COMMENTS_MODE +comments_mode = ${COMMENTS_MODE:-1} -enable_comment_avatars = $ENABLE_COMMENTS_AVATARS +enable_comment_avatars = ${ENABLE_COMMENTS_AVATARS:-True} # 0 to sort by top # 1 to sort by newest -default_comment_sorting = $DEFAULT_COMMENT_SORTING +default_comment_sorting = ${DEFAULT_COMMENT_SORTING:-0} -theater_mode = $THEATER_MODE +theater_mode = ${THEATER_MODE:-True} -default_resolution = $DEFAULT_RESOLUTION +default_resolution = ${DEFAULT_RESOLUTION:-720} -use_video_player = $USE_VIDEO_PLAYER +use_video_player = ${USE_VIDEO_PLAYER:-0} -proxy_images = $PROXY_IMAGES +proxy_images = ${PROXY_IMAGES:-True} -use_comments_js = $USE_COMMENTS_JS +use_comments_js = ${USE_COMMENTS_JS:-True} -use_sponsorblock_js = $USE_SPONSORBLOCK_JS +use_sponsorblock_js = ${USE_SPONSORBLOCK_JS:-False} -theme = $THEME +theme = ${THEME:-0} -font = $FONT +font = ${FONT:-0} -embed_page_mode = $EMBED_PAGE_MODE +embed_page_mode = ${EMBED_PAGE_MODE:-True} -autocheck_subscriptions = $AUTOCHECK_SUBSCRIPTIONS +autocheck_subscriptions = ${AUTOCHECK_SUBSCRIPTIONS:-True} # Developer use to debug 403s -gather_googlevideo_domains = $GATHER_GOOGLEVIDEO_DOMAINS +gather_googlevideo_domains = ${GATHER_GOOGLEVIDEO_DOMAINS:-False} # Save all responses from youtube for debugging -debugging_save_responses = $DEBUGGING_SAVE_RESPONSES +debugging_save_responses = ${DEBUGGING_SAVE_RESPONSES:-False} # Do not change, remove, or comment out this value, or else your settings may be lost or corrupted settings_version = 3 @@ -81,4 +81,4 @@ fi cd /srv/app || exit -exec gunicorn -b 0.0.0.0:8080 -w 4 server:site_dispatch +exec gunicorn -b "0.0.0.0:${PORT_NUMBER:-8080}" --timeout "${GUNICORN_TIMEOUT:-30}" --workers "${GUNICORN_NUM_WORKERS:-4}" server:site_dispatch -- cgit v1.2.3