Compare commits
3 Commits
8e43820281
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
88e9573038 | ||
|
|
e3a689623b | ||
|
|
e8d0d4e6b1 |
1034
Cargo.lock
generated
1034
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
21
Makefile
Normal file
21
Makefile
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
.PHONY: public private sbw
|
||||||
|
|
||||||
|
all: public private sbw
|
||||||
|
|
||||||
|
public:
|
||||||
|
cargo run delete --record-type a --domain publicmatt.com --name "@"
|
||||||
|
curl ipinfo.io/ip | xargs -I {} cargo run update --record-type a --domain publicmatt.com --name "@" --data {}
|
||||||
|
cargo run delete --record-type a --domain publicmatt.com --name "*"
|
||||||
|
curl ipinfo.io/ip | xargs -I {} cargo run update --record-type a --domain publicmatt.com --name "*" --data {}
|
||||||
|
|
||||||
|
sbw:
|
||||||
|
cargo run delete --record-type a --domain sailboatworld.com --name "@"
|
||||||
|
curl ipinfo.io/ip | xargs -I {} cargo run update --record-type a --domain sailboatworld.com --name "@" --data {}
|
||||||
|
cargo run delete --record-type a --domain sailboatworld.com --name "*"
|
||||||
|
curl ipinfo.io/ip | xargs -I {} cargo run update --record-type a --domain sailboatworld.com --name "*" --data {}
|
||||||
|
|
||||||
|
private:
|
||||||
|
cargo run delete --record-type a --domain privatematt.com --name "@"
|
||||||
|
curl ipinfo.io/ip | xargs -I {} cargo run update --record-type a --domain privatematt.com --name "@" --data {}
|
||||||
|
cargo run delete --record-type a --domain privatematt.com --name "*"
|
||||||
|
curl ipinfo.io/ip | xargs -I {} cargo run update --record-type a --domain privatematt.com --name "*" --data {}
|
||||||
41
flake.nix
Normal file
41
flake.nix
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
{
|
||||||
|
description = "GoDaddy DDNS — update A records via REST";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs, flake-utils }:
|
||||||
|
flake-utils.lib.eachDefaultSystem (system:
|
||||||
|
let
|
||||||
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
in {
|
||||||
|
packages.default = pkgs.rustPlatform.buildRustPackage {
|
||||||
|
pname = "godaddy_ddns";
|
||||||
|
version = "0.1.0";
|
||||||
|
src = ./.;
|
||||||
|
cargoLock.lockFile = ./Cargo.lock;
|
||||||
|
|
||||||
|
nativeBuildInputs = [ pkgs.pkg-config ];
|
||||||
|
buildInputs = [ pkgs.openssl ]
|
||||||
|
++ pkgs.lib.optionals pkgs.stdenv.isDarwin [
|
||||||
|
pkgs.darwin.apple_sdk.frameworks.Security
|
||||||
|
pkgs.darwin.apple_sdk.frameworks.SystemConfiguration
|
||||||
|
];
|
||||||
|
|
||||||
|
doCheck = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
devShells.default = pkgs.mkShell {
|
||||||
|
packages = [
|
||||||
|
pkgs.cargo
|
||||||
|
pkgs.rustc
|
||||||
|
pkgs.rustfmt
|
||||||
|
pkgs.clippy
|
||||||
|
pkgs.pkg-config
|
||||||
|
pkgs.openssl
|
||||||
|
];
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -1,10 +1,13 @@
|
|||||||
# GoDaddy DDNS
|
# GoDaddy DDNS
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## What is this?
|
## What is this?
|
||||||
|
|
||||||
It's a Rust application to update GoDaddy DNS Records via REST API.
|
It's a Rust application to update GoDaddy DNS Records via REST API.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
It order for the application to work, there needs to be:
|
It order for the application to work, there needs to be:
|
||||||
|
|
||||||
* Environment variables:
|
* Environment variables:
|
||||||
@@ -12,7 +15,7 @@ It order for the application to work, there needs to be:
|
|||||||
* `KEY` - GoDaddy API Key
|
* `KEY` - GoDaddy API Key
|
||||||
* `SECRET` - GoDaddy API SECRET
|
* `SECRET` - GoDaddy API SECRET
|
||||||
|
|
||||||
Info about how to generate the **KEY** and the **SECRET** can be found here: https://developer.godaddy.com/getstarted
|
Info about how to generate the **KEY** and the **SECRET** can be found here: <https://developer.godaddy.com/getstarted>
|
||||||
|
|
||||||
* A file called `records.json` placed in `$HOME/.godaddy-ddns` with the following structure:
|
* A file called `records.json` placed in `$HOME/.godaddy-ddns` with the following structure:
|
||||||
|
|
||||||
@@ -64,6 +67,3 @@ Example of use (with a given IP of 8.8.8.8) :
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -12,6 +12,6 @@ pub struct Auth {
|
|||||||
impl Auth {
|
impl Auth {
|
||||||
pub fn as_header(&self) -> String {
|
pub fn as_header(&self) -> String {
|
||||||
let header = format!("sso-key {}:{}", self.key, self.secret);
|
let header = format!("sso-key {}:{}", self.key, self.secret);
|
||||||
return header;
|
header
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ pub enum Api {
|
|||||||
|
|
||||||
#[derive(Deserialize, Debug)]
|
#[derive(Deserialize, Debug)]
|
||||||
pub struct ResponseError {
|
pub struct ResponseError {
|
||||||
pub code: String,
|
// pub code: String,
|
||||||
pub message: String,
|
pub message: String,
|
||||||
pub fields: Vec<ResponseField>,
|
pub fields: Vec<ResponseField>,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user