gcp-subscription-auto-ip-update

Automates DDNS updates and proxy subscription redistribution when a GCP VM public IP changes.

Updated Jul 3, 2026
One-click install
npx skills add https://github.com/CHENHUI-X/toolbox --skill gcp-subscription-auto-ip-update-chenhui-x
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gcp-subscription-auto-ip-update
Source: https://github.com/CHENHUI-X/toolbox/tree/main/custom-skills/devops/gcp-subscription-auto-ip-update
Command: npx skills add https://github.com/CHENHUI-X/toolbox --skill gcp-subscription-auto-ip-update-chenhui-x

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? GCP VMs with ephemeral IPs get a new public IP on every reboot, breaking DDNS records and proxy subscriptions distributed to clients like Stash. This Skill automates the full recovery chain so subscriptions stay reachable without manual intervention. ## Core Features & Use Cases - Boot-triggered IP detection: A systemd oneshot service runs gcp-ip-check.sh at boot, compares the current IP against the last recorded one, and stays silent when nothing changed. - Full update pipeline: On IP change it updates Cloudflare DNS A records, regenerates the Clash-format override YAML, pushes it to a private GitHub repo, and restarts the local HTTP subscription server. - Local HTTP distribution: A Python http.server serves custom-sub.yaml and other subscription formats behind key-based authentication for Stash overrides. - Use Case: After a GCP VM restart, the new IP is detected automatically, DDNS and the GitHub-hosted subscription are refreshed, and Stash immediately pulls the working config from the local endpoint. ## Quick Start Ask the agent to simulate an IP change and run the gcp-ip-check.sh script to verify the DDNS update, GitHub push, and subscription server restart all work end to end.

Frequently Asked Questions about gcp-subscription-auto-ip-update

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I auto-update Cloudflare DNS when a GCP VM IP changes?

Use a systemd oneshot service triggered at boot that runs an IP check script comparing the current public IP to the last recorded one. On change, call a Cloudflare API script with the new IP passed explicitly as an argument to update the DNS A record.

How to serve Clash subscription files over HTTP for Stash?

Run a lightweight Python http.server that maps URL paths to local YAML subscription files and requires a key query parameter, returning 401 without it. Manage it with a systemd unit using Restart=always so it survives crashes and reboots.

Why does Cloudflare DDNS update silently fail in a boot script?

The most common cause is calling the update script without passing the new IP as an argument, which makes it fail silently. Also verify the script has execute permission with chmod +x and add curl timeouts since networking may not be fully ready at boot.

Can I push subscription files to a private GitHub repo with a script?

Yes, use the GitHub Contents API with a PUT request authenticated by a personal access token that has Contents read and write permission. Classic tokens with repo scope tend to be more reliable than fine-grained tokens for this kind of automation.

Why does GitHub API return 401 Bad credentials with a valid token?

Common causes are the token belonging to a different GitHub account, a fine-grained token missing Contents read and write permission, or missing SSO authorization. Test with curl -u username:token against the API user endpoint to isolate authentication from permission issues.