Improve notifications
This commit is contained in:
@@ -55,14 +55,25 @@ func checkForConflictingService(ip net.IP, port uint16) error {
|
|||||||
|
|
||||||
// Notify the user that we killed something.
|
// Notify the user that we killed something.
|
||||||
notifications.Notify(¬ifications.Notification{
|
notifications.Notify(¬ifications.Notification{
|
||||||
EventID: "namserver:stopped-conflicting-service",
|
EventID: "namserver:stopped-conflicting-service",
|
||||||
Type: notifications.Info,
|
Type: notifications.Info,
|
||||||
Title: "Conflicting DNS Service",
|
Title: "Stopped Conflicting DNS Client",
|
||||||
Category: "Secure DNS",
|
|
||||||
Message: fmt.Sprintf(
|
Message: fmt.Sprintf(
|
||||||
"The Portmaster stopped a conflicting name service (pid %d) to gain required system integration.",
|
"The Portmaster stopped a conflicting DNS client (pid %d) to gain required system integration. If you are running another DNS client on this device on purpose, you can the check the documentation if it is compatible with the Portmaster.",
|
||||||
killed,
|
killed,
|
||||||
),
|
),
|
||||||
|
ShowOnSystem: true,
|
||||||
|
AvailableActions: []*notifications.Action{
|
||||||
|
{
|
||||||
|
ID: "ack",
|
||||||
|
Text: "OK",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Text: "Open Docs",
|
||||||
|
Type: notifications.ActionTypeOpenURL,
|
||||||
|
Payload: "https://docs.safing.io/portmaster/install/status/software-compatibility",
|
||||||
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
// Restart nameserver via service-worker logic.
|
// Restart nameserver via service-worker logic.
|
||||||
|
|||||||
@@ -241,15 +241,23 @@ func setCaptivePortal(portalURL *url.URL) {
|
|||||||
// notify
|
// notify
|
||||||
cleanUpPortalNotification()
|
cleanUpPortalNotification()
|
||||||
captivePortalNotification = notifications.Notify(¬ifications.Notification{
|
captivePortalNotification = notifications.Notify(¬ifications.Notification{
|
||||||
EventID: "netenv:captive-portal",
|
EventID: "netenv:captive-portal",
|
||||||
Type: notifications.Info,
|
Type: notifications.Info,
|
||||||
Title: "Captive Portal",
|
Title: "Captive Portal Detected",
|
||||||
Category: "Core",
|
Message: "The Portmaster detected a captive portal. You might experience limited network connectivity until the portal is handled.",
|
||||||
Message: fmt.Sprintf(
|
ShowOnSystem: true,
|
||||||
"Portmaster detected a captive portal at %s",
|
EventData: captivePortal,
|
||||||
captivePortal.Domain,
|
AvailableActions: []*notifications.Action{
|
||||||
),
|
{
|
||||||
EventData: captivePortal,
|
Text: "Open Portal",
|
||||||
|
Type: notifications.ActionTypeOpenURL,
|
||||||
|
Payload: captivePortal.URL,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ID: "ack",
|
||||||
|
Text: "Ignore",
|
||||||
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -282,7 +282,7 @@ func checkForUpdates(ctx context.Context) (err error) {
|
|||||||
"The Portmaster failed to check for updates. This might be a temporary issue of your device, your network or the update servers. The Portmaster will automatically try again later.",
|
"The Portmaster failed to check for updates. This might be a temporary issue of your device, your network or the update servers. The Portmaster will automatically try again later.",
|
||||||
notifications.Action{
|
notifications.Action{
|
||||||
ID: "retry",
|
ID: "retry",
|
||||||
Text: "Try Again",
|
Text: "Try Again Now",
|
||||||
Type: notifications.ActionTypeWebhook,
|
Type: notifications.ActionTypeWebhook,
|
||||||
Payload: ¬ifications.ActionTypeWebhookPayload{
|
Payload: ¬ifications.ActionTypeWebhookPayload{
|
||||||
URL: apiPathCheckForUpdates,
|
URL: apiPathCheckForUpdates,
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ func warnOnIncorrectParentPath() {
|
|||||||
"updates:unsupported-parent",
|
"updates:unsupported-parent",
|
||||||
"Unsupported Launcher",
|
"Unsupported Launcher",
|
||||||
fmt.Sprintf(
|
fmt.Sprintf(
|
||||||
"The portmaster has been launched by an unexpected %s binary at %s. Please configure your system to use the binary at %s as this version will be kept up to date automatically.",
|
"The Portmaster has been launched by an unexpected %s binary at %s. Please configure your system to use the binary at %s as this version will be kept up to date automatically.",
|
||||||
expectedFileName,
|
expectedFileName,
|
||||||
absPath,
|
absPath,
|
||||||
filepath.Join(root, expectedFileName),
|
filepath.Join(root, expectedFileName),
|
||||||
|
|||||||
Reference in New Issue
Block a user