Skip to content

Commit

Permalink
Add docs, persist webhooks from gitops even when empty
Browse files Browse the repository at this point in the history
  • Loading branch information
dantecatalfamo committed Jan 10, 2025
1 parent de53040 commit 5d07f60
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/Configuration/yaml-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,21 @@ For secrets, you can add [GitHub environment variables](https://docs.github.com/

The `webhook_settings` section lets you define webhook settings for failing policy, vulnerability, and host status automations. Learn more about automations in Fleet [here](https://fleetdm.com/docs/using-fleet/automations).

#### activities_webhook

- `enable_activities_webhook` (default: `false`)
- `destination_url` is the URL to `POST` to when an activity is generated (default: `""`)

### Example

```yaml
org_settings:
webhook_settings:
activities_webhook:
enable_activities_webhook: true
destination_url: https://example.org/webhook_handler
```

#### failing_policies_webhook

- `enable_failing_policies_webhook` (default: `false`)
Expand Down
6 changes: 6 additions & 0 deletions server/service/appconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,12 @@ func (svc *Service) ModifyAppConfig(ctx context.Context, p []byte, applyOpts fle
}
}

// Webhook settings should always come from the new config,
// if there are no settings, disable webhooks. The unmarshal
// that merges the settings doesn't set the fields to the
// default values.
appConfig.WebhookSettings = newAppConfig.WebhookSettings

// If the license is Premium, we should always send usage statisics.
if license.IsPremium() {
appConfig.ServerSettings.EnableAnalytics = true
Expand Down

0 comments on commit 5d07f60

Please sign in to comment.