Merge branch 'master' into master

This commit is contained in:
x86dev 2017-07-28 22:26:41 +02:00 committed by GitHub
commit 6b325708db

View File

@ -11,7 +11,7 @@ setup_nginx()
if [ "$TTRSS_WITH_SELFSIGNED_CERT" = "1" ]; then if [ "$TTRSS_WITH_SELFSIGNED_CERT" = "1" ]; then
# Install OpenSSL. # Install OpenSSL.
apk update && apk add openssl apk update && apk add openssl
if [ ! -f "/etc/ssl/private/ttrss.key" ]; then if [ ! -f "/etc/ssl/private/ttrss.key" ]; then
echo "Setup: Generating self-signed certificate ..." echo "Setup: Generating self-signed certificate ..."
# Generate the TLS certificate for our Tiny Tiny RSS server instance. # Generate the TLS certificate for our Tiny Tiny RSS server instance.
@ -33,7 +33,7 @@ setup_nginx()
echo "Setup: !!! WARNING - No encryption (TLS) used - WARNING !!!" echo "Setup: !!! WARNING - No encryption (TLS) used - WARNING !!!"
echo "Setup: !!! This is not recommended for a production server !!!" echo "Setup: !!! This is not recommended for a production server !!!"
echo "Setup: You have been warned." echo "Setup: You have been warned."
# Turn off SSL. # Turn off SSL.
sed -i -e "s/listen\s*4443\s*;/listen 8080;/g" ${NGINX_CONF} sed -i -e "s/listen\s*4443\s*;/listen 8080;/g" ${NGINX_CONF}
sed -i -e "s/ssl\s*on\s*;/ssl off;/g" ${NGINX_CONF} sed -i -e "s/ssl\s*on\s*;/ssl off;/g" ${NGINX_CONF}
@ -83,7 +83,7 @@ setup_ttrss()
fi fi
if [ "$TTRSS_WITH_SELFSIGNED_CERT" = "1" ]; then if [ "$TTRSS_WITH_SELFSIGNED_CERT" = "1" ]; then
# Make sure the TTRSS protocol is https now. # Make sure the TTRSS protocol is https now.
TTRSS_PROTO=https TTRSS_PROTO=https
@ -95,28 +95,42 @@ setup_ttrss()
# If no protocol is specified, use http as default. Not secure, I know. # If no protocol is specified, use http as default. Not secure, I know.
if [ -z ${TTRSS_PROTO} ]; then if [ -z ${TTRSS_PROTO} ]; then
TTRSS_PROTO=http TTRSS_PROTO=http
# Set the default port if not specified otherwise. # Set the default port if not specified otherwise.
if [ -z ${TTRSS_PORT} ]; then if [ -z ${TTRSS_PORT} ]; then
TTRSS_PORT=:8080 TTRSS_PORT=:8080
fi fi
fi fi
# If we've been passed $TTRSS_SELF_URL as an env variable, then use that, # If we've been passed $TTRSS_SELF_URL as an env variable, then use that,
# But if not, use the URL we constructed above # otherwise use the URL we constructed above.
if [ -z "$TTRSS_SELF_URL" ]; then if [ -z "$TTRSS_SELF_URL" ]; then
# Construct the final URL TTRSS will use. # Construct the final URL TTRSS will use.
TTRSS_SELF_URL=${TTRSS_PROTO}://${TTRSS_URL}${TTRSS_PORT}/ TTRSS_SELF_URL=${TTRSS_PROTO}://${TTRSS_URL}${TTRSS_PORT}/
fi fi
echo "Setup: URL is: $TTRSS_SELF_URL" echo "Setup: URL is: $TTRSS_SELF_URL"
# Patch URL path. # Patch URL path.
sed -i -e 's@htt.*/@'"${TTRSS_SELF_URL}"'@g' ${TTRSS_PATH}/config.php sed -i -e 's@htt.*/@'"${TTRSS_SELF_URL}"'@g' ${TTRSS_PATH}/config.php
# Enable additional system plugins: api_newsplus. # Enable additional system plugins.
sed -i -e "s/.*define('PLUGINS'.*/define('PLUGINS', 'api_newsplus, auth_internal, note, updater');/g" ${TTRSS_PATH}/config.php if [ -z ${TTRSS_PLUGINS} ]; then
# api_newsplus (API for News+ Android App).
TTRSS_PLUGINS=api_newsplus
# Only if SSL/TLS is enabled: af_zz_imgproxy (Loads insecure images via built-in proxy).
if [ "$TTRSS_PROTO" = "https" ]; then
TTRSS_PLUGINS=${TTRSS_PLUGINS},af_zz_imgproxy
fi
fi
echo "Setup: Additional plugins: $TTRSS_PLUGINS"
sed -i -e "s/.*define('PLUGINS'.*/define('PLUGINS', '$TTRSS_PLUGINS, auth_internal, note, updater');/g" ${TTRSS_PATH}/config.php
} }
setup_db() setup_db()