Created
February 24, 2021 09:55
-
-
Save OriPekelman/87078f6815586c6d17d08cb14714c9e6 to your computer and use it in GitHub Desktop.
A simple vault as an app getting started... on platform.sh
This file contains 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
#.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 |
This file contains 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
#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 |
This file contains 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
# .platform/routes.yaml | |
"https://vault.{default}/": | |
type: upstream | |
upstream: "vault:http" |
This file contains 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
#.platform/services.yaml | |
#empty as we are using the raft storage engine |
This file contains 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
#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