reorg
Jes Olson j3s@c3f.net
Mon, 26 Sep 2022 22:03:53 -0500
6 files changed,
16 insertions(+),
79 deletions(-)
D
libs/common
@@ -1,13 +0,0 @@
-# * -want_backup_user=true -die() { - printf "%s.\n" "$1" - exit 1 -} - -# *.cyberia.club -operators="jes forest zico queerposting sanine" # this var will be present on all *.cyberia.club systems - -# domechild.cyberia.club -weirdo=yes # this var will only be present during domechild's run -
A
main.go
@@ -0,0 +1,9 @@
+package main + +import ( + "fmt" +) + +func main() { + fmt.Println("zoa zoa zoa") +}
M
scripts/host.example.org
→
examples/host.example.org
@@ -12,9 +12,10 @@ # above into a single line:
# remember: file, owners, perms # and optionally: a command to run if the file is updated -zoa-file repositories /etc/apk/repositories root:root 0644 'apk update' - -zoa file -f repositories -o root -g root -m 0644 /etc/apk/repositories +file='/etc/apk/repositories' +zoa-file repositories $file +chown root:root $file +chmod 0644 $file # zoa-file will only run "apk update" if the file is changed, or if its permissions # change. zoa-file also gives you more pretty output.
D
zoa
@@ -1,60 +0,0 @@
-#!/bin/sh -# -# zoa -# a simple posix config management system -# intended for human-scale usage - -# TODO: force shellcheck - -# funcs -# TODO: pretty print func - -die() { - printf "%s\n." "$1" - exit 1 -} - -# vars -# TODO: check for $1 $2 -# TODO: if zoa_repo == dev, skip git and use local dev mode -# TODO: check for bad chars in zoa_repo or zoa_branch -# TODO: make zoa_files lowercase everywhere -# TODO: if dev, make initial host file if it doesn't exist -# would "/" fuck us? etc -# aka validate input - -zoa_repo="$1" -zoa_branch="$2" -zoa_dev="$3" -if [ -n "$zoa_dev" ]; then - zoa_dir="./" - # skip the whole git clone & fetch -else - zoa_dir="/var/lib/zoa" -fi -zoa_workdir="$zoa_dir/$zoa_repo/$zoa_branch" -zoa_scripts="$zoa_workdir/scripts" -zoa_files="$zoa_workdir/files" -entrypoint="$zoa_workdir/hosts/$(uname -n)" - -# handle globhost? -if [ -f "$entrypoint" ]; then - exec "$zoa_workdir/hosts/$(uname -n)" -else - die "$entrypoint does not exist" -fi - -# check if repo exists locally -# true: -# check if git repo -# true: nothing -# false: exit -# check if branch is correct -# true: nothing -# false: exit -# fetch latest -# false: -# mkdir -p /var/lib/zoa/repos/ -# clone the repo to /var/lib/zoa/repo/branchname -# TODO: do we need branchname? -