aboutsummaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorbinary <me@rgoncalves.se>2021-03-15 20:42:30 +0100
committerbinary <me@rgoncalves.se>2021-03-15 20:42:30 +0100
commite5fda5ea2f71c2a432a8bcfdefb835f70c4a49b0 (patch)
treee6d78c1e0dfe896eef6085ade373278171411d38 /roles
parent6cf77357bcd32ecff44446564ece49b1ab286ece (diff)
downloadinfrastructure-e5fda5ea2f71c2a432a8bcfdefb835f70c4a49b0.tar.gz
Add miniflux role for rss agregation.
Diffstat (limited to 'roles')
-rw-r--r--roles/miniflux/meta/main.yml8
-rw-r--r--roles/miniflux/tasks/main.yml49
-rw-r--r--roles/miniflux/templates/etc-miniflux.conf.j293
-rw-r--r--roles/miniflux/vars/main.yml11
4 files changed, 161 insertions, 0 deletions
diff --git a/roles/miniflux/meta/main.yml b/roles/miniflux/meta/main.yml
new file mode 100644
index 0000000..ca4e7dd
--- /dev/null
+++ b/roles/miniflux/meta/main.yml
@@ -0,0 +1,8 @@
+
+# miniflux ~~ roles/miniflux/meta/main.yml
+# Meta parameters
+
+---
+
+dependencies:
+ - { role: postgres, tags: "dependency" }
diff --git a/roles/miniflux/tasks/main.yml b/roles/miniflux/tasks/main.yml
new file mode 100644
index 0000000..95c5d92
--- /dev/null
+++ b/roles/miniflux/tasks/main.yml
@@ -0,0 +1,49 @@
+
+# git ~~ roles/git/tasks/main.yml
+# Init git user and settings
+
+---
+
+- name: ensure miniflux is installed
+ package:
+ name: miniflux
+ state: present
+
+- name: ensure miniflux db user exists
+ shell: |
+ createuser -U postgres miniflux
+ register: result
+ failed_when: result.rc != 0 and "already exists" not in result.stderr
+
+- name: ensure miniflux database exists
+ shell: |
+ createdb -U postgres -O miniflux miniflux
+ createdb -U postgres -O miniflux miniflux2
+ register: result
+ failed_when: result.rc != 0 and "already exists" not in result.stderr
+
+- name: ensure miniflux db user exists
+ shell: |
+ psql -U postgres miniflux -c "create extension hstore"
+ register: result
+ failed_when: result.rc != 0 and "already exists" not in result.stderr
+
+- name: run postgres migrations
+ shell: |
+ psql -U postgres -c "ALTER USER miniflux WITH SUPERUSER"
+ miniflux -migrate
+ psql -U postgres -c "ALTER USER miniflux WITH NOSUPERUSER"
+
+- name: generate configuration
+ template:
+ src: etc-miniflux.conf.j2
+ dest: /etc/miniflux.conf
+ owner: "{{ miniflux_user }}"
+ owner: "{{ miniflux_group }}"
+ mode: "0644"
+
+- name: ensure miniflux is enabled and restarted
+ service:
+ name: miniflux
+ state: restarted
+ enabled: true
diff --git a/roles/miniflux/templates/etc-miniflux.conf.j2 b/roles/miniflux/templates/etc-miniflux.conf.j2
new file mode 100644
index 0000000..b820f27
--- /dev/null
+++ b/roles/miniflux/templates/etc-miniflux.conf.j2
@@ -0,0 +1,93 @@
+
+# miniflux configuration file
+# wrote for migration version : 34
+# managed by Ansible
+
+DEBUG=0
+#DATABASE_URL=user=miniflux password= dbname=miniflux sslmode=disable
+
+# WORKER_POOL_SIZE Number of background workers (default: 5)
+WORKER_POOL_SIZE=5
+
+# POLLING_FREQUENCY Refresh interval in minutes for feeds
+# (default: 60)
+POLLING_FREQUENCY=60
+
+# BATCH_SIZE Number of feeds to send to the queue for each interval
+# (default: 10)
+BATCH_SIZE=10
+
+# DATABASE_MAX_CONNS Maximum number of database connections
+# (default: 20)
+DATABASE_MAX_CONNS=20
+
+# DATABASE_MIN_CONNS Minimum number of database connections
+# (default: 1)
+DATABASE_MIN_CONNS=1
+
+# CLEANUP_ARCHIVE_READ_DAYS Number of days after which marking read
+# items as removed (default: 60)
+CLEANUP_ARCHIVE_READ_DAYS=60
+
+# LISTEN_ADDR Address to listen on (use absolute path for Unix socket)
+# (default: 127.0.0.1:8080)
+LISTEN_ADDR={{ miniflux_listenaddr }}:{{ miniflux_port }}
+
+# PORT Override LISTEN_ADDR to 0.0.0.0:$PORT (PaaS) (default: None)
+
+# BASE_URL Base URL to generate HTML links and base path for cookies
+# default: http://localhost/)
+BASE_URL=https://miniflux.{{ global.domain_name }}/
+
+# CLEANUP_FREQUENCY_HOURS Cleanup job frequency in hours, remove old
+# sessions and archive read entries (default: 24)
+CLEANUP_FREQUENCY_HOURS=24
+
+# HTTPS Forces cookies to use secure flag and send HSTS headers
+(default: None)
+
+# DISABLE_HSTS Disable HTTP Strict Transport Security header if HTTPS
+# is set (default: None)
+
+# DISABLE_HTTP_SERVICE Disable HTTP service (default: None)
+
+# DISABLE_SCHEDULER_SERVICE Disable scheduler service (default: None)
+
+# CERT_FILE Path to SSL certificate (default: None)
+
+# KEY_FILE Path to SSL private key (default: None)
+
+# CERT_DOMAIN Use Let's Encrypt to get automatically a certificate for
+# this domain (default: None)
+
+# CERT_CACHE Let's Encrypt cache directory (default: /tmp/cert_cache)
+
+# OAUTH2_PROVIDER OAuth2 provider to use, at this time only google is
+# supported (default: None)
+
+# OAUTH2_CLIENT_ID OAuth2 client ID (default: None)
+
+# OAUTH2_CLIENT_SECRET OAuth2 client secret (default: None)
+
+# OAUTH2_REDIRECT_URL OAuth2 redirect URL (default: None)
+
+# OAUTH2_USER_CREATION Set to 1 to authorize OAuth2 user creation
+# (default: None)
+
+# RUN_MIGRATIONS Set to 1 to run database migrations (default: None)
+
+# CREATE_ADMIN Set to 1 to create an admin user from environment
+# variables (default: None)
+
+# ADMIN_USERNAME Admin user login, used only if CREATE_ADMIN is
+# enabled (default: None)
+
+# ADMIN_PASSWORD Admin user password, used only if CREATE_ADMIN is
+# enabled (default: None)
+
+# POCKET_CONSUMER_KEY Pocket consumer API key for all users
+# (default: None)
+
+# PROXY_IMAGES Avoids mixed content warnings for external images:
+# http-only, all, or none (default: http-only)
+
diff --git a/roles/miniflux/vars/main.yml b/roles/miniflux/vars/main.yml
new file mode 100644
index 0000000..13e634c
--- /dev/null
+++ b/roles/miniflux/vars/main.yml
@@ -0,0 +1,11 @@
+
+# miniflux ~~ roles/miniflux/tasks/vars.yml
+# default vars for miniflux role
+
+---
+
+miniflux_user: "_miniflux"
+miniflux_group: "_miniflux"
+
+miniflux_listenaddr: "0.0.0.0"
+miniflux_port: "8010"
remember that computers suck.