diff options
author | Stonewall Jackson <stonewall@sacredheartsc.com> | 2023-02-04 01:23:43 -0500 |
---|---|---|
committer | Stonewall Jackson <stonewall@sacredheartsc.com> | 2023-02-04 01:52:13 -0500 |
commit | 0261e875679f1bf63c8d689da7fc7e014597885d (patch) | |
tree | 3f19cd74a0c1070944f75437f30b098d6ef2ffcb /roles/ttrss/templates | |
download | selfhosted-0261e875679f1bf63c8d689da7fc7e014597885d.tar.gz selfhosted-0261e875679f1bf63c8d689da7fc7e014597885d.zip |
initial commit
Diffstat (limited to 'roles/ttrss/templates')
-rw-r--r-- | roles/ttrss/templates/etc/systemd/system/ttrss.service.j2 | 18 | ||||
-rw-r--r-- | roles/ttrss/templates/usr/local/sbin/ttrss-update.sh.j2 | 27 | ||||
-rw-r--r-- | roles/ttrss/templates/var/www/ttrss/config.php.j2 | 23 |
3 files changed, 68 insertions, 0 deletions
diff --git a/roles/ttrss/templates/etc/systemd/system/ttrss.service.j2 b/roles/ttrss/templates/etc/systemd/system/ttrss.service.j2 new file mode 100644 index 0000000..53fef07 --- /dev/null +++ b/roles/ttrss/templates/etc/systemd/system/ttrss.service.j2 @@ -0,0 +1,18 @@ +[Unit] +Description=Tiny Tiny RSS background feed updates +Wants=gssproxy.service +After=network-online.target nss-lookup.target gssproxy.service +StartLimitIntervalSec=200 +StartLimitBurst=5 + +[Service] +Type=simple +User=apache +Group=apache +Environment=GSS_USE_PROXY=yes +ExecStart=php {{ ttrss_home }}/update_daemon2.php +Restart=on-failure +RestartSec=30 + +[Install] +WantedBy=multi-user.target diff --git a/roles/ttrss/templates/usr/local/sbin/ttrss-update.sh.j2 b/roles/ttrss/templates/usr/local/sbin/ttrss-update.sh.j2 new file mode 100644 index 0000000..663558c --- /dev/null +++ b/roles/ttrss/templates/usr/local/sbin/ttrss-update.sh.j2 @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +set -eu + +SRCDIR={{ ttrss_home | quote }} + +if (( $EUID != 0 )); then + echo 'must be superuser' 1>&2 + exit 1 +fi + +cd "$SRCDIR" + +git fetch + +local_rev=$(git rev-parse HEAD) +upstream_rev=$(git rev-parse '@{u}') + +echo "local: $local_rev" +echo "upstream: $upstream_rev" + +if [ "$local_rev" != "$upstream_rev" ]; then + git reset --hard HEAD + systemctl restart ttrss +else + echo "ttrss is already up to date" +fi diff --git a/roles/ttrss/templates/var/www/ttrss/config.php.j2 b/roles/ttrss/templates/var/www/ttrss/config.php.j2 new file mode 100644 index 0000000..9b5e108 --- /dev/null +++ b/roles/ttrss/templates/var/www/ttrss/config.php.j2 @@ -0,0 +1,23 @@ +<?php +putenv('TTRSS_SELF_URL_PATH={{ ttrss_url }}'); + +putenv('TTRSS_DB_TYPE=pgsql'); +putenv('TTRSS_DB_HOST={{ ttrss_db_host }}'); +putenv('TTRSS_DB_USER={{ ttrss_user }}'); +putenv('TTRSS_DB_NAME={{ ttrss_db_name }}'); + +putenv('TTRSS_SESSION_COOKIE_LIFETIME={{ ttrss_session_lifetime_sec }}'); + +putenv('TTRSS_SMTP_FROM_NAME={{ ttrss_email_from_name }}'); +putenv('TTRSS_SMTP_FROM_ADDRESS={{ ttrss_email_from_address }}'); + +putenv('TTRSS_PHP_EXECUTABLE=/usr/bin/php'); + +putenv('TTRSS_LOG_DESTINATION=syslog'); + +putenv('TTRSS_CHECK_FOR_UPDATES=false'); + +putenv('TTRSS_PLUGINS=auth_freeipa'); + +putenv('TTRSS_AUTH_FREEIPA_ALLOW_GROUPS={{ ttrss_access_group }}'); +putenv('TTRSS_AUTH_FREEIPA_ADMIN_GROUPS={{ ttrss_admin_group }}'); |