2023-12-24 14:36:54 -08:00
---
version: 1
{{- if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "files" "apprise-custom")) -}}
include:
- custom.yml
{{ end }}
# Define an Asset object if you wish (Optional)
# asset:
# app_id: AppriseTest
# app_desc: Apprise Test Notifications
# app_url: http://nuxref.com
groups:
- chat: matrix
- developer: slack
- social: reddit, twitter
- owner: sendgrid, twilio, rsyslog, system
tag: all
urls:
{{- $ gmailAppPassword := (default "" (env "GMAIL_PASSWORD")) -}}
{{- if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "GMAIL_PASSWORD")) -}}
{{- $ gmailAppPassword = includeTemplate "secrets/GMAIL_PASSWORD" | decrypt | trim -}}
{{- end -}}
{{- if ne $ gmailAppPassword "" -}}
### E-mail
# Source: https://github.com/caronc/apprise/wiki/Notify_email
# Sends an e-mail with GMail SMTP using GMail username provided in .chezmoi.yaml.tmpl and uses `GMAIL_PASSWORD` (which can be an app password instead of your normal password)
- mailto://{{ .user.gmail.username }}:{{- $ gmailAppPassword -}}@gmail.com:587?smtp=smtp.gmail.com&from={{ .user.gmail.username }}:
- to: "{{ .user.email }}"
tag: email, gmail
{{ end }}
{{- $ iftttWebhookId := (default "" (env "IFTTT_WEBHOOK_ID")) -}}
{{- if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "IFTTT_WEBHOOK_ID")) -}}
{{- $ iftttWebhookId = includeTemplate "secrets/IFTTT_WEBHOOK_ID" | decrypt | trim -}}
{{- end -}}
{{- if ne $ iftttWebhookId "" -}}
### IFTTT
# Source: https://github.com/caronc/apprise/wiki/Notify_ifttt
# Triggers an IFTTT webhook
- ifttt://{{- $ iftttWebhookId -}}:
- tag: ifttt
{{ end }}
{{- $ matrixPassword := (default "" (env "MATRIX_PASSWORD")) -}}
{{- if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "MATRIX_PASSWORD")) -}}
{{- $ matrixPassword = includeTemplate "secrets/MATRIX_PASSWORD" | decrypt | trim -}}
{{- end -}}
{{- $ matrixUsername := (default "" (env "MATRIX_USERNAME")) -}}
{{- if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "MATRIX_USERNAME")) -}}
{{- $ matrixUsername = includeTemplate "secrets/MATRIX_USERNAME" | decrypt | trim -}}
{{- end -}}
{{- if and (ne $ matrixPassword "") (ne $ matrixUsername "") -}}
### Matrix
# Source: https://github.com/caronc/apprise/wiki/Notify_matrix
# https://app.element.io/ #/room/ #megabyte . space : matrix . org
# Posts a message in a Matrix chatroom
- matrix://{{- $ matrixUsername -}}:{{- $ matrixPassword -}}@matrix.org/ #megabyte . space :
- tag: chat, matrix, megabyte-labs
# https://app.element.io/ #/room/ #install . doctor : matrix . org
- matrix://{{- $ matrixUsername -}}:{{- $ matrixPassword -}}@matrix.org/ #install . doctor :
- tag: chat, matrix, install-doctor
{{ end }}
### Microsoft Teams
# Source: https://github.com/caronc/apprise/wiki/Notify_msteams
# Note: Microsoft Teams currently requires paid subscriptions of Office 365 for a custom organization
{{- $ redditAppId := (default "" (env "REDDIT_APP_ID")) -}}
{{- if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "REDDIT_APP_ID")) -}}
{{- $ redditAppId = includeTemplate "secrets/REDDIT_APP_ID" | decrypt | trim -}}
{{- end -}}
{{- $ redditAppSecret := (default "" (env "REDDIT_APP_SECRET")) -}}
{{- if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "REDDIT_APP_SECRET")) -}}
{{- $ redditAppSecret = includeTemplate "secrets/REDDIT_APP_SECRET" | decrypt | trim -}}
{{- end -}}
{{- $ redditPassword := (default "" (env "REDDIT_PASSWORD")) -}}
{{- if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "REDDIT_PASSWORD")) -}}
{{- $ redditPassword = includeTemplate "secrets/REDDIT_PASSWORD" | decrypt | trim -}}
{{- end -}}
{{- $ redditUsername := (default "" (env "REDDIT_USERNAME")) -}}
{{- if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "REDDIT_USERNAME")) -}}
{{- $ redditUsername = includeTemplate "secrets/REDDIT_USERNAME" | decrypt | trim -}}
{{- end -}}
{{- if and (ne $ redditAppId "") (ne $ redditAppSecret "") (ne $ redditPassword "") (ne $ redditUsername "") -}}
### Reddit
# Source: https://github.com/caronc/apprise/wiki/Notify_reddit
# TODO - Replace opensource below with appropriate sub-reddit
- reddit://{{- $ redditUsername -}}:{{- $ redditPassword -}}@{{- $ redditAppId -}}/{{- $ redditAppSecret -}}/{subreddit}:
- tag: reddit, post, megabyte-labs
{{ end }}
### RSyslog
# Source: https://github.com/caronc/apprise/wiki/Notify_rsyslog
- rsyslog://localhost:
- tag: rsyslog, log
{{- $ sendGridApiKey := (default "" (env "SENDGRID_API_KEY")) -}}
{{- if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "SENDGRID_API_KEY")) -}}
{{- $ sendGridApiKey = includeTemplate "secrets/SENDGRID_API_KEY" | decrypt | trim -}}
{{- end -}}
{{- if ne $ sendGridApiKey "" -}}
### SendGrid
# Source: https://github.com/caronc/apprise/wiki/Notify_sendgrid
# Sends an e-mail using SendGrid (with templating options)
- sendgrid://{{- $ sendGridApiKey -}}:{{ .host.noReplyEmail }}:
- to: "{{ .user.email }}"
tag: email, sendgrid
{{ end }}
{{- $ slackBotToken := (default "" (env "SLACK_BOT_USER_OAUTH_TOKEN")) -}}
{{- if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "SLACK_BOT_USER_OAUTH_TOKEN")) -}}
{{- $ slackBotToken = includeTemplate "secrets/SLACK_BOT_USER_OAUTH_TOKEN" | decrypt | trim -}}
{{- end -}}
{{- if ne $ slackBotToken "" -}}
### Slack
# Source: https://github.com/caronc/apprise/wiki/Notify_slack
# Posts in Slack chatroom
- slack://{{ $ slackBotToken }}:
- tag: chat, slack
{{ end }}
2024-01-02 17:40:12 -08:00
{{- $ telegramBotToken := (default "" (env "TELEGRAM_BOT_TOKEN")) -}}
{{- if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "TELEGRAM_BOT_TOKEN")) -}}
{{- $ telegramBotToken = includeTemplate "secrets/TELEGRAM_BOT_TOKEN" | decrypt | trim -}}
{{- end -}}
{{- $ telegramRecipient := (default "" (env "TELEGRAM_RECIPIENT_ID")) -}}
{{- if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "TELEGRAM_RECIPIENT_ID")) -}}
{{- $ telegramRecipient = includeTemplate "secrets/TELEGRAM_RECIPIENT_ID" | decrypt | trim -}}
{{- end -}}
{{- if and (ne $ telegramBotToken "") (ne $ telegramRecipient "") -}}
### Telegram
- tgram://{{ $ telegramBotToken }}/{chat_id}/
- tag: chat, telegram
{{ end }}
2023-12-24 14:36:54 -08:00
{{- $ twilioAccountSid := (default "" (env "TWILIO_ACCOUNT_SID")) -}}
{{- if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "TWILIO_ACCOUNT_SID")) -}}
{{- $ twilioAccountSid = includeTemplate "secrets/TWILIO_ACCOUNT_SID" | decrypt | trim -}}
{{- end -}}
{{- $ twilioAuthToken := (default "" (env "TWILIO_AUTH_TOKEN")) -}}
{{- if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "TWILIO_AUTH_TOKEN")) -}}
{{- $ twilioAuthToken = includeTemplate "secrets/TWILIO_AUTH_TOKEN" | decrypt | trim -}}
{{- end -}}
{{- $ twilioFromNumber := (default "" (env "TWILIO_FROM_NUMBER")) -}}
{{- if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "TWILIO_FROM_NUMBER")) -}}
{{- $ twilioFromNumber = includeTemplate "secrets/TWILIO_FROM_NUMBER" | decrypt | trim -}}
{{- end -}}
{{- $ cellPhoneNumber := (default "" (env "CELL_PHONE_NUMBER")) -}}
{{- if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "CELL_PHONE_NUMBER")) -}}
{{- $ cellPhoneNumber = includeTemplate "secrets/CELL_PHONE_NUMBER" | decrypt | trim -}}
{{- end -}}
{{- if and (ne $ twilioAccountSid "") (ne $ twilioAuthToken "") (ne $ twilioFromNumber "") (ne $ cellPhoneNumber "") -}}
### Twilio
# Source: https://github.com/caronc/apprise/wiki/Notify_twilio
# Sends a text message from Twilio to the `CELL_PHONE_NUMBER`
- twilio://{{- $ twilioAccountSid -}}:{{- $ twilioAuthToken -}}@{{- $ twilioFromNumber -}}/{{- $ cellPhoneNumber -}}
- tag: text, twilio
{{ end }}
{{- $ twitterApiKey := (default "" (env "TWITTER_API_KEY")) -}}
{{- if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "TWITTER_API_KEY")) -}}
{{- $ twitterApiKey = includeTemplate "secrets/TWITTER_API_KEY" | decrypt | trim -}}
{{- end -}}
{{- $ twitterApiKeySecret := (default "" (env "TWITTER_API_KEY_SECRET")) -}}
{{- if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "TWITTER_API_KEY_SECRET")) -}}
{{- $ twitterApiKeySecret = includeTemplate "secrets/TWITTER_API_KEY_SECRET" | decrypt | trim -}}
{{- end -}}
{{- $ twitterAccessToken := (default "" (env "TWITTER_ACCESS_TOKEN")) -}}
{{- if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "TWITTER_ACCESS_TOKEN")) -}}
{{- $ twitterAccessToken = includeTemplate "secrets/TWITTER_ACCESS_TOKEN" | decrypt | trim -}}
{{- end -}}
{{- $ twitterAccessTokenSecret := (default "" (env "TWITTER_ACCESS_TOKEN_SECRET")) -}}
{{- if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "TWITTER_ACCESS_TOKEN_SECRET")) -}}
{{- $ twitterAccessTokenSecret = includeTemplate "secrets/TWITTER_ACCESS_TOKEN_SECRET" | decrypt | trim -}}
{{- end -}}
{{- if and (ne $ twitterApiKey "") (ne $ twitterApiKeySecret "") (ne $ twitterAccessToken "") (ne $ twitterAccessTokenSecret "") -}}
### Twitter
# Posts a tweet
- twitter://{{- $ twitterApiKey -}}/{{- $ twitterApiKeySecret -}}/{{- $ twitterAccessToken -}}/{{- $ twitterAccessTokenSecret -}}?mode=tweet:
- tag: post, tweet, megabyte-labs
{{ end }}
### dbus
# Source: https://github.com/caronc/apprise/wiki/Notify_dbus
- dbus://:
- tag: dbus, system
### GNOME
# Source: https://github.com/caronc/apprise/wiki/Notify_gnome
- gnome://:
- tag: gnome, system
### macOS
# Source: https://github.com/caronc/apprise/wiki/Notify_macosx
- macosx://:
- tag: macos, system
### Windows
# Source: