mirror of
https://github.com/C9Glax/tranga.git
synced 2025-02-23 07:40:13 +01:00
#187 Server v1 NTFY username password
This commit is contained in:
parent
d52ec8d36f
commit
5614729eab
@ -492,12 +492,13 @@ public class Server : GlobalBase
|
|||||||
}else if (notificationConnectorType is NotificationConnector.NotificationConnectorType.Ntfy)
|
}else if (notificationConnectorType is NotificationConnector.NotificationConnectorType.Ntfy)
|
||||||
{
|
{
|
||||||
if (!requestVariables.TryGetValue("ntfyUrl", out string? ntfyUrl) ||
|
if (!requestVariables.TryGetValue("ntfyUrl", out string? ntfyUrl) ||
|
||||||
!requestVariables.TryGetValue("ntfyAuth", out string? ntfyAuth))
|
!requestVariables.TryGetValue("ntfyUser", out string? ntfyUser)||
|
||||||
|
!requestVariables.TryGetValue("ntfyPass", out string? ntfyPass))
|
||||||
{
|
{
|
||||||
SendResponse(HttpStatusCode.BadRequest, response);
|
SendResponse(HttpStatusCode.BadRequest, response);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
AddNotificationConnector(new Ntfy(this, ntfyUrl, ntfyAuth));
|
AddNotificationConnector(new Ntfy(this, ntfyUrl, ntfyUser, ntfyPass, null));
|
||||||
SendResponse(HttpStatusCode.Accepted, response);
|
SendResponse(HttpStatusCode.Accepted, response);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -534,12 +535,13 @@ public class Server : GlobalBase
|
|||||||
}else if (notificationConnectorType is NotificationConnector.NotificationConnectorType.Ntfy)
|
}else if (notificationConnectorType is NotificationConnector.NotificationConnectorType.Ntfy)
|
||||||
{
|
{
|
||||||
if (!requestVariables.TryGetValue("ntfyUrl", out string? ntfyUrl) ||
|
if (!requestVariables.TryGetValue("ntfyUrl", out string? ntfyUrl) ||
|
||||||
!requestVariables.TryGetValue("ntfyAuth", out string? ntfyAuth))
|
!requestVariables.TryGetValue("ntfyUser", out string? ntfyUser)||
|
||||||
|
!requestVariables.TryGetValue("ntfyPass", out string? ntfyPass))
|
||||||
{
|
{
|
||||||
SendResponse(HttpStatusCode.BadRequest, response);
|
SendResponse(HttpStatusCode.BadRequest, response);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
notificationConnector = new Ntfy(this, ntfyUrl, ntfyAuth);
|
notificationConnector = new Ntfy(this, ntfyUrl, ntfyUser, ntfyPass, null);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user