Skip to content

Commit d92e00b

Browse files
committed
Docker image for windows is now complete.
1 parent 704abd3 commit d92e00b

File tree

10 files changed

+736
-820
lines changed

10 files changed

+736
-820
lines changed

ReadMe.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ With Coderr, you can focus on building new features and spend minimal time corre
3030

3131
## Getting started
3232

33-
Once you have [downloaded and installed the server](https://github.com/coderrio/Coderr.Server/releases) you need to install and configure one of our nuget packages. You can read more about them [here](https://coderr.io/documentation/client/).
33+
1. [Download Coderr Server](https://github.com/coderrio/Coderr.Server/releases), use our [cloud service](https://app.coderr.io) (free for up to five users) or use our [Docker image]()
34+
2. Install one of our [nuget libraries](https://www.nuget.org/packages?q=coderr.client) (or [npm library](https://www.npmjs.com/package/coderr.client)).
35+
3. Follow the instructions in the package ReadMe (max three lines of code to get started).
36+
4. Try the code below.
3437

3538
**Unhandled exceptions will automatically be reported by the client libraries.**
3639

src/DockerCompose/Windows/docker-compose.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@ services:
1919

2020
# Comment out this line once Coderr have been configured (run through the install wizard)
2121
# and then restart the container.
22-
# - CODERR_CONFIG_PASSWORD=changeThis2
22+
- CODERR_CONFIG_PASSWORD=changeThis
23+
24+
volumes:
25+
- ${APPDATA}/Microsoft/UserSecrets:C:\ProtectedStorage:rw
26+
2327
ports:
2428
- "60473:5000/tcp"
2529
- "60474:5001"
26-
27-
28-

src/Server/Coderr.Server.ReportAnalyzer.Abstractions/ErrorReports/ReportDTO.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ namespace Coderr.Server.ReportAnalyzer.Abstractions.ErrorReports
77
/// </summary>
88
public class ReportDTO
99
{
10+
public ReportDTO(int id)
11+
{
12+
Id = id;
13+
}
14+
15+
protected ReportDTO()
16+
{
17+
18+
}
19+
1020
/// <summary>
1121
/// Application that the incident and report belongs in.
1222
/// </summary>
@@ -30,7 +40,7 @@ public class ReportDTO
3040
/// <summary>
3141
/// DB primary key
3242
/// </summary>
33-
public int Id { get; set; }
43+
public int Id { get; private set; }
3444

3545
/// <summary>
3646
/// DB primary key

src/Server/Coderr.Server.ReportAnalyzer.Tests/ErrorOrigins/Handlers/StorePositionFromNewReportTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public async Task Should_be_able_to_use_position_in_CoderrCollection()
2222
var repos = Substitute.For<IErrorOriginRepository>();
2323
var incident = new IncidentSummaryDTO(1, "Hello");
2424
var data = new Dictionary<string, string> {{"Longitude", "60.6065"}, {"Latitude", "15.6355"}};
25-
var report = new ReportDTO {ContextCollections = new[] {new ContextCollectionDTO("CoderrData", data)}};
25+
var report = new ReportDTO(1) {ContextCollections = new[] {new ContextCollectionDTO("CoderrData", data)}};
2626
var e = new ReportAddedToIncident(incident, report, false);
2727
var context = Substitute.For<IMessageContext>();
2828
var configWrapper = Substitute.For<IConfiguration<OriginsConfiguration>>();
@@ -42,7 +42,7 @@ public async Task Should_be_able_to_use_position_in_regular_collection()
4242
var repos = Substitute.For<IErrorOriginRepository>();
4343
var incident = new IncidentSummaryDTO(1, "Hello");
4444
var data = new Dictionary<string, string> {{"ReportLongitude", "60.6065"}, {"ReportLatitude", "15.6355"}};
45-
var report = new ReportDTO {ContextCollections = new[] {new ContextCollectionDTO("SomeCollection", data)}};
45+
var report = new ReportDTO(1) {ContextCollections = new[] {new ContextCollectionDTO("SomeCollection", data)}};
4646
var e = new ReportAddedToIncident(incident, report, false);
4747
var context = Substitute.For<IMessageContext>();
4848
var configWrapper = Substitute.For<IConfiguration<OriginsConfiguration>>();

src/Server/Coderr.Server.ReportAnalyzer.Tests/Tagging/IdentifyTagsFromIncidentTests.cs

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public async Task should_be_able_to_identity_tags_when_only_one_is_specified()
2323
provider.GetIdentifiers(Arg.Any<TagIdentifierContext>()).Returns(new ITagIdentifier[0]);
2424
var ctx = Substitute.For<IMessageContext>();
2525
var incident = new IncidentSummaryDTO(1, "Ada");
26-
var report = new ReportDTO
26+
var report = new ReportDTO(1)
2727
{
2828
ContextCollections = new[]
2929
{new ContextCollectionDTO("Data", new Dictionary<string, string> {{"ErrTags", "MyTag"}})}
@@ -47,7 +47,7 @@ public async Task should_be_able_to_identity_tags_when_only_multiple_tags_are_sp
4747
provider.GetIdentifiers(Arg.Any<TagIdentifierContext>()).Returns(new ITagIdentifier[0]);
4848
var ctx = Substitute.For<IMessageContext>();
4949
var incident = new IncidentSummaryDTO(1, "Ada");
50-
var report = new ReportDTO
50+
var report = new ReportDTO(1)
5151
{
5252
ContextCollections = new[]
5353
{new ContextCollectionDTO("Data", new Dictionary<string, string> {{"ErrTags", "MyTag,YourTag"}})}
@@ -63,30 +63,6 @@ public async Task should_be_able_to_identity_tags_when_only_multiple_tags_are_sp
6363
tags[0].Name.Should().Be("MyTag");
6464
tags[1].Name.Should().Be("YourTag");
6565
}
66-
67-
[Fact]
68-
public async Task should_be_able_to_identity_tags_when_only_multiple_tags_are_specified_with_spaces()
69-
{
70-
var repos = Substitute.For<ITagsRepository>();
71-
var provider = Substitute.For<ITagIdentifierProvider>();
72-
provider.GetIdentifiers(Arg.Any<TagIdentifierContext>()).Returns(new ITagIdentifier[0]);
73-
var ctx = Substitute.For<IMessageContext>();
74-
var incident = new IncidentSummaryDTO(1, "Ada");
75-
var report = new ReportDTO
76-
{
77-
ContextCollections = new[]
78-
{new ContextCollectionDTO("Data", new Dictionary<string, string> {{"ErrTags[]", "MyTag"}, {"ErrTags[]", "YourTag"}})}
79-
};
80-
var e = new ReportAddedToIncident(incident, report, false);
81-
82-
var sut = new IdentifyTagsFromIncident(repos, provider);
83-
await sut.HandleAsync(ctx, e);
84-
85-
var arguments = repos.ReceivedCalls().First(x => x.GetMethodInfo().Name == "AddAsync")
86-
.GetArguments();
87-
var tags = (Tag[]) arguments[1];
88-
tags[0].Name.Should().Be("MyTag");
89-
tags[1].Name.Should().Be("YourTag");
90-
}
66+
9167
}
9268
}

src/Server/Coderr.Server.ReportAnalyzer/Inbound/Handlers/Reports/ReportAnalyzer.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,13 +314,12 @@ private ReportExeptionDTO ConvertToCoreException(ErrorReportException exception)
314314

315315
private ReportDTO ConvertToCoreReport(ErrorReportEntity report, string version)
316316
{
317-
var dto = new ReportDTO
317+
var dto = new ReportDTO(report.Id)
318318
{
319319
ApplicationId = report.ApplicationId,
320320
ContextCollections =
321321
report.ContextCollections.Select(x => new ContextCollectionDTO(x.Name, x.Properties)).ToArray(),
322322
CreatedAtUtc = report.CreatedAtUtc,
323-
Id = report.Id,
324323
IncidentId = report.IncidentId,
325324
RemoteAddress = report.RemoteAddress,
326325
ReportId = report.ClientReportId,

src/Server/Coderr.Server.Web/Startup.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
using Microsoft.AspNetCore.Authentication;
3030
using Microsoft.AspNetCore.Authentication.Cookies;
3131
using Microsoft.AspNetCore.Builder;
32+
using Microsoft.AspNetCore.DataProtection;
3233
using Microsoft.AspNetCore.Hosting;
3334
using Microsoft.AspNetCore.Http;
3435
using Microsoft.AspNetCore.Http.Extensions;
@@ -203,6 +204,11 @@ public void ConfigureServices(IServiceCollection services)
203204
jsonOptions.SerializerSettings.ContractResolver = new IncludeNonPublicMembersContractResolver();
204205
});
205206

207+
if (HostConfig.Instance.IsRunningInDocker)
208+
{
209+
services.AddDataProtection()
210+
.PersistKeysToFileSystem(new System.IO.DirectoryInfo(@"C:\ProtectedStorage"));
211+
}
206212

207213
var authenticationBuilder = services.AddAuthentication("Cookies");
208214
authenticationBuilder.AddCookie(CookieAuthenticationDefaults.AuthenticationScheme, options =>

0 commit comments

Comments
 (0)