Remove ntfy: notifications go only through the app notification stream
Server: drop ntfy publishing (stage hooks, run outbox, chat attention, chat tool notify, auto-switch and schedule notices), the chat push outbox (its table is dropped at startup), ntfy status/endpoints and PIPELINES_NTFY_*. The app_notifications stream, subscribe/clear and kinds are unchanged. Notification settings keep run_finished/chat_needs_you/chat_reply_finished; ntfy_enabled is accepted and ignored and its stored row is never read. Stage type=ntfy is rejected: "ntfy stages were removed; notifications go to the Pipelines apps — use the stage notify hook". The notify hook remains. Installer: no ntfy build, accounts, config or supervisor child; manifest gets top-level "mode" (legacy ntfy.mode still read). Reinstall retires an old ntfy (safe PID-file stop, deletes binary, config, data dir, token, log, with a note in logs/install.log); uninstall cleans leftovers. App: ntfy settings section replaced by "Notification events"; texts updated. Docs: docs/ntfy.md folded into docs/notifications.md; install, docker, cli, author skill references updated; security review M1 marked resolved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -27,31 +27,24 @@ class ConfigureTests(unittest.TestCase):
|
||||
except ValueError:
|
||||
self.skipTest("host timezone is unavailable in this environment")
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
zone = configure.configure(directory, "http://192.168.1.20:8090", "0.0.0.0")
|
||||
zone = configure.configure(directory)
|
||||
self.assertTrue(zone)
|
||||
settings = Path(directory, ".env")
|
||||
original = settings.read_bytes()
|
||||
self.assertIn(f"TZ={zone}", settings.read_text())
|
||||
self.assertEqual(Path(directory, "secrets/ntfy-token.txt").stat().st_mode & 0o777, 0o600)
|
||||
self.assertNotIn("NTFY", settings.read_text())
|
||||
self.assertFalse(Path(directory, "secrets").exists())
|
||||
with self.assertRaises(ValueError):
|
||||
configure.configure(directory, "http://192.168.1.21:8090", "0.0.0.0")
|
||||
configure.configure(directory, "Europe/London")
|
||||
self.assertEqual(settings.read_bytes(), original)
|
||||
|
||||
def test_existing_token_is_not_overwritten(self):
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
secrets = Path(directory, "secrets")
|
||||
secrets.mkdir()
|
||||
token = secrets / "ntfy-token.txt"
|
||||
token.write_text("existing-secret")
|
||||
configure.configure(directory, "http://192.168.1.20:8090", "0.0.0.0", "Europe/London")
|
||||
self.assertEqual(token.read_text(), "existing-secret")
|
||||
|
||||
def test_reject_bad_url_and_injected_values(self):
|
||||
for url in ["file:///foo", "https://user:pass@example.com", "https://example.com/topic", "https://example.com?token=secret"]:
|
||||
with tempfile.TemporaryDirectory() as directory, self.assertRaises(ValueError):
|
||||
configure.configure(directory, url, "0.0.0.0", "Europe/London")
|
||||
def test_reject_injected_values(self):
|
||||
for timezone in ("Europe/London\nEVIL=yes", "Nowhere/Invalid"):
|
||||
with tempfile.TemporaryDirectory() as directory, self.assertRaises(Exception):
|
||||
configure.configure(directory, timezone)
|
||||
self.assertFalse(Path(directory, ".env").exists())
|
||||
with tempfile.TemporaryDirectory() as directory, self.assertRaises(ValueError):
|
||||
configure.configure(directory, "https://example.com", "0.0.0.0\nEVIL=yes", "Europe/London")
|
||||
configure.configure(directory, "Europe/London", port=70000)
|
||||
|
||||
def test_client_default_is_saved_privately_and_preserves_other_keys(self):
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
|
||||
Reference in New Issue
Block a user