Updating dashboard to be cloud-init only. - selfhost - Incus configurations for my self-hosted setup.
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
---
(DIR) commit e1923390fc7e1b1c48e67e4277f2ebafb49b8499
(DIR) parent 19ece40bba3fc2a8f8d08770b14cf2b6e4700d8d
(HTM) Author: Jay Scott <me@jay.scot>
Date: Mon, 8 Jul 2024 20:08:01 +0100
Updating dashboard to be cloud-init only.
Diffstat:
M dashboard/dashboard.yaml | 24 ++++++++++++++++++++++++
D dashboard/files/lighttpd.conf | 29 -----------------------------
M dashboard/init.sh | 4 ----
3 files changed, 24 insertions(+), 33 deletions(-)
---
(DIR) diff --git a/dashboard/dashboard.yaml b/dashboard/dashboard.yaml
@@ -27,3 +27,27 @@ config:
nameservers: ['192.168.2.10', '1.1.1.1']
packages:
- lighttpd
+ runcmd:
+ - rc-service lighttpd start
+ write_files:
+ - path: /etc/lighttpd/lighttpd.conf
+ defer: true
+ append: true
+ content: |
+
+ 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 = "dashboard.jay.scot"
+ server.document-root = "/srv/www/"
+ }
+
+ $HTTP["scheme"] == "http" {
+ $HTTP["host"] =~ ".*" {
+ url.redirect = (".*" => "https://%0$0")
+ }
+ }
(DIR) diff --git a/dashboard/files/lighttpd.conf b/dashboard/files/lighttpd.conf
@@ -1,29 +0,0 @@
-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 = "dashboard.jay.scot"
- server.document-root = "/srv/www/"
-}
-
-$HTTP["scheme"] == "http" {
- $HTTP["host"] =~ ".*" {
- url.redirect = (".*" => "https://%0$0")
- }
-}
(DIR) diff --git a/dashboard/init.sh b/dashboard/init.sh
@@ -6,7 +6,3 @@ 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 exec $HOST -- cloud-init status --wait
-incus exec $HOST -- rc-service lighttpd start
-