Skip to content

Commit

Permalink
Minor update to rootfs/docker-bootstrap.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
socheatsok78 committed May 10, 2024
1 parent 1063bef commit 7c714b2
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions rootfs/docker-bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ get_addr () {
# VAULT_LOCAL_CONFIG below.
VAULT_CONFIG_DIR=/vault/config

# Specifies the identifier for the Vault cluster.
# When connecting to Vault Enterprise, this value will be used in the interface.
# This value also used to identify the cluster in the Prometheus metrics.
export VAULT_CLUSTER_NAME=${VAULT_CLUSTER_NAME:-"vault"}
entrypoint_log "Configure VAULT_CLUSTER_NAME as \"$VAULT_CLUSTER_NAME\""

# Specifies the address (full URL) to advertise to other
# Vault servers in the cluster for client redirection.
if [ -n "$VAULT_API_INTERFACE" ]; then
Expand All @@ -41,7 +35,7 @@ if [ -n "$VAULT_API_INTERFACE" ]; then
fi

# If VAULT_LISTENER_CONFIG_FILE doesn't exist, generate a default "tcp" listener configuration
export VAULT_LISTENER_CONFIG_FILE=${VAULT_LISTENER_CONFIG_FILE:-"$VAULT_CONFIG_DIR/listener.hcl"}
VAULT_LISTENER_CONFIG_FILE=${VAULT_LISTENER_CONFIG_FILE:-"$VAULT_CONFIG_DIR/listener.hcl"}
if [ ! -f "$VAULT_LISTENER_CONFIG_FILE" ]; then
# If VAULT_LISTENER_TLS_KEY_FILE and VAULT_LISTENER_TLS_CERT_FILE are set, enable TLS
VAULT_LISTENER_TLS_CONFIG=" tls_disable = true"
Expand Down Expand Up @@ -69,12 +63,18 @@ if [[ -n "${VAULT_RAFT_PATH}" ]]; then
fi

# If VAULT_STORAGE_CONFIG_FILE doesn't exist, generate a default "raft" storage configuration
export VAULT_STORAGE_CONFIG_FILE=${VAULT_STORAGE_CONFIG_FILE:-"$VAULT_CONFIG_DIR/raft-storage.hcl"}
VAULT_STORAGE_CONFIG_FILE=${VAULT_STORAGE_CONFIG_FILE:-"$VAULT_CONFIG_DIR/raft-storage.hcl"}
if [ ! -f "$VAULT_STORAGE_CONFIG_FILE" ]; then
# Write the listener configuration to the file
echo "storage \"raft\" {}" > "$VAULT_STORAGE_CONFIG_FILE"
fi

# Specifies the identifier for the Vault cluster.
# When connecting to Vault Enterprise, this value will be used in the interface.
# This value also used to identify the cluster in the Prometheus metrics.
VAULT_CLUSTER_NAME=${VAULT_CLUSTER_NAME:-"vault"}
entrypoint_log "Configure VAULT_CLUSTER_NAME as \"$VAULT_CLUSTER_NAME\""

# These are a set of custom environment variables that can be used to
# generate a configuration file on the fly.

Expand All @@ -88,7 +88,7 @@ VAULT_MAX_LEASE_TTL=${VAULT_MAX_LEASE_TTL:-"0"}
VAULT_DEFAULT_MAX_REQUEST_DURATION=${VAULT_DEFAULT_MAX_REQUEST_DURATION:-"0"}

# Raw storage endpoint configuration
export VAULT_RAW_STORAGE_ENDPOINT=${VAULT_RAW_STORAGE_ENDPOINT:-"false"}
VAULT_RAW_STORAGE_ENDPOINT=${VAULT_RAW_STORAGE_ENDPOINT:-"false"}
if [[ "${VAULT_RAW_STORAGE_ENDPOINT}" == "true" ]]; then
entrypoint_log ""
entrypoint_log "----------------------------------------------------------------------"
Expand Down Expand Up @@ -126,6 +126,7 @@ default_lease_ttl = "${VAULT_DEFAULT_LEASE_TTL}"
default_max_request_duration = "${VAULT_DEFAULT_MAX_REQUEST_DURATION}"
max_lease_ttl = "${VAULT_MAX_LEASE_TTL}"
# Prometheus metrics
telemetry {
prometheus_retention_time = "24h"
disable_hostname = true
Expand Down

0 comments on commit 7c714b2

Please sign in to comment.