Open ntfy notifications in the app and notify chats that need the operator
Run notifications now always click through to pipelines://run/<id>; a valid PIPELINES_WEB_PUBLIC_URL adds an "Open in browser" ntfy view action instead of replacing the click. Queued rows derive links from the run id at delivery, so legacy rows holding a web URL still open the app. Unresolved chat questions/forms and permission requests publish one async, bounded notification to the system destination (pipelines://chat/<id> plus the browser action), deduplicated per form/request id across reconnects and replays. stage.PublishNtfy gains optional, strictly validated view actions. Server tests now clear the operator's real ntfy environment.
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// TestMain isolates the package from an operator's real notification setup:
|
||||
// a developer shell may export the installed server's ntfy configuration, and
|
||||
// no test may publish to it. Tests that need ntfy point it at an httptest server.
|
||||
func TestMain(m *testing.M) {
|
||||
for _, name := range []string{"PIPELINES_NTFY_URL", "PIPELINES_NTFY_PUBLIC_URL", "PIPELINES_NTFY_TOKEN", "PIPELINES_NTFY_TOKEN_FILE", "PIPELINES_WEB_PUBLIC_URL"} {
|
||||
os.Unsetenv(name)
|
||||
}
|
||||
os.Exit(m.Run())
|
||||
}
|
||||
Reference in New Issue
Block a user