feat: add new option FRESHRSS_TRUSTED_SOURCES
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
8ae6d67686
commit
6c0ec6e6ec
@ -48,7 +48,6 @@ FRESHRSS_BASE_URL="http://localhost/"
|
|||||||
FRESHRSS_LANGUAGE="en"
|
FRESHRSS_LANGUAGE="en"
|
||||||
FRESHRSS_TITLE="FreshRSS"
|
FRESHRSS_TITLE="FreshRSS"
|
||||||
FRESHRSS_META_DESCRIPTION=
|
FRESHRSS_META_DESCRIPTION=
|
||||||
FRESHRSS_DEFAULT_USER="_"
|
|
||||||
FRESHRSS_ALLOW_ANONYMOUS="false"
|
FRESHRSS_ALLOW_ANONYMOUS="false"
|
||||||
FRESHRSS_ALLOW_ANONYMOUS_REFRESH="false"
|
FRESHRSS_ALLOW_ANONYMOUS_REFRESH="false"
|
||||||
FRESHRSS_AUTH_TYPE="form"
|
FRESHRSS_AUTH_TYPE="form"
|
||||||
@ -80,6 +79,8 @@ FRESHRSS_DB_BASE=
|
|||||||
FRESHRSS_DB_PREFIX="freshrss_"
|
FRESHRSS_DB_PREFIX="freshrss_"
|
||||||
## comma-seperated string, extensions must be installed!
|
## comma-seperated string, extensions must be installed!
|
||||||
FRESHRSS_EXTENSIONS_ENABLED="Tumblr-GDPR"
|
FRESHRSS_EXTENSIONS_ENABLED="Tumblr-GDPR"
|
||||||
|
## comma-seperated string
|
||||||
|
FRESHRSS_TRUSTED_SOURCES=127.0.0.0/8,::1/128
|
||||||
```
|
```
|
||||||
|
|
||||||
### PHP
|
### PHP
|
||||||
|
@ -7,7 +7,7 @@ return array(
|
|||||||
'language' => '{{ getenv "FRESHRSS_LANGUAGE" "en" }}',
|
'language' => '{{ getenv "FRESHRSS_LANGUAGE" "en" }}',
|
||||||
'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" "_" }}',
|
'default_user' => '{{ getenv "FRESHRSS_DEFAULT_USER" "admin" }}',
|
||||||
'allow_anonymous' => {{ getenv "FRESHRSS_ALLOW_ANONYMOUS" "false" }},
|
'allow_anonymous' => {{ getenv "FRESHRSS_ALLOW_ANONYMOUS" "false" }},
|
||||||
'allow_anonymous_refresh' => {{ getenv "FRESHRSS_ALLOW_ANONYMOUS_REFRESH" "false" }},
|
'allow_anonymous_refresh' => {{ getenv "FRESHRSS_ALLOW_ANONYMOUS_REFRESH" "false" }},
|
||||||
'auth_type' => '{{ getenv "FRESHRSS_AUTH_TYPE" "form" }}',
|
'auth_type' => '{{ getenv "FRESHRSS_AUTH_TYPE" "form" }}',
|
||||||
@ -71,4 +71,10 @@ return array(
|
|||||||
),
|
),
|
||||||
|
|
||||||
'disable_update' => true,
|
'disable_update' => true,
|
||||||
|
|
||||||
|
'trusted_sources' => [
|
||||||
|
{{- range (getenv "FRESHRSS_TRUSTED_SOURCES" "127.0.0.0/8,::1/128" | strings.Split ",") }}
|
||||||
|
'{{ . | strings.TrimSpace }}',
|
||||||
|
{{- end }}
|
||||||
|
]
|
||||||
);
|
);
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
. /usr/local/lib/log.sh
|
. /usr/local/lib/log.sh
|
||||||
|
|
||||||
/usr/local/bin/gomplate -o /etc/php8/php.ini -f /etc/templates/php.ini.tmpl
|
/usr/local/bin/gomplate -o /etc/php8/php.ini -f /etc/templates/php.ini.tmpl
|
||||||
/usr/local/bin/gomplate -o /var/www/app/data/config.php -f /etc/templates/config.php.tmpl
|
|
||||||
/usr/local/bin/gomplate -o /var/www/app/constants.local.php -f /etc/templates/constants.local.php.tmpl
|
/usr/local/bin/gomplate -o /var/www/app/constants.local.php -f /etc/templates/constants.local.php.tmpl
|
||||||
|
|
||||||
if [ -n "${FRESHRSS_POSTGRES_SSL_ROOTCERT}" ] && [ ! -f "/var/www/.postgresql/root.crt" ]; then
|
if [ -n "${FRESHRSS_POSTGRES_SSL_ROOTCERT}" ] && [ ! -f "/var/www/.postgresql/root.crt" ]; then
|
||||||
@ -35,26 +34,26 @@ else
|
|||||||
exit $EXITCODE
|
exit $EXITCODE
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${FRESHRSS_DEFAULT_USER}" ]; then
|
log_info "Ensure default user exists"
|
||||||
log_info "Ensure default user exists"
|
ERROR=$(/usr/bin/php ./cli/create-user.php \
|
||||||
ERROR=$(/usr/bin/php ./cli/create-user.php \
|
--user "${FRESHRSS_DEFAULT_USER:-admin}" \
|
||||||
--user "$FRESHRSS_DEFAULT_USER" \
|
--password "${FRESHRSS_DEFAULT_PASSWORD:-freshrss}" \
|
||||||
--password "$FRESHRSS_DEFAULT_PASSWORD" \
|
--language "${FRESHRSS_LANGUAGE:-en}" \
|
||||||
--language "${FRESHRSS_LANGUAGE:-en}" \
|
2>&1)
|
||||||
2>&1)
|
EXITCODE=$?
|
||||||
EXITCODE=$?
|
|
||||||
|
|
||||||
if [ $EXITCODE -eq 3 ]; then
|
if [ $EXITCODE -eq 3 ]; then
|
||||||
log_info "FreshRSS user already exists, skipped"
|
log_info "FreshRSS user already exists, skipped"
|
||||||
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"
|
./cli/list-users.php | xargs -n1 ./cli/actualize-user.php --user "${FRESHRSS_DEFAULT_USER:-admin}"
|
||||||
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
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
/usr/local/bin/gomplate -o /var/www/app/data/config.php -f /etc/templates/config.php.tmpl
|
||||||
|
|
||||||
log_info "Start FreshRSS Server\n"
|
log_info "Start FreshRSS Server\n"
|
||||||
supercronic /etc/crontabs/nginx &
|
supercronic /etc/crontabs/nginx &
|
||||||
php-fpm8 -F &
|
php-fpm8 -F &
|
||||||
|
Reference in New Issue
Block a user