Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions k8s/ex-dev-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ jobs:
image:
repository: exceptionless/job-ci

storage:
storageClassName: managed-csi-premium

config:
# Public client-scoped ingestion key for the hosted-dev Exceptionless project.
EX_ExceptionlessApiKey: "sdyW9LA7y2MbRGkdwTV8Ufdqw2250O0LGZuW1nV4"
Expand Down
3 changes: 3 additions & 0 deletions k8s/ex-prod-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ jobs:
minReplicaCount: 2
maxReplicaCount: 5

storage:
storageClassName: managed-csi-premium

config:
EX_ClientSetupShowServerUrl: "false"
EX_EnableSnapshotJobs: "true"
Expand Down
4 changes: 2 additions & 2 deletions k8s/exceptionless/templates/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ data:
EX_ForwardedHeaders__KnownNetworks__{{ $index }}: {{ $network | quote }}
{{- end }}
{{- end }}
EX_ConnectionStrings__Elasticsearch: {{ default "server=http://elasticsearch:9200" .Values.elasticsearch.connectionString }}
EX_ConnectionStrings__Elasticsearch: {{ default (printf "server=http://%s-elasticsearch:9200" (include "exceptionless.fullname" .)) .Values.elasticsearch.connectionString }}
{{- if (empty .Values.redis.connectionString) }}
EX_ConnectionStrings__Redis: {{ template "exceptionless.fullname" . }}-redis-master,abortConnect=false
EX_ConnectionStrings__Redis: {{ template "exceptionless.fullname" . }}-redis,abortConnect=false
{{- else }}
EX_ConnectionStrings__Redis: {{ .Values.redis.connectionString }}
{{- end }}
Expand Down
30 changes: 29 additions & 1 deletion k8s/exceptionless/templates/jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,15 @@ spec:
fieldRef:
fieldPath: metadata.uid
{{- include "exceptionless.otel-env" . | indent 16 }}
{{- if (empty .Values.storage.connectionString) }}
volumeMounts:
- mountPath: "/app/storage"
name: storage
volumes:
- name: storage
persistentVolumeClaim:
claimName: {{ template "exceptionless.fullname" . }}-storage
{{- end }}
restartPolicy: OnFailure

---
Expand Down Expand Up @@ -381,6 +390,15 @@ spec:
fieldRef:
fieldPath: metadata.uid
{{- include "exceptionless.otel-env" . | indent 12 }}
{{- if (empty .Values.storage.connectionString) }}
volumeMounts:
- mountPath: "/app/storage"
name: storage
volumes:
- name: storage
persistentVolumeClaim:
claimName: {{ template "exceptionless.fullname" . }}-storage
{{- end }}

{{- if not (kindIs "invalid" ( .Values.jobs.eventPosts | default dict ).maxReplicaCount) }}
---
Expand Down Expand Up @@ -417,7 +435,8 @@ metadata:
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
schedule: "0 0 29 2 1" # never, only manually
schedule: "0 0 29 2 1" # never, only manually (create a job with kubectl)
suspend: true
concurrencyPolicy: Forbid
jobTemplate:
spec:
Expand Down Expand Up @@ -730,6 +749,15 @@ spec:
fieldRef:
fieldPath: metadata.uid
{{- include "exceptionless.otel-env" . | indent 16 }}
{{- if (empty .Values.storage.connectionString) }}
volumeMounts:
- mountPath: "/app/storage"
name: storage
volumes:
- name: storage
persistentVolumeClaim:
claimName: {{ template "exceptionless.fullname" . }}-storage
{{- end }}
restartPolicy: OnFailure

---
Expand Down
10 changes: 7 additions & 3 deletions k8s/exceptionless/templates/storage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ metadata:
name: {{ template "exceptionless.fullname" . }}-storage
spec:
accessModes:
- ReadWriteMany
storageClassName: managed-csi-premium
{{- range (.Values.storage.accessModes | default (list "ReadWriteMany")) }}
- {{ . }}
{{- end }}
{{- if .Values.storage.storageClassName }}
storageClassName: {{ .Values.storage.storageClassName }}
{{- end }}
resources:
requests:
storage: 5Gi
storage: {{ .Values.storage.size | default "5Gi" }}

{{- end -}}
8 changes: 8 additions & 0 deletions k8s/exceptionless/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ redis:

