loving_ntfy

joined 1 year ago
[–] loving_ntfy@lemm.ee 2 points 1 year ago

Not quite clear.

Given I have no tiers, I am covered just with cache-duration and can completely ignore message-expiry-duration?

I have a single service that POSTs messages to ntfy which sends them to subscribers. Any subscriber will have to connect within cache-duration or else ntfy deletes messages older than that from the database. Is that accurate? The intention is to keep the sqlite db lean and small.

 

What is the difference between the two.

The cache-duration is explained in the docs and is fairly clear:

Duration for which messages will be buffered before they are deleted

so it is to account for network interruptions of subscribers.

message-expiry-duration is mentioned but there is no explanation for it in the docs.

[–] loving_ntfy@lemm.ee 2 points 1 year ago (1 children)

That would work great! So anything sent under "extras" would be forwarded verbatim to the mobile app.

Is it too much trouble to implement?

[–] loving_ntfy@lemm.ee 2 points 1 year ago (3 children)

My backend POSTs notification JSON to self-hosted ntfy server:

{
 "topic": "1234", 
 "message": "foo",
 "title": "bar",
 "customField": "baz"
}

The ntfy server should broadcast all fields, including customField to the websockets/subscribers of this topic.

Am I missing something?

[–] loving_ntfy@lemm.ee 1 points 1 year ago (1 children)

I also see log-file option. Is it possible to log both to a file (for later inspection) and to stderr?

 

I have a self-hosted ntfy instance and I am gradually building a bare-bones mobile app to display my notifications.

I am publishing by POSTing as JSON. Is it possible for the ntfy server to send all the data fields that are included in the JSON? I would like to pass data in custom fields. Makes sense?

If this does not exist, is it possible to make a feature-request?

[–] loving_ntfy@lemm.ee 2 points 1 year ago (3 children)

Nevermind. I found the problem. It was not NTFY's fault. Some of the notifications that were POSTed to NTFY, didn't follow the correct syntax (was sending "attach" in the JSON as string[] instead of a single string).

Would be nice though if NTFY could provide a debug log to catch such cases.

 

I do POSTs from a backend app to a self-hosted ntfy instance (docker). The POSTs do not fail and I also save them in local db. I now compare the notifications cached in /var/cache/ntfy/cache.db against the ones I save in my local db and I see that ntfy is missing a lot. As an example, today for example I have POSTed 540 times and in cache.db I see only 60 of them. The skipped ones are not even at regular intervals.

Is there a logfile I can check in the ntfy service? The output of the ntfy process itself only shows the expected INFO Server stats... message but not errors.

Is there any reason ntfy may not be registering some of the POSTed notifications?

Best regards.

Edit: I can also confirm on the mobile app that I did not receive the skipped ones; I have only received indeed the ones that I see in ntfy's cache.db.