aboutsummaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorJan Tuomi <jan@jantuomi.fi>2026-07-09 22:42:56 +0300
committerJan Tuomi <jan@jantuomi.fi>2026-07-09 22:42:56 +0300
commitb6747a645d2627d7672f77fd9d9f301c62c3ccb2 (patch)
treea4fd2dbe730ff9a32e8dcc861d750113340b52d8 /roles
parentbadf52135e97531e6c91743322bdbe16105b43e5 (diff)
Set up freshrss jail
Diffstat (limited to 'roles')
-rw-r--r--roles/jails/14_freshrss/defaults/main.yml39
-rw-r--r--roles/jails/14_freshrss/tasks/main.yml38
-rw-r--r--roles/jails/14_freshrss/templates/usr_local_etc_nginx_nginx.conf44
-rw-r--r--roles/jails/14_freshrss/templates/usr_local_etc_php_fpm.d_www.conf14
4 files changed, 135 insertions, 0 deletions
diff --git a/roles/jails/14_freshrss/defaults/main.yml b/roles/jails/14_freshrss/defaults/main.yml
index 5416267..5a55d8f 100644
--- a/roles/jails/14_freshrss/defaults/main.yml
+++ b/roles/jails/14_freshrss/defaults/main.yml
@@ -1 +1,40 @@
userland: "15.0-RELEASE"
+
+zfs:
+ - name: zroot/jails/volumes/freshrss_data
+ mountpoint: /usr/local/FreshRSS/data
+
+pkg:
+ - nginx
+ - php82
+ - php82-ctype
+ - php82-curl
+ - php82-dom
+ - php82-filter
+ - php82-gd
+ - php82-iconv
+ - php82-mbstring
+ - php82-opcache
+ - php82-pdo
+ - php82-pdo_sqlite
+ - php82-phar
+ - php82-posix
+ - php82-session
+ - php82-simplexml
+ - php82-sqlite3
+ - php82-tokenizer
+ - php82-xml
+ - php82-xmlreader
+ - php82-xmlwriter
+ - php82-zip
+ - php82-extensions
+
+files:
+ - src: usr_local_etc_nginx_nginx.conf
+ dest: /usr/local/etc/nginx/nginx.conf
+ - src: usr_local_etc_php_fpm.d_www.conf
+ dest: /usr/local/etc/php-fpm.d/www.conf
+
+services:
+ - nginx
+ - php_fpm
diff --git a/roles/jails/14_freshrss/tasks/main.yml b/roles/jails/14_freshrss/tasks/main.yml
index 2abdaff..9cc08fc 100644
--- a/roles/jails/14_freshrss/tasks/main.yml
+++ b/roles/jails/14_freshrss/tasks/main.yml
@@ -1,2 +1,40 @@
- import_role:
name: jail
+ tasks_from: jail_setup
+
+- name: Download FreshRSS
+ shell: |
+ if [ ! -f /usr/local/FreshRSS/constants.php ]; then
+ fetch -qo /tmp/freshrss.tar.gz https://github.com/FreshRSS/FreshRSS/archive/refs/heads/edge.tar.gz
+ tar -xf /tmp/freshrss.tar.gz --strip-components=1 -C /usr/local/FreshRSS
+ rm -f /tmp/freshrss.tar.gz
+ fi
+ register: _freshrss_download
+ changed_when: "'constants.php' not in _freshrss_download.cmd"
+
+- name: Set FreshRSS data ownership
+ file:
+ path: /usr/local/FreshRSS/data
+ state: directory
+ owner: www
+ group: www
+ recurse: true
+
+- name: Create php-fpm socket directory
+ file:
+ path: /var/run/php
+ state: directory
+ owner: www
+ group: www
+ mode: "0755"
+
+- name: Symlink FreshRSS public to webroot
+ file:
+ src: /usr/local/FreshRSS/p
+ dest: /var/www
+ state: link
+ force: true
+
+- import_role:
+ name: jail
+ tasks_from: jail_launch
diff --git a/roles/jails/14_freshrss/templates/usr_local_etc_nginx_nginx.conf b/roles/jails/14_freshrss/templates/usr_local_etc_nginx_nginx.conf
new file mode 100644
index 0000000..f486e13
--- /dev/null
+++ b/roles/jails/14_freshrss/templates/usr_local_etc_nginx_nginx.conf
@@ -0,0 +1,44 @@
+worker_processes auto;
+
+events {
+ worker_connections 1024;
+}
+
+http {
+ include mime.types;
+ default_type application/octet-stream;
+
+ sendfile on;
+ keepalive_timeout 65;
+
+ server {
+ listen 80;
+ server_name freshrss.jan.systems;
+
+ root /var/www;
+ index index.php index.html index.htm;
+
+ access_log /var/log/freshrss.access.log;
+ error_log /var/log/freshrss.error.log;
+
+ location = /api/pshb.php { deny all; }
+ location ^~ /api/pshb.php/ { deny all; }
+
+ location / {
+ try_files $uri $uri/ /index.php?$query_string;
+ }
+
+ location ~ ^.+?\.php(/.*)?$ {
+ try_files $fastcgi_script_name =404;
+
+ fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
+ fastcgi_split_path_info ^(.+\.php)(/.*)$;
+
+ set $path_info $fastcgi_path_info;
+ fastcgi_param PATH_INFO $path_info;
+
+ include fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ }
+ }
+}
diff --git a/roles/jails/14_freshrss/templates/usr_local_etc_php_fpm.d_www.conf b/roles/jails/14_freshrss/templates/usr_local_etc_php_fpm.d_www.conf
new file mode 100644
index 0000000..351470c
--- /dev/null
+++ b/roles/jails/14_freshrss/templates/usr_local_etc_php_fpm.d_www.conf
@@ -0,0 +1,14 @@
+[www]
+user = www
+group = www
+
+listen = /var/run/php/php8.2-fpm.sock
+listen.owner = www
+listen.group = www
+listen.mode = 0660
+
+pm = dynamic
+pm.max_children = 5
+pm.start_servers = 2
+pm.min_spare_servers = 1
+pm.max_spare_servers = 3