343 Commits

Author SHA1 Message Date
Yonle
98469a4521 package.json: bump revision to 3 for 3.0.2
Signed-off-by: Yonle <yonle@lecturify.net>
3.0.2-3
2024-05-24 20:19:28 +07:00
Yonle
d9d3b784d5 http page: handle x-forwarded-proto properly
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-24 13:35:38 +07:00
Yonle
014d4692cd bouncer connection to relays: tell ConnID in header
This commit will expose ConnID in User-Agent HTTP Header on connection to upstream
relays. The ConnID is only an random string that only the bostr admin
knows what IP it does belong. This random string is always changing and
will never give the same ID on every single connections, So please do
not take this to be a similiar thing like X-Real-IP.

The ConnID won't reveal client IP to upstream relay due to how the
bouncer technically works, But it will help on both parties to finding the
culprit.

Only the respective bostr owner / admin know what IP does this ConnIDs
belong.

- To report an suspected service abuse, Contact to the bostr admin.
  Make sure that you send atleast more than a single log of ConnID.
  Please remember that these ConnIDs is not always the same.
  So sending more log about ConnIDs will help bostr admin to figure out
  the culprit.

- For bostr admins, Finding out the culprit is easy.
  In your bostr log:

  1 --- xxx.xxx.xxx.xxx is now using session 171629xxxxxxx_1_0.503985444xxxxxxx
               ^                                             ^
               |                                             |
            Culprit                                        ConnID

Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-21 18:32:12 +07:00
Yonle
b99795f9d8 worker: do not reconnect to cache relays/loadbalancer bouncers if status code ix 4xx
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-21 16:32:07 +07:00
Yonle
6d50753390 package.json: bump revision 2 for 3.0.2
Signed-off-by: Yonle <yonle@lecturify.net>
3.0.2-2
2024-05-20 13:29:03 +07:00
Yonle
845aa5b3cc worker: fix bug where subscription limit is not being handled properly
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-20 13:16:53 +07:00
Yonle
2582700e57 defaultconf comment: add some note for <max_conn_per_ip>
Signed-off-by: Yonle <yonle@lecturify.net>
3.0.2-1
2024-05-20 06:37:08 +07:00
Yonle
83e4b384b9 README: Remove some words
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-20 06:36:45 +07:00
Yonle
d140da9812 package.json: bump 3.0.2 revision 1
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-20 06:19:44 +07:00
Yonle
14efdaf830 http & worker: handle max_client_subs properly
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-19 23:33:36 +07:00
Yonle
793bd71c66 http page: "mobile bandwidth usage" instead of "mobile data usage". this is minor
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-19 23:25:29 +07:00
Yonle
ee9c7de778 defaultconf comment: word grammar fix
Signed-off-by: Yonle <yonle@lecturify.net>
3.0.2
2024-05-19 23:20:43 +07:00
Yonle
1df2ad13db config: max_conn_per_ip for limiting maximum incomming connections per IP.
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-19 23:12:44 +07:00
Yonle
efc555e7a1 package.json: bump package version & set version as 3.0.2
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-19 23:00:16 +07:00
Yonle
2ea8f5bc98 code: add some code that does not have "use strict" being set
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-19 22:53:59 +07:00
Yonle
e55cf9025e http page: Add breakline.
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-19 22:44:09 +07:00
Yonle
9972bfdc01 http page: add welcome
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-19 22:37:02 +07:00
Yonle
43fbee2b36 README: update explanation
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-19 22:36:34 +07:00
Yonle
5af6d58e21 http page: tell about Administrator contact
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-19 22:03:24 +07:00
Yonle
f7cc855fe3 comm: User-Agent: Tell the contact address in User-Agent
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-19 22:01:13 +07:00
Yonle
55cd043b6e bouncer.js: try not send another AUTH after rejecting request due to unauthorized access
Signed-off-by: Yonle <yonle@lecturify.net>
3.0.1
2024-05-16 19:36:17 +07:00
Yonle
2d5f953d3f http.js: fix perMessageDeflate websocket compression still enabled
despite it's being disabled in config.

Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-16 19:33:09 +07:00
Yonle
1a3bac81b5 code: internal auth handling: improve the way of how it works
- Try not to renew ${authKey} variable after auth
- Call _auth() only after ${authenticated} and ${!sessStarted} is passed
  (_auth() is for telling the worker thread the authenticated user
  pubkey)
