https://github.com/ghostdevv/shire
Shire is a simple no fuss ddns client for cloudflare
https://github.com/ghostdevv/shire
Last synced: 12 months ago
JSON representation
Shire is a simple no fuss ddns client for cloudflare
- Host: GitHub
- URL: https://github.com/ghostdevv/shire
- Owner: ghostdevv
- License: mit
- Created: 2023-08-10T15:22:51.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-03T18:47:52.000Z (about 1 year ago)
- Last Synced: 2025-02-28T18:47:43.450Z (about 1 year ago)
- Language: Rust
- Size: 184 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Shire
Shire is a simple no fuss ddns client for Cloudflare. It allows you to update Cloudflare DNS record(s) with your current IP address.
## Installation
Grab your operating systems binary from the [Releases Tab](https://github.com/ghostdevv/shire/releases). You can then run this from terminal.
### Linux One Liner
If you're using linux you can use the following command to install it easily:
```bash
curl -sL -o shire https://github.com/ghostdevv/shire/releases/latest/download/shire-linux-amd64 \
&& chmod +x shire \
&& sudo mv -f shire /usr/local/bin \
&& sudo chown root:root /usr/local/bin/shire
```
### Cron
Shire is intended to be run as a cron job on linux, an example of that could be:
```
0 0 * * * /bin/bash /usr/local/bin/shire -k CF_API_KEY -z ZONE_ID -r RECORDS
```
See [Usage](#usage) for more information.
## Usage
```bash
$ shire --help
Shire is a simple no fuss ddns client for Cloudflare
Usage: shire [OPTIONS] --zone-id --key
Options:
-r, --records Comma seperated list of the record names to update
-z, --zone-id The Cloudflare Zone Id for your domain
-k, --key Your Cloudflare API key
-i, --ip-resolver The IP resolver url to use, this defaults to ip.willow.sh [default: https://ip.willow.sh]
-h, --help Print help
-V, --version Print version
```
### Example
If we wanted to update the record `test` we could do
```bash
shire --key CF_API_KEY --zone-id bab32631af40d574ag246741013k40z3 --records test
# or use the shorthand args
shire -k CF_API_KEY -z bab32631af40d574ag246741013k40z3 -r test
```
## Configuration
### Cloudflare API Key
You can generate an API Key by visiting the [Cloudflare Dashboard](https://dash.cloudflare.com/profile/api-tokens). Once you click the "Create Token" button, if available click the "Edit zone DNS" template, and then fill in similar to this:

Add as many zones as you are using with shire, or allow access to all zones.
### Zone Id
To get your Zone's Id visit your domain on the [Cloudflare Dashboard](https://dash.cloudflare.com?to=/:account/:zone). Click on the "Overview" tab, and scroll until you see the "API" on the right side of the page. You can then click to copy your Zone Id.

### Changing IP resolver
By default shire uses `https://ip.willow.sh`, a [cloudflare worker](https://workers.cloudflare.com/) run by me. You can pass your own URL that returns a text response with your ipv4 address:
```bash
$ shire --ip-resolver "https://ip.willow.sh"
```
I recommend you host your own [cloudflare worker](https://workers.cloudflare.com/) to make sure you can own & audit all the code you are running. However, you are more than welcome to use [mine](https://ip.willow.sh) if you like:
```js
export default {
/** @param {Request} request */
fetch(request) {
return new Response(request.headers.get('cf-connecting-ip'), {
headers: {
'Access-Control-Allow-Origin': '*',
}
});
}
}
```
```bash
$ curl https://ip.willow.sh
140.82.121.3
```