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

Use my new Bunny.NET API library #10

Merged
merged 2 commits into from
Jun 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/dotnet-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
source-url: https://nuget.pkg.github.com/prplecake/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Restore dependencies
run: dotnet restore
- name: Build
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ jobs:
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
source-url: https://nuget.pkg.github.com/prplecake/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Restore dependencies
run: dotnet restore
- name: Build
Expand Down
57 changes: 0 additions & 57 deletions src/BunnyDDNS.CLI/Api/Bunny/DnsApiClient.cs

This file was deleted.

1 change: 1 addition & 0 deletions src/BunnyDDNS.CLI/BunnyDDNS.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Bunny.NET" Version="0.0.2" />
<PackageReference Include="GitVersion.MsBuild" Version="5.12.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
8 changes: 4 additions & 4 deletions src/BunnyDDNS.CLI/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using BunnyDDNS.CLI.Api.Bunny;
using Bunny.NET.Client;
using BunnyDDNS.Core.Configuration;
using BunnyDDNS.Core.Utilities;
using Serilog;
Expand Down Expand Up @@ -37,8 +37,8 @@ public static int Main(string[] args)
_logger.Information("Current IP: {Ip}", currentIp);

// Find record in Bunny DNS
var dnsClient = new DnsApiClient(config);
var zone = dnsClient.GetDnsZoneByName(config.ZoneName).Result;
var dnsClient = new BunnyClient(config.Bunny.AccessToken);
var zone = dnsClient.GetZoneByName(config.ZoneName).Result;

// Update record in Bunny DNS
var record = zone.Records.First(r => r.Name.ToLower() == config.RecordName);
Expand All @@ -48,7 +48,7 @@ public static int Main(string[] args)
return 0;
}
_logger.Information("Updating record: {Record}", $"{record}.{zone}");
dnsClient.UpdateDnsRecord(
dnsClient.UpdateRecord(
zone.Id,
record,
currentIp
Expand Down
28 changes: 0 additions & 28 deletions src/BunnyDDNS.Core/Entities/Bunny/DnsZone.cs

This file was deleted.