Moving git HTML creation to own container. - selfhost - Incus configurations for my self-hosted setup.
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
       ---
 (DIR) commit ea21275670b896e65cbc166dcecdf12c2ccf8e4d
 (DIR) parent fcebb4eb3163de03350fcaae3c8890aea49489ca
 (HTM) Author: Jay Scott <me@jay.scot>
       Date:   Sat, 13 Jul 2024 19:54:22 +0100
       
       Moving git HTML creation to own container.
       
       Diffstat:
         D git/files/favicon.png               |       0 
         D git/files/logo.png                  |       0 
         D git/files/sealgit                   |       0 
         D git/files/stagit                    |       0 
         D git/files/stagit.sh                 |      24 ------------------------
         D git/files/style.css                 |      71 -------------------------------
         D git/files/templates/index.html      |      34 -------------------------------
         M git/git.yaml                        |       7 -------
         M git/init.sh                         |       7 -------
         A sealgit/files/sealgit               |       0 
         A sealgit/init.sh                     |       9 +++++++++
         A sealgit/sealgit.yaml                |      39 +++++++++++++++++++++++++++++++
       
       12 files changed, 48 insertions(+), 143 deletions(-)
       ---
 (DIR) diff --git a/git/files/favicon.png b/git/files/favicon.png
       Binary files differ.
 (DIR) diff --git a/git/files/logo.png b/git/files/logo.png
       Binary files differ.
 (DIR) diff --git a/git/files/sealgit b/git/files/sealgit
       Binary files differ.
 (DIR) diff --git a/git/files/stagit b/git/files/stagit
       Binary files differ.
 (DIR) diff --git a/git/files/stagit.sh b/git/files/stagit.sh
       @@ -1,24 +0,0 @@
       -#!/bin/sh
       -
       -reposdir="/srv/git"
       -wwwdir="/srv/www"
       -
       -#stagit-index "${reposdir}/"*/ | sed 's|/log\.html||g' > "${wwwdir}/index.html"
       -sealgit -p /srv/git/ -g > "${wwwdir}/index.html"
       -
       -for dir in "${reposdir}/"*/; do
       -
       -        r=$(basename "${dir}")
       -        printf "%s... " "${r}"
       -
       -        mkdir -p "${wwwdir}/${r}"
       -        cd "${wwwdir}/${r}" || continue
       -        stagit "${reposdir}/${r}"
       -
       -        ln -sf log.html index.html
       -        ln -sf ../style.css style.css
       -        ln -sf ../logo.png logo.png
       -        ln -sf ../favicon.png favicon.png
       -
       -        echo "done"
       -done
 (DIR) diff --git a/git/files/style.css b/git/files/style.css
       @@ -1,71 +0,0 @@
       -body {
       -    color: #000;
       -    background-color: #FFF;
       -    font-family: monospace;
       -}
       -
       -table { 
       -    padding-left: 20px;
       -}
       -
       -h1 {
       -    font-size: 2em;
       -    margin: 0;
       -}
       -
       -h2, h3, h4, h5, h6 {
       -    font-size: 1em;
       -    margin: 0;
       -}
       -
       -table td {
       -        padding: 0 0.4em;
       -}
       -
       -a {
       -    color: #000;
       -    text-decoration: none;
       -}
       -
       -a:hover {
       -    color: #333;
       -    font-weight: bold;
       -}
       -
       -a:target {
       -    background-color: #CCC;
       -}
       -
       -.desc {
       -    color: #555;
       -    margin-bottom: 1em;
       -}
       -
       -hr {
       -    border: 0;
       -    border-top: 1px solid #555;
       -    height: 1px;
       -}
       -
       -pre {
       -    font-family: monospace;
       -}
       -
       -@media (prefers-color-scheme: dark) {
       -    body {
       -        background-color: #000;
       -        color: #BDBDBD;
       -    }
       -    hr {
       -        border-color: #222;
       -    }
       -    a {
       -        color: #56C8FF;
       -    }
       -    a:target {
       -        background-color: #222;
       -    }
       -    .desc {
       -        color: #AAA;
       -    }
       -}
 (DIR) diff --git a/git/files/templates/index.html b/git/files/templates/index.html
       @@ -1,33 +0,0 @@
       -<!DOCTYPE html>
       -<html>
       -<head>
       -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
       -<meta name="viewport" content="width=device-width, initial-scale=1" />
       -<title>repos for days!</title>
       -<link rel="icon" type="image/png" href="favicon.png" />
       -<link rel="stylesheet" type="text/css" href="style.css" />
       -</head>
       -<body>
       -<table>
       -<tr><td><img src="logo.png" alt="" width="32" height="32" /></td>
       -<td><span class="desc">repos for days!</span></td></tr><tr><td></td><td>
       -</td></tr>
       -</table>
       -<hr/>
       -<div id="content">
       -<table id="index">
       -<thead>
       -<tr><td><b>Name</b></td><td><b>Description</b></td><td><b>Last commit</b></td></tr>
       -</thead>
       -<tbody>
       -{{range $group, $repos := .}}
       -<tr><td colspan="3"><b>{{if eq $group ""}} {{else}}<hr>{{end}}</b></td></tr>
       -  {{range $repos}}
       -  <tr><td><a href="{{.Name}}">{{.Name}}</a></td><td>{{.Description}}</td><td>{{.LastCommit}}</td></tr>
       -  {{end}}
       -{{end}}
       -</tbody>
       -</table>
       -</div>
       -</body>
       -</html>
       -\ No newline at end of file
 (DIR) diff --git a/git/git.yaml b/git/git.yaml
       @@ -5,12 +5,6 @@ devices:
            type: disk
            shift: true
        
       -  static:
       -    path: /srv/www
       -    source: /srv/services/static/git
       -    type: disk
       -    shift: true
       -
        config:
          cloud-init.network-config: |
            version: 2
       @@ -37,4 +31,3 @@ config:
              - echo "git:*" | chpasswd -e
            packages:
              - git
       -      - libgit2-dev
 (DIR) diff --git a/git/init.sh b/git/init.sh
       @@ -10,10 +10,3 @@ incus file push ./files/stagit.sh $HOST/etc/periodic/hourly/ -pv --mode 755
        
        incus exec $HOST -- cloud-init status --wait
        incus exec $HOST -- rc-update add sshd
       -incus exec $HOST -- mkdir /root/templates
       -
       -incus file push ./files/templates/index.html $HOST/root/templates/ -pv --mode 755
       -incus file push ./files/stagit $HOST/usr/bin/ -pv --mode 755
       -incus file push ./files/sealgit $HOST/usr/bin/ -pv --mode 755
       -
       -incus exec $HOST -- run-parts /etc/periodic/hourly
 (DIR) diff --git a/sealgit/files/sealgit b/sealgit/files/sealgit
       Binary files differ.
 (DIR) diff --git a/sealgit/init.sh b/sealgit/init.sh
       @@ -0,0 +1,9 @@
       +#!/bin/sh
       +
       +HOST=sealgit
       +
       +incus stop $HOST
       +incus delete $HOST
       +incus launch images:alpine/3.20/cloud $HOST < $HOST.yaml
       +
       +incus file push ./files/sealgit $HOST/usr/bin/ -pv --mode 755
 (DIR) diff --git a/sealgit/sealgit.yaml b/sealgit/sealgit.yaml
       @@ -0,0 +1,39 @@
       +devices:
       +  repos:
       +    path: /srv/git
       +    source: /srv/services/git
       +    type: disk
       +
       +  static:
       +    path: /srv/www
       +    source: /srv/services/static/git
       +    type: disk
       +    shift: true
       +
       +config:
       +  cloud-init.network-config: |
       +    version: 2
       +    ethernets:
       +      eth0:
       +        addresses:
       +          - 192.168.2.13/24
       +        gateway4: 192.168.2.1
       +  cloud-init.user-data: |
       +    #cloud-config
       +    package_upgrade: true
       +    hostname: sealgit.jay.scot
       +    timezone: Europe/London
       +    manage_resolv_conf: true
       +    resolv_conf:
       +      nameservers: ['192.168.2.10', '1.1.1.1']
       +    write_files:
       +      - path: /etc/periodic/hourly/sealgit.sh
       +        permissions: '0755'
       +        content: |
       +          #!/bin/sh
       +
       +          reposdir="/srv/git"
       +          wwwdir="/srv/www"
       +
       +          sealgit -g -p $reposdir -o "$wwwdir" -i .ssh
       +