Skip to content

Commit 704abd3

Browse files
committed
More docker adjustments
1 parent fb73076 commit 704abd3

File tree

8 files changed

+33
-59
lines changed

8 files changed

+33
-59
lines changed

src/DockerCompose/Windows/docker-compose.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,17 @@ services:
99
environment:
1010
- ASPNETCORE_ENVIRONMENT=Production
1111
- ASPNETCORE_URLS=http://+:5000
12+
13+
# To enable https, use these lines and configure a certificate
1214
#- ASPNETCORE_URLS=https://+:5001;http://+:5000
1315
#- ASPNETCORE_HTTPS_PORT=5001
1416

15-
#Change these
17+
# Adjust the connection string
1618
- CODERR_CONNECTIONSTRING=Data Source=host.docker.internal,1433;Initial Catalog=Coderr;Integrated Security=false;Connect Timeout=15;user=coderr;password=c0d3rr
17-
- CODERR_CONFIG_PASSWORD=changeThis2
19+
20+
# Comment out this line once Coderr have been configured (run through the install wizard)
21+
# and then restart the container.
22+
# - CODERR_CONFIG_PASSWORD=changeThis2
1823
ports:
1924
- "60473:5000/tcp"
2025
- "60474:5001"

src/Server/Coderr.Server.App/Core/Incidents/Jobs/DeleteEmptyIncidents.cs renamed to src/Server/Coderr.Server.App/Core/Incidents/Jobs/DeleteOldIncidents.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ namespace Coderr.Server.App.Core.Incidents.Jobs
2323
/// </para>
2424
/// </remarks>
2525
[ContainerService(RegisterAsSelf = true)]
26-
internal class DeleteEmptyIncidents : IBackgroundJobAsync
26+
internal class DeleteOldIncidents : IBackgroundJobAsync
2727
{
28-
private readonly ILog _logger = LogManager.GetLogger(typeof(DeleteEmptyIncidents));
28+
private readonly ILog _logger = LogManager.GetLogger(typeof(DeleteOldIncidents));
2929
private readonly IDbConnection _connection;
3030
private readonly IConfiguration<ReportConfig> _reportConfiguration;
3131

3232
/// <summary>
33-
/// Creates a new instance of <see cref="DeleteEmptyIncidents" />.
33+
/// Creates a new instance of <see cref="DeleteOldIncidents" />.
3434
/// </summary>
3535
/// <param name="connection">Used for SQL queries</param>
36-
public DeleteEmptyIncidents(IDbConnection connection, IConfiguration<ReportConfig> reportConfiguration)
36+
public DeleteOldIncidents(IDbConnection connection, IConfiguration<ReportConfig> reportConfiguration)
3737
{
3838
_connection = connection;
3939
_reportConfiguration = reportConfiguration;

src/Server/Coderr.Server.SqlServer/Core/Applications/ApplicationRepository.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ public class ApplicationRepository : IApplicationRepository
1717

1818
public ApplicationRepository(IAdoNetUnitOfWork uow)
1919
{
20-
if (uow == null) throw new ArgumentNullException("uow");
21-
_uow = uow;
20+
_uow = uow ?? throw new ArgumentNullException(nameof(uow));
2221
}
2322

2423
public async Task CreateAsync(ApplicationTeamMember member)
@@ -29,9 +28,10 @@ public async Task CreateAsync(ApplicationTeamMember member)
2928
public async Task<UserApplication[]> GetForUserAsync(int accountId)
3029
{
3130
if (accountId <= 0) throw new ArgumentOutOfRangeException(nameof(accountId));
32-
using (var cmd = (DbCommand) _uow.CreateCommand())
31+
using (var cmd = (DbCommand)_uow.CreateCommand())
3332
{
34-
cmd.CommandText = @"SELECT a.Id ApplicationId, a.Name ApplicationName, ApplicationMembers.Roles, a.NumberOfFtes NumberOfDevelopers
33+
cmd.CommandText =
34+
@"SELECT a.Id ApplicationId, a.Name ApplicationName, ApplicationMembers.Roles, a.NumberOfFtes NumberOfDevelopers
3535
FROM Applications a
3636
JOIN ApplicationMembers ON (ApplicationMembers.ApplicationId = a.Id)
3737
WHERE ApplicationMembers.AccountId = @userId
@@ -60,7 +60,7 @@ JOIN ApplicationMembers ON (ApplicationMembers.ApplicationId = a.Id)
6060

6161
public async Task RemoveTeamMemberAsync(int applicationId, string invitedEmailAddress)
6262
{
63-
using (var cmd = (DbCommand) _uow.CreateCommand())
63+
using (var cmd = (DbCommand)_uow.CreateCommand())
6464
{
6565
cmd.CommandText = "DELETE FROM ApplicationMembers WHERE ApplicationId=@appId AND EmailAddress = @email";
6666
cmd.AddParameter("appId", applicationId);
@@ -132,7 +132,7 @@ public async Task CreateAsync(Application application)
132132
{
133133
if (application == null) throw new ArgumentNullException("application");
134134

135-
using (var cmd = (DbCommand) _uow.CreateCommand())
135+
using (var cmd = (DbCommand)_uow.CreateCommand())
136136
{
137137
cmd.CommandText =
138138
@"INSERT INTO Applications (Name, AppKey, CreatedById, CreatedAtUtc, ApplicationType, SharedSecret, EstimatedNumberOfErrors, NumberOfFtes)
@@ -145,8 +145,8 @@ public async Task CreateAsync(Application application)
145145
cmd.AddParameter("SharedSecret", application.SharedSecret);
146146
cmd.AddParameter("EstimatedNumberOfErrors", application.EstimatedNumberOfErrors);
147147
cmd.AddParameter("NumberOfFtes", application.NumberOfFtes);
148-
var item = (decimal) await cmd.ExecuteScalarAsync();
149-
application.GetType().GetProperty("Id").SetValue(application, (int) item);
148+
var item = (decimal)await cmd.ExecuteScalarAsync();
149+
application.GetType().GetProperty("Id").SetValue(application, (int)item);
150150
}
151151
}
152152

@@ -170,7 +170,7 @@ public async Task DeleteAsync(int applicationId)
170170

171171
public async Task<Application[]> GetAllAsync()
172172
{
173-
using (var cmd = (DbCommand) _uow.CreateCommand())
173+
using (var cmd = (DbCommand)_uow.CreateCommand())
174174
{
175175
cmd.CommandText = "SELECT * FROM Applications ORDER BY Name";
176176

@@ -187,7 +187,7 @@ public async Task UpdateAsync(Application entity)
187187

188188
public async Task RemoveTeamMemberAsync(int applicationId, int userId)
189189
{
190-
using (var cmd = (DbCommand) _uow.CreateCommand())
190+
using (var cmd = (DbCommand)_uow.CreateCommand())
191191
{
192192
cmd.CommandText = "DELETE FROM ApplicationMembers WHERE ApplicationId=@appId AND AccountId = @userId";
193193
cmd.AddParameter("appId", applicationId);

src/Server/Coderr.Server.Web/ClientApp/boot.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { AppRoot } from "./services/AppRoot"
55
import { IUser } from "./vue-shim";
66
import { DateTime } from 'luxon';
77
import * as helpers from "./helpers";
8-
8+
export { default as $ } from 'jquery';
99
//Vue.use(VeeValidate);
1010
Vue.use(VueRouter);
1111
Vue.config.devtools = true;
@@ -30,7 +30,7 @@ Vue.filter("monthDay",
3030
Vue.filter("isoDate",
3131
(value: string) => {
3232
if (!value) return "n/a";
33-
return moment.utc(value).local().format("YYYY-MM-DD HH:MM:SS");
33+
return helpers.isoDate(value);
3434
});
3535

3636
Vue.filter("niceTime",

src/Server/Coderr.Server.Web/ClientApp/helpers.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ export function getLuxonDate(valueUtc: string | Date): DateTime {
99
}
1010
}
1111

12+
export function isoDate(valueUtc: string | Date): string {
13+
return getLuxonDate(valueUtc).toISO({ suppressMilliseconds: true, includeOffset: false });
14+
}
15+
1216
export function ago(valueUtc: string | Date): string {
1317
if (!valueUtc) return "n/a";
1418

src/Server/Coderr.Server.Web/appsettings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"Installation": {
3-
"IsConfigured": false,
4-
"Password": "changeThis2"
3+
"IsConfigured": true,
4+
"Password": "changeThis"
55
},
66
"EnableCors": true,
77
"ConnectionStrings": {

src/Server/Coderr.Server.Web/package-lock.json

Lines changed: 3 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Server/Coderr.Server.Web/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var bundleOutputDir = "./wwwroot/dist";
1111
function resolve(dir) {
1212
return path.join(__dirname, dir);
1313
}
14-
14+
//TODO: include jquery
1515
const baseConfig = {
1616
entry: {
1717
'main': "./ClientApp/boot.ts",

0 commit comments

Comments
 (0)