Skip to content

Instantly share code, notes, and snippets.

@OriPekelman
Created February 24, 2021 09:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OriPekelman/87078f6815586c6d17d08cb14714c9e6 to your computer and use it in GitHub Desktop.
Save OriPekelman/87078f6815586c6d17d08cb14714c9e6 to your computer and use it in GitHub Desktop.
A simple vault as an app getting started... on platform.sh
#.platform/applications.yaml
- name: vault
type: 'golang:1.15'
source:
root: vault
disk: 1024
hooks:
build: ./vault-install.sh
mounts:
"/data":
source: local
source_path: data
web:
upstream:
socket_family: tcp
protocol: http
commands:
start: ./vault server -config=/app/conf/config.hcl
locations:
/:
allow: false
passthru: true
#vault/conf/config.hcl
storage "raft" {
path = "/app/data"
node_id = "node1"
}
listener "tcp" {
address = "127.0.0.1:8888"
tls_disable = "true"
}
api_addr = "http://127.0.0.1:8888"
cluster_addr = "https://127.0.0.1:8201"
ui = true
# .platform/routes.yaml
"https://vault.{default}/":
type: upstream
upstream: "vault:http"
#.platform/services.yaml
#empty as we are using the raft storage engine
#vault/vault-install.sh
export VAULT_VERSION="1.6.2"
export DOWNLOAD_URL="https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_linux_amd64.zip"
cd $PLATFORM_CACHE_DIR
echo "Trying to download ${DOWNLOAD_URL}"
wget -N $DOWNLOAD_URL
unzip vault_${VAULT_VERSION}_linux_amd64.zip -d ~/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment