diff --git a/home/.chezmoiscripts/universal/run_onchange_after_26-system-vscode-node-modules.sh.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_26-system-vscode-node-modules.sh.tmpl index 0366934c..cdeaffbe 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_26-system-vscode-node-modules.sh.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_26-system-vscode-node-modules.sh.tmpl @@ -68,6 +68,7 @@ if command -v code > /dev/null && command -v pnpm > /dev/null && [ -f "${XDG_DAT ### Log message if install failed if [ -n "$EXIT_CODE" ]; then logg warn 'Possible error(s) were detected while installing linter fallback configurations to the home directory.' + logg info "Exit code: $EXIT_CODE" else logg success 'Installed linter fallback configuration node_modules' fi diff --git a/home/.chezmoiscripts/universal/run_onchange_after_40-firefox.sh.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_40-firefox.sh.tmpl index ff23c64d..6b65e91e 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_40-firefox.sh.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_40-firefox.sh.tmpl @@ -188,31 +188,39 @@ for SETTINGS_DIR in "$HOME/snap/firefox/common/.mozilla/firefox" "$HOME/.var/app logg info 'Running Firefox headlessly to generate default profiles' timeout 8 "$FIREFOX_EXE" --headless logg info 'Finished running Firefox headlessly' + elif [ -d /Applications ] && [ -d /System ] && [ ! -f "$SETTINGS_DIR/../installs.ini" ]; then + logg info 'Running Firefox headlessly to generate default profiles because install.ini is not at the macOS default location.' + timeout 8 "$FIREFOX_EXE" --headless + logg info 'Finished running Firefox headlessly (while fixing the missing macOS installs.ini issue)' fi ### Add the populated profiles.ini logg info "Copying "${XDG_DATA_HOME:-$HOME/.local/share}/firefox/profiles.ini" to profile directory" if [ -d /Applications ] && [ -d /System ]; then # macOS - logg info "Copying ~/.local/share/profiles.ini to $SETTINGS_DIR/../profiles.ini" + logg info "Copying ~/.local/share/firefox/profiles.ini to $SETTINGS_DIR/../profiles.ini" cp -f "${XDG_DATA_HOME:-$HOME/.local/share}/firefox/profiles.ini" "$SETTINGS_DIR/../profiles.ini" SETTINGS_INI="$SETTINGS_DIR/../installs.ini" else # Linux - logg info "Copying ~/.local/share/profiles.ini to $SETTINGS_DIR/profiles.ini" + logg info "Copying ~/.local/share/firefox/profiles.ini to $SETTINGS_DIR/profiles.ini" cp -f "${XDG_DATA_HOME:-$HOME/.local/share}/firefox/profiles.ini" "$SETTINGS_DIR/profiles.ini" SETTINGS_INI="$SETTINGS_DIR/installs.ini" fi ### Default profile (created by launching Firefox headlessly) # DEFAULT_RELEASE_PROFILE="$(find "$SETTINGS_DIR" -mindepth 1 -maxdepth 1 -name "*.default-*")" - DEFAULT_PROFILE_PROFILE="$SETTINGS_DIR/$(cat "$SETTINGS_INI" | grep 'Default=' | sed 's/.*Profiles\///')" - logg info 'Removing previous installs.ini file' - rm -f "$SETTINGS_INI" - # DEFAULT_PROFILE="$(find "$SETTINGS_DIR" -mindepth 1 -maxdepth 1 -name "*.default" -not -name "profile.default")" - if [ -n "$DEFAULT_RELEASE_PROFILE" ]; then - logg info "Syncing $DEFAULT_RELEASE_PROFILE to $SETTINGS_DIR/profile.default" - rsync -a "$DEFAULT_RELEASE_PROFILE/" "$SETTINGS_DIR/profile.default" + if [ -f "$SETTINGS_INI" ]; then + DEFAULT_PROFILE_PROFILE="$SETTINGS_DIR/$(cat "$SETTINGS_INI" | grep 'Default=' | sed 's/.*Profiles\///')" + logg info 'Removing previous installs.ini file' + rm -f "$SETTINGS_INI" + # DEFAULT_PROFILE="$(find "$SETTINGS_DIR" -mindepth 1 -maxdepth 1 -name "*.default" -not -name "profile.default")" + if [ -n "$DEFAULT_RELEASE_PROFILE" ]; then + logg info "Syncing $DEFAULT_RELEASE_PROFILE to $SETTINGS_DIR/profile.default" + rsync -a "$DEFAULT_RELEASE_PROFILE/" "$SETTINGS_DIR/profile.default" + fi + else + logg error "The $SETTINGS_INI file is missing" fi ### Miscellaneous default profiles diff --git a/home/.chezmoiscripts/universal/run_onchange_after_57-netdata.sh.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_57-netdata.sh.tmpl index 50b6817d..0d7af018 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_57-netdata.sh.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_57-netdata.sh.tmpl @@ -15,8 +15,8 @@ ### Claim the instance with Netdata Cloud if command -v netdata-claim.sh > /dev/null; then - NETDATA_TOKEN="{{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "NETDATA_TOKEN")) }}{{ includeTemplate "secrets/NETDATA_TOKEN" | decrypt }}{{ else }}{{ env "NETDATA_TOKEN" }}{{ end }}" - NETDATA_ROOM="{{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "NETDATA_ROOM")) }}{{ includeTemplate "secrets/NETDATA_ROOM" | decrypt }}{{ else }}{{ env "NETDATA_ROOM" }}{{ end }}" + NETDATA_TOKEN="{{- if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "NETDATA_TOKEN")) -}}{{- includeTemplate "secrets/NETDATA_TOKEN" | decrypt -}}{{- else -}}{{- env "NETDATA_TOKEN" -}}{{- end -}}" + NETDATA_ROOM="{{- if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "NETDATA_ROOM")) -}}{{- includeTemplate "secrets/NETDATA_ROOM" | decrypt -}}{{- else -}}{{- env "NETDATA_ROOM" -}}{{- end -}}" # netdata-claim.sh must be run as netdata user sudo -H -u netdata bash -c 'netdata-claim.sh -token="$NETDATA_TOKEN" -rooms="$NETDATA_ROOM" -url="{{ .netdataClaimURL }}"' @@ -49,7 +49,7 @@ if command -v netdata-claim.sh > /dev/null; then logg error 'No etc location found for netdata' && exit 1 fi logg info "Copying ${XDG_CONFIG_HOME:-$HOME/.config}/netdata/health.d/ to $NETDATA_ETC" - sudo cp -rf "Copying ${XDG_CONFIG_HOME:-$HOME/.config}/netdata/health.d/" "$NETDATA_ETC" + sudo cp -rf "${XDG_CONFIG_HOME:-$HOME/.config}/netdata/health.d/" "$NETDATA_ETC" # Backup current health alarm configuration and apply new one if [ -d /usr/local/lib/netdata ]; then @@ -73,7 +73,7 @@ if command -v netdata-claim.sh > /dev/null; then # Installing the script to generate report on CVEs in installed packages logg info 'Installing script to generate on CVEs in installed packages' - sudo cp -f "$DEBSECAN_GIT/usr_local_bin_debsecan-by-type" /usr/local/bin/debsecan-by-type + sudo cp -f "$DEBSECAN_GIT/usr_local_bin_debsecan-by-type" "/usr/local/bin/debsecan-by-type" # Generate initial debsecan reports in /var/log/debsecan/ logg info 'Generating initial debsecan reports in /var/log/debsecan/' @@ -88,13 +88,17 @@ if command -v netdata-claim.sh > /dev/null; then sudo cp -f "$DEBSECAN_GIT/etc_cron.d_debsecan" /etc/cron.d/debsecan # Install the module/configuration file - logg info 'Installing the module and configuration file + logg info 'Installing the module and configuration file' sudo "$DEBSECAN_GIT/debsecan.chart.py" /usr/libexec/netdata/python.d/debsecan.chart.py sudo "$DEBSECAN_GIT/debsecan.conf" /etc/netdata/python.d/debsecan.conf # Restart Netdata service - logg info 'Restarting netdata service' - sudo systemctl restart netdata + if command -v systemctl > /dev/null; then + logg info 'Restarting netdata service' + sudo systemctl restart netdata + else + logg warn '`systemctl` is not available' + fi else logg warn '`debsecan` is not available in the PATH or is not installed' fi diff --git a/home/Library/Managed Preferences/private_com.cloudflare.warp.plist.tmpl b/home/Library/Managed Preferences/private_com.cloudflare.warp.plist.tmpl index 0adcf6f3..0ffbfa8a 100644 --- a/home/Library/Managed Preferences/private_com.cloudflare.warp.plist.tmpl +++ b/home/Library/Managed Preferences/private_com.cloudflare.warp.plist.tmpl @@ -15,8 +15,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 -}} diff --git a/home/dot_config/shell/aliases.sh.tmpl b/home/dot_config/shell/aliases.sh.tmpl index c436ca44..30b84f23 100644 --- a/home/dot_config/shell/aliases.sh.tmpl +++ b/home/dot_config/shell/aliases.sh.tmpl @@ -156,6 +156,13 @@ if ! command -v pip > /dev/null; then alias pip='pip3' fi +# Link python to python3 +if [ -f /usr/bin/python3 ]; then + alias python='/usr/bin/python3' +elif [ -f /usr/local/bin/python3 ]; then + alias python='/usr/local/bin/python3' +fi + # Masked sudo password entry if command -v gum > /dev/null; then alias please="gum input --password | sudo -nS"