| Rename static to local and refactoring. - selfhost - Incus configurations for m… | |
| Log | |
| Files | |
| Refs | |
| README | |
| --- | |
| commit 8ad1036215ba5ae6cf91df0267771155417bf532 | |
| parent 48f39fe4a0a98c2d068246a14f7a0c2858a4d137 | |
| Author: Jay Scott <[email protected]> | |
| Date: Wed, 10 Jul 2024 07:58:05 +0100 | |
| Rename static to local and refactoring. | |
| Diffstat: | |
| A local/init.sh | 8 ++++++++ | |
| A local/local.yaml | 69 ++++++++++++++++++++++++++++++ | |
| D static/init.sh | 8 -------- | |
| D static/static.yaml | 81 ------------------------------ | |
| 4 files changed, 77 insertions(+), 89 deletions(-) | |
| --- | |
| diff --git a/local/init.sh b/local/init.sh | |
| @@ -0,0 +1,8 @@ | |
| +#!/bin/sh | |
| + | |
| +HOST=local | |
| + | |
| +incus stop $HOST | |
| +incus delete $HOST | |
| +incus launch images:alpine/3.20/cloud $HOST < $HOST.yaml | |
| + | |
| diff --git a/local/local.yaml b/local/local.yaml | |
| @@ -0,0 +1,69 @@ | |
| +devices: | |
| + dashboard: | |
| + path: /srv/www/dashboard | |
| + source: /srv/services/static/dashboard | |
| + type: disk | |
| + | |
| + docs: | |
| + path: /srv/www/docs | |
| + source: /srv/services/static/docs | |
| + type: disk | |
| + | |
| + feeds: | |
| + path: /srv/www/feeds | |
| + source: /srv/services/static/feeds | |
| + type: disk | |
| + | |
| + git: | |
| + path: /srv/www/git | |
| + source: /srv/services/static/git | |
| + type: disk | |
| + | |
| + 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.11/24 | |
| + gateway4: 192.168.2.1 | |
| + cloud-init.user-data: | | |
| + #cloud-config | |
| + package_upgrade: true | |
| + hostname: local.jay.scot | |
| + timezone: Europe/London | |
| + manage_resolv_conf: true | |
| + resolv_conf: | |
| + 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") | |
| + | |
| + 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" =>… | |
| + | |
| + $HTTP["host"] == "local.jay.scot" { | |
| + server.document-root = "/srv/www" | |
| + } | |
| + | |
| + $HTTP["scheme"] == "http" { | |
| + $HTTP["host"] =~ ".*" { | |
| + url.redirect = (".*" => "https://%0$0") | |
| + } | |
| + } | |
| diff --git a/static/init.sh b/static/init.sh | |
| @@ -1,8 +0,0 @@ | |
| -#!/bin/sh | |
| - | |
| -HOST=static | |
| - | |
| -incus stop $HOST | |
| -incus delete $HOST | |
| -incus launch images:alpine/3.20/cloud $HOST < $HOST.yaml | |
| - | |
| diff --git a/static/static.yaml b/static/static.yaml | |
| @@ -1,81 +0,0 @@ | |
| -devices: | |
| - dashboard: | |
| - path: /srv/www/dashboard | |
| - source: /srv/services/static/dashboard | |
| - type: disk | |
| - | |
| - docs: | |
| - path: /srv/www/docs | |
| - source: /srv/services/static/docs | |
| - type: disk | |
| - | |
| - feeds: | |
| - path: /srv/www/feeds | |
| - source: /srv/services/static/feeds | |
| - type: disk | |
| - | |
| - git: | |
| - path: /srv/www/git | |
| - source: /srv/services/static/git | |
| - type: disk | |
| - | |
| - 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.11/24 | |
| - gateway4: 192.168.2.1 | |
| - cloud-init.user-data: | | |
| - #cloud-config | |
| - package_upgrade: true | |
| - hostname: static.jay.scot | |
| - timezone: Europe/London | |
| - manage_resolv_conf: true | |
| - resolv_conf: | |
| - 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") | |
| - | |
| - 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" =>… | |
| - | |
| - $HTTP["host"] == "dashboard.jay.scot" { | |
| - server.document-root = "/srv/www/dashboard" | |
| - } | |
| - | |
| - $HTTP["host"] == "docs.jay.scot" { | |
| - server.document-root = "/srv/www/docs" | |
| - } | |
| - | |
| - $HTTP["host"] == "feeds.jay.scot" { | |
| - server.document-root = "/srv/www/feeds" | |
| - } | |
| - | |
| - $HTTP["host"] == "git.jay.scot" { | |
| - server.document-root = "/srv/www/git" | |
| - } | |
| - | |
| - $HTTP["scheme"] == "http" { | |
| - $HTTP["host"] =~ ".*" { | |
| - url.redirect = (".*" => "https://%0$0") | |
| - } | |
| - } |