e-note-ion 2.1.0__tar.gz → 2.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {e_note_ion-2.1.0/e_note_ion.egg-info → e_note_ion-2.1.2}/PKG-INFO +1 -1
- {e_note_ion-2.1.0 → e_note_ion-2.1.2/e_note_ion.egg-info}/PKG-INFO +1 -1
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/health.py +30 -1
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/pyproject.toml +1 -1
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/scheduler.py +38 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/LICENSE.txt +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/MANIFEST.in +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/README.md +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/config.py +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/e_note_ion.egg-info/SOURCES.txt +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/e_note_ion.egg-info/dependency_links.txt +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/e_note_ion.egg-info/entry_points.txt +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/e_note_ion.egg-info/requires.txt +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/e_note_ion.egg-info/top_level.txt +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/exceptions.py +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/healthalert.py +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/homebridge.py +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/integrations/__init__.py +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/integrations/bart.py +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/integrations/calendar.py +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/integrations/calendar_schedule.py +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/integrations/color.py +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/integrations/discogs.py +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/integrations/diving.py +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/integrations/google.py +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/integrations/http.py +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/integrations/media.py +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/integrations/message.py +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/integrations/moon.py +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/integrations/morning.py +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/integrations/notion.py +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/integrations/parcel.py +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/integrations/plex.py +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/integrations/qbittorrent.py +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/integrations/scheduler.py +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/integrations/tmdb.py +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/integrations/trakt.py +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/integrations/unraid.py +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/integrations/uptimerobot.py +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/integrations/vestaboard.py +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/integrations/weather.py +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/integrations/ynab.py +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/integrations/youtube.py +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/public.py +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/quiet.py +0 -0
- {e_note_ion-2.1.0 → e_note_ion-2.1.2}/setup.cfg +0 -0
|
@@ -103,6 +103,9 @@ class _TargetState:
|
|
|
103
103
|
# webhook-only targets, which fire on external events with no predictable
|
|
104
104
|
# interval and are therefore never overdue.
|
|
105
105
|
expected_interval: float | None = None
|
|
106
|
+
# When this integration was last *scheduled*, which is not the same as when it
|
|
107
|
+
# last produced an event — see note_scheduled().
|
|
108
|
+
last_scheduled: float = 0.0
|
|
106
109
|
|
|
107
110
|
|
|
108
111
|
# Reserved target name for the Vestaboard send path. Registered implicitly
|
|
@@ -284,6 +287,30 @@ def set_expected_interval(name: str, seconds: float) -> None:
|
|
|
284
287
|
state.expected_interval = seconds
|
|
285
288
|
|
|
286
289
|
|
|
290
|
+
def note_scheduled(name: str) -> None:
|
|
291
|
+
"""Record that *name* was enqueued, whatever becomes of the message.
|
|
292
|
+
|
|
293
|
+
Overdue detection asks "has this integration stopped firing". Health events
|
|
294
|
+
cannot answer that on their own, because an event is only recorded once the
|
|
295
|
+
worker pops the message and calls the integration — and a message that loses
|
|
296
|
+
priority contention is discarded before that ever happens.
|
|
297
|
+
|
|
298
|
+
A Plex now-playing card holds the board indefinitely, so during a film
|
|
299
|
+
contrib.uptimerobot.status is enqueued every 5 minutes and discarded 2
|
|
300
|
+
minutes later, never reaching the integration. Nothing is wrong: #600 already
|
|
301
|
+
classifies exactly that discard as expected. Without this, overdue flagged it
|
|
302
|
+
anyway and /health went red for the length of the film.
|
|
303
|
+
|
|
304
|
+
Deliberately not a HealthEvent: this says the scheduler fired, not that the
|
|
305
|
+
integration succeeded, and folding it into the event deque would corrupt the
|
|
306
|
+
success-rate calculation.
|
|
307
|
+
"""
|
|
308
|
+
with _lock:
|
|
309
|
+
state = _targets.get(name)
|
|
310
|
+
if state is not None:
|
|
311
|
+
state.last_scheduled = time.time()
|
|
312
|
+
|
|
313
|
+
|
|
287
314
|
def _is_overdue(state: _TargetState, now: float) -> bool:
|
|
288
315
|
"""Return True if *state* has gone too long without firing. Caller holds _lock."""
|
|
289
316
|
if state.expected_interval is None:
|
|
@@ -299,7 +326,9 @@ def _is_overdue(state: _TargetState, now: float) -> bool:
|
|
|
299
326
|
# timestamp, and register() leaves an existing target alone. So a restored
|
|
300
327
|
# target carries an old registered_at too.
|
|
301
328
|
last = state.events[-1].timestamp if state.events else state.registered_at
|
|
302
|
-
|
|
329
|
+
# Being scheduled counts as alive even when the message never reached the
|
|
330
|
+
# integration, so a long hold on the board cannot look like a stalled cron.
|
|
331
|
+
reference = max(last, _started_at, state.last_scheduled)
|
|
303
332
|
return (now - reference) > state.expected_interval * _OVERDUE_INTERVAL_MULTIPLIER
|
|
304
333
|
|
|
305
334
|
|
|
@@ -201,6 +201,14 @@ def enqueue(
|
|
|
201
201
|
seq = _counter
|
|
202
202
|
_counter += 1
|
|
203
203
|
|
|
204
|
+
# An enqueue means the cron fired, which is what overdue detection actually
|
|
205
|
+
# cares about. Recorded here rather than at send time because a message that
|
|
206
|
+
# loses priority contention is discarded before the integration is ever
|
|
207
|
+
# called — see health.note_scheduled(). (#502)
|
|
208
|
+
integration = data.get('integration')
|
|
209
|
+
if integration:
|
|
210
|
+
_health_mod.note_scheduled(integration)
|
|
211
|
+
|
|
204
212
|
msg = QueuedMessage(
|
|
205
213
|
priority=priority,
|
|
206
214
|
seq=seq,
|
|
@@ -783,6 +791,35 @@ _THIRD_PARTY_LOG_FLOORS: dict[str, int] = {
|
|
|
783
791
|
_ICAL_DIFF_MARKER = 'Ical data was modified'
|
|
784
792
|
|
|
785
793
|
|
|
794
|
+
class _RedactSecrets(logging.Filter):
|
|
795
|
+
"""Scrub credentials out of every log record before it is written.
|
|
796
|
+
|
|
797
|
+
urllib3 logs each request line at DEBUG, query string included, and BART
|
|
798
|
+
takes its API key as a query parameter — so a production run at
|
|
799
|
+
log_level = "DEBUG" wrote the key into the Docker log in plaintext on every
|
|
800
|
+
BART call. The #591 work only scrubbed error strings on their way into
|
|
801
|
+
health; it never touched what dependencies log directly.
|
|
802
|
+
|
|
803
|
+
Applied to the handler so it covers records from any logger, ours and
|
|
804
|
+
third-party alike, and at every level. redact() keeps scheme, host and path
|
|
805
|
+
shape, so the line stays useful for debugging.
|
|
806
|
+
"""
|
|
807
|
+
|
|
808
|
+
def filter(self, record: logging.LogRecord) -> bool:
|
|
809
|
+
try:
|
|
810
|
+
message = record.getMessage()
|
|
811
|
+
except Exception: # noqa: BLE001 — a broken record must not break logging
|
|
812
|
+
return True
|
|
813
|
+
# Cheap guard: only the regex-worthy records pay for the substitution.
|
|
814
|
+
if '://' not in message and '?' not in message:
|
|
815
|
+
return True
|
|
816
|
+
redacted = _http.redact(message)
|
|
817
|
+
if redacted != message:
|
|
818
|
+
record.msg = redacted
|
|
819
|
+
record.args = ()
|
|
820
|
+
return True
|
|
821
|
+
|
|
822
|
+
|
|
786
823
|
class _DropIcalDiff(logging.Filter):
|
|
787
824
|
"""Drop caldav's event-data diff, whatever the configured level."""
|
|
788
825
|
|
|
@@ -1798,6 +1835,7 @@ def main() -> None:
|
|
|
1798
1835
|
# placement that holds regardless of which logger caldav emits from.
|
|
1799
1836
|
for handler in logging.root.handlers:
|
|
1800
1837
|
handler.addFilter(_DropIcalDiff())
|
|
1838
|
+
handler.addFilter(_RedactSecrets())
|
|
1801
1839
|
|
|
1802
1840
|
model = _config_mod.get_model()
|
|
1803
1841
|
if model == 'flagship':
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|