Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Google Cloud SDK User Script Docker

Featured Replies

The enclosed script is my own creation for using a Dockerhub Google Cloud SDK image in order to run API commands for DNS updates.  This script starts a Docker container, runs the command, and discards it.  The persistent storage is in the appdata directory and should be mounted each time a new project is initialized or command is run. This is intended to be run via the User Scripts plugin.  Simply tweak the script to your liking and fill in the variables at the top.

 

Please do not ask for support regarding the Google API commands as I am no expert on all the details of what that entails, its simply provided as a starting point for those looking to run the GCloud SDK on Unraid without dedicating a VM to the task.  Before the script is run you will need to run the gcloud auth login and gcloud workspace commands with the persistent storage attached.  Directly from command line that would look something like this:

 

docker run --rm -e CLOUDSDK_CORE_PROJECT=$PROJECT_NAME -v /mnt/user/appdata/gcloud:/root/.config/gcloud google/cloud-sdk gcloud auth login



I use the LinuxServer.io Letsencrypt (SWAG) container with Google DNS authentication for a wildcard web certificate.  There does not seem to be an easier method of implementing dynamic DNS via Google Cloud (Google Domains does not have DNS authentication for wildcard certificates).

 

#!/bin/bash
DNS_ZONE=
DNS_RECORD_NAME=
DNS_RECORD_TYPE=A
DNS_RECORD_TTL=300
PATH_TRANSACTION=/root/.config/gcloud
PROJECT_NAME=

DNS_RECORD_OLDDATA=$(docker run --rm -e CLOUDSDK_CORE_PROJECT=$PROJECT_NAME -v /mnt/user/appdata/gcloud:/root/.config/gcloud google/cloud-sdk gcloud dns record-sets list --zone=$DNS_ZONE --name=$DNS_RECORD_NAME --type=$DNS_RECORD_TYPE | grep $DNS_RECORD_NAME | xargs | cut -d\  -f4)
DNS_RECORD_NEWDATA=$(curl ifconfig.me)

if [[ $DNS_RECORD_OLDDATA != $DNS_RECORD_NEWDATA ]]; then
  DEFAULT="--zone=$DNS_ZONE --transaction-file=$PATH_TRANSACTION/gcloud-dns-transaction-$(date +%s).yaml"
  docker run --rm -e CLOUDSDK_CORE_PROJECT=$PROJECT_NAME -v /mnt/user/appdata/gcloud:/root/.config/gcloud google/cloud-sdk gcloud dns record-sets transaction start $DEFAULT
  docker run --rm -e CLOUDSDK_CORE_PROJECT=$PROJECT_NAME -v /mnt/user/appdata/gcloud:/root/.config/gcloud google/cloud-sdk gcloud dns record-sets transaction remove $DEFAULT --name=$DNS_RECORD_NAME --type=$DNS_RECORD_TYPE --ttl=$DNS_RECORD_TTL $DNS_RECORD_OLDDATA
  docker run --rm -e CLOUDSDK_CORE_PROJECT=$PROJECT_NAME -v /mnt/user/appdata/gcloud:/root/.config/gcloud google/cloud-sdk gcloud dns record-sets transaction add $DEFAULT --name=$DNS_RECORD_NAME --type=$DNS_RECORD_TYPE --ttl=$DNS_RECORD_TTL $DNS_RECORD_NEWDATA
  docker run --rm -e CLOUDSDK_CORE_PROJECT=$PROJECT_NAME -v /mnt/user/appdata/gcloud:/root/.config/gcloud google/cloud-sdk gcloud dns record-sets transaction execute $DEFAULT
fi

 

Anyways, thats my rabbit hole for today... cheers.

dnsupdate.sh

Edited by slashmach1
discovered code function in forum posting

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.