Skip to content
This repository was archived by the owner on Jul 4, 2023. It is now read-only.

Commit a9e3d5e

Browse files
author
Riaan Nolan
committed
adding new hashicorp logos, adding waypoint, adding boundary
1 parent 6468780 commit a9e3d5e

33 files changed

+4065
-7
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
**.tfstate
77
**.backup
88
**.rli
9+
**.lock**
910
sonarqube/logs**
1011
sonarqube/data/es6**
1112
sonarqube/data/sonar.lock.db

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ This repository is designed to provide you with a stack that demonstrates the po
4848
* [__Terraform__](hashicorp/#terraform) - Use Infrastructure as Code to provision and manage any cloud, infrastructure, or service
4949
* [__Packer__](hashicorp/#packer) - Build Automated Machine Images
5050
* [__Sentinel__](hashicorp/#sentinel) - Sentinel is an embedded policy-as-code framework
51+
* [__Waypoint__](hashicorp/#waypoint) - Waypoint is an open source solution that provides a modern workflow for build, deploy, and release across platforms
52+
* [__Boundary__](hashicorp/#boundary) - Simple and secure remote access to any system from anywhere based on user identity.
5153
* [__Fabio__](hashicorp/#fabio-load-balancer) - Fabio is an HTTP and TCP reverse proxy that configures itself with data from Consul
5254
* [__Docker__](docker/#docker) - Securely build, share and run any application, anywhere
5355
* [__Localstack__](localstack/#localstack) - A fully functional local AWS cloud stack
@@ -98,8 +100,11 @@ Lead Automation Architect [riaan.nolan@servian.com](mailto:riaan.nolan@servian.c
98100

99101
## Contributors and Special mentions
100102
A Very special mention to HashiQube's contributors, Thank You All for your help, suggestions and contributions no matter how small <3
103+
- Thomas Cockin
101104
- Konstantin Vanyushov
102105
- Tristan Morgan
106+
- Ringo Chan
107+
- Ehsan Mirzaei
103108

104109
## License
105110
HashiQube is available as open-source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

SUMMARY.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
* [Home](README.md)
22

3-
* [Multi Cloud](multi-cloud/README.md)
43
* [Database](database/README.md)
54
* [Docker](docker/README.md)
65
* [Docsify](docsify/README.md)
@@ -9,3 +8,4 @@
98
* [Jenkins](jenkins/README.md)
109
* [Ldap](ldap/README.md)
1110
* [Localstack](localstack/README.md)
11+
* [Multi-cloud](multi-cloud/README.md)

Vagrantfile

+10
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ Vagrant::configure("2") do |config|
8888
if machines.size == 1 # only expose these ports if 1 machine, else conflicts
8989
config.vm.network "forwarded_port", guest: 8200, host: 8200 # vault
9090
config.vm.network "forwarded_port", guest: 4646, host: 4646 # nomad
91+
config.vm.network "forwarded_port", guest: 9702, host: 9702 # waypoint
92+
config.vm.network "forwarded_port", guest: 19200, host: 19200 # boundary
9193
config.vm.network "forwarded_port", guest: 8500, host: 8500 # consul
9294
config.vm.network "forwarded_port", guest: 8600, host: 8600, protocol: 'udp' # consul dns
9395
config.vm.network "forwarded_port", guest: 8800, host: 8800 # terraform-enterprise
@@ -200,6 +202,14 @@ Vagrant::configure("2") do |config|
200202
# vagrant up --provision-with nomad to only run this on vagrant up
201203
config.vm.provision "nomad", type: "shell", preserve_order: true, privileged: true, path: "hashicorp/nomad.sh"
202204

205+
# install waypoint
206+
# vagrant up --provision-with waypoint to only run this on vagrant up
207+
config.vm.provision "waypoint", type: "shell", preserve_order: true, privileged: true, path: "hashicorp/waypoint.sh"
208+
209+
# install boundary
210+
# vagrant up --provision-with boundary to only run this on vagrant up
211+
config.vm.provision "boundary", type: "shell", preserve_order: true, privileged: true, path: "hashicorp/boundary.sh"
212+
203213
# install packer
204214
# vagrant up --provision-with packer to only run this on vagrant up
205215
config.vm.provision "packer", type: "shell", preserve_order: true, privileged: true, path: "hashicorp/packer.sh"

hashicorp/README.md

+337
Large diffs are not rendered by default.

hashicorp/boundary.sh

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash
2+
# https://learn.hashicorp.com/tutorials/boundary/getting-started-install
3+
# https://learn.hashicorp.com/tutorials/boundary/getting-started-dev
4+
5+
function boundary-install() {
6+
sudo DEBIAN_FRONTEND=noninteractive apt-get --assume-yes install curl unzip jq
7+
yes | sudo docker system prune -a
8+
yes | sudo docker system prune --volumes
9+
# check if waypoint is installed, start and exit
10+
if [ -f /usr/local/bin/boundary ]; then
11+
echo -e '\e[38;5;198m'"++++ Bundary already installed at /usr/local/bin/boundary"
12+
echo -e '\e[38;5;198m'"++++ `/usr/local/bin/boundary version`"
13+
else
14+
# if boundary is not installed, download and install
15+
echo -e '\e[38;5;198m'"++++ Boundary not installed, installing.."
16+
LATEST_URL=$(curl -sL https://releases.hashicorp.com/boundary/index.json | jq -r '.versions[].builds[].url' | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n | egrep -v 'rc|beta' | egrep 'linux.*amd64' | sort -V | tail -n 1)
17+
wget -q $LATEST_URL -O /tmp/boundary.zip
18+
mkdir -p /usr/local/bin
19+
(cd /usr/local/bin && unzip /tmp/boundary.zip)
20+
echo -e '\e[38;5;198m'"++++ Installed `/usr/local/bin/boundary version`"
21+
fi
22+
mkdir -p /etc/boundary
23+
cat <<EOF | sudo tee /etc/boundary/server.conf
24+
listener "tcp" {
25+
purpose = "api"
26+
address = "0.0.0.0:19200"
27+
}
28+
EOF
29+
echo -e '\e[38;5;198m'"++++ Starting Boundary in dev mode"
30+
pkill boundary
31+
sleep 10
32+
pkill boundary
33+
nohup boundary dev -api-listen-address 0.0.0.0:19200 > /var/log/boundary.log 2>&1 &
34+
sh -c 'sudo tail -f /var/log/boundary.log | { sed "/worker successfully authed/ q" && kill $$ ;}'
35+
echo -e '\e[38;5;198m'"++++ Boundary Server started at http://localhost:19200"
36+
echo -e '\e[38;5;198m'"++++ Login with admin:password"
37+
# TODO: read token and test login
38+
# boundary authenticate password -login-name=admin -password password -auth-method-id=ampw_1234567890 -addr=http://127.0.0.1:19200
39+
}
40+
41+
boundary-install
132 KB
Loading
195 KB
Loading
178 KB
Loading
Loading
143 KB
Loading

hashicorp/images/waypoint.png

297 KB
Loading

hashicorp/packer/linux/ubuntu/playbook.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
owner: root
1010
- name: Return all kv v2 secrets from a path
1111
debug:
12-
msg: "{{ lookup('hashi_vault', 'secret=kv/ansible token=s.VJmrgSE5oGsmxJ9YhHzTEYi6 url=http://localhost:8200') }}"
12+
msg: "{{ lookup('hashi_vault', 'secret=kv/ansible token=s.3Z4JPOS0Wm1wsml7M9jRNq2W url=http://localhost:8200') }}"

hashicorp/waypoint.sh

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
#!/bin/bash
2+
# https://www.waypointproject.io/docs/getting-started
3+
# https://learn.hashicorp.com/tutorials/waypoint/get-started-nomad?in=waypoint/get-started-nomad
4+
5+
function waypoint-install() {
6+
sudo DEBIAN_FRONTEND=noninteractive apt-get --assume-yes install curl unzip jq
7+
yes | sudo docker system prune -a
8+
yes | sudo docker system prune --volumes
9+
# check if waypoint is installed, start and exit
10+
if [ -f /usr/local/bin/waypoint ]; then
11+
echo -e '\e[38;5;198m'"++++ Waypoint already installed at /usr/local/bin/waypoint"
12+
echo -e '\e[38;5;198m'"++++ `/usr/local/bin/waypoint version`"
13+
else
14+
# if waypoint is not installed, download and install
15+
echo -e '\e[38;5;198m'"++++ Waypoint not installed, installing.."
16+
LATEST_URL=$(curl -sL https://releases.hashicorp.com/waypoint/index.json | jq -r '.versions[].builds[].url' | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n | egrep -v 'rc|beta' | egrep 'linux.*amd64' | sort -V | tail -n 1)
17+
wget -q $LATEST_URL -O /tmp/waypoint.zip
18+
mkdir -p /usr/local/bin
19+
(cd /usr/local/bin && unzip /tmp/waypoint.zip)
20+
echo -e '\e[38;5;198m'"++++ Installed `/usr/local/bin/waypoint version`"
21+
fi
22+
echo -e '\e[38;5;198m'"++++ Docker pull Waypoint Server container"
23+
docker pull hashicorp/waypoint:latest
24+
docker stop waypoint-server
25+
docker rm waypoint-server
26+
echo -e '\e[38;5;198m'"++++ Waypoint Server starting"
27+
export NOMAD_ADDR='http://localhost:4646'
28+
waypoint install -platform=nomad -nomad-dc=dc1 -accept-tos
29+
nomad status
30+
echo -e '\e[38;5;198m'"++++ Git Clone Waypoint examples"
31+
rm -rf /vagrant/hashicorp/waypoint/examples
32+
mkdir -p /vagrant/hashicorp/waypoint
33+
git clone https://github.com/hashicorp/waypoint-examples.git /vagrant/hashicorp/waypoint/examples
34+
cd /vagrant/hashicorp/waypoint/examples/docker/nodejs
35+
sed -i '/<\/h1>/a <p>The files are located in \/vagrant\/hashicorp\/waypoint\/examples\/docker\/nodejs, and this file is views/pages/index.ejs<\/p>' /vagrant/hashicorp/waypoint/examples/docker/nodejs/views/pages/index.ejs
36+
echo -e '\e[38;5;198m'"++++ Write /vagrant/hashicorp/waypoint/examples/docker/nodejs/waypoint.hcl"
37+
rm -rf /vagrant/hashicorp/waypoint/examples/docker/nodejs/waypoint.hcl
38+
cat <<EOF | sudo tee /vagrant/hashicorp/waypoint/examples/docker/nodejs/waypoint.hcl
39+
project = "example-nodejs"
40+
app "example-nodejs" {
41+
build {
42+
use "pack" {}
43+
registry {
44+
use "docker" {
45+
image = "nodejs-example"
46+
tag = "1"
47+
local = true
48+
}
49+
}
50+
}
51+
deploy {
52+
use "nomad" {
53+
datacenter = "dc1"
54+
}
55+
}
56+
}
57+
EOF
58+
echo -e '\e[38;5;198m'"++++ Stop the Nodejs example job if running"
59+
nomad job stop $(nomad job status | grep running | grep example | cut -d ' ' -f1)
60+
waypoint init
61+
waypoint up
62+
echo -e '\e[38;5;198m'"++++ Waypoint Server https://10.9.99.10:9702 and enter the following Token displayed below"
63+
sudo waypoint token new
64+
echo -e '\e[38;5;198m'"++++ Nomad http://localhost:4646"
65+
66+
}
67+
68+
waypoint-install
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Node build artifacts
2+
node_modules
3+
npm-debug.log
4+
5+
# Local development
6+
*.env
7+
*.dev
8+
.DS_Store
9+
10+
# Docker
11+
Dockerfile
12+
docker-compose.yml
13+
14+
# Nomad
15+
*.db
16+
*.lock
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web: node index.js
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Waypoint NodeJS Example
2+
3+
|Title|Description|
4+
|---|---|
5+
|Pack|Cloud Native Buildpack|
6+
|Cloud|Local|
7+
|Language|JavaScript|
8+
|Docs|[Docker](https://www.waypointproject.io/plugins/docker)|
9+
|Tutorial|[HashiCorp Learn](https://learn.hashicorp.com/tutorials/waypoint/get-started-docker)|
10+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const express = require('express')
2+
const path = require('path')
3+
const PORT = process.env.PORT || 5000
4+
5+
express()
6+
.use(express.static(path.join(__dirname, 'public')))
7+
.set('views', path.join(__dirname, 'views'))
8+
.set('view engine', 'ejs')
9+
.get('/', (req, res) => res.render('pages/index'))
10+
.listen(PORT, () => console.log(`Listening on ${ PORT }`))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "node-js-getting-started",
3+
"version": "0.3.0",
4+
"description": "A sample Node.js app using Express 4",
5+
"engines": {
6+
"node": "12.x"
7+
},
8+
"main": "index.js",
9+
"scripts": {
10+
"start": "node index.js",
11+
"test": "node test.js"
12+
},
13+
"dependencies": {
14+
"ejs": "^2.5.6",
15+
"express": "^4.15.2"
16+
},
17+
"devDependencies": {
18+
"got": "^11.3.0",
19+
"tape": "^4.7.0"
20+
},
21+
"keywords": [
22+
"node",
23+
"express"
24+
],
25+
"license": "MIT"
26+
}
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
/* Copyright 2013 The Chromium Authors. All rights reserved.
2+
* Use of this source code is governed by a BSD-style license that can be
3+
* found in the LICENSE file. */
4+
5+
html, body {
6+
padding: 0;
7+
margin: 0;
8+
width: 100%;
9+
height: 100%;
10+
}
11+
12+
.icon {
13+
-webkit-user-select: none;
14+
user-select: none;
15+
display: inline-block;
16+
}
17+
18+
.icon-offline {
19+
content: -webkit-image-set( url(assets/default_100_percent/100-error-offline.png) 1x, url(assets/default_200_percent/200-error-offline.png) 2x);
20+
position: relative;
21+
}
22+
23+
.hidden {
24+
display: none;
25+
}
26+
27+
28+
/* Offline page */
29+
30+
.offline .interstitial-wrapper {
31+
color: #2b2b2b;
32+
font-size: 1em;
33+
line-height: 1.55;
34+
margin: 0 auto;
35+
max-width: 600px;
36+
padding-top: 100px;
37+
width: 100%;
38+
}
39+
40+
.offline .runner-container {
41+
height: 150px;
42+
max-width: 600px;
43+
overflow: hidden;
44+
/*position: absolute;*/
45+
top: 35px;
46+
width: 44px;
47+
}
48+
49+
.offline .runner-canvas {
50+
height: 150px;
51+
max-width: 600px;
52+
opacity: 1;
53+
overflow: hidden;
54+
/*position: absolute;*/
55+
top: 0;
56+
z-index: 2;
57+
}
58+
59+
.offline .controller {
60+
background: rgba(247, 247, 247, .1);
61+
height: 100vh;
62+
left: 0;
63+
position: absolute;
64+
top: 0;
65+
width: 100vw;
66+
z-index: 1;
67+
}
68+
69+
#offline-resources {
70+
display: none;
71+
}
72+
73+
@media (max-width: 420px) {
74+
.suggested-left > #control-buttons, .suggested-right > #control-buttons {
75+
float: none;
76+
}
77+
.snackbar {
78+
left: 0;
79+
bottom: 0;
80+
width: 100%;
81+
border-radius: 0;
82+
}
83+
}
84+
85+
@media (max-height: 350px) {
86+
h1 {
87+
margin: 0 0 15px;
88+
}
89+
.icon-offline {
90+
margin: 0 0 10px;
91+
}
92+
.interstitial-wrapper {
93+
margin-top: 5%;
94+
}
95+
.nav-wrapper {
96+
margin-top: 30px;
97+
}
98+
}
99+
100+
@media (min-width: 600px) and (max-width: 736px) and (orientation: landscape) {
101+
.offline .interstitial-wrapper {
102+
margin-left: 0;
103+
margin-right: 0;
104+
}
105+
}
106+
107+
@media (min-width: 420px) and (max-width: 736px) and (min-height: 240px) and (max-height: 420px) and (orientation:landscape) {
108+
.interstitial-wrapper {
109+
margin-bottom: 100px;
110+
}
111+
}
112+
113+
@media (min-height: 240px) and (orientation: landscape) {
114+
.offline .interstitial-wrapper {
115+
margin-bottom: 90px;
116+
}
117+
.icon-offline {
118+
margin-bottom: 20px;
119+
}
120+
}
121+
122+
@media (max-height: 320px) and (orientation: landscape) {
123+
.icon-offline {
124+
margin-bottom: 0;
125+
}
126+
.offline .runner-container {
127+
top: 10px;
128+
}
129+
}
130+
131+
@media (max-width: 240px) {
132+
.interstitial-wrapper {
133+
overflow: inherit;
134+
padding: 0 8px;
135+
}
136+
}

0 commit comments

Comments
 (0)