✨: add freshrss webapps
This commit is contained in:
20
roles/freshrss/tasks/cron.yml
Normal file
20
roles/freshrss/tasks/cron.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
|
||||
- name: Install FreshRSS timer
|
||||
ansible.builtin.template:
|
||||
src: freshrss.timer.j2
|
||||
dest: /etc/systemd/system/freshrss.timer
|
||||
mode: "0o644"
|
||||
|
||||
- name: Install FreshRSS service
|
||||
ansible.builtin.template:
|
||||
src: freshrss.service.j2
|
||||
dest: /etc/systemd/system/freshrss.service
|
||||
mode: "0o644"
|
||||
|
||||
- name: Enable FreshRSS timer
|
||||
ansible.builtin.systemd_service:
|
||||
name: freshrss.timer
|
||||
daemon_reload: true
|
||||
enabled: true
|
||||
state: started
|
15
roles/freshrss/tasks/db.yml
Normal file
15
roles/freshrss/tasks/db.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
|
||||
- name: Create freshrss db role
|
||||
become_user: postgres
|
||||
become: true
|
||||
community.postgresql.postgresql_user:
|
||||
name: "{{ freshrss_pg_role }}"
|
||||
password: "{{ freshrss_pg_password }}"
|
||||
|
||||
- name: Create roundcube db
|
||||
become_user: postgres
|
||||
become: true
|
||||
community.postgresql.postgresql_db:
|
||||
name: "{{ freshrss_pg_database }}"
|
||||
owner: "{{ freshrss_pg_role }}"
|
40
roles/freshrss/tasks/freshrss.yml
Normal file
40
roles/freshrss/tasks/freshrss.yml
Normal file
@@ -0,0 +1,40 @@
|
||||
---
|
||||
|
||||
- name: Create application directory
|
||||
ansible.builtin.file:
|
||||
state: directory
|
||||
dest: "{{ freshrss_local_path }}"
|
||||
owner: root
|
||||
group: www-data
|
||||
mode: "a-rwx,u+rwX,g+rX"
|
||||
|
||||
- name: Install freshrss application
|
||||
ansible.builtin.unarchive:
|
||||
remote_src: true
|
||||
src: "{{ freshrss_url }}"
|
||||
dest: "{{ freshrss_local_path }}"
|
||||
owner: root
|
||||
group: www-data
|
||||
mode: "a-rwx,u+rwX,g+rX"
|
||||
extra_opts: ['--strip-components=1']
|
||||
exclude:
|
||||
- "{{ freshrss_config_path }}"
|
||||
|
||||
- name: Put freshrss configuration file
|
||||
ansible.builtin.template:
|
||||
src: config.php.j2
|
||||
dest: "{{ freshrss_config_path }}"
|
||||
owner: root
|
||||
group: www-data
|
||||
mode: "0o660"
|
||||
|
||||
- name: Check writable dirs
|
||||
ansible.builtin.file:
|
||||
state: directory
|
||||
dest: "{{ freshrss_local_path }}/{{ item }}"
|
||||
owner: root
|
||||
group: www-data
|
||||
mode: "g+w"
|
||||
recurse: true
|
||||
loop:
|
||||
- "data"
|
10
roles/freshrss/tasks/main.yml
Normal file
10
roles/freshrss/tasks/main.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
|
||||
- name: Init db
|
||||
ansible.builtin.include_tasks: db.yml
|
||||
|
||||
- name: Install freshrss
|
||||
ansible.builtin.include_tasks: freshrss.yml
|
||||
|
||||
- name: Install freshrss cron
|
||||
ansible.builtin.include_tasks: cron.yml
|
77
roles/freshrss/templates/config.php.j2
Normal file
77
roles/freshrss/templates/config.php.j2
Normal file
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
return array (
|
||||
'environment' => 'production',
|
||||
'salt' => '{{ freshrss_salt }}',
|
||||
'base_url' => 'https://{{ freshrss_access_url }}',
|
||||
'auto_update_url' => 'https://update.freshrss.org',
|
||||
'language' => 'en',
|
||||
'title' => 'FreshRSS',
|
||||
'meta_description' => '',
|
||||
'logo_html' => '',
|
||||
'default_user' => 'mortal',
|
||||
'force_email_validation' => false,
|
||||
'allow_anonymous' => false,
|
||||
'allow_anonymous_refresh' => false,
|
||||
'auth_type' => 'form',
|
||||
'http_auth_auto_register' => true,
|
||||
'http_auth_auto_register_email_field' => '',
|
||||
'api_enabled' => true,
|
||||
'unsafe_autologin_enabled' => false,
|
||||
'simplepie_syslog_enabled' => true,
|
||||
'pubsubhubbub_enabled' => true,
|
||||
'allow_robots' => false,
|
||||
'allow_referrer' => false,
|
||||
'nb_parallel_refresh' => 10,
|
||||
'limits' =>
|
||||
array (
|
||||
'cookie_duration' => 7776000,
|
||||
'cache_duration' => 800,
|
||||
'timeout' => 20,
|
||||
'max_inactivity' => 9223372036854775807,
|
||||
'max_feeds' => 131072,
|
||||
'max_categories' => 16384,
|
||||
'max_registrations' => 1,
|
||||
),
|
||||
'curl_options' =>
|
||||
array (
|
||||
),
|
||||
'db' =>
|
||||
array (
|
||||
'type' => 'pgsql',
|
||||
'host' => 'localhost',
|
||||
'user' => '{{ freshrss_pg_role }}',
|
||||
'password' => '{{ freshrss_pg_password }}',
|
||||
'base' => '{{ freshrss_pg_database }}',
|
||||
'prefix' => 'freshrss_',
|
||||
'connection_uri_params' => '',
|
||||
'pdo_options' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'mailer' => 'mail',
|
||||
'smtp' =>
|
||||
array (
|
||||
'hostname' => '',
|
||||
'host' => 'localhost',
|
||||
'port' => 25,
|
||||
'auth' => false,
|
||||
'auth_type' => '',
|
||||
'username' => '',
|
||||
'password' => '',
|
||||
'secure' => '',
|
||||
'from' => 'root@localhost',
|
||||
),
|
||||
'extensions_enabled' =>
|
||||
array (
|
||||
),
|
||||
'extensions' =>
|
||||
array (
|
||||
),
|
||||
'disable_update' => false,
|
||||
'trusted_sources' =>
|
||||
array (
|
||||
0 => '127.0.0.0/8',
|
||||
1 => '::1/128',
|
||||
),
|
||||
);
|
8
roles/freshrss/templates/freshrss.service.j2
Normal file
8
roles/freshrss/templates/freshrss.service.j2
Normal file
@@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=FreshRSS get new content
|
||||
Wants=freshrss.timer
|
||||
|
||||
[Service]
|
||||
User=www-data
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/php {{ freshrss_local_path }}/app/actualize_script.php
|
9
roles/freshrss/templates/freshrss.timer.j2
Normal file
9
roles/freshrss/templates/freshrss.timer.j2
Normal file
@@ -0,0 +1,9 @@
|
||||
[Unit]
|
||||
Description=FreshRSS get new content
|
||||
|
||||
[Timer]
|
||||
OnBootSec=30s
|
||||
OnCalendar=*:0/5
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
8
roles/freshrss/vars/main.yml
Normal file
8
roles/freshrss/vars/main.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
|
||||
freshrss_version: "1.25.0"
|
||||
freshrss_url: "https://github.com/FreshRSS/FreshRSS/archive/refs/tags/{{ freshrss_version }}.tar.gz"
|
||||
|
||||
freshrss_access_url: "{{ web_hostname | selectattr('type', 'defined') | selectattr('type', '==', 'freshrss') | map(attribute='host') | first }}"
|
||||
freshrss_local_path: "/srv/http/{{ freshrss_access_url }}"
|
||||
freshrss_config_path: "{{ freshrss_local_path }}/data/config.php"
|
Reference in New Issue
Block a user