addnonssl
Some checks failed
web/docker-ttrss/pipeline/head There was a failure building this commit

This commit is contained in:
Julien Cabillot
2025-01-06 17:21:16 -05:00
parent 7d141bb3b2
commit 860abf0558
5 changed files with 17 additions and 124 deletions

View File

@@ -1,46 +1,5 @@
#!/bin/sh
setup_nginx()
{
if [ -z "$TTRSS_HOST" ]; then
TTRSS_HOST=ttrss
fi
NGINX_CONF=/etc/nginx/nginx.conf
if [ "$TTRSS_WITH_SELFSIGNED_CERT" = "1" ]; then
# Install OpenSSL.
apk update && apk add openssl
if [ ! -f "/etc/ssl/private/ttrss.key" ]; then
echo "Setup: Generating self-signed certificate ..."
# Generate the TLS certificate for our Tiny Tiny RSS server instance.
openssl req -new -newkey rsa:4096 -days 3650 -nodes -x509 \
-subj "/C=US/ST=World/L=World/O=$TTRSS_HOST/CN=$TTRSS_HOST" \
-keyout "/etc/ssl/private/ttrss.key" \
-out "/etc/ssl/certs/ttrss.crt"
fi
# Turn on SSL.
sed -i -e "s/listen\s*8080\s*;/listen 4443;/g" ${NGINX_CONF}
sed -i -e "s/ssl\s*off\s*;/ssl on;/g" ${NGINX_CONF}
sed -i -e "s/#ssl_/ssl_/g" ${NGINX_CONF}
# Set permissions.
chmod 600 "/etc/ssl/private/ttrss.key"
chmod 600 "/etc/ssl/certs/ttrss.crt"
else
echo "Setup: !!! WARNING - No encryption (TLS) used - WARNING !!!"
echo "Setup: !!! This is not recommended for a production server !!!"
echo "Setup: You have been warned."
# Turn off SSL.
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_/#ssl_/g" ${NGINX_CONF}
fi
}
setup_ttrss()
{
if [ -z "$TTRSS_REPO_URL" ]; then
@@ -54,28 +13,6 @@ setup_ttrss()
TTRSS_PATH_THEMES=${TTRSS_PATH}/themes.local
TTRSS_PATH_PLUGINS=${TTRSS_PATH}/plugins.local
if [ ! -d ${TTRSS_PATH} ]; then
mkdir -p ${TTRSS_PATH}
if [ -n "$TTRSS_GIT_TAG" ]; then
echo "Setup: Setting up Tiny Tiny RSS '$TTRSS_GIT_TAG' ..."
cd ${TTRSS_PATH}
git init .
git fetch --depth=1 ${TTRSS_REPO_URL} refs/tags/${TTRSS_GIT_TAG}:refs/tags/${TTRSS_GIT_TAG}
git checkout tags/${TTRSS_GIT_TAG}
else
echo "Setup: Setting up Tiny Tiny RSS (latest revision) ..."
git clone --depth=1 ${TTRSS_REPO_URL} ${TTRSS_PATH}
fi
mkdir -p ${TTRSS_PATH_PLUGINS}
git clone --depth=1 https://github.com/sepich/tt-rss-mobilize.git ${TTRSS_PATH_PLUGINS}/mobilize
git clone --depth=1 https://github.com/feediron/ttrss_plugin-feediron.git ${TTRSS_PATH_PLUGINS}/feediron
mkdir -p ${TTRSS_PATH_THEMES}
git clone --depth=1 https://github.com/levito/tt-rss-feedly-theme.git ${TTRSS_PATH_THEMES}/levito-feedly-git
git clone --depth=1 https://github.com/Gravemind/tt-rss-feedlish-theme.git ${TTRSS_PATH_THEMES}/gravemind-feedly-git
fi
# Add initial config.
cp ${TTRSS_PATH}/config.php-dist ${TTRSS_PATH}/config.php
@@ -150,7 +87,6 @@ setup_db()
php -f /srv/ttrss-configure-plugin-mobilize.php
}
setup_nginx
setup_ttrss
setup_db