Commit Graph

73 Commits

Author SHA1 Message Date
Peter Stuifzand
6fb4dc6ca8
Publish on hub.url, and answer with a status that means something
Some checks failed
continuous-integration/drone Build is failing
A publisher names the feed in hub.url (spec §7.1). This read hub.topic, which
belongs to subscribe and unsubscribe, so every compliant publisher sent a
notification the hub could not resolve: it logged "could not request topic :"
and returned 200 with an empty body. Nothing was ever delivered, and the
status said the opposite. hub.topic is still read, but only when hub.url is
missing.

The rest is the same class of bug — a response that reported success for work
that did not happen:

- a publish with no topic is 400, a topic that does not answer 2xx is 502,
  and a subscriber is told nothing about either;
- the fetched body is bounded, its response closed, and a callback is retried
  once with the outcome logged instead of assuming the first POST landed;
- unsubscribe wrote 200 and then an error body into the same response; it now
  answers once;
- the challenge comes from crypto/rand and must be echoed exactly, since a
  substring match let any page that mentioned it pass verification;
- pq.Error implements error on the pointer, so the value assertion never
  compiled; the statement now type-asserts the pointer;
- the database password can come from HUB_DB_PASSWORD instead of only being
  baked into the binary.

The build moves to go.mod and golang:1.22, because io.Discard does not exist
in the 1.12 image the pipeline was pinned to.
2026-11-08 01:20:53 +01:00
9ce5f6e6c6 Delete expired subscribers
All checks were successful
continuous-integration/drone/push Build is passing
2021-10-21 22:50:13 +02:00
3b2e866f3e Fix constraint language of subscribe query
All checks were successful
continuous-integration/drone/push Build is passing
2020-12-01 19:39:15 +01:00
5452cabf7e Update "updated" column on duplicate keys
All checks were successful
continuous-integration/drone/push Build is passing
2020-11-29 22:50:40 +01:00
85ac5fb6f2 Show more internal information about pq error
All checks were successful
continuous-integration/drone/push Build is passing
2020-11-29 22:33:17 +01:00
cae5011ff0 Improve loggin for publishing 2020-11-29 22:22:26 +01:00
bcde001866 Fix typo 2020-11-29 22:19:39 +01:00
925fbfc476 Show date in log times 2020-11-29 22:19:19 +01:00
4ef5b7b2dd Topic and callback should be absolute urls
All checks were successful
continuous-integration/drone/push Build is passing
2019-03-20 00:00:00 +01:00
071bf66721 Fix error in unsubscriber
All checks were successful
continuous-integration/drone/push Build is passing
- wrong error checking
2019-03-19 07:28:32 +01:00
59668090df Clean up publish
All checks were successful
continuous-integration/drone/push Build is passing
2019-03-19 07:24:13 +01:00
fd4ddaf6d6 Fix unsubscribe query
All checks were successful
continuous-integration/drone/push Build is passing
2019-03-19 07:19:01 +01:00
6f05bd0f85 Filter on topic
All checks were successful
continuous-integration/drone/push Build is passing
2019-03-19 07:18:24 +01:00
4e7b11d35a Change placeholders
All checks were successful
continuous-integration/drone/push Build is passing
2019-03-19 07:16:10 +01:00
877addb1fc Remove hub
All checks were successful
continuous-integration/drone/push Build is passing
2019-03-18 23:02:01 +01:00
9761710bd1 Change flags
All checks were successful
continuous-integration/drone/push Build is passing
2019-03-18 22:57:53 +01:00
90cb4bc674 Cleanup more logging
All checks were successful
continuous-integration/drone/push Build is passing
2019-03-18 22:51:22 +01:00
df9bb9396c Add more logging
All checks were successful
continuous-integration/drone/push Build is passing
2019-03-18 22:47:05 +01:00
3c6a5ac4d0 Fix another logging call
All checks were successful
continuous-integration/drone/push Build is passing
2019-03-18 22:13:39 +01:00
2cda6afee9 Fix logging
Some checks failed
continuous-integration/drone/push Build is failing
2019-03-18 22:12:50 +01:00
d58d21d491 Add some logging
Some checks failed
continuous-integration/drone/push Build is failing
2019-03-18 22:11:28 +01:00
07d94a789a Add arguments for database
Some checks failed
continuous-integration/drone/push Build is failing
2019-03-18 22:06:55 +01:00
ec510484d8 Cleanup websub hub (and use postgres) 2019-03-18 21:47:49 +01:00
1aa7ff8d92 Add option for server hostport
All checks were successful
the build was successful
2018-12-10 19:52:36 +01:00
7aa6471696 Cleanup (and re-enable stats)
All checks were successful
the build was successful
2018-12-10 19:39:34 +01:00
309b034180 Merge branch 'master' of https://git.p83.nl/peter/websub-hub 2018-12-10 19:34:30 +01:00
35d8d0d8d8 Add mutexes around saving the files 2018-12-10 19:33:32 +01:00
68d84bdaa3 Disable incStat
All checks were successful
the build was successful
2018-08-05 18:00:15 +02:00
aa257744f0 Disable stats
All checks were successful
the build was successful
2018-08-05 17:53:13 +02:00
f263b04661 Fix loading of stats.json and subscriptions.json
All checks were successful
the build was successful
2018-08-05 17:47:15 +02:00
bd733bac71 Save the contentType before sending it 2018-04-08 00:47:15 +02:00
7e612fd7bc Define postRes 2018-04-08 00:39:07 +02:00
961a653160 Don't overwrite the real request 2018-04-08 00:36:24 +02:00
27f8c9611d Add Accept header to publish request 2018-04-08 00:26:58 +02:00
9baab2fda9 Add Created time to Subscriber 2018-02-11 09:54:07 +01:00
22d75a2da6 Improve handling of hub.lease_seconds 2018-02-11 09:36:41 +01:00
648ba9f84b Log incoming subscription requests 2018-02-11 09:29:32 +01:00
e7df309708 Add stats to debug output 2018-02-10 15:28:41 +01:00
b088f7b9a5 Add address off to decoding/encoding 2018-01-31 16:36:47 +01:00
21aafdd7f1 Add error checking to load/save 2018-01-31 16:35:02 +01:00
4603b565a5 Add logging for missing topic and loading 2018-01-31 16:31:12 +01:00
7e833dbca3 Log load and save 2018-01-31 16:27:53 +01:00
e62711b74a Add logging of publish response 2018-01-31 16:15:40 +01:00
1f9037b3ef Use secret as verify_token 2018-01-31 15:07:26 +01:00
5aa9846b57 Add secret to check 2018-01-31 14:33:08 +01:00
7da531130a Don't send empty leaseSeconds 2018-01-31 14:30:50 +01:00
0bfcd8706f Add more logging and debugging 2018-01-31 14:20:08 +01:00
1db4c3cd28 Show as output 2018-01-30 23:06:05 +01:00
712760d771 Add reply for GET request 2018-01-30 23:03:22 +01:00
09ec4a556e Add validationURL 2018-01-30 21:54:01 +01:00