This commit is contained in:
Brian Zalewski 2023-07-10 08:10:00 +00:00
parent 1c4563bf1a
commit 8a2d039cb7
3 changed files with 11 additions and 30 deletions

View file

@ -225,8 +225,8 @@ else
fi
{{- $registrationToken := "" }}
{{- if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "cloudflared" .user.hostname)) -}}
{{- $registrationToken := (includeTemplate (joinPath "cloudflared" .user.hostname) | decrypt) -}}
{{- if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "cloudflared" .host.hostname)) -}}
{{- $registrationToken := (includeTemplate (joinPath "cloudflared" .host.hostname) | decrypt) -}}
{{- end }}
### Set up CloudFlare tunnels
if command -v cloudflared > /dev/null && [ -d "$HOME/.local/etc/cloudflared" ]; then
@ -240,13 +240,13 @@ if command -v cloudflared > /dev/null && [ -d "$HOME/.local/etc/cloudflared" ];
sudo cp -rf "$HOME/.local/etc/cloudflared/"* /usr/local/etc/cloudflared
# Register tunnel (if not already registered)
if cloudflared tunnel list | grep "host-{{ .user.hostname }}"; then
if cloudflared tunnel list | grep "host-{{ .host.hostname }}"; then
logg info 'CloudFlare tunnel is already registered'
else
logg info 'Creating a CloudFlare tunnel to this host'
sudo cloudflared tunnel create "host-{{ .user.hostname }}"
sudo cloudflared tunnel create "host-{{ .host.hostname }}"
fi
TUNNEL_ID="$(cloudflared tunnel list | grep "host-{{ .user.hostname }}" | sed 's/ .*//')"
TUNNEL_ID="$(cloudflared tunnel list | grep "host-{{ .host.hostname }}" | sed 's/ .*//')"
logg info "Tunnel ID: $TUNNEL_ID"
if [ -f "/usr/local/etc/cloudflared/${TUNNEL_ID}.json" ]
logg info 'Symlinking tunnel configuration to /usr/local/etc/cloudflared/credentials.json'

View file

@ -1,18 +0,0 @@
{{- if ne .host.distro.family "windows" -}}
#!/usr/bin/env bash
# @file Android SDK Pre-Install
# @brief Pre-installs a list of Android SDKs and Tools
# @description
# This script pre-installs Android SDKs and Tools defined in [`.chezmoidata.yaml`](https://github.com/megabyte-labs/install.doctor/tree/master/home/.chezmoidata.yaml)
# so that the user does not have to do anything on launching Android Studio for the first time.
{{ includeTemplate "universal/profile" }}
{{ includeTemplate "universal/logg" }}
### Run `sdkmanager`, if it is installed, to install SDKs and Tools
if command -v vim > /dev/null; then
{{ range .androidSDKs }}
echo 'y' | $HOME/android-sdk/cmdline-tools/latest/bin/sdkmanager --install "{{ . }}" 2>&1 /dev/null
{{ end }}
fi
{{ end -}}

View file

@ -579,7 +579,6 @@ softwarePackages:
_github: https://github.com/appium/appium
_home: https://appium.io/
_name: Appium
_service: appium
ansible: professormanhattan.appium
brew: appium
choco: appium-desktop
@ -9977,7 +9976,7 @@ softwarePlugins:
plugins:
- deployer/deployer
docker:
cmd: bash -c 'if ! docker extension list | grep {PLUGIN} > /dev/null; then echo y | docker extension install {PLUGIN}; fi'
cmd: bash -c 'if ! docker extension list | grep "{PLUGIN}" > /dev/null; then echo y | docker extension install "{PLUGIN}"; fi'
plugins:
- docker/disk-usage-extension
- docker/logs-explorer-extension
@ -9994,12 +9993,12 @@ softwarePlugins:
plugins:
- docker.io/nginx/unit
dotnet:
cmd: bash -c 'if dotnet tool list -g | grep {PLUGIN} > /dev/null; then dotnet tool install -g {PLUGIN}; fi'
cmd: bash -c 'if ! dotnet tool list -g | grep "{PLUGIN}" > /dev/null; then dotnet tool install -g "{PLUGIN}"; fi'
plugins:
- microsoft.cst.attacksurfaceanalyzer.cli
- dotnet-format
gcloud:
cmd: bash -c 'if ! gcloud components list | grep 'Installed.*{PLUGIN}' > /dev/null; then gcloud components install {PLUGIN}; fi'
cmd: bash -c 'if ! gcloud components list | grep 'Installed.*{PLUGIN}' > /dev/null; then gcloud components install "{PLUGIN}"; fi'
plugins:
- app-engine-go
- cloud-datastore-emulator
@ -10015,7 +10014,7 @@ softwarePlugins:
- terraform-tools
update: gcloud components update
gh:
cmd: bash -c 'if [ -n "$GITHUB_TOKEN" ] && ! gh extension list | grep {PLUGIN} > /dev/null; then gh extension install {PLUGIN}; fi'
cmd: bash -c 'if [ -n "$GITHUB_TOKEN" ] && ! gh extension list | grep "{PLUGIN}" > /dev/null; then gh extension install "{PLUGIN}"; fi'
plugins:
- abdfnx/gh-tran
- dlvhdr/gh-dash
@ -10050,7 +10049,7 @@ softwarePlugins:
- https://www.raycast.com/abielzulio/chatgpt
- https://www.raycast.com/BalliAsghar/mailsy
steampipe:
cmd: bash -c 'if [ ! -f /tmp/steampipe-plugin-list ]; then steampipe plugin list > /tmp/steampipe-plugin-list; fi && if ! cat /tmp/steampipe-plugin-list | grep {PLUGIN} > /dev/null; then steampipe plugin install {PLUGIN}; fi'
cmd: bash -c 'if [ ! -f /tmp/steampipe-plugin-list ]; then steampipe plugin list > /tmp/steampipe-plugin-list; fi && if ! cat /tmp/steampipe-plugin-list | grep "{PLUGIN}" > /dev/null; then steampipe plugin install "{PLUGIN}"; fi'
plugins:
- algolia
- aws
@ -10107,7 +10106,7 @@ softwarePlugins:
- name: Pieces
plugin: https://teams.microsoft.com/l/app/789f23b3-d882-45ca-b3a3-de7f850656ea
vagrant:
cmd: bash -c 'if ! vagrant plugin list | grep {PLUGIN}; then vagrant plugin install {PLUGIN}; fi'
cmd: bash -c 'if ! vagrant plugin list | grep "{PLUGIN}"; then vagrant plugin install "{PLUGIN}"; fi'
plugins:
- vagrant-bindfs
- vagrant-digitalocean