diff --git a/docs/TODO.md b/docs/TODO.md index a3712894..3d41c06c 100644 --- a/docs/TODO.md +++ b/docs/TODO.md @@ -8,6 +8,17 @@ https://github.com/rigoneri/Syte3 ✖ ERROR Gsettings Failed to apply gsetting Error: Command failed: gsettings set org.gnome.desktop.interface color-scheme prefer-dark No such key “color-scheme” +# Skate! +# RUNDECK +# Foreman? +# FOG +# AMANDA +# CloudStack +# AppScale +# resilio connect +# oVirt +# opennebula +# emailengine.app CLOUDFLARE_API_TOKEN GMAIL_APP_PASSWORD diff --git a/home/.chezmoidata.yaml b/home/.chezmoidata.yaml index 5fd3489a..387f058e 100644 --- a/home/.chezmoidata.yaml +++ b/home/.chezmoidata.yaml @@ -588,7 +588,6 @@ softwareGroups: - secretive - standard-notes - stats - - temps - teamviewer Misc-Development-Tools: &Misc-Development-Tools - ansifilter @@ -765,6 +764,7 @@ softwareGroups: - ots - share - syncthing + - lsyncd Transfer-Desktop: &Transfer-Desktop - ariang - dat-desktop @@ -1166,6 +1166,8 @@ softwareGroups: - plymouth - chromium - astronvim + # macOS menu bar app for weather - little bit buggy + - temps - asdf # editly NPM package is failing to install on macOS - attempts to compile with node-gyp - editly diff --git a/home/.chezmoiscripts/universal/run_onchange_after_05-postfix.sh.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_05-postfix.sh.tmpl new file mode 100644 index 00000000..1a9870a2 --- /dev/null +++ b/home/.chezmoiscripts/universal/run_onchange_after_05-postfix.sh.tmpl @@ -0,0 +1,74 @@ +{{- if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "ANSIBLE_GALAXY_TOKEN")) }}{{ includeTemplate "secrets/ANSIBLE_GALAXY_TOKEN" | decrypt }}{{ else }}{{ env "ANSIBLE_GALAXY_TOKEN" }}{{ end }} +#!/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 +# @description +# This script follows the instructions from [SendGrid's documentation on integrating Postfix](https://docs.sendgrid.com/for-developers/sending-email/postfix). +# After this script runs, you should be able to send outgoing e-mails using SendGrid as an SMTP handler. In other words, you will +# be able to use the `mail` CLI command to send e-mails. The following is an example mailing the contents of `~/.bashrc` to `name@email.com`: +# +# ```shell +# cat ~/.bashrc | mail -s "My subject" name@email.com +# ``` + +{{ includeTemplate "universal/profile" }} +{{ includeTemplate "universal/logg" }} + +if command -v postfix > /dev/null; then + ### Ensure dependencies are installed + if command -v apt > /dev/null; then + logg info 'Installing libsasl2-modules' + sudo apt-get update + sudo apt-get install -y libsasl2-modules || EXIT_CODE=$? + elif command -v dnf > /dev/null; then + sudo dnf install -y cyrus-sasl-plain || EXIT_CODE=$? + elif command -v yum > /dev/null; then + sudo yum install -y cyrus-sasl-plain || EXIT_CODE=$? + fi + if [ -n "$EXIT_CODE" ]; then + logg warn 'There was an error ensuring the Postfix-SendGrid dependencies were installed' + fi + + if [ -d /etc/postfix ]; then + ### Add the SendGrid Postfix settings to the Postfix configuration + if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/postfix/main.cf" ]; then + CONFIG_FILE=/etc/postfix/main.cf + if cat "$CONFIG_FILE" | grep '### INSTALL DOCTOR MANAGED'; then + logg info 'Removing Install Doctor-managed block of code in /etc/postfix/main.cf block' + START_LINE="$(echo `grep -n -m 1 "### INSTALL DOCTOR MANAGED ### START" "$CONFIG_FILE" | cut -f1 -d ":"`)" + END_LINE="$(echo `grep -n -m 1 "### INSTALL DOCTOR MANAGED ### END" "$CONFIG_FILE" | cut -f1 -d ":"`)" + if command -v gsed > /dev/null; then + gsed -i "$START_LINE,$END_LINEd" "$CONFIG_FILE" + else + sed -i "$START_LINE,$END_LINEd" "$CONFIG_FILE" + fi + fi + + ### Add Postfix main configuration + logg "Adding configuration from ${XDG_CONFIG_HOME:-$HOME/.config}/postfix/main.cf to /etc/postfix/main.cf" + echo "" | sudo tee -a "$CONFIG_FILE" + cat "${XDG_CONFIG_HOME:-$HOME/.config}/postfix/main.cf" | sudo tee -a "$CONFIG_FILE" + fi + + ### Ensure proper permissions on `sasl_passwd` and update Postfix hashmaps + if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/postfix/sasl_passwd" ]; then + logg info "Copying file from ${XDG_CONFIG_HOME:-$HOME/.config}/postfix/sasl_passwd to /etc/postfix/sasl_passwd" + sudo cp -f "${XDG_CONFIG_HOME:-$HOME/.config}/postfix/sasl_passwd" /etc/postfix/sasl_passwd + logg info 'Assigning proper permissions to /etc/postfix/sasl_passwd' + sudo chmod 600 /etc/postfix/sasl_passwd + logg info 'Updating Postfix hashmaps for /etc/postfix/sasl_passwd' + sudo postmap /etc/postfix/sasl_passwd + fi + + ### Enable / restart postfix + logg info 'Enabling / restarting postfix' + sudo systemctl enable postfix + sudo systemctl restart postfix + else + logg warn '/etc/postfix is not a directory! Skipping SendGrid Postfix setup.' + fi +else + logg info 'Skipping Postfix configuration because Postfix is not installed' +fi + +{{ end -}} \ No newline at end of file diff --git a/home/.chezmoitemplates/secrets/SENDGRID_API_KEY b/home/.chezmoitemplates/secrets/SENDGRID_API_KEY new file mode 100644 index 00000000..f1b45e2e --- /dev/null +++ b/home/.chezmoitemplates/secrets/SENDGRID_API_KEY @@ -0,0 +1,8 @@ +-----BEGIN AGE ENCRYPTED FILE----- +YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA4Y2Z1V0oxVWhDVmljM2ZV +MkRjbmRJYlErVnNhbE5wL0Y2MWtvUnlWdGhnCmlpb1pzVWlZeVRFV05CY1dmbGg5 +R1NwQlZOSU8zVFlySFBuRFBRbFJjMmsKLS0tIFZJOVdyakxNTDlVbGJ6a1dYcTR4 +bU9wV1k4YTFQUU55SVJVT05LWFlMbzAKmueb+ABaperDOZUNq33GOTXYSd6+Ic7U +79CgsKP0kpNp5yQRddNPLBWsP3mnve6d556awgt3XgCwOUs/nsMrRMEgPVnTzana +tXh0aFzf9Ok9xatiJTUlPHFIk863EwPEEDaODf2E +-----END AGE ENCRYPTED FILE----- \ No newline at end of file diff --git a/home/.chezmoitemplates/secrets/key-sendgrid-api-key b/home/.chezmoitemplates/secrets/key-sendgrid-api-key deleted file mode 100644 index 763fdce6..00000000 --- a/home/.chezmoitemplates/secrets/key-sendgrid-api-key +++ /dev/null @@ -1,8 +0,0 @@ ------BEGIN AGE ENCRYPTED FILE----- -YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBRYlovRUc3UnNtbW83dUQ5 -d0RwR284bTZMRStWNnJjZjhjUTNOVTlUc0ZJCi9VcEtRMzhkTFViY3M3cTJ2TlJo -WlZPenRLVjBGOVVBSVF5U255SWtiWTgKLS0tIEI4dm9BM1NsdjdaQ24vSjEweEZX -cUtZN2x1QmhxRG9vRHZ0N0tJY21Sc2sKxi6CxcuuyMA4Q9bPnl8gscmHiLwJb/UW -8qa+dPPVBt2X08mLVkpH2IbDC3l0LT6+mEtpJvRR1reH3ywlgi+6i2j3xBT6Wr34 -ZFAc+U4uTQ+61ghoOhayeGrFFs+gQ4Af6D8KdfY= ------END AGE ENCRYPTED FILE----- \ No newline at end of file diff --git a/home/dot_config/ngrok/ngrok.yml.tmpl b/home/dot_config/ngrok/ngrok.yml.tmpl index 98e2d711..2dc7a6cf 100644 --- a/home/dot_config/ngrok/ngrok.yml.tmpl +++ b/home/dot_config/ngrok/ngrok.yml.tmpl @@ -1,4 +1,4 @@ -{{- if (or (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "NGROK_AUTH_TOKEN")) (env "NGROK_AUTH_TOKEN")) -}} +{{- if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (or (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "NGROK_AUTH_TOKEN")) (env "NGROK_AUTH_TOKEN")) -}} version: "2" -authtoken: '{{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "NGROK_AUTH_TOKEN")) }}{{ includeTemplate "secrets/NGROK_AUTH_TOKEN" | decrypt }}{{ else }}{{ env "NGROK_AUTH_TOKEN" }}{{ end }}' +authtoken: '{{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "NGROK_AUTH_TOKEN")) }}{{- includeTemplate "secrets/NGROK_AUTH_TOKEN" | decrypt -}}{{ else }}{{- env "NGROK_AUTH_TOKEN" -}}{{ end }}' {{- end -}} \ No newline at end of file diff --git a/home/dot_config/npm/npmrc.tmpl b/home/dot_config/npm/npmrc.tmpl index 6519e174..e621db86 100644 --- a/home/dot_config/npm/npmrc.tmpl +++ b/home/dot_config/npm/npmrc.tmpl @@ -9,4 +9,4 @@ loglevel=error network-concurrency=32 prefix={{ .chezmoi.homeDir }}/.local/share/npm strict-peer-dependencies=false -//registry.npmjs.org/:_authToken={{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "NPM_TOKEN")) }}{{ includeTemplate "secrets/NPM_TOKEN" | decrypt }}{{ else if (env "NPM_TOKEN") }}{{ env "NPM_TOKEN" }}{{ else }}${NPM_TOKEN}{{ end }} \ No newline at end of file +//registry.npmjs.org/:_authToken={{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "NPM_TOKEN")) }}{{- includeTemplate "secrets/NPM_TOKEN" | decrypt -}}{{ else if (env "NPM_TOKEN") }}{{- env "NPM_TOKEN" -}}{{ else }}${NPM_TOKEN}{{ end }} \ No newline at end of file diff --git a/home/dot_config/postfix/main.cf b/home/dot_config/postfix/main.cf new file mode 100644 index 00000000..07cdc83d --- /dev/null +++ b/home/dot_config/postfix/main.cf @@ -0,0 +1,17 @@ +### INSTALL DOCTOR MANAGED ### START +# @file SendGrid Postfix configuration +# @brief Configures Postfix to use SendGrid as a relay host +# @description +# This configuration file is appended to `/etc/postfix/main.cf` by one of the scripts. It configures SendGrid +# as a relay host that Postfix can use. More details can be found in the +# [SendGrid documentation on integrating Postfix](https://docs.sendgrid.com/for-developers/sending-email/postfix). + +smtp_sasl_auth_enable = yes +smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd +smtp_sasl_security_options = noanonymous +smtp_sasl_tls_security_options = noanonymous +smtp_tls_security_level = encrypt +header_size_limit = 4096000 +relayhost = [smtp.sendgrid.net]:587 + +### INSTALL DOCTOR MANAGED ### END \ No newline at end of file diff --git a/home/dot_config/postfix/private_sasl_passwd.tmpl b/home/dot_config/postfix/private_sasl_passwd.tmpl new file mode 100644 index 00000000..3910adfc --- /dev/null +++ b/home/dot_config/postfix/private_sasl_passwd.tmpl @@ -0,0 +1,3 @@ +{{- if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (or (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "SENDGRID_API_KEY")) (env "SENDGRID_API_KEY")) -}} +[smtp.sendgrid.net]:587 apikey:{{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "SENDGRID_API_KEY")) }}{{ includeTemplate "secrets/SENDGRID_API_KEY" | decrypt }}{{ else }}{{ env "SENDGRID_API_KEY" }}{{ end }} +{{- end -}} \ No newline at end of file diff --git a/home/dot_config/rclone/merge_private_rclone.conf.tmpl b/home/dot_config/rclone/merge_private_rclone.conf.tmpl index a0a19544..47eb87c5 100644 --- a/home/dot_config/rclone/merge_private_rclone.conf.tmpl +++ b/home/dot_config/rclone/merge_private_rclone.conf.tmpl @@ -4,8 +4,8 @@ CONFIG_FILE="$HOME/.config/rclone/rclone.conf" if cat "$CONFIG_FILE" | grep '# MEGABYTE LABS MANAGED S3'; then # TODO: Remove old block - START_LINE="$(echo `grep -n -m 1 "# MEGABYTE LABS MANAGED S3" .zshrc | cut -f1 -d ":"`)" - END_LINE="$(echo `grep -n -m 1 "# MEGABYTE LABS MANAGED S3" .zshrc | cut -f1 -d ":"`)" + START_LINE="$(echo `grep -n -m 1 "# MEGABYTE LABS MANAGED S3" "$CONFIG_FILE" | cut -f1 -d ":"`)" + END_LINE="$(echo `grep -n -m 1 "# MEGABYTE LABS MANAGED S3" "$CONFIG_FILE" | cut -f1 -d ":"`)" if command -v gsed > /dev/null; then gsed -i "$START_LINE,$END_LINEd" "$CONFIG_FILE" else diff --git a/home/dot_config/samba/config.tmpl b/home/dot_config/samba/config.tmpl index fe327d48..3a0bd0fb 100644 --- a/home/dot_config/samba/config.tmpl +++ b/home/dot_config/samba/config.tmpl @@ -26,11 +26,13 @@ [Private] browsable = yes comment = Authenticated share with read/write capabilities (backed up to S3) - follow symlinks = no + follow symlinks = yes guest only = no - path = /mnt/samba-private + path = /mnt/Network Share (Private) public = no + unix extension = yes valid users = @sambausers + wide links = yes writable = true [Public] @@ -38,7 +40,7 @@ comment = Public folder provided for file sharing on the LAN (backed up to S3) follow symlinks = no guest only = yes - path = /mnt/samba-public + path = /mnt/Network Share (Public) public = yes writable = yes diff --git a/home/dot_config/slack-term/config.tmpl b/home/dot_config/slack-term/config.tmpl index 5f4a7ca4..1111cf78 100644 --- a/home/dot_config/slack-term/config.tmpl +++ b/home/dot_config/slack-term/config.tmpl @@ -1,5 +1,5 @@ { - "slack_token": "{{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "SLACK_API_TOKEN")) }}{{ includeTemplate "secrets/SLACK_API_TOKEN" | decrypt }}{{ else }}{{ env "SLACK_API_TOKEN" }}{{ end }}", + "slack_token": "{{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "SLACK_API_TOKEN")) }}{{- includeTemplate "secrets/SLACK_API_TOKEN" | decrypt -}}{{ else }}{{- env "SLACK_API_TOKEN" -}}{{ end }}", "sidebar_width": 3, "notify": "mention", "emoji": true, diff --git a/home/dot_config/tabby/config.yaml.tmpl b/home/dot_config/tabby/config.yaml.tmpl index 163329ed..71697a9d 100644 --- a/home/dot_config/tabby/config.yaml.tmpl +++ b/home/dot_config/tabby/config.yaml.tmpl @@ -1,5 +1,5 @@ {{- if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "files" "tabby")) -}} -{{ includeTemplate "files/tabby" | decrypt -}} +{{- includeTemplate "files/tabby" | decrypt -}} {{ else -}} version: 3 profiles: [] diff --git a/home/dot_config/warp/private_mdm.xml.tmpl b/home/dot_config/warp/private_mdm.xml.tmpl index 4597aef5..deb2b417 100644 --- a/home/dot_config/warp/private_mdm.xml.tmpl +++ b/home/dot_config/warp/private_mdm.xml.tmpl @@ -13,8 +13,8 @@ support_url https://megabyte.space auth_client_id - {{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "CLOUDFLARE_TEAMS_CLIENT_ID")) }}{{ includeTemplate "secrets/CLOUDFLARE_TEAMS_CLIENT_ID" | decrypt }}{{ else }}{{ env "CLOUDFLARE_TEAMS_CLIENT_ID" }}{{ end }} + {{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "CLOUDFLARE_TEAMS_CLIENT_ID")) }}{{- includeTemplate "secrets/CLOUDFLARE_TEAMS_CLIENT_ID" | decrypt -}}{{ else }}{{- env "CLOUDFLARE_TEAMS_CLIENT_ID" -}}{{ end }} auth_client_secret - {{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "CLOUDFLARE_TEAMS_CLIENT_SECRET")) }}{{ includeTemplate "secrets/CLOUDFLARE_TEAMS_CLIENT_SECRET" | decrypt }}{{ else }}{{ env "CLOUDFLARE_TEAMS_CLIENT_SECRET" }}{{ end }} + {{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "CLOUDFLARE_TEAMS_CLIENT_SECRET")) }}{{- includeTemplate "secrets/CLOUDFLARE_TEAMS_CLIENT_SECRET" | decrypt -}}{{ else }}{{- env "CLOUDFLARE_TEAMS_CLIENT_SECRET" -}}{{ end }} {{ end -}} diff --git a/software.yml b/software.yml index a517122c..a20acb85 100644 --- a/software.yml +++ b/software.yml @@ -7195,6 +7195,17 @@ softwarePackages: _type: cli brew: spectralops/tap/teller github: github.com/tellerops/teller + lsyncd: + _bin: lsyncd + _desc: Lsyncd (Live Syncing Daemon) synchronizes local directories with remote targets (via SSH and more) + _docs: https://lsyncd.github.io/lsyncd/ + _github: https://github.com/lsyncd/lsyncd + _home: false + _name: Lsyncd + apt: lsyncd + dnf: lsyncd + pacman: lsyncd + brew: lsyncd temps: _bin: null _desc: Simple menubar application based on Electron with actual weather information and forecast @@ -7230,6 +7241,16 @@ softwarePackages: snap: termius-app yay: termius _type: application + postfix: + _bin: postfix + _desc: Postfix is an e-mail server that can be used to send e-mail + _docs: https://www.postfix.org/documentation.html + _github: https://github.com/vdukhovni/postfix + _home: https://www.postfix.org/ + _name: Postfix + apt: postfix + dnf: postfix + pacman: postfix terraform: _deps: - tfenv