Document AUR package & alternatives

This commit is contained in:
Kaan Barmore-Genç 2022-01-30 17:03:57 -05:00
parent 87bc572111
commit 6667b62747
2 changed files with 28 additions and 60 deletions

View File

@ -1,51 +0,0 @@
# Maintainer: Kaan Genc <kaan@bgenc.net>
pkgname=gandi-live-dns
pkgver=1.0.1
pkgrel=1
pkgdesc="Automatically updates your IP address for Gandi's Live DNS."
_repo_path="SeriousBug/gandi-live-dns-rust"
url="https://github.com/${_repo_path}"
license=('MIT')
install="gandi-live-dns.install"
arch=('x86_64' 'armv6h' 'armv7h' 'aarch64')
backup=("etc/gandi-live-dns/gandi.conf")
depends=() # Dependency free
source=(
"https://raw.githubusercontent.com/${_repo_path}/${pkgver}/example.toml"
"gandi-live-dns.service"
"gandi-live-dns.timer"
"gandi-live-dns.sysusers"
)
_source_common="${url}/releases/download/${pkgver}/${pkgname}.${pkgver}.linux"
source_x86_64=("${_source_common}-x86_64.tar.xz")
source_armv6h=("${_source_common}-armv6.tar.xz")
source_armv7h=("${_source_common}-armv7.tar.xz")
source_aarch64=("${_source_common}-arm64.tar.xz")
package() {
# Install service files
install -Dm644 gandi-live-dns.service "${pkgdir}/usr/lib/systemd/system/gandi-live-dns.service"
install -Dm644 gandi-live-dns.timer "${pkgdir}/usr/lib/systemd/system/gandi-live-dns.timer"
install -Dm644 gandi-live-dns.sysusers "${pkgdir}/usr/lib/sysusers.d/gandi-live-dns.conf"
# Add the example config
mkdir -m600 -p "${pkgdir}/etc/gandi-live-dns"
install -Dm600 example.toml "${pkgdir}/etc/gandi-live-dns/example.toml"
# Install the program itself
install -Dm755 gandi-live-dns "${pkgdir}/usr/bin/gandi-live-dns"
}
sha256sums=('4f9dd02e0e03fd838081c3a8dd88b386411204853399f78fa83e8781271a012f'
'7ae1a8fa18e0ef41aa42c94b4a364fdab0a6c9520cbea486f8c9c7f5da22e88f'
'cd3b1ab682d421e8b9f230d9f44c07a9afe54ce12e55a2990fcbe606e4ccb9a3'
'a0e652bf8fd879dcbb96488322cac572346fa9a1dbbc2cac08b94b12d9629128')
sha256sums_x86_64=('75afe5409f4e98b91ef5966fbf6e2bfdeaccb299c2ccd35e722606ed0779c9f0')
sha256sums_armv6h=('cc8465bc0a8d1de0bbb1817071d5aadce5a30287e8a7f6f357180559cddbd78d')
sha256sums_armv7h=('95f80dd4fab25b4e6aeb4278e4b19255277000515d1ffacc03189c162b0c3b5c')
sha256sums_aarch64=('df5c93303707ff60a015da4548f80218978247c886152b2f59b8509826245c34')

View File

