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

Merge develop into master #63

Merged
merged 15 commits into from
Jan 5, 2024
Merged
1,513 changes: 1,216 additions & 297 deletions .editorconfig

Large diffs are not rendered by default.

20 changes: 7 additions & 13 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@main
with:
dotnet-version: '7.x.x'
dotnet-version: '8.x.x'
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@main
with:
Expand All @@ -27,25 +27,19 @@ jobs:
uses: gittools/actions/gitversion/execute@main
- name: Publish
run: |
dotnet publish RS.Fritz.Manager.UI/RS.Fritz.Manager.UI.csproj --configuration Release --no-self-contained --framework net7.0-windows10.0.22621.0 --runtime win-x64 -p:PublishReadyToRun=true -p:PublishReadyToRunComposite=true -p:PublishSingleFile=true -p:DebugType=embedded -p:AssemblyVersion=$env:GitVersion_AssemblySemVer -p:FileVersion=$env:GitVersion_AssemblySemFileVer -p:InformationalVersion=$env:GitVersion_InformationalVersion
dotnet publish RS.Fritz.Manager.UI/RS.Fritz.Manager.UI.csproj --configuration Release --no-self-contained --framework net7.0-windows10.0.22621.0 --runtime win-arm64 -p:PublishReadyToRun=true -p:PublishReadyToRunComposite=true -p:PublishSingleFile=true -p:DebugType=embedded -p:AssemblyVersion=$env:GitVersion_AssemblySemVer -p:FileVersion=$env:GitVersion_AssemblySemFileVer -p:InformationalVersion=$env:GitVersion_InformationalVersion
dotnet publish RS.Fritz.Manager.UI/RS.Fritz.Manager.UI.csproj --configuration Release --no-self-contained --framework net8.0-windows10.0.22621.0 --runtime win-x64 -p:PublishReadyToRun=true -p:PublishReadyToRunComposite=true -p:PublishSingleFile=true -p:DebugType=embedded -p:AssemblyVersion=$env:GitVersion_AssemblySemVer -p:FileVersion=$env:GitVersion_AssemblySemFileVer -p:InformationalVersion=$env:GitVersion_InformationalVersion
dotnet publish RS.Fritz.Manager.UI/RS.Fritz.Manager.UI.csproj --configuration Release --no-self-contained --framework net8.0-windows10.0.22621.0 --runtime win-arm64 -p:PublishReadyToRun=true -p:PublishReadyToRunComposite=true -p:PublishSingleFile=true -p:DebugType=embedded -p:AssemblyVersion=$env:GitVersion_AssemblySemVer -p:FileVersion=$env:GitVersion_AssemblySemFileVer -p:InformationalVersion=$env:GitVersion_InformationalVersion
- name: Zip
run: |
7z a -r ${{ format('RS.Fritz.Manager-v{0}-net7.0-windows-x64.zip', env.GitVersion_SemVer) }} ./RS.Fritz.Manager.UI/bin/Release/net7.0-windows10.0.22621.0/win-x64/publish/*.*
7z a -r ${{ format('RS.Fritz.Manager-v{0}-net7.0-windows-ARM64.zip', env.GitVersion_SemVer) }} ./RS.Fritz.Manager.UI/bin/Release/net7.0-windows10.0.22621.0/win-arm64/publish/*.*
- name: Prerelease
if: ${{ env.GitVersion_PreReleaseTag != '' }}
run: gh release create ${{ format('v{0}', env.GitVersion_SemVer) }} (get-item *.zip) --generate-notes --target ${{ github.sha }} --prerelease
env:
GH_TOKEN: ${{ github.token }}
7z a -r "${{ format('RS.Fritz.Manager-v{0}-net8.0-windows-x64.zip', env.GitVersion_SemVer) }}" "./RS.Fritz.Manager.UI/bin/Release/net8.0-windows10.0.22621.0/win-x64/publish/*.*" "-x!*.xml"
7z a -r "${{ format('RS.Fritz.Manager-v{0}-net8.0-windows-ARM64.zip', env.GitVersion_SemVer) }}" "./RS.Fritz.Manager.UI/bin/Release/net8.0-windows10.0.22621.0/win-arm64/publish/*.*" "-x!*.xml"
- name: Release
if: ${{ env.GitVersion_PreReleaseTag == '' }}
run: gh release create ${{ format('v{0}', env.GitVersion_SemVer) }} (get-item *.zip) --generate-notes --target ${{ github.sha }}
run: gh release create v${{ env.GitVersion_SemVer }} (get-item *.zip) --generate-notes --target ${{ github.sha }} ${{ env.PreReleaseTag != '' && '--prerelease' || '' }}
env:
GH_TOKEN: ${{ github.token }}
- name: Package
run: dotnet pack RS.Fritz.Manager.API/RS.Fritz.Manager.API.csproj --no-restore --configuration Release -p:PackageVersion=$env:GitVersion_NuGetVersionV2
- name: NuGet Push
run: dotnet nuget push ${{ format('RS.Fritz.Manager.API/bin/Release/RS.Fritz.Manager.API.{0}.nupkg', env.GitVersion_NuGetVersionV2) }} --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
- name: GitHub Push
run: dotnet nuget push ${{ format('RS.Fritz.Manager.API/bin/Release/RS.Fritz.Manager.API.{0}.nupkg', env.GitVersion_NuGetVersionV2) }} --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/Rans4ckeR/index.json
run: dotnet nuget push ${{ format('RS.Fritz.Manager.API/bin/Release/RS.Fritz.Manager.API.{0}.nupkg', env.GitVersion_NuGetVersionV2) }} --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/Rans4ckeR/index.json
12 changes: 12 additions & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear/>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
<packageSourceMapping>
<packageSource key="nuget.org">
<package pattern="*" />
</packageSource>
</packageSourceMapping>
</configuration>
27 changes: 23 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@

# RS.Fritz.Manager

Allows FritzBox device detection, monitoring, configuring and packet capturing.

Available as a standalone Windows application ([UI](#rsfritzmanagerui)) and as a NuGet package ([API](#rsfritzmanagerapi)).

For a list of implemented services check the [Service implementation status](#tr-064-service-implementation-status)


## RS.Fritz.Manager.UI

A Windows .NET WPF application for x64 and ARM64.

* [Releases](https://github.com/Rans4ckeR/RS.Fritz.Manager/releases)
Expand All @@ -20,6 +22,7 @@ A Windows .NET WPF application for x64 and ARM64.
![Untitled4](https://user-images.githubusercontent.com/25006126/163052588-4f1be776-9190-4ff9-8326-9c9615bf3e82.png)

## RS.Fritz.Manager.API

A NuGet package to manage FritzBox devices using pure WCF calls.

* [NuGet](https://www.nuget.org/packages/RS.Fritz.Manager.API)
Expand Down Expand Up @@ -109,6 +112,7 @@ static async Task StopCaptureAsync(InternetGatewayDevice device, CaptureInterfac
## TR-064 Service implementation status

### WAN

* 🔶 urn:dslforum-org:service:WANIPConnection
* ✅ GetInfo
* ✅ GetConnectionTypeInfo
Expand Down Expand Up @@ -177,9 +181,12 @@ static async Task StopCaptureAsync(InternetGatewayDevice device, CaptureInterfac
* ✅ GetATMEncapsulation
* ✅ GetAutoConfig
* ✅ GetStatistics
* ❌ urn:dslforum-org:service:X_AVM-DE_WANMobileConnection
* 🔶 urn:dslforum-org:service:X_AVM-DE_Speedtest
* ✅ GetInfo
* ❌ SetConfig
* ✅ GetStatistics
* ❌ ResetStatistics
* ❌ urn:dslforum-org:service:X_AVM-DE_RemoteAccess
* ❌ urn:dslforum-org:service:X_AVM-DE_MyFritz
* ❌ urn:dslforum-org:service:X_AVM-DE_HostFilter
Expand All @@ -194,33 +201,39 @@ static async Task StopCaptureAsync(InternetGatewayDevice device, CaptureInterfac
* ❌ SetForwardingEntryEnable

### Telephony

* ❌ urn:dslforum-org:service:X_AVM-DE_OnTel
* ❌ urn:dslforum-org:service:X_AVM-DE_TAM
* ❌ urn:dslforum-org:service:X_VoIP

### Home network

* 🔶 urn:dslforum-org:service:Hosts
* ✅ GetHostNumberOfEntries
* ❌ GetSpecificHostEntry
* ✅ GetGenericHostEntry
* ✅ X_AVM-DE_GetInfo
* ✅ X_AVM-DE_GetChangeCounter
* ❌ X_AVM-DE_GetAutoWakeOnLANByMACAddress
* ❌ X_AVM-DE_SetAutoWakeOnLANByMACAddress
* ❌ X_AVM-DE_SetHostNameByMACAddress
* ❌ X_AVM-DE_WakeOnLANByMACAddress
* ❌ X_AVM-DE_GetSpecificHostEntryByIp
* X_AVM-DE_HostsCheckUpdate
* X_AVM-DE_HostsCheckUpdate
* ❌ X_AVM-DE_HostDoUpdate
* ❌ X_AVM-DE_SetPrioritizationByIP
* ✅ X_AVM-DE_GetHostListPath
* ✅ X_AVM-DE_GetMeshListPath
* ✅ X_AVM-DE_GetFriendlyName
* ❌ X_AVM-DE_SetFriendlyName
* ❌ X_AVM-DE_SetFriendlyNameByIP
* ❌ X_AVM-DE_SetFriendlyNameByMAC
* 🔶 urn:dslforum-org:service:WLANConfiguration
* ❌ SetEnable
* ✅ GetInfo
* ❌ SetConfig
* ❌ SetSecurityKeys
* ❌ GetSecurityKeys
* ❌ SetDefaultWEPKeyIndex
* ❌ GetDefaultWEPKeyIndex
* ❌ SetBasBeaconSecurityProperties
* ✅ GetBasBeaconSecurityProperties
* ✅ GetBSSID
Expand Down Expand Up @@ -269,16 +282,19 @@ static async Task StopCaptureAsync(InternetGatewayDevice device, CaptureInterfac
* ✅ GetInfo
* ✅ GetStatistics
* ❌ urn:dslforum-org:service:X_AVM-DE_Dect
* ❌ urn:dslforum-org:service:X_AVM-DE_Media
* ❌ urn:dslforum-org:service:X_AVM-DE_Homeauto
* ❌ urn:dslforum-org:service:X_AVM-DE_Homeplug

### Storage/NAS

* ❌ urn:dslforum-org:service:X_AVM-DE_Storage
* ❌ urn:dslforum-org:service:X_AVM-DE_UPnP
* ❌ urn:dslforum-org:service:X_AVM-DE_WebDAVClient
* ❌ urn:dslforum-org:service:X_AVM-DE_Filelinks

### System

* ✅ urn:dslforum-org:service:DeviceInfo
* ✅ GetInfo
* ✅ SetProvisioningCode
Expand All @@ -297,6 +313,8 @@ static async Task StopCaptureAsync(InternetGatewayDevice device, CaptureInterfac
* ✅ X_AVM-DE_CreateUrlSID
* ✅ X_AVM-DE_GetSupportDataInfo
* ❌ X_AVM-DE_SendSupportData
* ❌ X_AVM-DE_GetSupportDataEnable
* ❌ X_AVM-DE_SetSupportDataEnable
* ✅ urn:dslforum-org:service:LANConfigSecurity
* ✅ GetInfo
* ✅ X_AVM-DE_GetAnonymousLogin
Expand All @@ -315,6 +333,7 @@ static async Task StopCaptureAsync(InternetGatewayDevice device, CaptureInterfac
* ✅ X_SetTR069Enable
* ✅ X_AVM-DE_GetTR069FirmwareDownloadEnabled
* ✅ X_AVM-DE_SetTR069FirmwareDownloadEnabled
* ❌ urn:dslforum-org:service:X_AVM-DE_USPController
* ❌ urn:dslforum-org:service:X_AVM-DE_Auth
* ✅ urn:dslforum-org:service:Time
* ✅ GetInfo
Expand Down
15 changes: 7 additions & 8 deletions RS.Fritz.Manager.API/Entities/InternetGatewayDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,19 @@

public ushort? SecurityPort { get; private set; }

public User[]? Users { get; private set; }

Check warning on line 11 in RS.Fritz.Manager.API/Entities/InternetGatewayDevice.cs

View workflow job for this annotation

GitHub Actions / build

Properties should not return arrays (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1819)

Check warning on line 11 in RS.Fritz.Manager.API/Entities/InternetGatewayDevice.cs

View workflow job for this annotation

GitHub Actions / build

Properties should not return arrays (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1819)

public NetworkCredential? NetworkCredential { get; set; }

public IEnumerable<ServiceListItem> Services { get => services ??= UPnPDescription.Device.GetServices().ToArray(); }
public IEnumerable<ServiceListItem> Services
=> services ??= UPnPDescription.Device.GetServices().ToArray();

internal Task<TResult> ExecuteAsync<TResult>(Func<IFritzServiceOperationHandler, InternetGatewayDevice, Task<TResult>> operation)
public async ValueTask InitializeAsync()
{
return operation(FritzServiceOperationHandler, this);
SecurityPort = (await this.DeviceInfoGetSecurityPortAsync().ConfigureAwait(false)).SecurityPort;
Users = (await UsersService.GetUsersAsync(this).ConfigureAwait(false)).ToArray();
}

public async Task InitializeAsync()
{
SecurityPort = (await this.DeviceInfoGetSecurityPortAsync()).SecurityPort;
Users = (await UsersService.GetUsersAsync(this)).ToArray();
}
internal Task<TResult> ExecuteAsync<TResult>(Func<IFritzServiceOperationHandler, InternetGatewayDevice, Task<TResult>> operation)
=> operation(FritzServiceOperationHandler, this);
}
2 changes: 1 addition & 1 deletion RS.Fritz.Manager.API/Extensions/DeviceExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public static IEnumerable<ServiceListItem> GetServices(this Device device)
{
IEnumerable<ServiceListItem> serviceListItems = device.ServiceList;

foreach (Device deviceListItem in device.DeviceList ?? Array.Empty<Device>())
foreach (Device deviceListItem in device.DeviceList ?? [])
{
serviceListItems = serviceListItems.Concat(GetServices(deviceListItem));
}
Expand Down
Loading
Loading