Simulate split brain failure on docker-compose using linux routes
- splitbrain
node splitbrain.js add [2,20] [10,3] true
- disable splitbrain
node splitbrain.js delete [2,20] [10,3]
# Mount wait-for-it https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh | |
version: "3" | |
networks: | |
kong-net: | |
driver: bridge | |
services: | |
####################################### | |
# Postgres: The database used by Kong | |
####################################### |
@Grab('com.github.scribejava:scribejava-apis:6.9.0') | |
import com.github.scribejava.apis.KeycloakApi; | |
import com.github.scribejava.core.builder.ServiceBuilder; | |
import com.github.scribejava.core.model.OAuth2AccessToken; | |
import com.github.scribejava.core.model.OAuthRequest; | |
import com.github.scribejava.core.model.Response; | |
import com.github.scribejava.core.model.Verb; | |
import com.github.scribejava.core.oauth.OAuth20Service; | |
import java.io.IOException; |
Simulate split brain failure on docker-compose using linux routes
node splitbrain.js add [2,20] [10,3] true
node splitbrain.js delete [2,20] [10,3]
#!/bin/bash | |
#trap "set +x; read -n1 -r -p "." key; set -x" DEBUG | |
# https://github.com/petergeneric/maven-release-script | |
function die_with() { | |
echo "$*" >&2 | |
exit 1 | |
} | |
function has_command() { |
// requestSpec will be the request spec for this response (currently always null) | |
// response is a Request.js response object | |
// context is the scenario context containing scenario variables | |
// ee is an event emitter for this scenario that we can use to add custom stats to the report | |
// npm install jsonwebtoken | |
const jwt = require('jsonwebtoken'); | |
const util = require('util'); |
const jwt = require('jsonwebtoken'); | |
const request = require('sync-request') | |
const NodeRSA = require('node-rsa'); | |
const FormData = request.FormData; | |
/*let token="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6Imd1ZXN0In0.OnuZnYMdetcg7AWGV6WURn8CFSfas6AQej4V9M13nsk" | |
console.log(jwt.decode(token, {complete: true})) | |
console.log( jwt.verify(token, ''))*/ |
FROM debian:buster | |
ARG DEBIAN_FRONTEND=noninteractive | |
ARG OPENXPKI_NOCONFIG=1 | |
RUN apt-get update && \ | |
apt-get install --assume-yes gpg libdbd-mysql-perl libapache2-mod-fcgid apache2 wget locales less gettext | |
RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && dpkg-reconfigure --frontend=noninteractive locales | |
RUN wget https://packages.openxpki.org/v3/debian/openxpki.list -O /etc/apt/sources.list.d/openxpki.list |
user=$1 | |
items=$2 | |
depth=$3 | |
curl --silent -kL https://api.github.com/users/$user/repos?per_page=$items |grep "full_name" |awk -v user="$user" -F"\"" '{print "https://github.com/"$4}' > $user-repos.txt | |
while read in; do | |
echo $in | |
gitleaks --repo="$in" --verbose --pretty --depth=$3 --threads=5 --report=$user-gitleaks-result; | |
done < $user-repos.txt |
relypartyadmin: | |
image: quay.io/oauth2-proxy/oauth2-proxy:latest | |
hostname: relypartyadmin | |
depends_on: | |
- appserver | |
restart: on-failure | |
ports: | |
- "8200:8200" | |
environment: | |
- OAUTH2_PROXY_STANDARD_LOGGING=true |