Peter Stuifzand
6fb4dc6ca8
Publish on hub.url, and answer with a status that means something
...
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
continuous-integration/drone/push Build is passing
2021-10-21 22:50:13 +02:00
6c63ba052b
Add type: docker to .drone.yml
2021-10-21 22:15:27 +02:00
3b2e866f3e
Fix constraint language of subscribe query
continuous-integration/drone/push Build is passing
2020-12-01 19:39:15 +01:00
5452cabf7e
Update "updated" column on duplicate keys
continuous-integration/drone/push Build is passing
2020-11-29 22:50:40 +01:00
85ac5fb6f2
Show more internal information about pq error
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
continuous-integration/drone/push Build is passing
2019-03-20 00:00:00 +01:00
72d161add4
Add unique index for topic and callback
2019-03-19 23:39:05 +01:00
071bf66721
Fix error in unsubscriber
...
continuous-integration/drone/push Build is passing
- wrong error checking
2019-03-19 07:28:32 +01:00
59668090df
Clean up publish
continuous-integration/drone/push Build is passing
2019-03-19 07:24:13 +01:00
fd4ddaf6d6
Fix unsubscribe query
continuous-integration/drone/push Build is passing
2019-03-19 07:19:01 +01:00
6f05bd0f85
Filter on topic
continuous-integration/drone/push Build is passing
2019-03-19 07:18:24 +01:00
4e7b11d35a
Change placeholders
continuous-integration/drone/push Build is passing
2019-03-19 07:16:10 +01:00
877addb1fc
Remove hub
continuous-integration/drone/push Build is passing
2019-03-18 23:02:01 +01:00
9761710bd1
Change flags
continuous-integration/drone/push Build is passing
2019-03-18 22:57:53 +01:00
90cb4bc674
Cleanup more logging
continuous-integration/drone/push Build is passing
2019-03-18 22:51:22 +01:00
df9bb9396c
Add more logging
continuous-integration/drone/push Build is passing
2019-03-18 22:47:05 +01:00
3c6a5ac4d0
Fix another logging call
continuous-integration/drone/push Build is passing
2019-03-18 22:13:39 +01:00
2cda6afee9
Fix logging
continuous-integration/drone/push Build is failing
2019-03-18 22:12:50 +01:00
d58d21d491
Add some logging
continuous-integration/drone/push Build is failing
2019-03-18 22:11:28 +01:00
d75e55ec49
Fix deployment target in .drone.yml
continuous-integration/drone/push Build is passing
2019-03-18 22:08:02 +01:00
07d94a789a
Add arguments for database
continuous-integration/drone/push Build is failing
2019-03-18 22:06:55 +01:00
4c1734095e
Build hubserver
continuous-integration/drone/push Build is failing
2019-03-18 21:55:48 +01:00
6e25373072
Use alpine Dockerfile
continuous-integration/drone/push Build is failing
2019-03-18 21:53:14 +01:00
f53c832859
Cleanup .drone.yml
continuous-integration/drone/push Build is failing
2019-03-18 21:48:05 +01:00
ec510484d8
Cleanup websub hub (and use postgres)
2019-03-18 21:47:49 +01:00
1aa7ff8d92
Add option for server hostport
2018-12-10 19:52:36 +01:00
7aa6471696
Cleanup (and re-enable stats)
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
2808530540
Fix typo in .drone.yml
2018-08-05 18:03:55 +02:00
b8dc97ff86
Build from git.p83.nl
2018-08-05 18:03:06 +02:00
68d84bdaa3
Disable incStat
2018-08-05 18:00:15 +02:00
aa257744f0
Disable stats
2018-08-05 17:53:13 +02:00
f263b04661
Fix loading of stats.json and subscriptions.json
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