From 9b371fd926a4119f1876a81900b7fc5ff6b80756 Mon Sep 17 00:00:00 2001 From: Brian Zalewski <59970525+ProfessorManhattan@users.noreply.github.com> Date: Mon, 31 Jul 2023 05:31:48 +0000 Subject: [PATCH] Latest --- home/.chezmoidata.yaml | 1 + home/.chezmoiignore | 2 + home/.chezmoiremove | 2 + .../run_before_01-system-homebrew.sh.tmpl | 6 + home/dot_VirtualBox/VirtualBox.xml.tmpl | 2 +- home/dot_config/Code/User/README.md | 117 +++++++++--------- home/dot_config/Code/User/extensions.json | 1 - home/dot_config/quokka/config.json | 5 + ...lone.conf.tmpl => modify_rclone.conf.tmpl} | 0 .../rclone/private_rclone.conf.tmpl | 13 ++ home/dot_config/shell/exports.sh.tmpl | 4 + home/dot_local/bin/executable_rclone-mount | 37 ++++-- home/dot_quokka.tmpl | 1 + home/dot_zshrc | 6 +- 14 files changed, 126 insertions(+), 71 deletions(-) create mode 100644 home/dot_config/quokka/config.json rename home/dot_config/rclone/{merge_private_rclone.conf.tmpl => modify_rclone.conf.tmpl} (100%) create mode 100644 home/dot_config/rclone/private_rclone.conf.tmpl create mode 100644 home/dot_quokka.tmpl diff --git a/home/.chezmoidata.yaml b/home/.chezmoidata.yaml index 0fe05f3f..c5c83c25 100644 --- a/home/.chezmoidata.yaml +++ b/home/.chezmoidata.yaml @@ -37,6 +37,7 @@ docker: wireguard: serverUrl: megabyte.space internalSubnet: 10.93.92.0 +kubernetesHost: kochab macosRemoteLogin: 'on' netdataClaimURL: https://app.netdata.cloud themeparkTheme: aquamarine diff --git a/home/.chezmoiignore b/home/.chezmoiignore index 683781ed..b8e76d58 100644 --- a/home/.chezmoiignore +++ b/home/.chezmoiignore @@ -47,6 +47,8 @@ dot_local/konsole/ dot_local/share/kde4/ dot_local/share/xfce4/ dot_var/ +.var/ +dot_VirtualBox/ dot_Xresources {{- end }} diff --git a/home/.chezmoiremove b/home/.chezmoiremove index 64632aae..fcabc0b8 100644 --- a/home/.chezmoiremove +++ b/home/.chezmoiremove @@ -21,6 +21,7 @@ Brewfile .krew .lesshst .m2 +.npm/ .npmrc .parallels/ .pearrc @@ -34,6 +35,7 @@ Brewfile .tinypng .tmux.conf .tmux.conf.local +.Trash/ .v8flags* .vagrant.d/ .viminfo diff --git a/home/.chezmoiscripts/universal/run_before_01-system-homebrew.sh.tmpl b/home/.chezmoiscripts/universal/run_before_01-system-homebrew.sh.tmpl index 8d315026..4655b9af 100644 --- a/home/.chezmoiscripts/universal/run_before_01-system-homebrew.sh.tmpl +++ b/home/.chezmoiscripts/universal/run_before_01-system-homebrew.sh.tmpl @@ -14,6 +14,12 @@ {{ includeTemplate "universal/profile-before" }} {{ includeTemplate "universal/logg-before" }} +### Configure Firewall +if [ -d /Applications ] && [ -d /System ]; then + logg info 'Disabling the block all incoming traffic option in the system Firewall settings' + /usr/libexec/ApplicationFirewall/socketfilterfw --setblockall off || logg error 'Failed to disable incoming traffic block in the system Firewall' && logg info 'Manually disable the option under "System Preferences" > "Network" > "Firewall" > "Incoming Traffic Block Toggle"' +fi + ### System upgrade on macOS if [ -d /Applications ] && [ -d /Library ] && [ -z "$NO_RESTART" ]; then if command -v gtimeout > /dev/null; then diff --git a/home/dot_VirtualBox/VirtualBox.xml.tmpl b/home/dot_VirtualBox/VirtualBox.xml.tmpl index 26a1da9e..f51de8de 100644 --- a/home/dot_VirtualBox/VirtualBox.xml.tmpl +++ b/home/dot_VirtualBox/VirtualBox.xml.tmpl @@ -24,7 +24,7 @@ - + diff --git a/home/dot_config/Code/User/README.md b/home/dot_config/Code/User/README.md index 758d9f47..7fcfa0f1 100644 --- a/home/dot_config/Code/User/README.md +++ b/home/dot_config/Code/User/README.md @@ -2,71 +2,72 @@ ## Deprecated Plugins -* "dart-code.dart-code", Creates a ~/.dart and ~/.dartServer folder. Does not respect XDG spec. -* "dart-code.flutter", - // "ibm.codewind", Creates a ~/.codewind folder. Does not respect XDG spec. - // "ibm.ibm-developer", - // "jfrog.jfrog-vscode-extension", Creates a ~/.jfrog-vscode-extension folder. Does not respect XDG spec. - // "lightrun.lightrunplugin-saas", Creates a ~/.lightrun folder. Does not respect XDG spec. - // "platformio.platformio-ide", Creates ~/.platformio folder. Does not respect XDG spec. -// "robocorp.robocorp-code", Creates a ~/.robocorp and ~/.robocorp-code folder. Does not respect XDG spec. - // "robocorp.robotframework-lsp", - // "sonarsource.sonarlint-vscode", Creates a ~/.sonarlint folder. Does not respect XDG spec. - // "sprkldev.sprkl-vscode", Creates a ~/.sprkl folder. Does not respect XDG spec. -// Creates ~/.console-ninja folder -- needs to respect XDG - // "wallabyjs.console-ninja", - "gitpod.gitpod-remote-ssh", // Bunch of errors like this during install [gitpod-remote-ssh]: Couldn't find message for key openPreview. - // "leonardssh.vscord", Discord presence plugin (requires embedding key in settings.json) - "ms-toolsai.vscode-ai-remote", [vscode-ai]: Couldn't find message for key azureml.internal.activate.title. - "ms-toolsai.vscode-ai", - "circleci.circleci", // Unneeded (not using CircleCI currently) - "wallabyjs.console-ninja", - "webhint.vscode-webhint", - "statelyai.stately-vscode", - "lottiefiles.vscode-lottie", - "logerfo.gitlab-notifications", - "antonreshetov.masscode-assistant", - "circleci.circleci", - "bridgecrew.checkov", +The following plugins were tested but removed because the `extensions.json` already includes about 200 plugins. The plugins were tested and removed if they added too much menu clutter, created unwieldly home folder additions, or were not deemed useful. + +```json +{ + "aic.docify", "amazonwebservices.aws-toolkit-vscode", - "okteto.kubernetes-context", - "okteto.remote-kubernetes", + "antonreshetov.masscode-assistant", + "appland.appmap", + "azure-automation.vscode-azureautomation", + "balazs4.gitlab-pipeline-monitor", + "bridgecrew.checkov", + "chiro2001.digital-ocean-manager", + "circleci.circleci", // Unneeded (not using CircleCI currently) + "dart-code.dart-code", // Creates a ~/.dart and ~/.dartServer folder. Does not respect XDG spec. + "dart-code.flutter", + "formulahendry.docker-explorer", + "getporter.porter-vscode", + "gitpod.gitpod-desktop", + "gitpod.gitpod-remote-ssh", // Bunch of errors like this during install [gitpod-remote-ssh]: Couldn't find message for key openPreview. + "google-home.google-home-extension", + "ibm.codewind", // Creates a ~/.codewind folder. Does not respect XDG spec. + "ibm.ibm-developer", + "idered.npm", + "infracost.infracost", + "ionic.ionic", + "jasonn-porch.gitlab-mr", + "jfrog.jfrog-vscode-extension", // Creates a ~/.jfrog-vscode-extension folder. Does not respect XDG spec. + "jsayol.firebase-explorer", + "leonardssh.vscord", // Discord presence plugin (requires embedding key in settings.json) + "lightrun.lightrunplugin-saas", // Creates a ~/.lightrun folder. Does not respect XDG spec. + "logerfo.gitlab-notifications", + "lottiefiles.vscode-lottie", "mindaro-dev.file-downloader", "mindaro.mindaro", - "redhat.vscode-server-connector", - "redhat.vscode-tekton-pipelines", - "chiro2001.digital-ocean-manager", - "ms-toolsai.vscode-ai-remote", + "mongodb.mongodb-vscode", + "ms-kubernetes-tools.kind-vscode", + "ms-toolsai.vscode-ai-remote", // Error encountered: [vscode-ai]: Couldn't find message for key azureml.internal.activate.title. "ms-toolsai.vscode-ai", "ms-vscode.powershell", - "gitpod.gitpod-desktop", - "ms-kubernetes-tools.kind-vscode", - "wasteamaccount.webtemplatestudio-dev-nightly", + "msazurermtools.azurerm-vscode-tools", + "nrwl.angular-console", + "okteto.kubernetes-context", + "okteto.remote-kubernetes", + "owenfarrell.vscode-vault", + "platformio.platformio-ide", // Creates ~/.platformio folder. Does not respect XDG spec. + "pwabuilder.pwa-studio", "rangav.vscode-thunder-client", "rapidapi.vscode-rapidapi-client", - "sapos.yeoman-ui", - "google-home.google-home-extension", - "stepsize.stepsize", - "leonardssh.vscord", - "aic.docify", - "jsayol.firebase-explorer", - "balazs4.gitlab-pipeline-monitor", - "jasonn-porch.gitlab-mr", - "teamhub.teamhub", - "infracost.infracost", - "mongodb.mongodb-vscode", - "pwabuilder.pwa-studio", - "sidekick.sidekick-debugger", - "appland.appmap", - "teamsdevapp.ms-teams-vscode-extension", - "saposs.app-studio-toolkit", - "azure-automation.vscode-azureautomation", - "formulahendry.docker-explorer", - "msazurermtools.azurerm-vscode-tools", - "idered.npm", "redhat.vscode-openshift-connector", "redhat.vscode-redhat-account", "redhat.vscode-rsp-ui", - "ionic.ionic", - "nrwl.angular-console", - "owenfarrell.vscode-vault", \ No newline at end of file + "redhat.vscode-server-connector", + "redhat.vscode-tekton-pipelines", + "robocorp.robocorp-code", // Creates a ~/.robocorp and ~/.robocorp-code folder. Does not respect XDG spec. + "robocorp.robotframework-lsp", + "sapos.yeoman-ui", + "saposs.app-studio-toolkit", + "sidekick.sidekick-debugger", + "sonarsource.sonarlint-vscode", // Creates a ~/.sonarlint folder. Does not respect XDG spec. + "sprkldev.sprkl-vscode", // Creates a ~/.sprkl folder. Does not respect XDG spec. + "statelyai.stately-vscode", + "stepsize.stepsize", + "teamhub.teamhub", + "teamsdevapp.ms-teams-vscode-extension", + "wallabyjs.console-ninja", // Creates ~/.console-ninja folder -- needs to respect XDG + "wasteamaccount.webtemplatestudio-dev-nightly", + "webhint.vscode-webhint" +} +``` \ No newline at end of file diff --git a/home/dot_config/Code/User/extensions.json b/home/dot_config/Code/User/extensions.json index be37c93a..21343ee5 100644 --- a/home/dot_config/Code/User/extensions.json +++ b/home/dot_config/Code/User/extensions.json @@ -11,7 +11,6 @@ "attilabuti.vscode-mjml", "bbenoist.vagrant", "beauallison.brew-services", - "getporter.porter-vscode", "bierner.color-info", "bierner.markdown-emoji", "bmewburn.vscode-intelephense-client", diff --git a/home/dot_config/quokka/config.json b/home/dot_config/quokka/config.json new file mode 100644 index 00000000..65a32a2a --- /dev/null +++ b/home/dot_config/quokka/config.json @@ -0,0 +1,5 @@ +{ + "autoLog":true, + "showSingleInlineValue":false, + "pro":false +} \ No newline at end of file diff --git a/home/dot_config/rclone/merge_private_rclone.conf.tmpl b/home/dot_config/rclone/modify_rclone.conf.tmpl similarity index 100% rename from home/dot_config/rclone/merge_private_rclone.conf.tmpl rename to home/dot_config/rclone/modify_rclone.conf.tmpl diff --git a/home/dot_config/rclone/private_rclone.conf.tmpl b/home/dot_config/rclone/private_rclone.conf.tmpl new file mode 100644 index 00000000..895a6eb0 --- /dev/null +++ b/home/dot_config/rclone/private_rclone.conf.tmpl @@ -0,0 +1,13 @@ +{{- if and (or (and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "CLOUDFLARE_R2_ID"))) (env "CLOUDFLARE_R2_ID")) (or (and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "CLOUDFLARE_R2_SECRET"))) (env "CLOUDFLARE_R2_SECRET")) (ne .user.cloudflare.r2 "") -}} +# MEGABYTE LABS MANAGED S3 +[{{ .user.username}}-s3] +access_key_id = {{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "CLOUDFLARE_R2_ID")) }}{{- includeTemplate "secrets/CLOUDFLARE_R2_ID" | decrypt | trim -}}{{ else }}{{- env "CLOUDFLARE_R2_ID" -}}{{ end }} +acl = private +endpoint = {{ .user.cloudflare.r2 }}.r2.cloudflarestorage.com +provider = Cloudflare +region = auto +secret_access_key = {{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "CLOUDFLARE_R2_SECRET")) }}{{- includeTemplate "secrets/CLOUDFLARE_R2_SECRET" | decrypt | trim -}}{{ else }}{{- env "CLOUDFLARE_R2_SECRET" -}}{{ end }} +type = s3 +# MEGABYTE LABS MANAGED S3 +EOT +{{- end -}} \ No newline at end of file diff --git a/home/dot_config/shell/exports.sh.tmpl b/home/dot_config/shell/exports.sh.tmpl index bd0a0b1d..8844742b 100644 --- a/home/dot_config/shell/exports.sh.tmpl +++ b/home/dot_config/shell/exports.sh.tmpl @@ -402,6 +402,10 @@ export WGETRC="$XDG_CONFIG_HOME/wget/wgetrc" ### Whalebrew export WHALEBREW_CONFIG_DIR="$XDG_CONFIG_HOME/whalebrew" +### .zsh_sessions +# Source: https://apple.stackexchange.com/questions/427561/macos-zsh-sessions-zsh-history-and-setopt-append-history +export SHELL_SESSIONS_DISABLE=1 + ### CloudFlare Wrangler export WRANGLER_INSTALL_PATH="$XDG_DATA_HOME/wrangler" export WRANGLER_HOME="$XDG_DATA_HOME/wrangler" diff --git a/home/dot_local/bin/executable_rclone-mount b/home/dot_local/bin/executable_rclone-mount index db74dd5b..82a676d6 100644 --- a/home/dot_local/bin/executable_rclone-mount +++ b/home/dot_local/bin/executable_rclone-mount @@ -49,25 +49,42 @@ fi MOUNT_LOWERCASE="$(echo "$MOUNT" | tr "[:upper:]" "[:lower:]")" unset AWS_CA_BUNDLE export PATH="$PATH:/usr/local/bin:/usr/bin" +# TODO: Only launch with --rc-web-gui if the servers hostname is the {{ .kubernetesHost }} +# TODO: Add more secure authentication method sudo rclone --config="$CONFIG_FOLDER/rclone.conf" \ mount \ - --cache-tmp-upload-path="$CACHE_FOLDER/$MOUNT-upload" \ + --allow-other \ + --buffer-size 4G \ + --bwlimit=40M \ --cache-chunk-path="$CACHE_FOLDER/$MOUNT-chunks" \ + --cache-db-path="$CACHE_FOLDER/$MOUNT-db" \ + --cache-dir="$CACHE_FOLDER/$MOUNT-vfs" \ + --cache-info-age=60m \ + --cache-tmp-upload-path="$CACHE_FOLDER/$MOUNT-upload" \ --cache-workers=8 \ --cache-writes \ - --cache-dir="$CACHE_FOLDER/$MOUNT-vfs" \ - --cache-db-path="$CACHE_FOLDER/$MOUNT-db" \ + --checkers=16 \ --daemon \ - --noapplexattr \ + --dir-cache-time 24h \ + --dir-cache-time=60m \ + --drive-use-trash \ + --exclude-from="$RCLONE_IGNORE" \ --log-file="$LOG_FILE" \ --no-modtime \ - --drive-use-trash \ + --noapplexattr \ + --rc \ + --rc-pass rclone \ + --rc-user rclone \ + --rc-web-gui \ --stats=0 \ - --checkers=16 \ - --bwlimit=40M \ - --dir-cache-time=60m \ + --vfs-cache-max-age 1000h \ + --vfs-cache-max-age 1000h \ + --vfs-cache-max-size 140G \ --vfs-cache-mode full \ + --vfs-cache-poll-interval 24h \ + --vfs-fast-fingerprint \ + --vfs-read-ahead 128M \ + --vfs-read-chunk-size 16M \ + --vfs-read-chunk-size-limit 128M \ --volname "$MOUNT" \ - --cache-info-age=60m \ - --filter-from="$RCLONE_IGNORE" \ "$MOUNT_LOWERCASE":"$MOUNT_LOWERCASE" "$MOUNT_PATH" diff --git a/home/dot_quokka.tmpl b/home/dot_quokka.tmpl new file mode 100644 index 00000000..50ee3f85 --- /dev/null +++ b/home/dot_quokka.tmpl @@ -0,0 +1 @@ +{{ .host.home }}/.config/quokka \ No newline at end of file diff --git a/home/dot_zshrc b/home/dot_zshrc index 7d37e356..966818a0 100644 --- a/home/dot_zshrc +++ b/home/dot_zshrc @@ -26,6 +26,10 @@ export WORDCHARS=${WORDCHARS//\/} export PROMPT_EOL_MARK= export TIMEFMT=$'\nreal\t%E\nuser\t%U\nsys\t%S\ncpu\t%P' +### .zcompdump +# Source: https://www.reddit.com/r/zsh/comments/nwxcg4/store_zcompdump_in_specific_directory/ +export ZSH_COMPDUMP="${XDG_CACHE_HOME:-$HOME/.cache}/zsh/zcompdump-$ZSH_VERSION" + ### Antigen export ADOTDIR="$HOME/.local/antigen" @@ -390,7 +394,7 @@ fi ### Homebrew ZSH Completions # Must be sourced before compinit / Oh-My-ZSH inclusion -FPATH="$HOMEBREW_PREFIX/share/zsh/site-functions:${FPATH}" +export FPATH="$HOMEBREW_PREFIX/share/zsh/site-functions:${FPATH}" ### ZSH compinit autoload -Uz +X compinit && compinit -d "${XDG_CACHE_HOME:-$HOME/.cache}/zsh/zcompdump-$ZSH_VERSION"