diff options
author | EuAndreh <eu@euandre.org> | 2023-03-10 17:49:29 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2023-03-10 17:49:29 -0300 |
commit | 840e4a283dde35fe077ea26c738d663b60ac50a1 (patch) | |
tree | cb7ad48affcb8fddce1a840a46e4fd6de817ff2f | |
parent | src/infrastructure/ssh.conf: Move to dotfiles (diff) | |
download | toph-840e4a283dde35fe077ea26c738d663b60ac50a1.tar.gz toph-840e4a283dde35fe077ea26c738d663b60ac50a1.tar.xz |
rm -rf aux/ README.md
-rw-r--r-- | README.md | 101 | ||||
-rw-r--r-- | aux/.gitignore | 1 | ||||
-rwxr-xr-x | aux/ci/report.sh | 158 | ||||
-rw-r--r-- | aux/lib.sh | 33 | ||||
-rw-r--r-- | aux/tld.txt | 1 | ||||
-rwxr-xr-x | aux/workflow/TODOs.sh | 65 | ||||
-rw-r--r-- | aux/workflow/favicon.svg | 62 | ||||
-rw-r--r-- | aux/workflow/head.html | 2 | ||||
-rwxr-xr-x | aux/workflow/md2html.sh | 87 | ||||
-rw-r--r-- | aux/workflow/preamble.md.in | 16 | ||||
-rw-r--r-- | aux/workflow/style.css | 80 | ||||
-rw-r--r-- | description | 2 |
12 files changed, 1 insertions, 607 deletions
diff --git a/README.md b/README.md deleted file mode 100644 index 779907f..0000000 --- a/README.md +++ /dev/null @@ -1,101 +0,0 @@ -# VPS - -See the online [TODOs](TODOs.html). - -## Workflow - -### Re-creating everything from scratch - -```shell -guix environment -m guix/manifest.scm -git crypt unlock -direnv allow -terraform apply -guix deploy -``` - -### After an update on `vultr.tf` - -```shell -terraform apply -guix deploy -``` - -### After editing `vps.scm` or other OS files - -```shell -guix deploy -``` - -## "base-guix-image" - -The base `vps.scm` file in the current snapshot (snapshot ID 5c35fb3a74873) -is: - -```scheme -(use-modules (gnu)) -(use-service-modules networking ssh) -(use-package-modules ssh) - -(define ssh-public-key - "ssh-rsa ...") - -(define sudoers "\ -root ALL=(ALL) ALL -%wheel ALL=NOPASSWD: ALL\n") - -(operating-system - (locale "fr_FR.UTF-8") - (timezone "America/Sao_Paulo") - (keyboard-layout (keyboard-layout "us")) - (host-name "guix-pet-server") - (users (cons* (user-account - (name "andreh") - (group "users") - (home-directory "/home/andreh") - (supplementary-groups '("wheel"))) - %base-user-accounts)) - (sudoers-file (plain-file "sudoers" sudoers)) - (packages - (append (map specification->package - '("nss-certs" - "rsync")) - %base-packages)) - (services - (append - (list (service openssh-service-type - (openssh-configuration - (openssh openssh-sans-x) - (password-authentication? #false) - (authorized-keys - `(("andreh" ,(plain-file "id_rsa.pub" ssh-public-key)))))) - (service dhcp-client-service-type)) - %base-services)) - (bootloader - (bootloader-configuration - (bootloader grub-bootloader) - (target "/dev/vda") - (keyboard-layout keyboard-layout))) - (swap-devices - (list (uuid "79a91c82-f3e1-4ed7-8c4e-23569f1ae0ca"))) - (file-systems - (cons* (file-system - (mount-point "/") - (device - (uuid "fddb6a4c-8b8c-4f57-b274-5d6d33200f28" - 'ext4)) - (type "ext4")) - %base-file-systems))) -``` - -This basic setup allows it to boot, starts the OpenSSH server agent and allows -the listed `ssh-public-key` to login, and commands from the -"andreh" user can run `sudo` without password. - -### Development REPL - -Start a REPL from the terminal: - -```shell -$ cd sync && guix repl --listen=tcp:37146 -``` diff --git a/aux/.gitignore b/aux/.gitignore deleted file mode 100644 index 93cad91..0000000 --- a/aux/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/workflow/preamble.md diff --git a/aux/ci/report.sh b/aux/ci/report.sh deleted file mode 100755 index 21cc54e..0000000 --- a/aux/ci/report.sh +++ /dev/null @@ -1,158 +0,0 @@ -#!/bin/sh -set -eu - -TLD="$(cat aux/tld.txt)" -. aux/lib.sh - - -usage() { - cat <<-'EOF' - Usage: - aux/ci/report.sh -n NAME -o OUTDIR - aux/ci/report.sh -h - EOF -} - -help() { - cat <<-'EOF' - - - Options: - -n NAME the lowercase name of the project - -o OUTDIR directory where to write the files - -h, --help show this message - - - Generate static HTML files CI report from data stored in git - notes. The metadata about the CI runs are stored in the ref - "refs/notes/ci-data", in the format described by - "aux/ci/run.sh", and the raw logs are stored under the ref - "refs/notes/ci-logs". - - - Examples: - - Generate report for project "myapp" in "public/ci/": - - $ sh aux/ci/report.sh -n myapp -o public/ci - EOF -} - - -for flag in "$@"; do - case "$flag" in - --) - break - ;; - --help) - usage - help - exit - ;; - *) - ;; - esac -done - -while getopts 'n:o:h' flag; do - case "$flag" in - n) - NAME="$OPTARG" - ;; - o) - OUTDIR="$OPTARG" - ;; - h) - usage - help - exit - ;; - *) - usage >&2 - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - - -eval "$(assert_arg "${NAME:-}" '-n NAME')" -eval "$(assert_arg "${OUTDIR:-}" '-o OUTDIR')" - -PASS='✅' -FAIL='❌' - -mkdir -p "$OUTDIR"/logs "$OUTDIR"/data - -for c in $(git notes list | cut -d' ' -f2); do - DATA="$(git notes --ref=refs/notes/ci-data show "$c")" - FILENAME="$(echo "$DATA" | cut -d' ' -f2)" - echo "$DATA" > "$OUTDIR/data/$FILENAME" - git notes --ref=refs/notes/ci-logs show "$c" \ - > "$OUTDIR/logs/$FILENAME" -done - -{ - cat <<-EOF - <!DOCTYPE html> - <html lang="en"> - <head> - <meta charset="UTF-8" /> - <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta name="description" content="CI logs for $NAME" /> - <link rel="icon" type="image/svg+xml" href="favicon.svg" /> - <title>$NAME - CI logs</title> - - <style> - EOF - - cat aux/workflow/style.css | sed 's|^| |' - - cat <<-EOF - </style> - - <style> - pre { - display: inline; - } - ol { - list-style-type: disc; - } - </style> - </head> - <body> - <main> - <h1> - CI logs for - <a href="https://$TLD/$NAME/en/">$NAME</a> - </h1> - <ol> - EOF - - for f in $(find "$OUTDIR/data/" -type f | LANG=C.UTF-8 sort -r); do - DATA="$(cat "$f")" - STATUS="$(echo "$DATA" | cut -d\ -f1)" - FILENAME="$(echo "$DATA" | cut -d\ -f2)" - - if [ "$STATUS" = 0 ]; then - STATUS_MARKER="$PASS" - else - STATUS_MARKER="$FAIL" - fi - - cat <<-EOF - <li> - <a href="logs/$FILENAME">$STATUS_MARKER <pre>$FILENAME</pre></a> - </li> - EOF - done - - cat <<-EOF - </ol> - </main> - </body> - </html> - EOF -} > "$OUTDIR"/index.html.tmp - -mv "$OUTDIR"/index.html.tmp "$OUTDIR"/index.html diff --git a/aux/lib.sh b/aux/lib.sh deleted file mode 100644 index 9d183f9..0000000 --- a/aux/lib.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -assert_arg() { - if [ -z "$1" ]; then - printf 'Missing %s.\n\n' "$2" >&2 - cat <<-'EOF' - usage >&2 - exit 2 - EOF - fi -} - -uuid() { - od -xN20 /dev/urandom | - head -n1 | - awk '{OFS="-"; print $2$3,$4,$5,$6,$7$8$9}' -} - -tmpname() { - echo "${TMPDIR:-/tmp}/uuid-tmpname with spaces.$(uuid)" -} - -mkstemp() { - name="$(tmpname)" - touch "$name" - echo "$name" -} - -mkdtemp() { - name="$(tmpname)" - mkdir "$name" - echo "$name" -} diff --git a/aux/tld.txt b/aux/tld.txt deleted file mode 100644 index 058a2d6..0000000 --- a/aux/tld.txt +++ /dev/null @@ -1 +0,0 @@ -euandre.org
\ No newline at end of file diff --git a/aux/workflow/TODOs.sh b/aux/workflow/TODOs.sh deleted file mode 100755 index 8b06d15..0000000 --- a/aux/workflow/TODOs.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/sh -set -eu - -TLD="$(cat aux/tld.txt)" -PROJECT_UC= -while getopts 'n:N:m:o:' flag; do - case "$flag" in - n) - PROJECT="$OPTARG" - ;; - N) - PROJECT_UC="$OPTARG" - ;; - m) - MAILING_LIST="$OPTARG" - ;; - o) - OUTDIR="$OPTARG" - ;; - *) - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - -assert_arg() { - if [ -z "$1" ]; then - echo "Missing $2" >&2 - exit 2 - fi -} - -assert_arg "${PROJECT:-}" '-n PROJECT' -assert_arg "${MAILING_LIST:-}" '-m MAILING_LIST' -assert_arg "${OUTDIR:-}" '-o OUTDIR' - -if [ -z "${PROJECT_UC:-}" ]; then - PROJECT_UC="$PROJECT" -fi - - -td -H | - cat aux/workflow/preamble.md - | - sed \ - -e "s:@PROJECT_UC@:$PROJECT_UC:g" \ - -e "s:@PROJECT@:$PROJECT:g" \ - -e "s:@MAILING_LIST@:$MAILING_LIST:g" \ - -e "s:@TLD@:$TLD:g" | - pandoc \ - --toc \ - --highlight-style pygments \ - --toc-depth=2 \ - -s \ - --metadata title="$PROJECT_UC - TODOs" \ - --metadata lang=en \ - -r commonmark \ - -w html \ - -H aux/workflow/favicon.html \ - -H aux/workflow/style.css | - sed \ - -e 's:<a><a:<a:g' \ - -e 's:</a></a>:</a>:g' - -# FIXME: check TODOs.sh from euandre.org diff --git a/aux/workflow/favicon.svg b/aux/workflow/favicon.svg deleted file mode 100644 index ce566b2..0000000 --- a/aux/workflow/favicon.svg +++ /dev/null @@ -1,62 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"> - <path d="M 0 8 L 1 8 L 1 9 L 0 9 L 0 8 Z" /> - <path d="M 0 13 L 1 13 L 1 14 L 0 14 L 0 13 Z" /> - <path d="M 1 8 L 2 8 L 2 9 L 1 9 L 1 8 Z" /> - <path d="M 1 13 L 2 13 L 2 14 L 1 14 L 1 13 Z" /> - <path d="M 2 8 L 3 8 L 3 9 L 2 9 L 2 8 Z" /> - <path d="M 2 13 L 3 13 L 3 14 L 2 14 L 2 13 Z" /> - <path d="M 3 8 L 4 8 L 4 9 L 3 9 L 3 8 Z" /> - <path d="M 3 13 L 4 13 L 4 14 L 3 14 L 3 13 Z" /> - <path d="M 4 7 L 5 7 L 5 8 L 4 8 L 4 7 Z" /> - <path d="M 4 8 L 5 8 L 5 9 L 4 9 L 4 8 Z" /> - <path d="M 4 13 L 5 13 L 5 14 L 4 14 L 4 13 Z" /> - <path d="M 5 6 L 6 6 L 6 7 L 5 7 L 5 6 Z" /> - <path d="M 5 7 L 6 7 L 6 8 L 5 8 L 5 7 Z" /> - <path d="M 5 13 L 6 13 L 6 14 L 5 14 L 5 13 Z" /> - <path d="M 6 5 L 7 5 L 7 6 L 6 6 L 6 5 Z" /> - <path d="M 6 6 L 7 6 L 7 7 L 6 7 L 6 6 Z" /> - <path d="M 6 14 L 7 14 L 7 15 L 6 15 L 6 14 Z" /> - <path d="M 7 1 L 8 1 L 8 2 L 7 2 L 7 1 Z" /> - <path d="M 7 14 L 8 14 L 8 15 L 7 15 L 7 14 Z" /> - <path d="M 7 15 L 8 15 L 8 16 L 7 16 L 7 15 Z" /> - <path d="M 7 2 L 8 2 L 8 3 L 7 3 L 7 2 Z" /> - <path d="M 7 3 L 8 3 L 8 4 L 7 4 L 7 3 Z" /> - <path d="M 7 4 L 8 4 L 8 5 L 7 5 L 7 4 Z" /> - <path d="M 7 5 L 8 5 L 8 6 L 7 6 L 7 5 Z" /> - <path d="M 8 1 L 9 1 L 9 2 L 8 2 L 8 1 Z" /> - <path d="M 8 15 L 9 15 L 9 16 L 8 16 L 8 15 Z" /> - <path d="M 9 1 L 10 1 L 10 2 L 9 2 L 9 1 Z" /> - <path d="M 9 2 L 10 2 L 10 3 L 9 3 L 9 2 Z" /> - <path d="M 9 6 L 10 6 L 10 7 L 9 7 L 9 6 Z" /> - <path d="M 9 15 L 10 15 L 10 16 L 9 16 L 9 15 Z" /> - <path d="M 10 2 L 11 2 L 11 3 L 10 3 L 10 2 Z" /> - <path d="M 10 3 L 11 3 L 11 4 L 10 4 L 10 3 Z" /> - <path d="M 10 4 L 11 4 L 11 5 L 10 5 L 10 4 Z" /> - <path d="M 10 5 L 11 5 L 11 6 L 10 6 L 10 5 Z" /> - <path d="M 10 6 L 11 6 L 11 7 L 10 7 L 10 6 Z" /> - <path d="M 11 6 L 12 6 L 12 7 L 11 7 L 11 6 Z" /> - <path d="M 11 8 L 12 8 L 12 9 L 11 9 L 11 8 Z" /> - <path d="M 10 15 L 11 15 L 11 16 L 10 16 L 10 15 Z" /> - <path d="M 11 10 L 12 10 L 12 11 L 11 11 L 11 10 Z" /> - <path d="M 11 12 L 12 12 L 12 13 L 11 13 L 11 12 Z" /> - <path d="M 11 14 L 12 14 L 12 15 L 11 15 L 11 14 Z" /> - <path d="M 11 15 L 12 15 L 12 16 L 11 16 L 11 15 Z" /> - <path d="M 12 6 L 13 6 L 13 7 L 12 7 L 12 6 Z" /> - <path d="M 12 8 L 13 8 L 13 9 L 12 9 L 12 8 Z" /> - <path d="M 12 10 L 13 10 L 13 11 L 12 11 L 12 10 Z" /> - <path d="M 12 12 L 13 12 L 13 13 L 12 13 L 12 12 Z" /> - <path d="M 12 14 L 13 14 L 13 15 L 12 15 L 12 14 Z" /> - <path d="M 13 6 L 14 6 L 14 7 L 13 7 L 13 6 Z" /> - <path d="M 13 8 L 14 8 L 14 9 L 13 9 L 13 8 Z" /> - <path d="M 13 10 L 14 10 L 14 11 L 13 11 L 13 10 Z" /> - <path d="M 13 12 L 14 12 L 14 13 L 13 13 L 13 12 Z" /> - <path d="M 13 13 L 14 13 L 14 14 L 13 14 L 13 13 Z" /> - <path d="M 13 14 L 14 14 L 14 15 L 13 15 L 13 14 Z" /> - <path d="M 14 7 L 15 7 L 15 8 L 14 8 L 14 7 Z" /> - <path d="M 14 8 L 15 8 L 15 9 L 14 9 L 14 8 Z" /> - <path d="M 14 9 L 15 9 L 15 10 L 14 10 L 14 9 Z" /> - <path d="M 14 10 L 15 10 L 15 11 L 14 11 L 14 10 Z" /> - <path d="M 14 11 L 15 11 L 15 12 L 14 12 L 14 11 Z" /> - <path d="M 14 12 L 15 12 L 15 13 L 14 13 L 14 12 Z" /> -</svg> diff --git a/aux/workflow/head.html b/aux/workflow/head.html deleted file mode 100644 index 3902690..0000000 --- a/aux/workflow/head.html +++ /dev/null @@ -1,2 +0,0 @@ -<link rel="icon" href="favicon.svg" type="image/svg+xml" /> -<link rel="stylesheet" href="style.css" type="text/css" /> diff --git a/aux/workflow/md2html.sh b/aux/workflow/md2html.sh deleted file mode 100755 index 957bfc2..0000000 --- a/aux/workflow/md2html.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/bin/sh -set -eu - -. aux/lib.sh - -usage() { - cat <<-'EOF' - Usage: - aux/workflow/md2html.sh -N NAME_UC -T TITLE [-D TOC_DEPTH] < FILE.md - aux/workflow/md2html.sh -h - EOF -} - -help() { - cat <<-'EOF' - - Options: - -N NAME_UC the uppercased name of the project - -T TITLE the required title of the generated HTML - document - -D TOC_DEPTH the depth of the generated table of - contents (default: 2) - -h, --help show this message - - - Read markdown text from STDIN and emit HTML to STDOUT. - EOF -} - -for flag in "$@"; do - case "$flag" in - --) - break - ;; - --help) - usage - help - exit - ;; - *) - ;; - esac -done - -TOC_DEPTH=2 -while getopts 'N:T:D:h' flag; do - case "$flag" in - N) - NAME_UC="$OPTARG" - ;; - T) - TITLE="$OPTARG" - ;; - D) - TOC_DEPTH="$OPTARG" - ;; - h) - usage - help - exit - ;; - *) - usage >&2 - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - -eval "$(assert_arg "${NAME_UC:-}" '-T TITLE')" -eval "$(assert_arg "${TITLE:-}" '-T TITLE')" - -THE_LANG='en' - -ALTERNATES=/dev/null - -pandoc \ - -s \ - --toc \ - --toc-depth="$TOC_DEPTH" \ - --highlight-style=pygments \ - --metadata lang="$THE_LANG" \ - --metadata title="$TITLE - $NAME_UC" \ - -r commonmark \ - -w html \ - -H aux/workflow/head.html \ - -H "$ALTERNATES" diff --git a/aux/workflow/preamble.md.in b/aux/workflow/preamble.md.in deleted file mode 100644 index 1d17997..0000000 --- a/aux/workflow/preamble.md.in +++ /dev/null @@ -1,16 +0,0 @@ -# About - -TODOs for [@PROJECT_UC@](https://@TLD@/@PROJECT@/en/). - -Register a new one at -<span id="new">[@MAILING_LIST@](mailto:@MAILING_LIST@?subject=%5B@PROJECT@%5D%20BUG%20or%20TASK%3A%20%3Cdescription%3E)</span> -and see [existing discussions](@LIST_SEARCH@). - -*Você também pode escrever em português*. - -*Vous pouvez aussi écrire en français*. - -*Vi povas ankaŭ skribi esperante*. - -*Tu también puedes escribir en español*. - diff --git a/aux/workflow/style.css b/aux/workflow/style.css deleted file mode 100644 index 4f3c83e..0000000 --- a/aux/workflow/style.css +++ /dev/null @@ -1,80 +0,0 @@ -html { - line-height: 1.5; -} - -body { - max-width: 800px; - margin: 0 auto 0 auto; -} - -hr { - background-color: #ccc; -} - -.header-anchor { - opacity: 0.5; - display: inline-block; -} - -.tag { - font-family: monospace; - font-size: 70%; - background-color: lightgray; - color: black; - padding: 3px; - border-radius: 5px; -} - -.TODO { - color: brown; -} - -.DOING { - color: yellowgreen; -} - -.WAITING, .MEETING { - color: orange; -} - -.INACTIVE { - color: gray; -} - -.NEXT { - color: red; -} - -.CANCELLED, .DONE, .WONTFIX { - color: green; -} - -pre, code { - background-color: #ddd; - border-radius: 5px; - padding: 3px; -} - -pre > code { - overflow: auto; - white-space: pre; -} - -@media(prefers-color-scheme: dark) { - :root { - color: white; - background-color: black; - } - - a { - color: hsl(211, 100%, 60%); - } - - a:visited { - color: hsl(242, 100%, 80%); - } - - pre, code { - background-color: #222; - } -} diff --git a/description b/description index fe0a0cb..e448be9 100644 --- a/description +++ b/description @@ -1 +1 @@ -Setup and configuration for VPS and other personal servers. +Setup and configuration for VPS and other personal servers |