Commit Graph

694 Commits

Author SHA1 Message Date
GitHub Actions 5bafd92edf fix: supply slack webhook token in handler create sub-tests
The slack sub-tests in TestDiscordOnly_CreateRejectsNonDiscord and
TestBlocker3_CreateProviderRejectsNonDiscordWithSecurityEvents were
omitting the required token field from their request payloads.
CreateProvider enforces that Slack providers must have a non-empty
token (the webhook URL) at creation time. Without it the service
returns "slack webhook URL is required", which the handler does not
classify as a 400 validation error, so it falls through to 500.

Add a token field to each test struct, populate it for the slack
case with a valid-format Slack webhook URL, and use
WithSlackURLValidator to bypass the real format check in unit tests —
matching the pattern used in all existing service-level Slack tests.
2026-03-15 15:17:23 +00:00
GitHub Actions 6e4294dce1 fix: validate Slack webhook URL at provider create/update time 2026-03-15 12:23:27 +00:00
GitHub Actions 72598ed2ce fix: inject Slack URL validator via constructor option instead of field mutation 2026-03-15 11:27:51 +00:00
GitHub Actions ab4dee5fcd fix: make Slack webhook URL validator injectable on NotificationService 2026-03-15 11:15:10 +00:00
Jeremy 0ce35f2d64 Merge branch 'development' into feature/beta-release 2026-03-14 23:47:43 -04:00
GitHub Actions fd58f9d99a fix(auth): update SameSite cookie policy description for clarity 2026-03-15 03:23:06 +00:00
GitHub Actions f33ab83b7c fix(auth): rename isLocalHost to isLocalOrPrivateHost and update related tests 2026-03-15 03:20:11 +00:00
GitHub Actions 6777f6e8ff feat(auth): implement Bearer token fallback in fetchSessionUser for private network HTTP connections
- Expanded fetchSessionUser to include Bearer token from localStorage as a fallback for authentication when Secure cookies fail.
- Updated headers to conditionally include Authorization if a token is present.
- Ensured compatibility with the recent fix for the Secure cookie flag on private network connections.
2026-03-15 02:25:07 +00:00
GitHub Actions 0c419d8f85 chore: add Slack provider validation tests for payload and webhook URL 2026-03-13 12:09:35 +00:00
GitHub Actions 26be592f4d feat: add Slack notification provider support
- Updated the notification provider types to include 'slack'.
- Modified API tests to handle 'slack' as a valid provider type.
- Enhanced frontend forms to display Slack-specific fields (webhook URL and channel name).
- Implemented CRUD operations for Slack providers, ensuring proper payload structure.
- Added E2E tests for Slack notification provider, covering form rendering, validation, and security checks.
- Updated translations to include Slack-related text.
- Ensured that sensitive information (like tokens) is not exposed in API responses.
2026-03-13 03:40:02 +00:00
GitHub Actions 593694a4b4 fix(deps): update goccy/go-json to version 0.10.6 2026-03-12 17:49:05 +00:00
GitHub Actions 442164cc5c fix(deps): update golang.org/x/crypto and golang.org/x/net dependencies to latest versions 2026-03-12 10:05:51 +00:00
renovate[bot] 7932188dae fix(deps): update non-major-updates 2026-03-12 09:30:08 +00:00
GitHub Actions b76c1d7efc chore: update golang.org/x/sync dependency to v0.20.0 and remove outdated golang.org/x/text v0.34.0 2026-03-11 15:54:36 +00:00
renovate[bot] 065ac87815 fix(deps): update non-major-updates 2026-03-11 14:53:49 +00:00
GitHub Actions c977c6f9a4 fit(notification): enhance Telegram integration with dynamic API base URL and improved payload validation 2026-03-11 00:34:39 +00:00
GitHub Actions 9000c1f4ba chore: add comprehensive tests for Telegram notification service functionality 2026-03-10 23:32:29 +00:00
GitHub Actions 2fc5b10d3d fix(notifications): surface provider API error details in test failure messages 2026-03-10 17:30:31 +00:00
GitHub Actions ef71f66029 feat: add Telegram notification provider support
- Updated API to support Telegram as a notification provider type.
- Enhanced tests to cover Telegram provider creation, updates, and token handling.
- Modified frontend forms to include Telegram-specific fields and validation.
- Added localization strings for Telegram provider.
- Implemented security measures to ensure bot tokens are not exposed in API responses.
2026-03-10 12:14:57 +00:00
GitHub Actions 3414c7c941 fix: update modernc.org/libc to v1.70.0 and golang.org/x/mod to v0.33.0 2026-03-09 13:10:46 +00:00
GitHub Actions 0f823956c6 fix: add email service check in ShouldUseNotify method 2026-03-09 00:49:07 +00:00
GitHub Actions 799ca8c5f9 fix: enhance decompression limit check to prevent false positives for valid files 2026-03-09 00:42:23 +00:00
GitHub Actions 791e812c3c fix: add assertion for ExpiresAt field in ManualChallenge struct 2026-03-09 00:09:14 +00:00
GitHub Actions d7de28a040 fix: allow saving email notification providers and render HTML body correctly 2026-03-08 20:26:13 +00:00
GitHub Actions d1baf6f1b0 feat: implement email provider testing functionality and corresponding unit tests 2026-03-08 16:14:08 +00:00
GitHub Actions 3201830405 chore: update dependencies for golang.org/x/time, golang.org/x/arch, and golang.org/x/sys 2026-03-08 15:52:44 +00:00
GitHub Actions c4e8d6c8ae chore: add unit tests for certificate handler, logs websocket upgrader, config loading, and mail service 2026-03-08 05:45:21 +00:00
GitHub Actions 65b82a8e08 feat: add email notification provider with HTML templates
- Implemented email notification functionality in the NotificationService.
- Added support for rendering email templates based on event types.
- Created HTML templates for various notification types (security alerts, SSL events, uptime events, and system events).
- Updated the dispatchEmail method to utilize the new email templates.
- Added tests for email template rendering and fallback mechanisms.
- Enhanced documentation to include email notification setup and usage instructions.
- Introduced end-to-end tests for the email notification provider in the settings.
2026-03-07 19:54:21 +00:00
GitHub Actions c144bb2b97 fix: enhance email notification formatting with HTML for improved readability 2026-03-07 05:53:46 +00:00
GitHub Actions ca3c1085ac fix: update notification messages for various handlers to improve clarity and consistency 2026-03-07 05:16:07 +00:00
GitHub Actions 744b6aeff5 fix: improve pagination handling and prevent decompression bombs in backup service
fix: enhance JWT secret management to avoid hardcoded values and ensure security
feat: add SMTP address sanitization to prevent email header injection vulnerabilities
2026-03-07 03:39:54 +00:00
GitHub Actions 81497beb4b fix: update opentelemetry dependencies to latest versions for improved performance 2026-03-07 02:06:15 +00:00
Jeremy 801760add1 Potential fix for code scanning alert no. 1271: Email content injection
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2026-03-06 15:30:55 -05:00
GitHub Actions 4ebf8d23fe fix: enhance email sanitization by trimming whitespace and normalizing input 2026-03-06 20:18:51 +00:00
GitHub Actions b527470e75 fix: update opentelemetry dependencies to v1.42.0 for improved functionality and performance 2026-03-06 19:58:19 +00:00
GitHub Actions 89b4d88eb1 fix: enhance email content sanitization to prevent CR/LF injection and improve security 2026-03-06 19:56:22 +00:00
GitHub Actions a69f698440 fix: enhance WebSocket origin check and improve email validation in mail service 2026-03-06 13:50:59 +00:00
GitHub Actions ee224adcf1 fix: update notification provider type in tests and enhance email injection sanitization 2026-03-06 06:31:11 +00:00
Jeremy 99ff0a34e3 Merge pull request #808 from Wikid82/renovate/feature/beta-release-non-major-updates
chore(deps): update non-major-updates (feature/beta-release)
2026-03-05 21:07:44 -05:00
GitHub Actions ed89295012 feat: wire MailService into notification dispatch pipeline (Stage 3)
Unifies the two previously independent email subsystems — MailService
(net/smtp transport) and NotificationService (HTTP-based providers) —
so email can participate in the notification dispatch pipeline.