- In worker_bouncer.js, If csess[m.id].pubkey === m.pubkey, We do not
  need to do another reAUTH to these relays.

Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-16 18:45:55 +07:00
Yonle
02d58cfba3 package.json: set version to 3.0.1
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-16 18:35:08 +07:00
Yonle
8665374a66 fix authorized_keys don't work on npub string & make private_keys accept npub string
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-16 18:34:07 +07:00
Yonle
34ab5f6013 http.js: fix regex & method of getting websocket URLs from bouncer
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-13 16:36:52 +07:00
Yonle
396bd3f7bb fix code at commit 649c425
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-13 07:09:17 +07:00
Yonle
4848e1d0a7 defaultconf comment: fix typo for a4adf49 2024-05-13 06:39:21 +07:00
Yonle
a4adf49738 defaultconf comment: add both note and attention for loadbalancer section 2024-05-13 06:36:12 +07:00
Yonle
649c425e42 http.js: try fetch loadbalancers relay list
Ref: https://github.com/Yonle/bostr/issues/19

Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-13 06:33:56 +07:00
Yonle
b420125e63 defaultconf comment: eose_timeout is no longer available
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-12 21:16:30 +07:00
Yonle
88cb575ee4 bostr_cli: change missing field check text
Signed-off-by: Yonle <yonle@lecturify.net>
3.0.0
2024-05-12 16:11:51 +07:00
Yonle
33e17b23d7 testworker: try use different sid for test
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-12 16:11:31 +07:00
Yonle
dc96f87515 code comments: remove some old comments and try improve some existing one
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-12 16:07:38 +07:00
Yonle
b6f490ab4a defaultconf comment: another explanation for max_known_events
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-12 11:59:52 +07:00
Yonle
9cba4108ba cli: add testworker
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-12 10:10:56 +07:00
Yonle
5375f98241 http.js: if there's no config.perMessageDeflate, default it to true
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-12 10:02:31 +07:00
Yonle
167d0d8927 defaultconf comment: The CPU usage may equally intensive even with deflate compression disabled. So removing the comment
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-12 08:14:32 +07:00
Yonle
e5a5c78ad6 defaultconf: set perMessageDeflate as on
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-12 08:08:40 +07:00
Yonle
ab98804bdd defaultconf: set max_known_events default as 5000
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-11 19:06:22 +07:00
Yonle
7e54d9a209 bouncer: fix duplicates being forwarded to client.
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-11 19:04:15 +07:00
Yonle
1e235a94d0 README: small fix of text
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-11 18:03:49 +07:00
Yonle
65cddf8030 bouncer: trigger EOSE according to max_known_events value if available
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-11 14:07:35 +07:00
Yonle
63a653ae51 conf & bouncer: introducing max_known_events configuration
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-11 13:44:25 +07:00
Yonle
c8dfe77fc8 bouncer: forgot to tell the ident that worker should delete
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-11 13:12:39 +07:00
Yonle
32c6a93370 deps: add optional package for another speed: utf-8-validate
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-11 12:11:52 +07:00
Yonle
82689f7c50 deps: need more speed? there you go. bufferutil for ws dep
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-11 12:01:05 +07:00
Yonle
62c79c1180 bouncer: bugfix of EVENT write did not work due to lack of allowed_publishers check.
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-11 11:35:09 +07:00
Yonle
e8c5abedfd bouncer: just don't leave every single orphan unresolved Promises being lonely in memory
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-11 11:19:00 +07:00
Yonle
bd425a9e5a bouncer: just poke ready function if session is already prepared
Signed-off-by: Yonle <yonle@lecturify.net>
2024-05-11 11:01:53 +07:00