Skip to content

Instantly share code, notes, and snippets.

View magicalyak's full-sized avatar

Tom Gamull magicalyak

View GitHub Profile
@magicalyak
magicalyak / eap_proxy.sh
Created May 24, 2020 15:29 — forked from magn2o/eap_proxy.sh
init.d style service script for eap_proxy on the UDMPro.
#!/bin/sh
set -eu -o pipefail
CONTAINER_NAME="eap_proxy"
IMAGE_NAME="pbrah/eap_proxy-udmpro"
IMAGE_TAG="v1.1"
container_exists() {
podman container inspect "${1}" &>/dev/null
@magicalyak
magicalyak / api.conf
Last active April 15, 2020 20:27 — forked from bgautrea/api.conf
OIDC Sync
server {
listen 8080;
server_name _;
access_log off;
location /api {
api write=off;
}
location = /dashboard.html {
root /usr/share/nginx/html;
}
@magicalyak
magicalyak / OIDCSync.sh
Last active April 15, 2020 20:12 — forked from bgautrea/nginx-config.yaml
OIDC with KeyValue Zone Sync
# First command is adding the sync directive to the keyavl zone
# Second command is adding the zone_sync listener and directive that lets NGINX sync the state of the keyval zone. It uses service discovery to find the other NGINX instances based off of a headless service in kubernetes for the nginx-ingress pods.
# Third command creates the headless service with port 12345
# Fourth and Fifth apply the service and the nginx-config that includes the stream config for zone_sync and the keyval zones.
# sed -i 's/\(.*keyval_zone.*\);/\1 sync;/g' nginx-config.yaml.orig
# sed -i 's/\(^data:.*\)/\1 \n stream-snippets:\n resolver kube-dns.kube-system.svc.cluster.local valid=5s;\n\n server {\n listen 0.0.0.0:12345;\n zone_sync;\n zone_sync_server nginx-ingress-headless.nginx-ingress.svc.cluster.local:12345 resolve;\n }\n/g' nginx-config.yaml.orig
# cat << EOF >> headless.yaml
apiVersion: v1
kind: Service