Skip to content

Instantly share code, notes, and snippets.

View sirkirby's full-sized avatar
:octocat:

Chris Kirby sirkirby

:octocat:
View GitHub Profile
@sirkirby
sirkirby / SerilogEventGridEvent.json
Last active October 6, 2017 22:48
Example event payload generated from serilog event grid sink
{
"id": "85a69262-5b1a-43e5-80d9-af6c98c7ba49",
"eventType": "importComplete",
"subject": "myApp/myLogic/900000",
"eventTime": "2017-10-05T20:47:58.2488847Z",
"data": [
{
"key": "recordCount",
"value": 1452
},

Keybase proof

I hereby claim:

  • I am sirkirby on github.
  • I am chriskirby (https://keybase.io/chriskirby) on keybase.
  • I have a public key ASBT3pQVwsN0LTNVsgsEl7AxPccPMkgR30RFMKrhK6u6nAo

To claim this, I am signing this object:

@sirkirby
sirkirby / cloudflare-tunnel-ingress.yml
Created January 13, 2022 01:15
Cloudflare tunnel ingress rules
tunnel: fd1f3bb2-ca6d-4807-9e60-b5b6834d060e
credentials-file: fd1f3bb2-ca6d-4807-9e60-b5b6834d060e.json
originRequest: # Root-level configuration
connectTimeout: 30s
noTLSVerify: true
ingress:
# plex media server
- hostname: plex.mydomain.net
service: https://192.168.1.20:32400
@sirkirby
sirkirby / cloudflared-config.service
Created January 13, 2022 01:26
Cloudflared service config
[Unit]
Description=Cloudflare Tunnel
After=network.target
[Service]
TimeoutStartSec=0
Type=notify
ExecStart=/usr/local/bin/cloudflared --config /home/chris/.cloudflared/config.yml --autoupdate-freq 24h tunnel run
Restart=on-failure
RestartSec=5s
@sirkirby
sirkirby / cloudflared-lb-tunnel-stack.yml
Last active March 11, 2022 20:23
Set up two load balanced cloudflared tunnels
version: "3.7"
configs:
swarm-config:
file: swarm-config.yml
swarm2-config:
file: swarm2-config.yml
secrets:
cloudflared-cert:
@sirkirby
sirkirby / cloudflared-lb-ingress.yml
Created March 10, 2022 18:28
ingress portion of config, which includes health check endpoint
ingress:
# plex and media servers
- hostname: plex.mydomain.net
service: https://192.168.1.20:32400
# health check
# important for up/down notifications from Cloudflare
- hostname: "*"
path: /check
service: http_status:200
sudo nano /etc/systemd/system/cloudflared-proxy-dns.service
[Unit]
Description=DNS over HTTPS (DoH) proxy client
Wants=network-online.target nss-lookup.target
Before=nss-lookup.target
[Service]
AmbientCapabilities=CAP_NET_BIND_SERVICE
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
[Unit]
Description=DNS over HTTPS (DoH) proxy client
Wants=network-online.target nss-lookup.target
Before=nss-lookup.target
[Service]
AmbientCapabilities=CAP_NET_BIND_SERVICE
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
DynamicUser=yes
ExecStart=/usr/local/bin/cloudflared proxy-dns --port 5053 --upstream "https://your-gateway.cloudflare-gateway.com/dns-query"
[Unit]
Description=Cloudflare Tunnel
After=network.target
[Service]
TimeoutStartSec=0
Type=notify
ExecStart=/usr/local/bin/cloudflared --config /etc/cloudflared/config.yml --autoupdate-freq 24h --origincert /etc/cloudflared/cert.pem
Restart=on-failure
RestartSec=5s
# primary pi-hole
export GS_INSTALL=primary && curl -sSL https://gravity.vmstan.com | bash
# secondary pi-hole
export GS_INSTALL=secondary && curl -sSL https://gravity.vmstan.com | bash
# automate sync on secondary
./gravity-sync.sh automate