Commit Graph

101 Commits

Author SHA1 Message Date
Shivaram Lingamneni de005ee69f enhanced auth integrations (#2383)
* Harvest cookies from the initial websocket handshake to pass to an
  auth-script (#2185)
* Allow running auth-script and ip-check-script over unix domain socket
  (#2280)
2026-04-15 01:48:29 -04:00
Shivaram Lingamneni 76e8e61705 fix #2227 (#2334)
* fix #2227

Instead of returning an error from Accept(), force the caller to process
errors from trying to read and parse the PROXY protocol.

The advantage here is that we don't have to rely on (net.Error).Temporary
or incur timed backoff from net/http when hitting these errors. However,
we still risk stalling processing of new incoming connections if someone
opens a connection to the proxy listener and doesn't send anything.
This is hard to fix while maintaining the net.Listener abstraction in
cooperation with http.Server.

* reduce proxy deadline to 5 seconds
2026-03-02 04:10:26 -05:00
Shivaram Lingamneni 6ba60c89c4 move mysql serialization tools to shared pkgs 2025-12-30 23:34:05 -05:00
thatcher-gaming 4dcbc48159 metadata-2 (#2273)
Initial implementation of draft/metadata-2
2025-06-15 04:06:45 -04:00
Shivaram Lingamneni 36e5451aa5 implement draft/webpush (#2205) 2025-01-13 21:47:21 -05:00
Shivaram Lingamneni f77d430d25 use maps.Clone from go1.21 2023-08-15 20:57:52 -04:00
Shivaram Lingamneni 28d9a7ff63 use slices.Contains from go1.21 2023-08-15 20:55:09 -04:00
Shivaram Lingamneni b3abd0bf1d use slices.Reverse from go1.21 2023-08-15 20:45:00 -04:00
Shivaram Lingamneni 60af8ee491 clean up force-trailing logic 2023-06-02 02:58:09 -04:00
Shivaram Lingamneni eeec481b8d tweaks to NAMES implementation (#2058)
* tweaks to NAMES implementation

* tweak member caching

* add a benchmark for NAMES
2023-04-14 02:15:56 -04:00
Shivaram Lingamneni db0910d82d fix linter error
See #2052
2023-03-04 23:29:16 -08:00
Shivaram Lingamneni 4317016a09 Merge pull request #2028 from slingamn/channels_taketwo.1
refactor of channel persistence to use UUIDs
2023-01-15 08:01:37 -08:00
Shivaram Lingamneni 3ceff6a8b1 make ReloadableListener lock-free
Also stop attaching the *tls.Config to the wrapped connection,
since this forces it to be retained beyond its natural lifetime.
2023-01-05 20:18:14 -05:00
Shivaram Lingamneni 7ce0636276 refactor of channel persistence to use UUIDs 2023-01-04 05:06:21 -05:00
Shivaram Lingamneni a052b82c78 don't reference SIGUSR1 on windows (#2018) 2022-12-18 00:15:55 -05:00
Shivaram Lingamneni d17faf6bcb fix #1975
Provide a nondestructive stack trace dump option even when the http pprof
listener is disabled
2022-12-10 22:15:37 -08:00
Shivaram Lingamneni e20c983b57 fix #2002 (#2003)
* fix #2002

`CS AMODE #channel +f nickname` is invalid, but was being accepted
incorrectly.

* simplify logic
2022-11-06 14:41:29 -05:00
Shivaram Lingamneni a99c8a42f9 remove utils.ConfigStore in favor of atomic.Pointer[T] 2022-08-03 00:59:00 -04:00
Shivaram Lingamneni 5b72cd8622 apply go1.19 gofmt 2022-08-03 00:54:50 -04:00
Shivaram Lingamneni 34ad3a2dc1 ConfigStore: clarify intended use 2022-05-03 23:27:24 -04:00
Shivaram Lingamneni c603d41d08 genericize atomic config changes 2022-05-03 11:12:11 -04:00
Shivaram Lingamneni 2df5fb1956 use genericized slice-reversing function 2022-04-29 13:39:11 -04:00
Shivaram Lingamneni a549827f17 upgrade to go 1.18, use generics 2022-03-30 00:44:51 -04:00
Shivaram Lingamneni 5bbee02fe6 fix #1676
Fix various pagination issues with CHATHISTORY; also undo #491
(msgid munging).
2021-10-29 04:50:24 -04:00
Shivaram Lingamneni b0f412538c move signals code to utils/ 2021-09-19 04:02:44 -04:00
Shivaram Lingamneni e0e4791f72 factor out some shared code 2021-09-18 21:28:16 -04:00
Shivaram Lingamneni 492109f29d upgrade go to 1.17 2021-08-20 15:59:26 -04:00
Shivaram Lingamneni 5b33cd436f remove unnecessary indirection in semaphore 2021-04-07 08:44:17 -04:00
Shivaram Lingamneni 549d06bc98 simplify semaphore release code 2021-04-07 08:33:19 -04:00
Shivaram Lingamneni 430b40fc2f upgrade go to 1.16
Fixes #1510
2021-02-17 15:14:53 -05:00
Shivaram Lingamneni ec375f5bdc consolidate ArgsToStrings 2020-12-30 00:41:34 -05:00
Shivaram Lingamneni 7bdbb01238 fix #1428
Tor listeners should never see an STS cap.

Add an undocumented 'hide-sts' key for listeners that hides the STS cap.
This can be used if the listener is secured at layer 3 or 4 (VPNs,
E2E mixnets). It will be necessary to add the relevant IPs to `secure-nets`.
2020-12-05 23:06:23 -05:00
Shivaram Lingamneni db100f1f91 Merge pull request #1231 from slingamn/buffer.2
more memory-efficient implementation of line reading
2020-11-30 02:34:25 -08:00
Shivaram Lingamneni ec15d367ba fix #1387
Instead of building a new serialized message for each recipient,
try to cache them.
2020-11-27 00:13:47 -05:00
Shivaram Lingamneni c57828eb62 documentation updates for proxy v2 2020-11-19 17:01:56 -05:00
Shivaram Lingamneni 3062f97c2b fix #1389
Support PROXY protocol v2, including ahead of plaintext connections
2020-11-19 12:31:58 -05:00
Shivaram Lingamneni dc456bd6a4 refactor schema versions to be ints, not strings 2020-10-27 12:26:44 -04:00
Shivaram Lingamneni 475d7ba418 fix non-linux builds 2020-09-29 15:22:12 -04:00
Shivaram Lingamneni f12384c5a6 Output unix socket credentials where applicable
thanks @ajaspers!
2020-09-24 10:59:30 -04:00
Shivaram Lingamneni bcdf61bd7a fix #1284 2020-09-24 02:44:12 -04:00
Shivaram Lingamneni 1a9f501383 fix #414 2020-09-23 02:25:29 -04:00
Shivaram Lingamneni 0073b98505 fix (*http.Server).Serve() exiting on ErrBadProxyLine
anything other than a (net.Error) with Temporary() == true
is treated as a fatal error that causes the http server to exit
2020-09-16 06:12:27 -04:00
Shivaram Lingamneni c78253fd93 more memory-efficient implementation of line reading 2020-08-07 01:10:46 -04:00
Shivaram Lingamneni df8be72c6f move StringSet to utils package 2020-08-04 21:54:03 -04:00
Shivaram Lingamneni 00e2c2816b use strings.Builder instead of bytes.Buffer where applicable 2020-06-08 23:38:10 -04:00
Alex Jaspersen 2cb91bab04 Fix issue with one-character args in ArgsToStrings. 2020-05-30 15:45:43 +00:00
Shivaram Lingamneni 2f20034bb7 fix TAGMSG playback
1. TAGMSG were incorrectly being considered multilines, because
   Is512() was checking the wrong thing
2. Playback of TAGMSG should depend on event-playback, not on message-tags
2020-05-22 12:07:53 -04:00
Shivaram Lingamneni 8efbc4bc32 maintain lenBytes as a running count 2020-05-14 22:16:34 -04:00
Shivaram Lingamneni 2779fe7c10 fix #1005 2020-05-14 12:58:49 -04:00
Shivaram Lingamneni d092f6b330 explanatory comment for CompileMasks 2020-05-13 10:07:54 -04:00