Skip to content

Commit

Permalink
chore: notification updates
Browse files Browse the repository at this point in the history
  • Loading branch information
moshloop committed Jul 23, 2024
1 parent 9994b18 commit e8c9b9f
Show file tree
Hide file tree
Showing 71 changed files with 1,680 additions and 274 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ site/
node_modules
.vscode
modules/
.aider*
.venv/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
[submodule "docs-vale-package"]
path = docs-vale-package
url = https://github.com/flanksource/docs-vale-package
[submodule "modules/duty"]
path = modules/duty
url = https://github.com/flanksource/duty.git
40 changes: 20 additions & 20 deletions common/src/components/Fields.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@ import ReactMarkdown from 'react-markdown'
import clsx from 'clsx'

const schemes = {
"EnvVar": "[EnvVar](/reference/env-var)",
"MatchPattern": "[MatchPattern](/reference/types#match-pattern)",
"[]EnvVar": "[[]EnvVar](/reference/env-var)",
"CEL": "[CEL](/reference/scripting/cel)",
"Javascript": "[Javascript](/reference/scripting/javascript)",
"Gotemplate": "[Go Template](/reference/scripting/gotemplate)",
"Duration": "[Duration](/reference/types#duration)",
"JSONPathOrString": "`string` or [JSONPath](https://jsonpath.com/)",
"[]JSONPathOrString": "`[]string` or [[]JSONPath](https://jsonpath.com/)",
"JSONPath": "[JSONPath](https://jsonpath.com/)",
"Size": "[Size](/reference/types#size)",
"Agent": "[Agent](/reference/types#agent)",
"ResourceSelector": "[ResourceSelector](/reference/resource-selector)",
"Connection": "[Connection](/reference/connections)",
"envvar": "[EnvVar](/reference/env-var)",
"matchpattern": "[MatchPattern](/reference/types#match-pattern)",
"[]envvar": "[[]EnvVar](/reference/env-var)",
"cel": "[CEL](/reference/scripting/cel)",
"javascript": "[Javascript](/reference/scripting/javascript)",
"gotemplate": "[Go Template](/reference/scripting/gotemplate)",
"duration": "[Duration](/reference/types#duration)",
"jsonpathorstring": "`string` or [JSONPath](https://jsonpath.com/)",
"[]jsonpathorstring": "`[]string` or [[]JSONPath](https://jsonpath.com/)",
"jsonpath": "[JSONPath](https://jsonpath.com/)",
"size": "[Size](/reference/types#size)",
"agent": "[Agent](/reference/types#agent)",
"resourceselector": "[ResourceSelector](/reference/resource-selector)",
"connection": "[Connection](/reference/connections)",
"string": "`string`",
"Icon": "[Icon](/reference/types#icon)",
"icon": "[Icon](/reference/types#icon)",
"bool": "`boolean`",
"int": "`integer`",
"NotificationURL": "[Notification](/reference/notifications)",
"NotificationConnection": "[Connection](/reference/connections)",
"NotificationProperties": "[map[string]string](/reference/notifications#properties)",
"notificationurl": "[Notification](/reference/notifications)",
"notificationconnection": "[Connection](/reference/connections)",
"notificationproperties": "[map[string]string](/reference/notifications#properties)",
}
export default function Fields({ common = [], rows = [], oneOf, anyOf, connection }) {

Expand Down Expand Up @@ -311,10 +311,10 @@ export default function Fields({ common = [], rows = [], oneOf, anyOf, connectio
{row.anyOf &&
<code>{row.anyOf.join(' | ')}</code>
}
{!row.anyOf &&
{!row.anyOf && row.scheme &&
<ReactMarkdown>
{
schemes[row.scheme] || (row.scheme ? row.scheme : 'string')
schemes[row.scheme.toLowerCase()] || (row.scheme ? row.scheme : 'string')
}
</ReactMarkdown>
}
Expand Down
12 changes: 6 additions & 6 deletions mission-control/docs/config-db/concepts/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@
title: Changes
---

When you save a config item to ConfigDB, it also tracks its changes. These changes may come from external sources like Kubernetes events or Azure activities. Alternatively, they can be automatically detected by comparing the old config with the newly changed one.
When you save a config item to Config DB, it tracks its changes. These changes come from external sources like Kubernetes events or Azure activities. Alternatively, Mission Control can automatically detect changes by comparing the old config with the new one.

Changes are of two types
Changes are of two types:

- Diff change
- Event based change

### Diff Change

These are changes generated by ConfigDB by simply comparing the old and new config values. The image below shows a change where the port value was modified from 8080 to 3000.
Config DB generates these changes by comparing the old and new config values. The image below shows a change where the port value was modified from 8080 to 3000.

![Kubernetes Deployment Replica change](/img/config-changes.png)

### Event based change

These are changes provided by an external source example: Kubernetes Events & AWS CLoudtrail. Event based changes have a type associated to it.
External sources like Kubernetes Events and AWS CloudTrail provide these changes. Event-based changes have an associated type.

![Event based config changes of a Kubernetes Pod](/img/event-based-config-changes.png)
![Event-based config changes of a Kubernetes Pod](/img/event-based-config-changes.png)



See [Transformation Changes](./transform#changes)
See [Transformation Changes](./transform#changes).
28 changes: 0 additions & 28 deletions mission-control/docs/notifications/channels.md

This file was deleted.

105 changes: 105 additions & 0 deletions mission-control/docs/notifications/channels/discord.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Discord

:::note URL Format
discord://__`token`__@__`webhookid`__
:::

import { FaGear } from "react-icons/fa6";
import Fields from '@site/src/components/Fields';

<Fields rows={[
{
field: "token",
required: true,
description: "Discord API application token",
scheme: "string",
},
{
field: "webhookID",
required: true,
description: "Discord webhook ID",
scheme: "string",
},
{
field: "avatar",
description: "Override the webhook default avatar with specified URL",
aliases: ["avatarurl"],
scheme: "string",
},
{
field: "color",
description: "The color of the left border for plain messages",
default: "0x50D9ff",
scheme: "string",
},
{
field: "colorDebug",
description: "The color of the left border for debug messages",
default: "0x7b00ab",
scheme: "string",
},
{
field: "colorError",
description: "The color of the left border for error messages",
default: "0xd60510",
scheme: "string",
},
{
field: "colorInfo",
description: "The color of the left border for info messages",
default: "0x2488ff",
scheme: "string",
},
{
field: "colorWarn",
description: "The color of the left border for warning messages",
default: "0xffc441",
scheme: "string",
},
{
field: "json",
description: "Whether to send the whole message as the JSON payload instead of using it as the 'content' field",
default: "No",
scheme: "bool",
},
{
field: "splitLines",
description: "Whether to send each line as a separate embedded item",
default: "Yes",
scheme: "bool",
},
{
field: "username",
description: "Override the webhook default username",
scheme: "string",
},
]} />


## Getting a

1. Click on the <FaGear /> next to your channel name
![Screenshot 1](discord/sc-1.png)

2. Click on **Integrations**
![Screenshot 2](discord/sc-2.png)

3. Click on **Create Webhook**
![Screenshot 3](discord/sc-3.png)

4. Set the name, channel and icon and then click on **Copy Webhook URL**
![Screenshot 4](discord/sc-4.png)

5. Click on **Save Changes**
![Screenshot 5](discord/sc-5.png)

6. Copy the `webhookId` and `token` fields from the URL
```
https://discord.com/api/webhooks/693853386302554172/W3dE2OZz4C13_4z_uHfDOoC7BqTW288s-z1ykqI0iJnY_HjRqMGO8Sc7YDqvf_KVKjhJ
└────────────────┘ └──────────────────────────────────────────────────────────────────┘
webhook id token
discord://W3dE2OZz4C13_4z_uHfDOoC7BqTW288s-z1ykqI0iJnY_HjRqMGO8Sc7YDqvf_KVKjhJ@693853386302554172
└──────────────────────────────────────────────────────────────────┘ └────────────────┘
token webhook id
```
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
104 changes: 104 additions & 0 deletions mission-control/docs/notifications/channels/email.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Email


:::note URL Format
smtp://`username`:`password`@`host`:`port`/?from=`fromAddress`&to=`recipient1`[,`recipient2`,...]
:::

<Fields rows={[{
field: "username",
description: "SMTP server username",
default: "",
required: false,
urlPart: "username"
},
{
field: "password",
description: "SMTP server password or hash (for OAuth2)",
default: "",
required: false,
urlPart: "password"
},
{
field: "host",
description: "SMTP server hostname or IP address",
default: "",
required: true,
urlPart: "host"
},
{
field: "port",
description: "SMTP server port, common ones are 25, 465, 587 or 2525",
default: "25",
urlPart: "port"
},
{
field: "fromAddress",
description: "E-mail address that the mail are sent from",
aliases: [
"from"
],
default: "",
required: true
},
{
field: "auth",
description: "SMTP authentication method",
default: "Unknown",
oneOf: [
"None",
"Plain",
"CRAMMD5",
"Unknown",
"OAuth2"
],
required: false
},
{
field: "clientHost",
description: "The client host name sent to the SMTP server during HELLO phase. If set to \"auto\" it will use the OS hostname",
default: "localhost",
required: false
},
{
field: "encryption",
description: "Encryption method",
default: "Auto",
oneOf: [
"None",
"ExplicitTLS",
"ImplicitTLS",
"Auto"
],
required: false
},
{
field: "fromName",
description: "Name of the sender",
default: "",
required: false
},
{
field: "subject",
description: "The subject of the sent mail",
aliases: [
"title"
],
default: "Shoutrrr Notification",
required: false
},
{
field: "useHTML",
description: "Whether the message being sent is in HTML",
default: false,
required: false
},
{
field: "useStartTLS",
description: "Whether to use StartTLS encryption",
aliases: [
"starttls"
],
default: true,
required: false
}]}/>
Loading

0 comments on commit e8c9b9f

Please sign in to comment.