Appearance
Configuration
GrydReports configuration is split into:
GrydReportsOptions(main module behavior)GrydFiles:Profiles:gryd.report(where generated files are stored — see File Storage)ReportDeliveryOptions(delivery defaults)ReportScheduleOptions(recurring scheduling guardrails)
Recommended Setup (Facade)
Use the facade for the standard stack (Application + Infrastructure + API):
csharp
builder.Services.AddGrydReports(
builder.Configuration,
db => db.UseNpgsql(builder.Configuration.GetConnectionString("GrydReports"))
);This automatically binds GrydReportsOptions from GrydReports section in appsettings.json.
Advanced Setup (Fine-Grained)
Use Infrastructure registration directly when you need explicit option callbacks:
csharp
builder.Services.AddGrydReportsApplication();
builder.Services.AddGrydReportsInfrastructure(
configureOptions: options =>
{
options.AutoRegisterTemplates = true;
options.TemplateAssemblies.Add(typeof(Program).Assembly);
},
configureDbContext: db =>
db.UseNpgsql(builder.Configuration.GetConnectionString("GrydReports"))
);
builder.Services.AddGrydReportsApi();appsettings.json
GrydReports section is bound to GrydReportsOptions. The optional scheduling integration uses the GrydJobs module's connection key, ConnectionStrings:GrydJobs; it is configured by GrydJobs, not by GrydReports.
json
{
"ConnectionStrings": {
"GrydReports": "Host=localhost;Database=gryd_reports;Username=postgres;Password=postgres",
"GrydJobs": "Host=localhost;Port=5432;Database=gryd_jobs;Username=postgres;Password=postgres"
},
"GrydReports": {
"AutoRegisterTemplates": true
},
"GrydFiles": {
"Profiles": {
"gryd.report": {
"MaxSizeBytes": 52428800,
"AllowedContentTypes": [
"application/pdf",
"text/csv",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
],
"ScanRequired": false,
"DefaultRetentionMode": "UntilReleased"
}
}
}
}File Storage (GrydFiles)
Generated reports are stored in GrydFiles, the platform's file module, in process. There is no report-specific storage configuration: the bucket is the one GrydStorage configures, and the rules come from the gryd.report profile. The host registers the file module; GrydReports refuses to start when the gryd.report profile is not declared.
csharp
builder.Services.AddGrydObjectStorage(builder.Configuration);
builder.Services.AddGrydFiles(builder.Configuration);
builder.Services.AddGrydFilesClamAv(builder.Configuration);
builder.Services.AddGrydReports(builder.Configuration, db => db.UseNpgsql(connectionString));gryd.report setting | Meaning for reports |
|---|---|
AllowedContentTypes | Must include the type of every format you render: application/pdf, text/csv, the XLSX type. A report of a format the profile does not accept fails to store |
MaxSizeBytes | The largest report that can be stored |
ScanRequired: false | The antivirus is waived — the file never left this process. The server still computes the SHA-256 and checks the content against the type, and the waiver is written to the audit trail at start-up |
DefaultRetentionMode: UntilReleased | The file lives while its execution holds it. Deleting the execution releases it, and GrydFiles purges it after GrydFiles:PurgeGracePeriodDays |
DownloadUrlTtlMinutes | How long a download URL from GET /reports/{id}/download stays valid (default 5) |
Each stored report is referenced by its execution with owner scope gryd.report-execution and owner key equal to the execution id. See the GrydFiles pages on retention and purge and download.
Delivery Configuration
Configure default delivery constraints and message templates:
csharp
builder.Services.ConfigureGrydReportsDelivery(opts =>
{
opts.DefaultSenderEmail = "reports@company.com";
opts.DefaultSenderName = "Report System";
opts.DefaultEmailSubject = "Report: {ReportName} - {Date}";
opts.DefaultEmailBody = "Please find the attached report.";
opts.MaxRecipients = 50;
opts.WebhookTimeout = TimeSpan.FromSeconds(30);
opts.RetryCount = 3;
});The built-in email placeholder uses the recipient limit and email subject/body defaults only to validate and log intent; it has no SMTP sender. A host provider owns its transport settings. RetryCount is currently not consumed by the shipped webhook provider and does not enable retries.
Scheduling Configuration (Optional)
ReportScheduleOptions is currently registered as a configuration type but its properties are not consumed by the scheduling runtime. Setting these values does not enforce the listed limits. Recurring scheduling itself is optional and only applies when:
GrydReports.Scheduling.GrydJobspackage is installedbuilder.Services.AddGrydReportsScheduling()is registered
csharp
builder.Services.ConfigureGrydReportsScheduling(opts =>
{
// 0 = unlimited schedules per tenant
opts.MaxSchedulesPerTenant = 0;
opts.MaxConsecutiveFailures = 3;
opts.MinimumInterval = TimeSpan.FromHours(1);
opts.NotifyOnAutoPause = true;
});Declared options without runtime behavior
These configuration properties exist in the options model, but current runtime code does not consume them. Setting them does not enable the described behavior:
GlobalReportsdoes not bypass tenant query filters.Permissionsdoes not enforce per-template authorization; apply policies in the host.DigitalSignaturedoes not cryptographically sign generated PDFs. The QuestPDF signature component draws a visible signature line only.Cachingdoes not cache report output.ConnectionStringis not used to configure the ReportsDbContext; configure the database provider via the facade'sconfigureDbContextargument or Infrastructure registration.EmailDeliveryis not read by the delivery providers; useReportDeliveryOptionsfor the built-in email placeholder's validation/logging defaults or supply a hostIReportDeliveryprovider.RetentionDays,EnableAutoCleanup,MaxSyncGenerationSize,SyncGenerationTimeout, andForceAsyncAboveBytesdo not currently alter the generation or cleanup path.ReportScheduleOptionsproperties are declarations only; recurring job registration does not consume those limits or notification settings.
The GrydReportsOptions source and ReportScheduleOptions source show the declared shapes. Use the registration examples above for settings that the current runtime actually reads.
Health Checks
Register module health checks:
csharp
builder.Services.AddGrydReportsHealthChecks(builder.Configuration);This registers:
grydreports-database: PostgreSQL connectivitygrydreports-self: module self-check
Map endpoint:
csharp
app.MapHealthChecks("/health", new HealthCheckOptions
{
Predicate = check => check.Tags.Contains("grydreports")
});Option Reference
GrydReportsOptions
| Option | Type | Default | Description |
|---|---|---|---|
ConnectionString | string? | null | Not used to configure the DbContext; configure its provider through registration |
RetentionDays | int | 90 | Declared option; current cleanup does not read it |
EnableAutoCleanup | bool | true | Declared option; current cleanup does not read it |
MaxSyncGenerationSize | long | 50 MB | Declared option; generation does not enforce this limit |
SyncGenerationTimeout | TimeSpan | 2 min | Declared option; generation does not enforce this timeout |
ForceAsyncAboveBytes | long? | null | Reserved; currently unused and does not enable queued generation |
AutoRegisterTemplates | bool | true | Scans only assemblies supplied through TemplateAssemblies |
Caching.Enabled | bool | false | Reserved property; generation does not read it or cache output |
Caching.DefaultExpiration | TimeSpan | 1 hour | Reserved property; no cache TTL is applied |
DigitalSignature.Enabled | bool | false | Declared option; no PDF signing implementation consumes it |
ReportDeliveryOptions
| Option | Type | Default | Description |
|---|---|---|---|
DefaultSenderEmail | string? | null | Default sender email |
DefaultSenderName | string? | null | Default sender display name |
DefaultEmailSubject | string | Report: {ReportName} - {Date} | Subject template |
DefaultEmailBody | string | Please find the attached report. | Body template |
MaxRecipients | int | 50 | Max email recipients |
WebhookTimeout | TimeSpan | 30s | Webhook timeout |
RetryCount | int | 3 | Reserved declaration; the shipped webhook provider does not retry automatically |
ReportScheduleOptions (optional scheduling; declarations are not consumed)
| Option | Type | Default | Description |
|---|---|---|---|
MaxSchedulesPerTenant | int | 0 | Declared option; no active-schedule limit is enforced from this setting |
MaxConsecutiveFailures | int | 3 | Declared option; not applied to schedule execution |
MinimumInterval | TimeSpan | 1 hour | Declared option; no minimum interval is enforced from this setting |
NotifyOnAutoPause | bool | true | Declared option; no notification is sent from this setting |