storage:
connectionString:
# Used for the folder storage claim when no connectionString is set. Leave
# storageClassName empty to use the cluster default. Pods on more than one node
# need a ReadWriteMany capable class (NFS, Azure Files, EFS) or an object
# storage connectionString.
storageClassName:
accessModes:
- ReadWriteMany
size: 5Gi

cache:
connectionString:
Expand Down
10 changes: 8 additions & 2 deletions src/Exceptionless.Core/Configuration/EmailOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public static EmailOptions ReadFromConfiguration(IConfiguration config, AppOptio
options.TestEmailAddress = config.GetValue(nameof(options.TestEmailAddress), appOptions.AppMode == AppMode.Development ? "admin@exceptionless.test" : null);
options.ContactEmailAddress = config.GetValue<string>(nameof(options.ContactEmailAddress));

bool isSecure = false;
string? emailConnectionString = config.GetConnectionString("Email");
if (!String.IsNullOrEmpty(emailConnectionString))
{
Expand All @@ -51,19 +52,24 @@ public static EmailOptions ReadFromConfiguration(IConfiguration config, AppOptio
options.SmtpPort = uri.Port;
options.SmtpUser = uri.User;
options.SmtpPassword = uri.Password;
isSecure = uri.IsSecure;
}

options.SmtpFrom = config.GetValue(nameof(options.SmtpFrom), appOptions.AppMode == AppMode.Development ? "Exceptionless <noreply@localhost>" : null);
options.SmtpEncryption = config.GetValue(nameof(options.SmtpEncryption), GetDefaultSmtpEncryption(options.SmtpPort));
options.SmtpEncryption = config.GetValue(nameof(options.SmtpEncryption), GetDefaultSmtpEncryption(options.SmtpPort, isSecure));

if (String.IsNullOrWhiteSpace(options.SmtpUser) != String.IsNullOrWhiteSpace(options.SmtpPassword))
throw new ArgumentException("Must specify both the SmtpUser and the SmtpPassword, or neither.");

return options;
}

private static SmtpEncryption GetDefaultSmtpEncryption(int port)
private static SmtpEncryption GetDefaultSmtpEncryption(int port, bool isSecure)
{
// The smtps scheme always selects TLS: implicit on 465, STARTTLS on other ports.
if (isSecure && port != 465)
return SmtpEncryption.StartTLS;

return port switch
{
465 => SmtpEncryption.SSL,
Expand Down
1 change: 0 additions & 1 deletion src/Exceptionless.Core/Utility/SmtpUri.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public SmtpUri(Uri uri)
}

Host = uri.Host;
Port = uri.IsDefaultPort ? 25 : uri.Port;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this still needed?

}

public string Host { get; }
Expand Down
10 changes: 5 additions & 5 deletions src/Exceptionless.Web/Api/Endpoints/EventEndpoints.cs
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ public static IEndpointRouteBuilder MapEventEndpoints(this IEndpointRouteBuilder
["geo"] = "The geo coordinates where the event happened.",
["tags"] = "A list of tags used to categorize this event (comma separated).",
["identity"] = "The user's identity that the event happened to.",
["identityname"] = "The user's friendly name that the event happened to.",
["identity.name"] = "The user's friendly name that the event happened to.",
["userAgent"] = "The user agent that submitted the event.",
["parameters"] = "Query string parameters that control what properties are set on the event",
},
Expand Down Expand Up @@ -647,7 +647,7 @@ public static IEndpointRouteBuilder MapEventEndpoints(this IEndpointRouteBuilder
["geo"] = "The geo coordinates where the event happened.",
["tags"] = "A list of tags used to categorize this event (comma separated).",
["identity"] = "The user's identity that the event happened to.",
["identityname"] = "The user's friendly name that the event happened to.",
["identity.name"] = "The user's friendly name that the event happened to.",
["userAgent"] = "The user agent that submitted the event.",
["parameters"] = "Query string parameters that control what properties are set on the event",
},
Expand Down Expand Up @@ -679,7 +679,7 @@ public static IEndpointRouteBuilder MapEventEndpoints(this IEndpointRouteBuilder
["geo"] = "The geo coordinates where the event happened.",
["tags"] = "A list of tags used to categorize this event (comma separated).",
["identity"] = "The user's identity that the event happened to.",
["identityname"] = "The user's friendly name that the event happened to.",
["identity.name"] = "The user's friendly name that the event happened to.",
["userAgent"] = "The user agent that submitted the event.",
["parameters"] = "Query String parameters that control what properties are set on the event",
},
Expand Down Expand Up @@ -712,7 +712,7 @@ public static IEndpointRouteBuilder MapEventEndpoints(this IEndpointRouteBuilder
["geo"] = "The geo coordinates where the event happened.",
["tags"] = "A list of tags used to categorize this event (comma separated).",
["identity"] = "The user's identity that the event happened to.",
["identityname"] = "The user's friendly name that the event happened to.",
["identity.name"] = "The user's friendly name that the event happened to.",
["userAgent"] = "The user agent that submitted the event.",
["parameters"] = "Query String parameters that control what properties are set on the event",
},
Expand Down Expand Up @@ -920,7 +920,7 @@ internal static class EventEndpointHelpers
new("geo", "query", Description: "The geo coordinates where the event happened."),
new("tags", "query", Description: "A list of tags used to categorize this event (comma separated)."),
new("identity", "query", Description: "The user's identity that the event happened to."),
new("identityname", "query", Description: "The user's friendly name that the event happened to."),
new("identity.name", "query", Description: "The user's friendly name that the event happened to."),
new("userAgent", "header", Description: "The user agent that submitted the event."),
new("parameters", "query", Description: "Query string parameters that control what properties are set on the event", Type: "array"),
];
Expand Down
6 changes: 3 additions & 3 deletions src/Exceptionless.Web/Api/Endpoints/TokenEndpoints.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public static IEndpointRouteBuilder MapTokenEndpoints(this IEndpointRouteBuilder
.ProducesProblem(StatusCodes.Status400BadRequest)
.ProducesProblem(StatusCodes.Status409Conflict)
.WithSummary("Create")
.WithDescription("To create a new token, you must specify an organization_id and project_id. Valid scopes are client, user, admin, and source-maps:write. The source-maps:write scope requires a project-scoped token.")
.WithDescription("To create a new token, you must specify an organization_id and project_id. Valid scopes are client, user, global (global administrators only), and source-maps:write. The source-maps:write scope requires a project-scoped token.")
.WithMetadata(new EndpointDocumentation {
RequestBodyDescription = "The token.",
ResponseDescriptions = new() {
Expand All @@ -119,7 +119,7 @@ public static IEndpointRouteBuilder MapTokenEndpoints(this IEndpointRouteBuilder
.ProducesProblem(StatusCodes.Status404NotFound)
.ProducesProblem(StatusCodes.Status409Conflict)
.WithSummary("Create for project")
.WithDescription("This is a helper action that makes it easier to create a token for a specific project. Valid scopes are client, user, admin, and source-maps:write.")
.WithDescription("This is a helper action that makes it easier to create a token for a specific project. Valid scopes are client, user, global (global administrators only), and source-maps:write.")
.WithMetadata(new EndpointDocumentation {
RequestBodyDescription = "The token.",
ParameterDescriptions = new() {
Expand All @@ -143,7 +143,7 @@ public static IEndpointRouteBuilder MapTokenEndpoints(this IEndpointRouteBuilder
.ProducesProblem(StatusCodes.Status400BadRequest)
.ProducesProblem(StatusCodes.Status409Conflict)
.WithSummary("Create for organization")
.WithDescription("This is a helper action that makes it easier to create a token for a specific organization. You may also specify a scope when creating a token. There are three valid scopes: client, user and admin.")
.WithDescription("This is a helper action that makes it easier to create a token for a specific organization. You may also specify a scope when creating a token. Valid scopes are client, user and global (global administrators only).")
.WithMetadata(new EndpointDocumentation {
RequestBodyDescription = "The token.",
ParameterDescriptions = new() {
Expand Down
4 changes: 3 additions & 1 deletion src/Exceptionless.Web/Api/Handlers/EventHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -362,11 +362,13 @@ public async Task<Result> Handle(SetEventUserDescription message)
// Set the project for the configuration response filter.
httpContext.Request.SetProject(project);

// Match RemovePrivateInformationPlugin: drop the email address when private information is not collected.
bool includePrivateInformation = project.Configuration.Settings.GetBoolean(SettingsDictionary.KnownKeys.IncludePrivateInformation, true);
var eventUserDescription = new EventUserDescription
{
ProjectId = project.Id,
ReferenceId = message.ReferenceId,
EmailAddress = message.Description.EmailAddress,
EmailAddress = includePrivateInformation ? message.Description.EmailAddress : null,
Description = message.Description.Description,
Data = message.Description.Data
};
Expand Down
7 changes: 3 additions & 4 deletions src/Exceptionless.Web/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,9 @@ ApplicationException applicationException when applicationException.Message.Cont
await next();
});

var serverAddressesFeature = app.Services.GetRequiredService<IServer>().Features.Get<IServerAddressesFeature>();
bool ssl = options.AppMode != AppMode.Development && serverAddressesFeature is not null && serverAddressesFeature.Addresses.Any(a => a.StartsWith("https://"));

if (ssl)
// Resolves the HTTPS port lazily on the first request (HTTPS_PORT or the bound https addresses)
// and does nothing when there is no HTTPS endpoint. Server addresses are not known until startup.
if (options.AppMode != AppMode.Development)
app.UseHttpsRedirection();

var frontendOptions = app.Services.GetRequiredService<AppOptions>();
Expand Down
22 changes: 11 additions & 11 deletions tests/Exceptionless.Tests/Api/Data/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@
}
},
{
"name": "identityname",
"name": "identity.name",
"in": "query",
"description": "The user\u0027s friendly name that the event happened to.",
"schema": {
Expand Down Expand Up @@ -903,7 +903,7 @@
}
},
{
"name": "identityname",
"name": "identity.name",
"in": "query",
"description": "The user\u0027s friendly name that the event happened to.",
"schema": {
Expand Down Expand Up @@ -1074,7 +1074,7 @@
}
},
{
"name": "identityname",
"name": "identity.name",
"in": "query",
"description": "The user\u0027s friendly name that the event happened to.",
"schema": {
Expand Down Expand Up @@ -1254,7 +1254,7 @@
}
},
{
"name": "identityname",
"name": "identity.name",
"in": "query",
"description": "The user\u0027s friendly name that the event happened to.",
"schema": {
Expand Down Expand Up @@ -2176,7 +2176,7 @@
"Token"
],
"summary": "Create for organization",
"description": "This is a helper action that makes it easier to create a token for a specific organization. You may also specify a scope when creating a token. There are three valid scopes: client, user and admin.",
"description": "This is a helper action that makes it easier to create a token for a specific organization. You may also specify a scope when creating a token. Valid scopes are client, user and global (global administrators only).",
"parameters": [
{
"name": "organizationId",
Expand Down Expand Up @@ -2321,7 +2321,7 @@
"Token"
],
"summary": "Create for project",
"description": "This is a helper action that makes it easier to create a token for a specific project. Valid scopes are client, user, admin, and source-maps:write.",
"description": "This is a helper action that makes it easier to create a token for a specific project. Valid scopes are client, user, global (global administrators only), and source-maps:write.",
"parameters": [
{
"name": "projectId",
Expand Down Expand Up @@ -2630,7 +2630,7 @@
"Token"
],
"summary": "Create",
"description": "To create a new token, you must specify an organization_id and project_id. Valid scopes are client, user, admin, and source-maps:write. The source-maps:write scope requires a project-scoped token.",
"description": "To create a new token, you must specify an organization_id and project_id. Valid scopes are client, user, global (global administrators only), and source-maps:write. The source-maps:write scope requires a project-scoped token.",
"requestBody": {
"description": "The token.",
"content": {
Expand Down Expand Up @@ -10876,7 +10876,7 @@
}
},
{
"name": "identityname",
"name": "identity.name",
"in": "query",
"description": "The user\u0027s friendly name that the event happened to.",
"schema": {
Expand Down Expand Up @@ -11049,7 +11049,7 @@
}
},
{
"name": "identityname",
"name": "identity.name",
"in": "query",
"description": "The user\u0027s friendly name that the event happened to.",
"schema": {
Expand Down Expand Up @@ -11229,7 +11229,7 @@
}
},
{
"name": "identityname",
"name": "identity.name",
"in": "query",
"description": "The user\u0027s friendly name that the event happened to.",
"schema": {
Expand Down Expand Up @@ -11412,7 +11412,7 @@
}
},
{
"name": "identityname",
"name": "identity.name",
"in": "query",
"description": "The user\u0027s friendly name that the event happened to.",
"schema": {
Expand Down
Loading
Loading