Skip to content

Commit

Permalink
Add better error handling, configurable console output verbosity (inc…
Browse files Browse the repository at this point in the history
…luding statistics), update dependencies.

* Refactor host, to support different console output verbosity options (including statistics) which are configurable via config.
* Catch NotImplementedExceptions thrown when parsing messages
* Add Endjin.RecommendedPractices.GitHub to missing projects & ensure compliance.
* Update NuGet package dependencies
* Update scripted build to the latest version (includes Covenant SBOM) & update gitignore for local folders generated by local builds.
  • Loading branch information
HowardvanRooijen authored Oct 25, 2022
1 parent c8e2975 commit 2097311
Show file tree
Hide file tree
Showing 16 changed files with 507 additions and 215 deletions.
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -335,4 +335,11 @@ ASALocalRun/
coverage.cobertura.xml

# VS Code config files
/.vscode
/.vscode

_packages
_codeCoverage
/Ais.Net.Receiver.sbom.spdx.json
/Ais.Net.Receiver.sbom.json
/Ais.Net.Receiver.sbom.html
/Ais.Net.Receiver.sbom.cyclonedx.xml
52 changes: 50 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@ Use the following commands to install .NET 6.0 on your Pi.

Use the following commands to install PowerShell on your Pi.

1. Download the latest package `wget https://github.com/PowerShell/PowerShell/releases/download/v7.2.1/powershell-7.2.1-linux-arm32.tar.gz`
1. Download the latest package `wget https://github.com/PowerShell/PowerShell/releases/download/v7.2.7/powershell-7.2.7-linux-arm32.tar.gz`
1. Create a directory for it to be unpacked into `mkdir ~/powershell`
1. Unpack `tar -xvf ./powershell-7.2.1-linux-arm32.tar.gz -C ~/powershell`
1. Unpack `tar -xvf ./powershell-7.2.7-linux-arm32.tar.gz -C ~/powershell`
1. Give it executable rights `sudo chmod +x /opt/microsoft/powershell/7/pwsh`
1. Create a symbolic link `sudo ln -s /opt/microsoft/powershell/7/pwsh /usr/bin/pwsh`