@ -11,20 +11,24 @@ program can update both IPv4 and IPv6 addresses for one or more domains and
subdomains. It's a one-shot tool that's meant to be managed with a systemd timer subdomains. It's a one-shot tool that's meant to be managed with a systemd timer
or cron. or cron.
Inspired by [cavebeat's similar tool](https://github.com/cavebeat/gandi-live-dns),
which seems to be unmaintained at the time I'm writing this. I decided to rewrite
it in Rust as a learning project.
## Usage ## Usage
> This tool doesn't rate limit itself at the moment. If you have more than 30 > This tool doesn't rate limit itself at the moment. If you have more than 30
> entries that need to be updated, the operation may hit rate the limit of Gandi > entries that need to be updated, the operation may hit the rate limit of Gandi
> and fail. You can work around this using multiple config files and waiting at > and fail. You can work around this using multiple config files and waiting at
> least 1 minute between runs. > least 1 minute between runs.
### System packages
Packages are available for some linux distributions.
- ArchLinux: [gandi-live-dns-rust on AUR](https://aur.archlinux.org/packages/gandi-live-dns-rust/)
> Contributions to release this for other distributions are welcome!
### Prebuilt binaries ### Prebuilt binaries
`gandi-live-dns-rust` provides pre-built binaries with the releases. See the `gandi-live-dns` provides pre-built binaries with the releases. See the
[releases page](https://github.com/SeriousBug/gandi-live-dns-rust/releases) to [releases page](https://github.com/SeriousBug/gandi-live-dns-rust/releases) to
get the latest version. These binaries are statically linked, and provided for get the latest version. These binaries are statically linked, and provided for
both Linux and Windows, including ARM architectures for the Linux version. both Linux and Windows, including ARM architectures for the Linux version.
@ -38,8 +42,8 @@ Download the latest version from the releases page, extract it from the archive,
### With docker ### With docker
`gandi-live-dns-rust` has Docker images available for x86_64, arm64, armv6, and armv7 platforms. Use the [seriousbug/gandi-live-dns-rust](https://hub.docker.com/r/seriousbug/gandi-live-dns-rust) Docker images, which are available for x86_64,
Follow the steps below to use these images. arm64, armv6, and armv7 platforms. Follow the steps below to use these images.
- Create a file `gandi.toml`, then copy and paste the contents of [`example.toml`](https://raw.githubusercontent.com/SeriousBug/gandi-live-dns-rust/master/example.toml) - Create a file `gandi.toml`, then copy and paste the contents of [`example.toml`](https://raw.githubusercontent.com/SeriousBug/gandi-live-dns-rust/master/example.toml)
- Follow the instructions in the example config to get your API key and put it in the config - Follow the instructions in the example config to get your API key and put it in the config
@ -47,7 +51,7 @@ Follow the steps below to use these images.
- Run `docker run --rm -it -v $(pwd)/gandi.toml:/gandi.toml:ro seriousbug/gandi-live-dns-rust:latest` - Run `docker run --rm -it -v $(pwd)/gandi.toml:/gandi.toml:ro seriousbug/gandi-live-dns-rust:latest`
> Docker doesn't [support IPv6](https://docs.docker.com/config/daemon/ipv6/) out > Docker doesn't [support IPv6](https://docs.docker.com/config/daemon/ipv6/) out
> of the box. Check the linked page to enable it, or use the native option. > of the box. If you need to update IPv6 addresses, check the linked page to enable IPv6 or use the prebuilt binaries directly.
> If you get [errors](https://stackoverflow.com/questions/42248198/how-to-mount-a-single-file-in-a-volume) about not finding the config file, make sure your command > If you get [errors](https://stackoverflow.com/questions/42248198/how-to-mount-a-single-file-in-a-volume) about not finding the config file, make sure your command
> has a full path to the config file (`$(pwd)/gandi.toml` part). Otherwise > has a full path to the config file (`$(pwd)/gandi.toml` part). Otherwise
@ -60,6 +64,14 @@ to automatically run this tool. By default it will update the IP addresses after
every boot up, and at least once a day. You can adjust the timer to speed this every boot up, and at least once a day. You can adjust the timer to speed this
up, but avoid unnecessarily overloading Gandi's servers. up, but avoid unnecessarily overloading Gandi's servers.
- Place `gandi-live-dns.timer` and `gandi-live-dns.service` into `/etc/systemd/system`
- Put `gandi-live-dns` binary into `/usr/bin/`
- You can also place it in `/usr/local/bin` or some other directory, just make sure to update the path in the service file
- Create the folder `/etc/gandi-live-dns`, and place your `gandi.toml` into it
- Create a user for the service: `useradd --system gandi-live-dns --home-dir /etc/gandi-live-dns`
- Make sure only the service can access the config file: `chown gandi-live-dns: /etc/gandi-live-dns/gandi.toml && chmod 600 /etc/gandi-live-dns/gandi.toml`
- Enable the timer with `systemctl enable --now gandi-live-dns.timer`
## Development ## Development
### Local builds ### Local builds
@ -79,3 +91,10 @@ Docker with `docker login`. Then follow these steps:
- Create a release on Github - Create a release on Github
- Make sure to create a tag for the release version on `master` - Make sure to create a tag for the release version on `master`
- Upload the binary archives to the Github release - Upload the binary archives to the Github release
## Alternatives
- [laur89's Bash based updater](https://github.com/laur89/docker-gandi-dns-update)
- [ Adam Vigneaux's Bash based updater, with a docker image](https://github.com/AdamVig/gandi-dynamic-dns)
- [Yago Riveiro's Python based updater](https://github.com/yriveiro/giu)
- [ Maxime Le Conte des Floris' Go based updater](https://github.com/mlcdf/dyndns)