-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f88f4b4
commit 4fb3e0e
Showing
1 changed file
with
37 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,42 @@ | ||
# sharp-glesys-client | ||
### A C# Rest client for Gleesys API | ||
# sharp-glesys-client, | ||
A C# Rest client for Gleesys API and a program to update A records | ||
|
||
## Introduction | ||
|
||
I am writing this console application and the client library only to fulfill my needs, which is to either update records on domains with my public IP or any IP found on any adapter that starts with a given string. | ||
|
||
This is useful to keep your domain synced with your public domain if you don't have static IP where you host services, in your homelab for example. | ||
This is useful to keep your domain synced with your public IP if you don't have static IP where you host services, in your homelab for example. | ||
|
||
The option to find an IP address based on a string is useful if you want to use your domain name internally in a network, where you want the application to find your current local network IP and update the domain with that. | ||
|
||
You only need listrecords and updaterecord permission on the account used to access Glesys API at the moment. Which means that the application cannot create or delete records. | ||
|
||
## Variables | ||
|
||
You can run the program with a appsettings.json to set the variables or as a Docker container and supply the settings as environment variables. | ||
|
||
| Variable | Required | Default value | Description | ||
| --- | ----------- | --- | --- | ||
| GLESYS_WEBSERVICE_URL | No | https://api.glesys.com | Webservice URL | ||
| GLESYS_USE_PUBLIC_IP | No | true | Whether to use public IP or IP found by using GLESYS_IP_STARTS_WITH variable | ||
| GLESYS_TTL | No | 300 | TTL to set on the records | ||
| GLESYS_INTERVAL | No | 60 | Interval to run in minutes | ||
| GLESYS_IP_STARTS_WITH | No | | String used to find IP on any adapter to use for the updates. Used together with USE_PUBLIC_IP = false | ||
| GLESYS_USERNAME | Yes | | Username (starts with 'cl') for the API | ||
| GLESYS_APIKEY | Yes | | API key for the account | ||
| GLESYS_DOMAINS | Yes | | Domains and hosts that should be updated. Format is '\<domain1>#\<host1>,\<host2>\|\<domain2>#\<host1>,\<host2>' | ||
|
||
THe option to find an IP address based on a string is useful if you want to use your domain name internally in a network, where you want the application to find your current local network IP and update the domain with that. | ||
## Docker container | ||
There is a container that is built every time code is pushed and automatically published. The path to the image is ghcr.io/thebiffman/sharp-glesys-client:main. Below is a docker-compose template: | ||
|
||
You only need listrecords and updaterecord permission on the account used to access Glesys API at the moment. Which means that the application cannot create or delete records currently. | ||
``` | ||
services: | ||
dns-updater: | ||
image: ghcr.io/thebiffman/sharp-glesys-client:main | ||
container_name: dns-updater | ||
environment: | ||
- GLESYS_USERNAME=clxxxx | ||
- GLESYS_APIKEY= | ||
- GLESYS_DOMAINS=example1.com#@,www,*|example1.com#@,www,* | ||
restart: "unless-stopped" | ||
``` |