This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM debian:jessie | |
RUN set -ex && \ | |
echo 'deb http://deb.debian.org/debian jessie-backports main' \ | |
> /etc/apt/sources.list.d/jessie-backports.list && \ | |
apt update -y && \ | |
apt install -t \ | |
jessie-backports \ | |
openjdk-8-jre-headless \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// tables package holds the methods for manipulating specific | |
// postgres tables. | |
package tables | |
import ( | |
"time" | |
"github.com/davecgh/go-spew/spew" | |
"github.com/pkg/errors" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// roach wraps `lib/pq` providing the basic methods for | |
// creating an entrypoint for our database. | |
package roach | |
import ( | |
"database/sql" | |
"fmt" | |
"github.com/davecgh/go-spew/spew" | |
"github.com/pkg/errors" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bearer to Basic | |
http -v :80/bearer-to-basic Authorization:'Bearer token' | |
GET /bearer-to-basic HTTP/1.1 | |
Accept: */* | |
Accept-Encoding: gzip, deflate | |
Authorization: Bearer token | |
Connection: keep-alive | |
Host: localhost:80 | |
User-Agent: HTTPie/0.9.9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Outputs the contents of the headers | |
-- in a plain text format. | |
-- Headers: | |
-- key=value | |
return function () | |
-- 'ngx.say' emits content to the HTTP client of that | |
-- request. | |
ngx.say("Headers:") | |
-- 'req.get_headers' gives us a lua table that |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local log = ngx.log | |
local ERR = ngx.ERR | |
-- Requiring the basic string manipulationn utilities | |
-- from a file that lives at '/etc/nginx/*.lua' as | |
-- indicated in the 'nginx.conf' file. | |
require("utils") | |
-- Rewrites an `Authorization: Basic b64(<token>:"")` header |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
default_type application/octet-stream; | |
sendfile on; | |
keepalive_timeout 65; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CONTAINER_NAME := nginx-lua-tests | |
# RUN is responsible for running our container. | |
# First it removes any prvevious containers that | |
# were set up during testing, ignoring errors. | |
# Then, it runs a container using | |
# openresty/opernresty:alpine-fat as the base image. | |
# It binds a volume with our nginx configuration and | |
# lua volumes so that we don't need to create a custom | |
# image and keep restarting the container. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"variables": { | |
"aws_access_key": "<access_key>", | |
"aws_secret_key": "<secret_key>" | |
}, | |
"builders": [ | |
{ | |
"type": "amazon-ebs", | |
"access_key": "{{user `aws_access_key`}}", | |
"secret_key": "{{user `aws_secret_key`}}", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker stack deploy \ | |
--compose-file ./docker-compose.yml \ | |
mystack | |
docker service ls | |
NAME MODE REPLICAS IMAGE | |
mystack_consul replicated 3/3 consul:0.7.2 | |