Expand All @@ -238,6 +238,54 @@ If you need to look at / edit the deployed `aisr.service` use `sudo nano /lib/s

Use [Azure Storage Explorer](https://azure.microsoft.com/en-us/features/storage-explorer/) to browse to where files are captured.

### Configuration

Configuration is read from `settings.json` and can also be overridden for local development by using a `settings.local.json` file.

```json
{
"Ais": {
"host": "153.44.253.27",
"port": "5631",
"loggerVerbosity": "Minimal",
"statisticsPeriodicity": "00:01:00",
"retryAttempts": 100,
"retryPeriodicity": "00:00:00:00.500"
},
"Storage": {
"enableCapture": true,
"connectionString": "DefaultEndpointsProtocol=https;AccountName=<ACCOUNT_NAME>;AccountKey=<ACCOUNT_KEY>",
"containerName": "nmea-ais-dev",
"writeBatchSize": 500
}
}
```

#### AIS

These settings control the `ReceiverHost` and its behaviour.

- `host`: IP Address or FQDN of the AIS Source
- `port`: Port number for the AIS Source
- `loggerVerbosity`: Controls the output to the console.
- `Quiet` = Essential only,
- `Minimal` = Statistics only. Sample rate of statistics controlled by `statisticsPeriodicity`,
- `Normal` = Vessel Names and Positions,
- `Detailed` = NMEA Sentences,
- `Diagnostic` = Messages and Errors
- `statisticsPeriodicity`: TimeSpan defining the sample rate of statistics to display
- `retryAttempts`: Number of retry attempts when a connection error occurs
- `retryPeriodicity`: How long to wait before a retry attempt.
-
#### Storage

These settings control the capturing NMEA sentences to Azure Blob Storage.

- `enableCapture`: Whether you want to capture the NMEA sentences and write them to Azure Blob Storage
- `connectionString`: Azure Storage Account Connection String
- `containerName`: Name of the container to capture the NMEA sentences. You can use this to separate a local dev storage container from your production storage container, within the same storage account.
- `writeBatchSize`: How many NMEA sentences to batch before writing to Azure Blob Storage.

## Licenses

[![GitHub license](https://img.shields.io/badge/license-Apache%202-blue.svg)](https://raw.githubusercontent.com/ais-dotnet/Ais.Net.Receiver/master/LICENSE)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

116 changes: 58 additions & 58 deletions Solutions/Ais.Net.Models.Specs/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,40 @@
"net6.0": {
"Corvus.Testing.SpecFlow.NUnit": {
"type": "Direct",
"requested": "[1.4.8, )",
"resolved": "1.4.8",
"contentHash": "4+9Ky6SMDm43HgbVYNYNnxpv1IRZUwFfD55dKiEHdbIsd0GQUapDwNxEWmtUl29pUS1NlU3YCfDdXH1EWxxsbg==",
"requested": "[1.5.1, )",
"resolved": "1.5.1",
"contentHash": "y0ztTHAvKYa9QTqmcQqVgNMMSeggmBy+je7v0cs0XIw8XMmdwxt3am66JT9hN354LD6l9l/Cey/pjWkAH1Kkxg==",
"dependencies": {
"Corvus.Testing.SpecFlow": "1.4.8",
"Corvus.Testing.SpecFlow": "1.5.1",
"Microsoft.NET.Test.Sdk": "16.11.0",
"Moq": "4.16.1",
"SpecFlow.NUnit.Runners": "3.9.50",
"Moq": "4.17.2",
"SpecFlow.NUnit.Runners": "3.9.74",
"coverlet.msbuild": "3.1.2"
}
},
"Endjin.RecommendedPractices.GitHub": {
"type": "Direct",
"requested": "[2.1.0, )",
"resolved": "2.1.0",
"contentHash": "I5hRIYqow1UTBh+mlsaC23Pi1ISIbc04HUeDbdnmv4a3tCZyOEYOJF8Q/SVWbSEdh9chEPYSr6qfdltv/GrCPA==",
"requested": "[2.1.2, )",
"resolved": "2.1.2",
"contentHash": "mBUCmeSdWWrIQKuuYd9zflcwupRDmpF39dsbb07e6azlNIQqaE1J5TQa17c3SFVRXn9IZrClsmKoMporRTAWwQ==",
"dependencies": {
"Endjin.RecommendedPractices": "2.1.0",
"Endjin.RecommendedPractices": "2.1.2",
"Microsoft.SourceLink.GitHub": "1.1.1"
}
},
"Roslynator.Analyzers": {
"type": "Direct",
"requested": "[4.0.2, )",
"resolved": "4.0.2",
"contentHash": "UmKLY06/yIAAkARvvGHjIS5LA0XEeEn7pbRHmsDcxvbLFla2fqrTTPVBUW7HMttBAwFi2WKvkVzGNu3/0JDdxA=="
"requested": "[4.1.1, )",
"resolved": "4.1.1",
"contentHash": "3cPVlrB1PytlO1ztZZBOExDKQWpMZgI15ZDa0BqLu0l6xv+xIRfEpqjNRcpvUy3aLxWTkPgSKZbbaO+VoFEJ1g=="
},
"StyleCop.Analyzers": {
"type": "Direct",
"requested": "[1.2.0-beta.406, )",
"resolved": "1.2.0-beta.406",
"contentHash": "YbsYoczQPZyz+4nmQ7bBiU9uQkk7Q2KUizQWEv01S4/ImCdJFiHvJfm8HAINNS0cvSLOA7xM9Y+KWQ2FOYjgkA==",
"requested": "[1.2.0-beta.435, )",
"resolved": "1.2.0-beta.435",
"contentHash": "TADk7vdGXtfTnYCV7GyleaaRTQjfoSfZXprQrVMm7cSJtJbFc1QIbWPyLvrgrfGdfHbGmUPvaN4ODKNxg2jgPQ==",
"dependencies": {
"StyleCop.Analyzers.Unstable": "1.2.0.406"
"StyleCop.Analyzers.Unstable": "1.2.0.435"
}
},
"Ais.Net": {
Expand All @@ -55,8 +55,8 @@
},
"Castle.Core": {
"type": "Transitive",
"resolved": "4.4.0",
"contentHash": "b5rRL5zeaau1y/5hIbI+6mGw3cwun16YjkHZnV9RRT5UyUIFsgLmNXJ0YnIN9p8Hw7K7AbG1q1UclQVU3DinAQ==",
"resolved": "4.4.1",
"contentHash": "zanbjWC0Y05gbx4eGXkzVycOQqVOFVeCjVsDSyuao9P4mtN1w3WxxTo193NGC7j3o2u3AJRswaoC6hEbnGACnQ==",
"dependencies": {
"NETStandard.Library": "1.6.1",
"System.Collections.Specialized": "4.3.0",
Expand All @@ -72,14 +72,14 @@
},
"Corvus.Testing.SpecFlow": {
"type": "Transitive",
"resolved": "1.4.8",
"contentHash": "UNc7x4jSCWioi8kmjyP1zrkim4gntGF8yIqKARt80lPfYqQNZQKOtUkFpxSz4W0DWcAV7Hlwj8C3tY7ExTmNhg==",
"resolved": "1.5.1",
"contentHash": "V2T6PjkWwzMrkwew29GmaIceDepKEaev+CyBDJLfCOZth4lHiiyhEb0mlIv/GKJTwLLzvTUlUr8yxetIeRCE6Q==",
"dependencies": {
"Microsoft.Extensions.Configuration.Abstractions": "3.1.22",
"Microsoft.Extensions.DependencyInjection": "3.1.22",
"Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.22",
"NUnit": "3.13.2",
"SpecFlow": "3.9.50",
"Microsoft.Extensions.Configuration.Abstractions": "3.1.24",
"Microsoft.Extensions.DependencyInjection": "3.1.24",
"Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.24",
"NUnit": "3.13.3",
"SpecFlow": "3.9.74",
"System.Management": "4.7.0"
}
},
Expand All @@ -90,8 +90,8 @@
},
"Endjin.RecommendedPractices": {
"type": "Transitive",
"resolved": "2.1.0",
"contentHash": "2h0r1wg2Oc0LPzsW9VAI+yf4hNOk37oi/zi1SmjlCmT1Jin+4dFxbRXc3uTRvD2mrTGC8VOb0OBnyoZ1Qg41dA==",
"resolved": "2.1.2",
"contentHash": "Nbj0WS3zVDD2wjfU2/nbkWIWS9Ljg8VN+SSpaCuf5lHBOIEb0Ra201lGcyJHtRHybAciz+hQA9lHj7TnG52qqw==",
"dependencies": {
"Microsoft.Build.Tasks.Git": "1.1.1"
}
Expand Down Expand Up @@ -166,24 +166,24 @@
},
"Microsoft.Extensions.Configuration.Abstractions": {
"type": "Transitive",
"resolved": "3.1.22",
"contentHash": "znkB/7CpLNzFPFrZP0dK5dLwLt/GgrDBdBCaTQvVAPAJdA96DkhizknBC5+vn0Le8JNOoGt4QlG7WMywswkA0w==",
"resolved": "3.1.24",
"contentHash": "3YeuWZKoBxLe3KjYMY9Hk0cUs9VpqqUOekfUkNP3Px2DlOLi5S+qJx2sUkOjKsbDztbb+35v5TUylSysvdNJvg==",
"dependencies": {
"Microsoft.Extensions.Primitives": "3.1.22"
"Microsoft.Extensions.Primitives": "3.1.24"
}
},
"Microsoft.Extensions.DependencyInjection": {
"type": "Transitive",
"resolved": "3.1.22",
"contentHash": "QrzfKU8te2X0ykM8XY9YzLvzTGO8qOMq45/Y2sy5gZryQqYe9CxEr0ulwG0idpL+ByK7luX7djmtT8Nv1mMaZw==",
"resolved": "3.1.24",
"contentHash": "edKD2klSQqQood/i/S8Wcwj7GdpJrx6YNx6aEwrrD9HPb9E9b6K1jhAEqd5Pjy3YrIgB+lG4a59GB8ZkVDRN6A==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.22"
"Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.24"
}
},
"Microsoft.Extensions.DependencyInjection.Abstractions": {
"type": "Transitive",
"resolved": "3.1.22",
"contentHash": "+zBl4NrqANk4JalElpCZ3P2rQ33A3ldRCF1K7RikOuNzEWG5B2M5C+Izas7q5Ub6bFMzAvCJh5E+BtT/gTUD6Q=="
"resolved": "3.1.24",
"contentHash": "vUVCGgYpwKK3C20t0swdxWKTmom3TByacyyj/sEMPWjfufcGxNM2W+qxgBOTMucFQpvbyPwBIFKAik7gYYFqxw=="
},
"Microsoft.Extensions.DependencyModel": {
"type": "Transitive",
Expand All @@ -199,8 +199,8 @@
},
"Microsoft.Extensions.Primitives": {
"type": "Transitive",
"resolved": "3.1.22",
"contentHash": "B5CNTMTdzVj/xMpazYcczFk3aUg/qduSfKAfUCH0gJ54NETETHaJBPy2GV6VlIeIw4UZqzXV3DroUkuHP561zg=="
"resolved": "3.1.24",
"contentHash": "MCg9BTY32DBAYCIltI5pkE7LbK/2KTpeK3ZknbTQuQOEV+guLVOHv5yNDW7NhiX2n3FTGTL9uhAf7effqYkAbg=="
},
"Microsoft.NET.Test.Sdk": {
"type": "Transitive",
Expand Down Expand Up @@ -274,10 +274,10 @@
},
"Moq": {
"type": "Transitive",
"resolved": "4.16.1",
"contentHash": "bw3R9q8cVNhWXNpnvWb0OGP4HadS4zvClq+T1zf7AF+tLY1haZ2AvbHidQekf4PDv1T40c6brZeT/V0IBq7cEQ==",
"resolved": "4.17.2",
"contentHash": "HytUPJ3/uks2UgJ9hIcyXm3YxpFAR4OJzbQwTHltbKGun3lFLhEHs97hiiPj1dY8jV/kasXeihTzDxct6Zf3iQ==",
"dependencies": {
"Castle.Core": "4.4.0",
"Castle.Core": "4.4.1",
"System.Threading.Tasks.Extensions": "4.5.4"
}
},
Expand Down Expand Up @@ -325,8 +325,8 @@
},
"NUnit": {
"type": "Transitive",
"resolved": "3.13.2",
"contentHash": "u+fz/lXyR4vlamySNAEMrXvh+GhAQiB6/aVZtU5WjivR5zF26Ui0tfteDtWqT90k9D8y6g8rFKYQC97Z7d195w==",
"resolved": "3.13.3",
"contentHash": "KNPDpls6EfHwC3+nnA67fh5wpxeLb3VLFAfLxrug6JMYDLHH6InaQIWR7Sc3y75d/9IKzMksH/gi08W7XWbmnQ==",
"dependencies": {
"NETStandard.Library": "2.0.0"
}
Expand Down Expand Up @@ -490,8 +490,8 @@
},
"SpecFlow": {
"type": "Transitive",
"resolved": "3.9.50",
"contentHash": "8iBOWWyLj5R0tEhbBLeg1VTCtuDrfvkqYBYn6RRsL+D0FGdtXvyimeW2IHZunKrCiCdPF1f31ZFRwsMoHSFt2Q==",
"resolved": "3.9.74",
"contentHash": "n6kcg9ZeQWxqJFoT23SsFT89U1QQNwvcN9pAX5alB6ZPr6K0p5D5nGIJ1PZsSaFaRFutiwQ+DicmxBCPAZVYIA==",
"dependencies": {
"BoDi": "1.5.0",
"Gherkin": "19.0.3",
Expand All @@ -509,36 +509,36 @@
},
"SpecFlow.NUnit": {
"type": "Transitive",
"resolved": "3.9.50",
"contentHash": "D0dBAhECMbj5KtAYPpNW/jhOeOs98cZpAYDBg81N82NUoEfpXhhfSyXxpql53VII6QDtPzrRnczM9EJASfTv1w==",
"resolved": "3.9.74",
"contentHash": "nMPLztTT5IZDMnvNCUxklqaM+agn4kjuNy/qAcYQQOxau2G1MF73UxhL9OXjJQaEuPuyT8gJvXudOYCFZWztxA==",
"dependencies": {
"NUnit": "3.13.1",
"SpecFlow": "[3.9.50]",
"SpecFlow.Tools.MsBuild.Generation": "[3.9.50]"
"SpecFlow": "[3.9.74]",
"SpecFlow.Tools.MsBuild.Generation": "[3.9.74]"
}
},
"SpecFlow.NUnit.Runners": {
"type": "Transitive",
"resolved": "3.9.50",
"contentHash": "HR3kO/rEXG8aqIBUfiUg2XGjRJ6PxMp9Uz2uhFUdsXMakIMTtK0fzMnh0gvfriGHetF6Ra5eA4gR/XKE9KyzbA==",
"resolved": "3.9.74",
"contentHash": "m595x3GM7CYco+KsXo96irQ2jcjC6+1+41bKdmnTdl3RAvnC4jUZ9f5B5FhGuaVK4+j4GwWi8MZtGMrT//zHLA==",
"dependencies": {
"NUnit.Console": "3.12.0",
"NUnit3TestAdapter": "3.17.0",
"SpecFlow.NUnit": "[3.9.50]"
"SpecFlow.NUnit": "[3.9.74]"
}
},
"SpecFlow.Tools.MsBuild.Generation": {
"type": "Transitive",
"resolved": "3.9.50",
"contentHash": "oJ5LXdKBnx2faO3I3hNVt+Pyeb6pE9mYxPFCvNXydQ2je3C1O8rDznK9Cxh3Tn8ixpx4LWCYuch9VSL9jZjfXQ==",
"resolved": "3.9.74",
"contentHash": "I/9OvmKOohJqIUNJ0xGYJCWfL6WKDaes8OoOAD/2yhGX+tzC5ofs9yqkP9Cu/xfnIx+11IR3pZs7YhBhGAcgWQ==",
"dependencies": {
"SpecFlow": "[3.9.50]"
"SpecFlow": "[3.9.74]"
}
},
"StyleCop.Analyzers.Unstable": {
"type": "Transitive",
"resolved": "1.2.0.406",
"contentHash": "FclNdBR81ynIo9l1QNlo+l0I/PaFIYaPQPlMram8XVIMh6G6G43KTa1aCxfwTj13uKlAJS/LhLy6KjOPOeAU4w=="
"resolved": "1.2.0.435",
"contentHash": "ouwPWZxbOV3SmCZxIRqHvljkSzkCyi1tDoMzQtDb/bRP8ctASV/iRJr+A2Gdj0QLaLmWnqTWDrH82/iP+X80Lg=="
},
"System.AppContext": {
"type": "Transitive",
Expand Down Expand Up @@ -1463,7 +1463,7 @@
"ais.net.models": {
"type": "Project",
"dependencies": {
"Ais.Net": "0.4.2"
"Ais.Net": "[0.4.2, )"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="$(EndjinProjectPropsPath)" Condition="$(EndjinProjectPropsPath) != ''" />

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
Expand All @@ -25,6 +27,10 @@
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="[6.0.*,)" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="[6.0.*,)" />
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="[6.0.*,)" />
<PackageReference Include="Endjin.RecommendedPractices.GitHub" Version="2.1.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down
Loading

0 comments on commit 2097311

Please sign in to comment.