Initial commit
This commit is contained in:
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
bin/
|
||||||
|
obj/
|
||||||
|
/packages/
|
||||||
|
riderModule.iml
|
||||||
|
/_ReSharper.Caches/
|
||||||
8
Automatic Parking.sln
Normal file
8
Automatic Parking.sln
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
25
Source/.dockerignore
Normal file
25
Source/.dockerignore
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
**/.dockerignore
|
||||||
|
**/.env
|
||||||
|
**/.git
|
||||||
|
**/.gitignore
|
||||||
|
**/.project
|
||||||
|
**/.settings
|
||||||
|
**/.toolstarget
|
||||||
|
**/.vs
|
||||||
|
**/.vscode
|
||||||
|
**/.idea
|
||||||
|
**/*.*proj.user
|
||||||
|
**/*.dbmdl
|
||||||
|
**/*.jfm
|
||||||
|
**/azds.yaml
|
||||||
|
**/bin
|
||||||
|
**/charts
|
||||||
|
**/docker-compose*
|
||||||
|
**/Dockerfile*
|
||||||
|
**/node_modules
|
||||||
|
**/npm-debug.log
|
||||||
|
**/obj
|
||||||
|
**/secrets.dev.yaml
|
||||||
|
**/values.dev.yaml
|
||||||
|
LICENSE
|
||||||
|
README.md
|
||||||
23
Source/ProofOfConcept/Dockerfile
Normal file
23
Source/ProofOfConcept/Dockerfile
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base
|
||||||
|
USER $APP_UID
|
||||||
|
WORKDIR /app
|
||||||
|
EXPOSE 8080
|
||||||
|
EXPOSE 8081
|
||||||
|
|
||||||
|
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
|
||||||
|
ARG BUILD_CONFIGURATION=Release
|
||||||
|
WORKDIR /src
|
||||||
|
COPY ["ProofOfConcept/ProofOfConcept.csproj", "ProofOfConcept/"]
|
||||||
|
RUN dotnet restore "ProofOfConcept/ProofOfConcept.csproj"
|
||||||
|
COPY . .
|
||||||
|
WORKDIR "/src/ProofOfConcept"
|
||||||
|
RUN dotnet build "./ProofOfConcept.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
||||||
|
|
||||||
|
FROM build AS publish
|
||||||
|
ARG BUILD_CONFIGURATION=Release
|
||||||
|
RUN dotnet publish "./ProofOfConcept.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
|
||||||
|
|
||||||
|
FROM base AS final
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=publish /app/publish .
|
||||||
|
ENTRYPOINT ["dotnet", "ProofOfConcept.dll"]
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
-----BEGIN EC PRIVATE KEY-----
|
||||||
|
MHcCAQEEILhLK/yU2FhrSsxvKbclNq8bRkV1fLb3qIHGfNOWwEyZoAoGCCqGSM49
|
||||||
|
AwEHoUQDQgAE/2+0ZNUwcsa7C2kkQa6J4egse3+NTnFd7DKlLOcEZGrCBn/mfxsZ
|
||||||
|
UpQoVCeoh4j6w5ue471Ott70qpsRuOtjbQ==
|
||||||
|
-----END EC PRIVATE KEY-----
|
||||||
4
Source/ProofOfConcept/Resources/Signature/public-key.pem
Normal file
4
Source/ProofOfConcept/Resources/Signature/public-key.pem
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
-----BEGIN PUBLIC KEY-----
|
||||||
|
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE/2+0ZNUwcsa7C2kkQa6J4egse3+N
|
||||||
|
TnFd7DKlLOcEZGrCBn/mfxsZUpQoVCeoh4j6w5ue471Ott70qpsRuOtjbQ==
|
||||||
|
-----END PUBLIC KEY-----
|
||||||
24
Source/ProofOfConcept/Services/MQTTClient.cs
Normal file
24
Source/ProofOfConcept/Services/MQTTClient.cs
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
namespace ProofOfConcept.Services;
|
||||||
|
|
||||||
|
public class MQTTClient
|
||||||
|
{
|
||||||
|
private ILogger<MQTTClient> logger;
|
||||||
|
private MQTTClientConfiguration configuration;
|
||||||
|
|
||||||
|
public MQTTClient(ILogger<MQTTClient> logger, IOptionsMonitor<MQTTClientConfiguration> options)
|
||||||
|
{
|
||||||
|
this.logger = logger;
|
||||||
|
this.configuration = options.CurrentValue;
|
||||||
|
|
||||||
|
options.OnChange(newValue =>
|
||||||
|
{
|
||||||
|
this.configuration = newValue;
|
||||||
|
logger.LogInformation("Configuration of {ClassName} changed", nameof(MQTTClient));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class MQTTClientConfiguration
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
24
Source/ProofOfConcept/Services/MQTTServer.cs
Normal file
24
Source/ProofOfConcept/Services/MQTTServer.cs
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
namespace ProofOfConcept.Services;
|
||||||
|
|
||||||
|
public class MQTTServer
|
||||||
|
{
|
||||||
|
private ILogger<MQTTServer> logger;
|
||||||
|
private MQTTServerConfiguration configuration;
|
||||||
|
|
||||||
|
public MQTTServer(ILogger<MQTTServer> logger, IOptionsMonitor<MQTTServerConfiguration> options)
|
||||||
|
{
|
||||||
|
this.logger = logger;
|
||||||
|
this.configuration = options.CurrentValue;
|
||||||
|
|
||||||
|
options.OnChange(newValue =>
|
||||||
|
{
|
||||||
|
this.configuration = newValue;
|
||||||
|
logger.LogInformation("Configuration of {ClassName} changed", nameof(MQTTServer));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class MQTTServerConfiguration
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
24
Source/ProofOfConcept/Services/MessageProcessor.cs
Normal file
24
Source/ProofOfConcept/Services/MessageProcessor.cs
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
namespace ProofOfConcept.Services;
|
||||||
|
|
||||||
|
public class MessageProcessor
|
||||||
|
{
|
||||||
|
private ILogger<MessageProcessor> logger;
|
||||||
|
private MessageProcessorConfiguration configuration;
|
||||||
|
|
||||||
|
public MessageProcessor(ILogger<MessageProcessor> logger, IOptionsMonitor<MessageProcessorConfiguration> options)
|
||||||
|
{
|
||||||
|
this.logger = logger;
|
||||||
|
this.configuration = options.CurrentValue;
|
||||||
|
|
||||||
|
options.OnChange(newValue =>
|
||||||
|
{
|
||||||
|
this.configuration = newValue;
|
||||||
|
logger.LogInformation("Configuration of {ClassName} changed", nameof(MessageProcessor));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class MessageProcessorConfiguration
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user