fix: use api url for healthcheck if enabled (#105)
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

Reviewed-on: docker/freshrss#105
This commit is contained in:
Robert Kaussow 2023-06-10 23:55:34 +02:00
parent 5aebe22bc9
commit ab2ed79a3a
3 changed files with 19 additions and 9 deletions

View File

@ -8,15 +8,15 @@ return array(
'title' => '{{ getenv "FRESHRSS_TITLE" "FreshRSS" }}', 'title' => '{{ getenv "FRESHRSS_TITLE" "FreshRSS" }}',
'meta_description' => '{{ getenv "FRESHRSS_META_DESCRIPTION" }}', 'meta_description' => '{{ getenv "FRESHRSS_META_DESCRIPTION" }}',
'default_user' => '{{ getenv "FRESHRSS_DEFAULT_USER" "admin" }}', 'default_user' => '{{ getenv "FRESHRSS_DEFAULT_USER" "admin" }}',
'allow_anonymous' => {{ getenv "FRESHRSS_ALLOW_ANONYMOUS" "false" }}, 'allow_anonymous' => {{ getenv "FRESHRSS_ALLOW_ANONYMOUS" "false" | conv.ToBool }},
'allow_anonymous_refresh' => {{ getenv "FRESHRSS_ALLOW_ANONYMOUS_REFRESH" "false" }}, 'allow_anonymous_refresh' => {{ getenv "FRESHRSS_ALLOW_ANONYMOUS_REFRESH" "false" | conv.ToBool }},
'auth_type' => '{{ getenv "FRESHRSS_AUTH_TYPE" "form" }}', 'auth_type' => '{{ getenv "FRESHRSS_AUTH_TYPE" "form" }}',
'api_enabled' => {{ getenv "FRESHRSS_API_ENABLED" "false" }}, 'api_enabled' => {{ getenv "FRESHRSS_API_ENABLED" "false" | conv.ToBool }},
'unsafe_autologin_enabled' => {{ getenv "FRESHRSS_UNSAFE_AUTOLOGIN_ENABLED" "false" }}, 'unsafe_autologin_enabled' => {{ getenv "FRESHRSS_UNSAFE_AUTOLOGIN_ENABLED" "false" | conv.ToBool }},
'simplepie_syslog_enabled' => {{ getenv "FRESHRSS_SIMPLEPIE_SYSLOG_ENABLED" "true" }}, 'simplepie_syslog_enabled' => {{ getenv "FRESHRSS_SIMPLEPIE_SYSLOG_ENABLED" "true" | conv.ToBool }},
'pubsubhubbub_enabled' => {{ getenv "FRESHRSS_PUBSUBHUBBUB_ENABLED" "false" }}, 'pubsubhubbub_enabled' => {{ getenv "FRESHRSS_PUBSUBHUBBUB_ENABLED" "false" | conv.ToBool }},
'allow_robots' => {{ getenv "FRESHRSS_ALLOW_ROBOTS" "false" }}, 'allow_robots' => {{ getenv "FRESHRSS_ALLOW_ROBOTS" "false" | conv.ToBool }},
'allow_referrer' => {{ getenv "FRESHRSS_ALLOW_REFERRER" "false" }}, 'allow_referrer' => {{ getenv "FRESHRSS_ALLOW_REFERRER" "false" | conv.ToBool }},
'limits' => array( 'limits' => array(
'cookie_duration' => {{ getenv "FRESHRSS_LIMITS_COOKIE_DURATION" "2592000" }}, 'cookie_duration' => {{ getenv "FRESHRSS_LIMITS_COOKIE_DURATION" "2592000" }},

View File

@ -47,6 +47,7 @@ if [ $EXITCODE -eq 3 ]; then
elif [ $EXITCODE -eq 0 ]; then elif [ $EXITCODE -eq 0 ]; then
log_info "FreshRSS user successfully created" log_info "FreshRSS user successfully created"
./cli/list-users.php | xargs -n1 ./cli/actualize-user.php --user "${FRESHRSS_DEFAULT_USER:-admin}" ./cli/list-users.php | xargs -n1 ./cli/actualize-user.php --user "${FRESHRSS_DEFAULT_USER:-admin}"
./cli/access-permissions.sh
else else
log_error "FreshRSS error during the creation of a user: ${ERROR}" log_error "FreshRSS error during the creation of a user: ${ERROR}"
exit $EXITCODE exit $EXITCODE

View File

@ -1,3 +1,12 @@
#!/usr/bin/env sh #!/usr/bin/env sh
(php -r "readfile('http://127.0.0.1:8080/i/');" | grep -q 'jsonVars') || exit 1 # shellcheck disable=SC3040
set -eo pipefail
if [ "$(gomplate -i '{{ getenv "FRESHRSS_API_ENABLED" "false" | conv.ToBool }}')" = "true" ]; then
(php -r "readfile('http://127.0.0.1:8080/api/fever.php');" | grep -q 'api_versionX') || exit 1
else
(php -r "readfile('http://127.0.0.1:8080/i/');" | grep -q 'jsonVars') || exit 1
fi
exit 0