Corefile is:
example.com {
file db.example.com
debug
lboverlay example.com
forward . 8.8.8.8
}
| difference between my newer impl and coredns for a plugin that adds a NSID OPT rr to the Msg. | |
| First coredns, after that "testserv" | |
| ```go | |
| // Nsid plugin | |
| type Nsid struct { | |
| Next plugin.Handler | |
| Data string | |
| } |
| # Fetch a mr/pr number from the hub and check it out in either mr-<num> or pr-<num> branch | |
| pr = "!f() { \ | |
| case $(git hubtype) in \ | |
| github) git githubpr;; \ | |
| gitlab) git gitlabpr;; \ | |
| esac; \ | |
| }; f" | |
| gitlabpr = "!f() { pr=$(basename $1); git fetch origin pull/$pr/head:pr-$pr && git checkout pr-$pr; }; f" | |
| githubpr = "!f() { mr=$(basename $1); git fetch origin merge-requests/$mr/head:mr-$mr && git checkout mr-$mr; }; f" | |
| hubtype = "!f() { case $(git remote get-url origin) in *github*) echo github;; *gitlab*) echo gitlab;; esac; }; f" |
| package main | |
| import ( | |
| "bytes" | |
| "flag" | |
| "fmt" | |
| "log" | |
| "os" | |
| "os/exec" | |
| "strconv" |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/lightbox2/2.11.1/css/lightbox.min.css" integrity="sha256-tBxlolRHP9uMsEFKVk+hk//ekOlXOixLKvye5W2WR5c=" crossorigin="anonymous" /> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/lightbox2/2.11.1/js/lightbox.min.js" integrity="sha256-CtKylYan+AJuoH8jrMht1+1PMhMqrKnB8K5g012WN5I=" crossorigin="anonymous"></script> | |
| <!-- | |
| The galleries must be all lowercase otherwise the caption are not found. | |
| We use a flexport to show 3 photos in a row, and that should work in mobile as well. | |
| Thumbs are generated on the fly. | |
| Each gallery is placed under a content/galleries as: |
| # check current service | |
| % ./gitopperctl list service @localhost grafana-server | |
| SERVICE HASH STATE INFO SINCE | |
| grafana-server 606eb576c1b91248e4c1c4cd0d720f27ac0deb70 OK 0001-01-01 00:00:00 +0000 UTC | |
| # oh no, we need to rollback | |
| % ./gitopperctl state rollback @localhost grafana-server 8df1b3db679253ba501d594de285cc3e9ed308ed | |
| # check |
| package dns | |
| import ( | |
| "fmt" | |
| "net" | |
| "testing" | |
| ) | |
| // Test function to test how the API feels. | |
| func TestDNS(t *testing.T) { |
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "os" | |
| "github.com/miekg/dns" | |
| ) |
Corefile is:
example.com {
file db.example.com
debug
lboverlay example.com
forward . 8.8.8.8
}
Goal: a minimal grafana that is 100% provisioned via files. There is no U/I to add dashoards on the fly.
| # Force resigning | |
| $ rm /var/lib/coredns/db.miek.nl.signed | |
| [ERROR] plugin/file: Failed to open zone "miek.nl." in "/var/lib/coredns/db.miek.nl.signed": open /var/lib/coredns/db.miek.nl.signed: no such file or directory | |
| $ kill -SIGUSR1 $(pidof coredns) | |
| [INFO] SIGUSR1: Reloading | |
| [INFO] Reloading |