Documenting singularity role
This commit is contained in:
27
roles/Singularity/README.md
Normal file
27
roles/Singularity/README.md
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
Singularity is our server-side RSS reader.
|
||||||
|
|
||||||
|
# Etymology
|
||||||
|
|
||||||
|
Singularity is named after a more scientific name for a "black hole". Similar to this event, Singularity pulls many disparate news sources into a single feed & location. User can then use client apps or a web browser to view this single source of truth.
|
||||||
|
|
||||||
|
# Relevant Files and Software
|
||||||
|
|
||||||
|
Prior to pushing this role, the admin will want to use `files/create-db.sh` to seed the initial database & schema. Afterwards, deploy this role to the host and front it with a [WebServer](../WebServer).
|
||||||
|
|
||||||
|
## Backups
|
||||||
|
|
||||||
|
[AniNIX/Aether](/AniNIX/Aether) will back up this system -- sample backup and recovery testing is in `files/test-backup.bash`. It's important to test these, as users won't want to find their feeds over again.
|
||||||
|
|
||||||
|
# Available Clients
|
||||||
|
|
||||||
|
There is an Android application on [the Play store](https://play.google.com/store/apps/details?id=org.ttrssreader).
|
||||||
|
|
||||||
|
# Equivalents or Competition
|
||||||
|
|
||||||
|
Android has a native Google Discover mode in the home screen on devices -- Windows also has news in the taskbar.
|
||||||
|
|
||||||
|
CLI readers like [Newsraft](https://wiki.archlinux.org/title/Newsraft) or cloud readers like [Feedly](https://feedly.com) are also available. A number of Android apps can serve this function.
|
||||||
|
|
||||||
|
# Additional Reference
|
||||||
|
|
||||||
|
See [RFC 4287](https://www.rfc-editor.org/rfc/rfc4287) and [5023](https://www.rfc-editor.org/rfc/rfc5023) for details on the Atom format.
|
||||||
6
roles/Singularity/files/create-db.bash
Executable file
6
roles/Singularity/files/create-db.bash
Executable file
@@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -Eeo pipefail
|
||||||
|
sudo -u postgres createuser -W --createdb ttrss
|
||||||
|
sudo -u postgres createdb -U ttrss ttrss
|
||||||
|
sudo -u postgres psql ttrss -U ttrss -f /usr/share/webapps/tt-rss/sql/pgsql/schema.sql
|
||||||
|
sudo -u http php /usr/share/webapps/tt-rss/update.php --update-schema
|
||||||
4
roles/Singularity/files/delete-db.bash
Executable file
4
roles/Singularity/files/delete-db.bash
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -Eeo pipefail
|
||||||
|
sudo -u postgres dropdb ttrss
|
||||||
|
sudo -u postgres dropuser ttrss
|
||||||
13
roles/Singularity/files/test-backup.bash
Normal file
13
roles/Singularity/files/test-backup.bash
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
backupfile="$HOME"/tt-rss.sql
|
||||||
|
|
||||||
|
function test-backup() {
|
||||||
|
sudo -u postgres pg_dump -d ttrss > "$backupfile"
|
||||||
|
}
|
||||||
|
|
||||||
|
function test-restore() {
|
||||||
|
./delete-db.bash
|
||||||
|
./create-db.bash
|
||||||
|
cat "$backupfile" | sudo -u postgres psql -d ttrss
|
||||||
|
}
|
||||||
10
roles/Singularity/files/tt-rss.hook
Normal file
10
roles/Singularity/files/tt-rss.hook
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
[Trigger]
|
||||||
|
Operation = Install
|
||||||
|
Operation = Upgrade
|
||||||
|
Type = Package
|
||||||
|
Target = tt-rss
|
||||||
|
|
||||||
|
[Action]
|
||||||
|
Description = Updating TT-RSS Database
|
||||||
|
When = PostTransaction
|
||||||
|
Exec = /usr/bin/runuser -u http -- /usr/bin/php /usr/share/webapps/tt-rss/update.php --update-schema=force-yes
|
||||||
41
roles/Singularity/tasks/main.yml
Normal file
41
roles/Singularity/tasks/main.yml
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
become: yes
|
||||||
|
package:
|
||||||
|
state: present
|
||||||
|
name:
|
||||||
|
- tt-rss
|
||||||
|
|
||||||
|
- name: Set permissions
|
||||||
|
become: yes
|
||||||
|
file:
|
||||||
|
path: /usr/share/webapps/tt-rss
|
||||||
|
owner: http
|
||||||
|
group: http
|
||||||
|
recurse: yes
|
||||||
|
|
||||||
|
- name: Configure
|
||||||
|
become: yes
|
||||||
|
template:
|
||||||
|
src: config.php.j2
|
||||||
|
dest: /usr/share/webapps/tt-rss/config.php
|
||||||
|
owner: http
|
||||||
|
group: http
|
||||||
|
mode: 0600
|
||||||
|
|
||||||
|
- name: Enable service
|
||||||
|
become: yes
|
||||||
|
service:
|
||||||
|
name: tt-rss.service
|
||||||
|
state: restarted
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
- name: Update hook
|
||||||
|
become: yes
|
||||||
|
copy:
|
||||||
|
src: tt-rss.hook
|
||||||
|
dest: /etc/pacman.d/hooks/tt-rss.hook
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0644
|
||||||
11
roles/Singularity/templates/config.php.j2
Normal file
11
roles/Singularity/templates/config.php.j2
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// DB Drivers
|
||||||
|
putenv('TTRSS_DB_TYPE=pgsql');
|
||||||
|
putenv('TTRSS_DB_HOST=localhost');
|
||||||
|
putenv('TTRSS_DB_USER=ttrss');
|
||||||
|
putenv('TTRSS_DB_NAME=ttrss');
|
||||||
|
putenv('TTRSS_DB_PASS={{ secrets['Singularity']['db'] }}');
|
||||||
|
putenv('TTRSS_DB_PORT=5432');
|
||||||
|
putenv('TTRSS_LOG_DESTINATION=syslog');
|
||||||
|
putenv('TTRSS_SELF_URL_PATH=https://singularity.{{ external_domain }}');
|
||||||
Reference in New Issue
Block a user