diff --git a/home/.chezmoiscripts/universal/run_onchange_after_05-postfix.sh.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_05-postfix.sh.tmpl index fb3b1b35..e7e5ba05 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_05-postfix.sh.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_05-postfix.sh.tmpl @@ -1,4 +1,4 @@ -{{- if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "ANSIBLE_GALAXY_TOKEN")) }}{{ includeTemplate "secrets/ANSIBLE_GALAXY_TOKEN" | decrypt }}{{ else }}{{ env "ANSIBLE_GALAXY_TOKEN" }}{{ end }} +{{- if or (and (ne .host.distro.family "windows") (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "SENDGRID_API_KEY")) (env "SENDGRID_API_KEY")) -}} #!/usr/bin/env bash # @file SendGrid Postfix Configuration # @brief Configures Postfix to use SendGrid as a relay host so you can use the `mail` program to send e-mail from the command-line diff --git a/home/.chezmoiscripts/universal/run_onchange_after_58-nginx-amplify.sh.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_58-nginx-amplify.sh.tmpl new file mode 100644 index 00000000..2e328032 --- /dev/null +++ b/home/.chezmoiscripts/universal/run_onchange_after_58-nginx-amplify.sh.tmpl @@ -0,0 +1,28 @@ +{{- if or (and (eq .host.distro.family "linux") (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "NGINX_AMPLIFY_API_KEY")) (env "NGINX_AMPLIFY_API_KEY")) -}} +#!/usr/bin/env bash +# @file NGINX Amplify Join +# @brief Set up NGINX Amplify and joins the cloud monitoring service dashboard +# @description +# This script installs NGINX Amplify and connects with the user's NGINX Amplify instance, assuming the `NGINX_AMPLIFY_API_KEY` +# is defined. NGINX Amplify is a free web application that serves as a way of browsing through metrics of all your connected +# NGINX instances. +# +# ## Links +# +# * [NGINX Amplify login](https://amplify.nginx.com/login) +# * [NGINX Amplify documentation](https://docs.nginx.com/nginx-amplify/#) + +{{ includeTemplate "universal/profile" }} +{{ includeTemplate "universal/logg" }} + +if command -v nginx > /dev/null; then + 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 -}}{{ else }}{{- env "NGINX_AMPLIFY_API_KEY" -}}{{ end }}" sh "$TMP" +fi + +{{ end -}} +{{ end -}} \ No newline at end of file diff --git a/home/.chezmoitemplates/secrets/NGINX_AMPLIFY_API_KEY b/home/.chezmoitemplates/secrets/NGINX_AMPLIFY_API_KEY new file mode 100644 index 00000000..573c2f82 --- /dev/null +++ b/home/.chezmoitemplates/secrets/NGINX_AMPLIFY_API_KEY @@ -0,0 +1,7 @@ +-----BEGIN AGE ENCRYPTED FILE----- +YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBpY2FrK0lGbC9nOWVyem55 +NksxcDhONVgvbTlYczRVbHNkSWdWMHhrMVhVCnl2Tm9QYWZaZHgrbkRXNHZpU1pM +cnpVL0diTXBiRGwrU3l2VUJOczdVWnMKLS0tIGxGeUtnOEtIVExNNWtTYnZ2WHNq +Uk0xSHRwWWdHanV5eE52ZVpBL2xERDgKxvx2/KXJEgKas/qNsQ5vkh+gjVEFp0Po +flSRh9JJzEilUuGYT5pqpI5f9aGOvPeN5VCRb68+Sr1TAqB78HEX2Hs= +-----END AGE ENCRYPTED FILE----- \ No newline at end of file diff --git a/home/.chezmoitemplates/secrets/key-digitalocean-pat b/home/.chezmoitemplates/secrets/key-digitalocean-pat deleted file mode 100644 index 388f995e..00000000 --- a/home/.chezmoitemplates/secrets/key-digitalocean-pat +++ /dev/null @@ -1,8 +0,0 @@ ------BEGIN AGE ENCRYPTED FILE----- -YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBRZGN4c25lbFN6VXdmTnp5 -S2dXd1MzMDVrN0s2RkF6Uk1IT1BKSXdLMlFvClNVWm5JUlRlY0E1UjlySUtpSGRS -ZGptZmcrYS9nelUwVi9nK28vL0hYOVEKLS0tIHl4b3RTU0xSdDNvd2hIYlhEc0tS -SmljZ0dKRzlwb3FhT1cxcVhCZTYyd3MKHbF2O5C+sRFDfSgPob7yP6/h6UGXDTHD -t8j4N/7htop4kb13G/8LTQr1NMIWHbQaOZhdmlFN+C6bjf3u6Aqk3r1uqzJpw0Hi -wietd1PIMB/tijZ/zzZy04NCrQ96LqBULZZPMl1u8w== ------END AGE ENCRYPTED FILE----- \ No newline at end of file diff --git a/home/.chezmoitemplates/secrets/key-nginx-amplify-api-key b/home/.chezmoitemplates/secrets/key-nginx-amplify-api-key deleted file mode 100644 index 3eab12a4..00000000 --- a/home/.chezmoitemplates/secrets/key-nginx-amplify-api-key +++ /dev/null @@ -1,7 +0,0 @@ ------BEGIN AGE ENCRYPTED FILE----- -YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBnZ3FKdmpCMS9ST3NFbjIx -Qk1zVkFUSEdlcEl5VWoxMjlhMVdRa2F1K0FzClhpVHNhb2JVcjUzQTdlYjBMTzN1 -UlorcVMzVjdsMWx5enNnYmF6eHZLVjAKLS0tIDVBNXRMRXJueHoyNUExMTllMW9S -ejZ1WnBSZjZzR0c5MVBqTzBpdVplN3MKMNRDbcXLGho22BoRWM09uZQYvihMlN1T -LCjWLzjcxap3Pz76RkWc4zNXkLFG0p3S4o78SWY3eGsfN2ZePJ3w4Q== ------END AGE ENCRYPTED FILE----- \ No newline at end of file