Key changes:
- SendEmail signature updated to accept context.Context and []string
  recipients to enable timeout propagation and multi-recipient dispatch
- NotificationService.dispatchEmail() wires MailService as a first-class
  provider type with IsConfigured() guard and 30s context timeout
- 'email' added to isSupportedNotificationProviderType() and
  supportsJSONTemplates() returns false for email (plain/HTML only)
- settings_handler.go test-email endpoint updated to new SendEmail API
- Frontend: 'email' added to provider type union in notifications.ts,
  Notifications.tsx shows recipient field and hides URL/token fields for
  email providers
- All existing tests updated to match new SendEmail signature
- New tests added covering dispatchEmail paths, IsConfigured guards,
  recipient validation, and context timeout behaviour

Also fixes confirmed false-positive CodeQL go/email-injection alerts:
- smtp.SendMail, sendSSL w.Write, and sendSTARTTLS w.Write sites now
  carry inline codeql[go/email-injection] annotations as required by the
  CodeQL same-line suppression spec; preceding-line annotations silently
  no-op in current CodeQL versions
- auth_handler.go c.SetCookie annotated for intentional Secure=false on
  local non-HTTPS loopback (go/cookie-secure-not-set warning only)

Closes part of #800
2026-03-06 02:06:49 +00:00
renovate[bot] 834907cb5d chore(deps): update non-major-updates 2026-03-06 02:02:10 +00:00
GitHub Actions 5fa0cff274 fix: eliminate wall-clock race in TestApplyRepullsOnCacheExpired
The test used a 5ms TTL with a 10ms wall-clock sleep to simulate cache
expiry. On loaded CI runners (Azure eastus), the repull HTTP round-trip
plus disk I/O for Store easily exceeded 5ms, causing the freshly written
cache entry to also appear expired when Load was called immediately after,
producing a spurious 'cache expired' error.

