aboutsummaryrefslogtreecommitdiffstats
path: root/roles/jails/05_homepage
diff options
context:
space:
mode:
authorJan Tuomi <jan@jantuomi.fi>2026-05-13 00:13:57 +0300
committerJan Tuomi <jan@jantuomi.fi>2026-05-16 18:42:27 +0300
commitb5860daf11ac353049cb1654b9414a129e5cfb96 (patch)
tree87ed89711e4f0e85ace0a97fa123199152c67302 /roles/jails/05_homepage
parent4715a28fdcd87440400d17154bfa361d99db29cc (diff)
Rework
Diffstat (limited to 'roles/jails/05_homepage')
-rw-r--r--roles/jails/05_homepage/defaults/main.yml18
-rw-r--r--roles/jails/05_homepage/tasks/main.yml2
-rw-r--r--roles/jails/05_homepage/templates/etc_crontab.j29
-rw-r--r--roles/jails/05_homepage/templates/usr_local_etc_nginx_nginx.conf.j255
4 files changed, 84 insertions, 0 deletions
diff --git a/roles/jails/05_homepage/defaults/main.yml b/roles/jails/05_homepage/defaults/main.yml
new file mode 100644
index 0000000..d48c9fa
--- /dev/null
+++ b/roles/jails/05_homepage/defaults/main.yml
@@ -0,0 +1,18 @@
+userland: "14.3-RELEASE"
+
+pkg:
+ - nginx
+ - rsync
+ - bash
+
+files:
+ - src: usr_local_etc_nginx_nginx.conf.j2
+ dest: /usr/local/etc/nginx/nginx.conf
+ - src: etc_crontab.j2
+ dest: /etc/crontab
+
+dirs:
+ - /var/www
+
+services:
+ - nginx
diff --git a/roles/jails/05_homepage/tasks/main.yml b/roles/jails/05_homepage/tasks/main.yml
new file mode 100644
index 0000000..2abdaff
--- /dev/null
+++ b/roles/jails/05_homepage/tasks/main.yml
@@ -0,0 +1,2 @@
+- import_role:
+ name: jail
diff --git a/roles/jails/05_homepage/templates/etc_crontab.j2 b/roles/jails/05_homepage/templates/etc_crontab.j2
new file mode 100644
index 0000000..8541f57
--- /dev/null
+++ b/roles/jails/05_homepage/templates/etc_crontab.j2
@@ -0,0 +1,9 @@
+# /etc/crontab - root's crontab for FreeBSD
+#
+#
+SHELL=/bin/sh
+PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
+#
+#minute hour mday month wday who command
+
+# TODO: update linklog
diff --git a/roles/jails/05_homepage/templates/usr_local_etc_nginx_nginx.conf.j2 b/roles/jails/05_homepage/templates/usr_local_etc_nginx_nginx.conf.j2
new file mode 100644
index 0000000..ee45405
--- /dev/null
+++ b/roles/jails/05_homepage/templates/usr_local_etc_nginx_nginx.conf.j2
@@ -0,0 +1,55 @@
+worker_processes auto;
+
+events {
+ worker_connections 1024;
+}
+
+http {
+ include mime.types;
+ default_type application/octet-stream;
+
+ sendfile on;
+ keepalive_timeout 65;
+
+ gzip on;
+ gzip_vary on;
+ gzip_proxied any;
+ gzip_comp_level 6;
+ gzip_min_length 256;
+
+ # Compress sensible, text-based response types (HTML is covered by default)
+ gzip_types
+ text/plain
+ text/css
+ text/xml
+ text/javascript
+ application/javascript
+ application/json
+ application/ld+json
+ application/xml
+ application/rss+xml
+ application/atom+xml
+ image/svg+xml;
+
+ server {
+ listen 80 default_server;
+ server_name _;
+
+ root /var/www;
+
+ index index.html;
+
+ # Migration redirects from legacy site
+ location ~ ^/archive(?:/(.*))?$ {
+ return 307 /posts/$1$is_args$args;
+ }
+ location = /feed.xml {
+ # Serve atom.xml content at the legacy feed.xml URL (no redirect)
+ rewrite ^ /atom.xml break;
+ }
+
+ location / {
+ try_files $uri $uri.html $uri/ =404;
+ }
+ }
+}