Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cloudflare api to fix removed field #60

Merged
merged 2 commits into from
Jun 29, 2024

Conversation

Wyn-Price
Copy link
Contributor

A patch for cloudflare/cloudflare-rs/pull/240
Fixes #57

I've included @jcgruenhage's make-owner-fields-optional changes in my cloudflare-rs PR.

Removes some unused imports that no longer exist (ApiClient), and the change in api.rs is to coerce the error type from Client::new, as I'm assuming they're now returning their own error type. I can make this nicer if you want.

I can confirm that this works with A records, I haven't tested with AAAA records but I can't see why it wouldn't also work.

Before:
$ cargo run -- --records x.wynprice.com --token XXX
    Finished dev [unoptimized + debuginfo] target(s) in 0.13s
     Running `target/debug/cfdyndns --records x.wynprice.com --token XXX`
 INFO  cfdyndns::ip > ...
Error: error decoding response body: missing field `multiple_railguns_allowed` at line 1 column 586
After - when there is no change needed:
$ cargo run -- --records x.wynprice.com --token XXX
   Compiling cfdyndns v0.2.0 (/home/wp/programming/cfdyndns)
    Finished dev [unoptimized + debuginfo] target(s) in 4.37s
     Running `target/debug/cfdyndns --records x.wynprice.com --token XXX`
 INFO  cfdyndns::ip > ...
 INFO  cfdyndns::dns > skipping A record `x.wynprice.com`; already up to date
After - when the DNS record needs changing:
$ cargo run -- --records x.wynprice.com --token XXX
   Compiling cfdyndns v0.2.0 (/home/wp/programming/cfdyndns)
    Finished dev [unoptimized + debuginfo] target(s) in 0.14s
     Running `target/debug/cfdyndns --records x.wynprice.com --token XXX`
 INFO  cfdyndns::ip > ...
 INFO  cfdyndns::dns > request: x.wynprice.com (... → ...)

@nrdxp
Copy link
Owner

nrdxp commented Jun 28, 2024

looks like the build is failing in CI

@Wyn-Price
Copy link
Contributor Author

Yup, I can have a look at it tonight.

@Wyn-Price
Copy link
Contributor Author

I reran crate2nix, hopefully that's what the problem was. It seems to have changed the format of crate-hashes.json (even though the version of crate2nix was the same) ,but hopefully that's fine.

Copy link
Owner

@nrdxp nrdxp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks for the fix. I would just request you maybe squash the first two commits of the PR into one, and it should be ready to merge.

@Wyn-Price
Copy link
Contributor Author

Sure, done

@nrdxp nrdxp merged commit a05d046 into nrdxp:master Jun 29, 2024
4 checks passed
@Wyn-Price
Copy link
Contributor Author

Wyn-Price commented Jun 29, 2024

I'm happy to update nixpkgs if you create a new release, or I can just update to the latest commit

@nrdxp
Copy link
Owner

nrdxp commented Jun 29, 2024

tagged as v0.2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: missing field multiple_railguns_allowed
2 participants