HubCache already exposes a nowFn field for deterministic time injection.
Replace the sleep-based approach with a nowFn that advances the clock 2
hours, making the initial entry appear expired to Apply while keeping the
freshly re-stored entry (retrieved_at ≈ now+2h, TTL=1h) valid for the
final assertion.
2026-03-05 20:20:14 +00:00
GitHub Actions f2cf5c3508 chore: add coverage for default false state of email notifications feature flag 2026-03-05 14:58:21 +00:00
GitHub Actions ddc79865bc test: cover email provider paths in SendExternal and TestProvider
Two unit tests cover the code paths introduced when email was registered
as a recognised notification provider type in Stage 2.

- TestSendExternal_EmailProviderSkipsJSONTemplate exercises the goroutine
  warn path where an enabled email provider passes isDispatchEnabled but
  fails supportsJSONTemplates, producing a warning log without panicking
- TestTestProvider_EmailRejectsJSONTemplateStep asserts TestProvider
  returns a clear error for email providers because the JSON template
  dispatch path does not apply to email delivery

Patch coverage: 6/6 changed lines covered (100%)
2026-03-05 06:57:37 +00:00
GitHub Actions 2f83526966 fix: resolve email provider test regression from Stage 2 flag registration
After email was recognised as a supported provider type, the existing
rejection assertion for unsupported types incorrectly included email
in its denial list, causing a nil-dereference panic.

- Remove email from the unsupported-type rejection list and cover it
  in the accepted-types path instead
- Correct allFeaturesEnabled fixture to set email flag to true, keeping
  the fixture semantically consistent with all other service flags
2026-03-05 04:22:04 +00:00
GitHub Actions 5a58404e1b feat: register email as feature-flagged notification service
Add email as a recognized, feature-flagged notification service type.
The flag defaults to false and acts as a dispatch gate alongside the
existing discord, gotify, and webhook notification service flags.

- Add FlagEmailServiceEnabled constant to the notifications feature flag
  registry with the canonical key convention
- Register the flag in the handler defaults so it appears in the feature
  flags API response with a false default
- Recognise 'email' as a supported notification provider type so that
  providers of this type pass the type validation gate
- Gate email dispatch on the new flag in isDispatchEnabled() following
  the same pattern as gotify and webhook service flags
- Expand the E2E test fixtures FeatureFlags interface to include the new
  flag key so typed fixture objects remain accurate

No email message dispatch is wired in this commit; the flag registration
alone makes the email provider type valid and toggleable.
2026-03-05 03:36:27 +00:00
GitHub Actions 8ea907066b chore: remove Shoutrrr residue and dead notification legacy code
Remove all deprecated Shoutrrr integration artifacts and dead legacy fallback
code from the notification subsystem.

- Remove legacySendFunc field, ErrLegacyFallbackDisabled error, and
  legacyFallbackInvocationError() from notification service
- Delete ShouldUseLegacyFallback() from notification router; simplify
  ShouldUseNotify() by removing now-dead providerEngine parameter
- Remove EngineLegacy engine constant; EngineNotifyV1 is the sole engine
- Remove legacy.fallback_enabled feature flag, retiredLegacyFallbackEnvAliases,
  and parseFlagBool/resolveRetiredLegacyFallback helpers from flags handler
- Remove orphaned EmailRecipients field from NotificationConfig model
- Delete feature_flags_coverage_v2_test.go (tested only the retired flag path)
- Delete security_notifications_test.go.archived (stale archived file)
- Move FIREFOX_E2E_FIXES_SUMMARY.md to docs/implementation/
- Remove root-level scan artifacts tracked in error; add gitignore patterns to
  prevent future tracking of trivy-report.json and related outputs
- Update ARCHITECTURE.instructions.md: Notifications row Shoutrrr → Notify

No functional changes to active notification dispatch or mail delivery.
2026-03-05 00:41:42 +00:00
GitHub Actions 27c252600a chore: git cache cleanup 2026-03-04 18:34:49 +00:00
GitHub Actions c32cce2a88 chore: git cache cleanup 2026-03-04 18:34:39 +00:00
GitHub Actions f062dc206e fix: restrict email changes for non-admin users to profile settings 2026-03-04 12:38:28 +00:00