Adding sfeed container. - selfhost - Incus configurations for my self-hosted setup.
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
---
(DIR) commit 62b0fa7fad89fc5b453edcfb915fd8222b74bc86
(DIR) parent 7f29fb96e0c3f9a9195a0475c71c7a5476c09cbd
(HTM) Author: Jay Scott <me@jay.scot>
Date: Thu, 20 Jun 2024 16:59:09 +0100
Adding sfeed container.
Diffstat:
A feeds/feeds.yaml | 32 +++++++++++++++++++++++++++++++
A feeds/files/fetch.sh | 5 +++++
A feeds/files/lighttpd.conf | 29 +++++++++++++++++++++++++++++
A feeds/files/style.css | 68 +++++++++++++++++++++++++++++++
A feeds/init.sh | 13 +++++++++++++
5 files changed, 147 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/feeds/feeds.yaml b/feeds/feeds.yaml
@@ -0,0 +1,32 @@
+devices:
+ feeds:
+ path: /root/.sfeed
+ source: /srv/services/feeds
+ type: disk
+ shift: true
+ certs:
+ path: /etc/lighttpd/certs
+ source: /srv/certs
+ type: disk
+ shift: true
+
+config:
+ cloud-init.network-config: |
+ version: 2
+ ethernets:
+ eth0:
+ addresses:
+ - 192.168.2.16/24
+ gateway4: 192.168.2.1
+ cloud-init.user-data: |
+ #cloud-config
+ package_upgrade: true
+ hostname: feeds.jay.scot
+ timezone: Europe/London
+ manage_resolv_conf: true
+ resolv_conf:
+ nameservers: ['192.168.2.10', '1.1.1.1']
+ packages:
+ - lighttpd
+ - sfeed
+ - curl
(DIR) diff --git a/feeds/files/fetch.sh b/feeds/files/fetch.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+sfeed_update
+sfeed_html /root/.sfeed/feeds/* > /srv/index.html
+cp /root/.sfeed/style.css /srv/
(DIR) diff --git a/feeds/files/lighttpd.conf b/feeds/files/lighttpd.conf
@@ -0,0 +1,29 @@
+var.basedir = "/var/www/localhost"
+var.logdir = "/var/log/lighttpd"
+var.statedir = "/var/lib/lighttpd"
+
+include "mime-types.conf"
+server.username = "lighttpd"
+server.groupname = "lighttpd"
+server.document-root = var.basedir + "/htdocs"
+server.pid-file = "/run/lighttpd.pid"
+server.errorlog = var.logdir + "/error.log"
+index-file.names = ("index.html")
+
+server.modules += ( "mod_redirect", "mod_openssl")
+
+$SERVER["socket"] == ":443" {
+ ssl.engine = "enable"
+ ssl.pemfile = "/etc/lighttpd/certs/jay.scot.cer"
+ ssl.privkey = "/etc/lighttpd/certs/jay.scot.key"
+ ssl.openssl.ssl-conf-cmd = ("MinProtocol" => "TLSv1.3", "Options" => "-ServerPreference")
+
+ server.name = "feeds.jay.scot"
+ server.document-root = "/srv/"
+}
+
+$HTTP["scheme"] == "http" {
+ $HTTP["host"] =~ ".*" {
+ url.redirect = (".*" => "https://%0$0")
+ }
+}
(DIR) diff --git a/feeds/files/style.css b/feeds/files/style.css
@@ -0,0 +1,68 @@
+body {
+ background-color: #fff;
+ color: #333;
+ font-family: monospace;
+ font-size: 11pt;
+ margin: 0;
+ overflow: hidden;
+ padding: 0;
+}
+h2 {
+ font-size: 14pt;
+ margin: 0.5em 0;
+}
+#sidebar ul, #sidebar ul li {
+ list-style: none;
+ margin: 0;
+ padding: 0;
+ font-size: 9pt;
+}
+#sidebar {
+ background-color: inherit;
+}
+#sidebar a {
+ padding: 5px 3px 5px 10px;
+ display: block;
+ text-decoration: none;
+}
+a {
+ text-decoration: none;
+}
+a:hover {
+ background-color: grey;
+ color: black
+}
+
+#sidebar a, #items h2 a {
+ color: inherit;
+}
+div#items {
+ padding: 0 15px;
+}
+body.noframe div#sidebar {
+ height: 100%;
+ left: 0;
+ overflow: auto;
+ position: fixed;
+ top: 0;
+ width: 250px;
+ z-index: 999;
+}
+body.noframe div#items {
+ height: 100%;
+ left: 250px;
+ overflow: auto;
+ position: absolute;
+ right: 0;
+ top: 0;
+}
+body.noframe div#items.nosidebar {
+ left: 0px;
+}
+body.frame {
+ overflow: auto;
+}
+body.frame #sidebar br {
+ display: none;
+}
+
(DIR) diff --git a/feeds/init.sh b/feeds/init.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+HOST=feeds
+
+incus stop $HOST
+incus delete $HOST
+incus launch images:alpine/3.20/cloud $HOST < $HOST.yaml
+
+incus file push ./files/lighttpd.conf $HOST/etc/lighttpd/ -pv --mode 644
+incus file push ./files/fetch.sh $HOST/etc/periodic/hourly/ -pv --mode 755
+incus exec $HOST -- cloud-init status --wait
+incus exec $HOST -- rc-service lighttpd start
+