Updated variables for post scripts
This commit is contained in:
parent
1fd7ff7395
commit
075611e7c6
2 changed files with 17 additions and 6 deletions
|
@ -15,7 +15,7 @@ if command -v docker > /dev/null; then
|
|||
logg info "Found DOCKERHUB_TOKEN in ${XDG_DATA_HOME:-$HOME/.local/share}/chezmoi/home/.chezmoitemplates/secrets"
|
||||
if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/age/chezmoi.txt" ]; then
|
||||
logg info 'Decrypting DOCKERHUB_TOKEN token with Age encryption key'
|
||||
DOCKERHUB_TOKEN="$(cat "$CLOUDFLARED_CERT" | chezmoi decrypt)"
|
||||
DOCKERHUB_TOKEN="$(cat "$DOCKERHUB_TOKEN_FILE" | chezmoi decrypt)"
|
||||
else
|
||||
logg warn 'Age encryption key is missing from ~/.config/age/chezmoi.txt'
|
||||
fi
|
||||
|
|
|
@ -19,11 +19,22 @@ if command -v nginx > /dev/null; then
|
|||
else
|
||||
### Linux
|
||||
NGINX_CONFIG_DIR=/etc/nginx
|
||||
logg info 'Downloading the NGINX Amplify installer script'
|
||||
TMP="$(mktemp)"
|
||||
curl -sSL https://github.com/nginxinc/nginx-amplify-agent/raw/master/packages/install.sh > "$TMP"
|
||||
logg info 'Running the NGINX Amplify setup script'
|
||||
API_KEY="{{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "NGINX_AMPLIFY_API_KEY")) }}{{- includeTemplate "secrets/NGINX_AMPLIFY_API_KEY" | decrypt | trim -}}{{ else }}{{- env "NGINX_AMPLIFY_API_KEY" -}}{{ end }}" sh "$TMP"
|
||||
NGINX_AMPLIFY_API_KEY_FILE="${XDG_DATA_HOME:-$HOME/.local/share}/chezmoi/home/.chezmoitemplates/secrets/NGINX_AMPLIFY_API_KEY"
|
||||
if [ -f "$NGINX_AMPLIFY_API_KEY_FILE" ]; then
|
||||
logg info "Found NGINX_AMPLIFY_API_KEY in ${XDG_DATA_HOME:-$HOME/.local/share}/chezmoi/home/.chezmoitemplates/secrets"
|
||||
if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/age/chezmoi.txt" ]; then
|
||||
logg info 'Decrypting NGINX_AMPLIFY_API_KEY token with Age encryption key'
|
||||
logg info 'Downloading the NGINX Amplify installer script'
|
||||
TMP="$(mktemp)"
|
||||
curl -sSL https://github.com/nginxinc/nginx-amplify-agent/raw/master/packages/install.sh > "$TMP"
|
||||
logg info 'Running the NGINX Amplify setup script'
|
||||
API_KEY="$(cat "$NGINX_AMPLIFY_API_KEY_FILE" | chezmoi decrypt)" sh "$TMP"
|
||||
else
|
||||
logg warn 'Age encryption key is missing from ~/.config/age/chezmoi.txt'
|
||||
fi
|
||||
else
|
||||
logg warn "NGINX_AMPLIFY_API_KEY is missing from ${XDG_DATA_HOME:-$HOME/.local/share}/chezmoi/home/.chezmoitemplates/secrets"
|
||||
fi
|
||||
fi
|
||||
logg info "Ensuring $NGINX_CONFIG_DIR is present" && sudo mkdir -p "$NGINX_CONFIG_DIR"
|
||||
logg info "Copying configuration files from $HOME/.local/etc/nginx to $NGINX_CONFIG_DIR"
|
||||
|
|
Loading…
Reference in a new issue