3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-11 06:29:29 +01:00
Commit Graph

532 Commits

Author SHA1 Message Date
Shivaram Lingamneni
1fb9bd7208 Fix a bug in 330 RPL_WHOISACCOUNT
According to https://defs.ircdocs.horse/defs/numerics.html, 330 RPL_WHOISACCOUNT
takes 4 parameters: `<client> <nick> <authname> :<info>`. We were omitting
the second parameter (the target nick).

Also refactor locking.
2018-08-17 11:45:32 -04:00
Shivaram Lingamneni
cbc2b07d35 Merge remote-tracking branch 'origin/master' into passhashing.2 2018-08-15 13:02:05 -04:00
Shivaram Lingamneni
578ca2fdf6 add support for service command aliases 2018-08-06 10:08:58 -04:00
Shivaram Lingamneni
3c12fb6254 fix #283 (remove unnecessary log.Fatal)
The server should never crash during rehash, even if the config is invalid.
2018-08-06 10:08:58 -04:00
Shivaram Lingamneni
dfb0a57040 refactor the password hashing / password autoupgrade system 2018-08-06 02:26:21 -04:00
Shivaram Lingamneni
1383190249 refactor rehash to rely more on server.config 2018-07-16 03:46:40 -04:00
Shivaram Lingamneni
2a33c1483b atomic bitset implementations of caps.Set and modes.ModeSet 2018-06-25 18:17:47 -04:00
Shivaram Lingamneni
31f386f5a9 add CHANSERV UNREGISTER 2018-06-04 05:02:22 -04:00
Daniel Oaks
45b8d9e6fa Update snomask to work with HOPM 2018-05-29 03:21:48 +10:00
Daniel Oaks
de7b679fc5
Merge pull request #247 from slingamn/vhosts.3
initial vhosts implementation, #183
2018-05-19 08:51:16 +10:00
Shivaram Lingamneni
ebfef1e848 add Semaphore and ServerSemaphores 2018-04-26 06:03:10 -04:00
Shivaram Lingamneni
74fa58dda0 Merge remote-tracking branch 'origin/master' into vhosts.4 2018-04-23 21:46:12 -04:00
Shivaram Lingamneni
cc9941cb07 review fixes, bug fixes 2018-04-23 02:38:35 -04:00
Shivaram Lingamneni
fad2475c3f modes refactor, #255 2018-04-22 19:36:15 -04:00
Daniel Oaks
4a17eadbce
Merge pull request #246 from slingamn/db_autoupgrade.1
implement database auto-upgrades (#243)
2018-04-22 13:39:41 +10:00
moocow
744ad2ce0b Stats for LUSERS logic now seperated, fixed params in LUSERS 2018-04-20 22:48:15 +02:00
Shivaram Lingamneni
5e62cc4ebc initial vhosts implementation, #183 2018-04-19 03:00:56 -04:00
Daniel Oaks
40d6cd02da Fix whois channel handling 2018-04-18 01:11:12 +10:00
Shivaram Lingamneni
69fd3ac324 implement database auto-upgrades (#243) 2018-04-16 16:35:01 -04:00
Daniel Oaks
9e8920394f Only display modestring on connect if it's set 2018-04-09 16:37:06 +10:00
Daniel Oaks
ab6cd599b2 Fix name of ISUPPORT token (REGCOMMANDS -> ACCCOMMANDS) 2018-04-01 12:04:25 +10:00
Daniel Oaks
5cbd4d1de2 Force help entries for every ChanServ command as well 2018-04-01 11:54:49 +10:00
Daniel Oaks
7b8c4e7e91 Refactor nickserv.go to better support NS HELP and translations 2018-04-01 11:22:06 +10:00
Shivaram Lingamneni
7cfa75a59e
Merge pull request #218 from slingamn/socketwriter.1
refactor irc.Socket
2018-03-28 13:26:03 -04:00
Shivaram Lingamneni
65f2e95d2b
Merge pull request #222 from slingamn/fakelag.3
implement fakelag (#189)
2018-03-28 13:25:49 -04:00
Shivaram Lingamneni
1bf5e2a7c8 implement fakelag (#189) 2018-03-22 11:04:21 -04:00
Shivaram Lingamneni
a8b952da77 store maxSendQBytes in a uint32 to avoid alignment problems
The sync.atomic documentation says:

"On both ARM and x86-32, it is the caller's responsibility to arrange
for 64-bit alignment of 64-bit words accessed atomically."
2018-03-19 00:24:20 -04:00
Shivaram Lingamneni
2885b37768 partial fix for #217
See discussion on issue; this might not be a complete fix but it's
definitely better than the current behavior.
2018-03-18 00:12:50 -04:00
Shivaram Lingamneni
d1f5c59eef fix #190 2018-03-17 23:26:07 -04:00
Shivaram Lingamneni
211ed6af99 add an option to expose a pprof http endpoint 2018-03-13 16:55:30 -04:00
Shivaram Lingamneni
54123ef9a2 clear failed nick assignments to avoid confusion 2018-02-27 05:22:01 -05:00
Shivaram Lingamneni
be86684e96 implement #199 2018-02-26 22:48:52 -05:00
Daniel Oaks
04d7792ed2
Merge pull request #195 from slingamn/stopevent
clean up stopEvent (requires go v1.10)
2018-02-23 07:49:22 -08:00
Daniel Oaks
25f8b15232
Merge pull request #194 from slingamn/issue192.1
fix #192
2018-02-19 14:54:03 +10:00
Shivaram Lingamneni
02161184cf clean up stopEvent (requires go v1.10) 2018-02-18 23:18:32 -05:00
Shivaram Lingamneni
5b636371a9 fix SASL enable-disable logic 2018-02-18 22:15:43 -05:00
Shivaram Lingamneni
ced3a17cd3 fix #192 2018-02-18 21:52:39 -05:00
Shivaram Lingamneni
988cb22692 changes to nick reservation
* Clients are now renamed, not disconnected, on reservation timeout
* Nick reservation config is now its own subsection
2018-02-18 04:46:14 -05:00
Shivaram Lingamneni
ad73d68807 refactor account registration, add nick enforcement 2018-02-11 05:30:40 -05:00
Daniel Oaks
e0fa97d344 Get labeled-reply working just fine 2018-02-06 00:21:08 +10:00
Daniel Oaks
3680a3fe9a Merge 2018-02-04 21:32:48 +10:00
Daniel Oaks
2419f69879 Move all errors into errors.go 2018-02-03 22:03:36 +10:00
Daniel Oaks
2ecec25d28 Misc refactoring 2018-02-03 21:15:07 +10:00
Daniel Oaks
3634d0601e Split modes into a subpackage (this is painful, but will force us to simplify and improve the API for interacting with modes) 2018-02-03 20:21:32 +10:00
Daniel Oaks
afd6ca610c Split language into a subpackage 2018-02-03 19:46:14 +10:00
Daniel Oaks
1b14230758 ...fix info string, how did that get messed up? 2018-02-03 19:30:23 +10:00
Daniel Oaks
47d2ce351c Centralise all command handlers in handlers.go 2018-02-03 19:28:02 +10:00
Shivaram Lingamneni
2a7f055ef3 support unix domain sockets 2018-02-01 16:19:07 -05:00
Shivaram Lingamneni
bec39ee8cb log new listener creation 2018-02-01 15:53:44 -05:00
Daniel Oaks
07fc902b21 Labeled-Response 2018-01-28 00:40:34 +10:00
Daniel Oaks
fc9b501a77 Show translator names in INFO 2018-01-25 19:51:02 +10:00
Daniel Oaks
c5a6d22192 Hopefully apply new languages better, esp. during rehash 2018-01-23 21:27:15 +10:00
Daniel Oaks
638b0c03fc Better translate HELP entries and indexes 2018-01-23 21:17:14 +10:00
Daniel Oaks
099fd7c08f Update translation backend stuff a little more 2018-01-23 17:22:39 +10:00
Daniel Oaks
1a5ff05493 Update translation framework 2018-01-23 16:50:19 +10:00
Daniel Oaks
75dcff7183 Update translation framework, add badge to readme 2018-01-23 15:06:55 +10:00
Shivaram Lingamneni
7edd9032d3 remove newConns channel 2018-01-22 13:51:25 -05:00
Shivaram Lingamneni
62fc2c0cc3 remove Server.commands 2018-01-22 13:47:57 -05:00
Daniel Oaks
090095b2b9 Set default client language when creating them 2018-01-22 21:30:28 +10:00
Daniel Oaks
275227a461 Make like every client-facing string translatable 2018-01-22 21:26:01 +10:00
Daniel Oaks
0569b5cfaa RESUME: Fix a few bugs, play modestrings 'n' all 2018-01-22 20:55:20 +10:00
Daniel Oaks
f8b39cfe61 Send fake channel joins on RESUME 2018-01-22 17:58:10 +10:00
Daniel Oaks
0d5327de8a Fix some issues, add RPL_WHOISACCOUNT 2018-01-22 17:57:38 +10:00
Daniel Oaks
ac99e82192 Fix build issues 2018-01-22 17:57:38 +10:00
Daniel Oaks
d09f085b1a Add very initial RESUME cap and command 2018-01-22 17:57:38 +10:00
Daniel Oaks
e99f22488f Make LANGUAGE support work 2018-01-22 17:30:31 +10:00
Daniel Oaks
a7fdade41d Extend to include example translation stuff 2018-01-21 16:49:17 +10:00
Daniel Oaks
3b3c1c733a Support bot mode +B 2018-01-07 12:56:51 +10:00
Daniel Oaks
3ba8af714e Use base 36 when generating message IDs, gives us full 0-9a-z to use while preserving uniqueness nicely 2018-01-04 00:21:35 +10:00
Daniel Oaks
63bd52d471 Make message IDs much shorter (thanks @prawnsalad!) 2018-01-04 00:13:32 +10:00
Daniel Oaks
197ab520bf Change casemapping name and advertisement to match new spec 2017-12-26 12:30:04 +10:00
Shivaram Lingamneni
52b0fb71e7 refactor ClientManager 2017-11-22 05:09:38 -05:00
Daniel Oaks
dedb029272 DLINE: Save name of the banning oper 2017-11-19 10:27:40 +10:00
Daniel Oaks
8036df92fc WHO: Require first param, matching other servers 2017-11-19 10:10:10 +10:00
Shivaram Lingamneni
d4cb15354f remove registeredChannelsMutex
This moves channel registration to an eventual consistency model,
where the in-memory datastructures (Channel and ChannelManager)
are the exclusive source of truth, and updates to them get persisted
asynchronously to the DB.
2017-11-08 22:24:33 -05:00
Shivaram Lingamneni
9b74c47b74 rename some getters
Rename getters in conformance with the "Effective Go" styleguide recommendation:
https://golang.org/doc/effective_go.html#Getters
2017-11-03 02:36:55 -04:00
Shivaram Lingamneni
94cf438f51 remove channelJoinPartMutex 2017-10-30 05:21:47 -04:00
Daniel Oaks
d715abf0f0 Add the INFO command 2017-10-29 07:59:56 +00:00
Daniel Oaks
c6b6a25906 Merge remote-tracking branch 'slingmann/recovery' 2017-10-29 04:37:57 +00:00
Shivaram Lingamneni
7b58bf76ef make error recovery configurable 2017-10-26 04:19:01 -04:00
Shivaram Lingamneni
fa83ccd82b refactor synchronization for Channel 2017-10-22 19:50:16 -04:00
Daniel Oaks
8910dc59ee Fix KLINE quit/error message and corrects comment on Client.Quit 2017-10-16 10:48:05 +10:00
Shivaram Lingamneni
e540fde816 refactor idle timeouts 2017-10-15 19:46:25 -04:00
Daniel Oaks
34987ba53a Allow WEBIRC from specified hosts 2017-10-15 16:18:14 +10:00
Daniel Oaks
2791476f16 INVITE: Fix dumb crash (thanks for pointing this out, @josephbisch!) 2017-10-10 11:17:41 +10:00
Shivaram Lingamneni
d66470f1c4 review fix: rename various packages and objects 2017-10-09 17:38:06 -04:00
Shivaram Lingamneni
58faad90dd add loglines for IP limits 2017-10-09 13:24:12 -04:00
Shivaram Lingamneni
ac9ac5ef19 create separate irc/connection_limiting package 2017-10-09 13:24:12 -04:00
Shivaram Lingamneni
a2ac4eeef9 refactor limits and throttling 2017-10-09 13:24:12 -04:00
Daniel Oaks
695faefd93 Allow formatting codes in the MOTD 2017-10-08 20:17:49 +10:00
Daniel Oaks
d4a8984e63 Initial implementation of labeled-responses for WHOIS 2017-10-08 11:05:05 +10:00
Daniel Oaks
68b1dc9e72 Split passwd into its' own subpackage 2017-10-06 00:03:53 +10:00
Daniel Oaks
207c1074df Split utils out to a separate subpackage 2017-10-05 23:47:43 +10:00
Daniel Oaks
4aa52956e5 Split isupport to its' own subpackage 2017-10-05 23:39:57 +10:00
Daniel Oaks
eac6a69782 Fix some notes and add some comments. 2017-10-05 23:29:34 +10:00
Shivaram Lingamneni
456174ed53 review fixes for raw i/o notification 2017-10-05 21:06:22 +10:00
Shivaram Lingamneni
aff1752d67 refactor logging to implement #142 2017-10-05 21:05:57 +10:00
Daniel Oaks
f7f049973f Rip out REST API and web interface.
It's not really used and I'd rather not have it here unless I'm able to actively maintain it properly and build out the web interface.

I might re-add it later but for now I'd rather not have it unless anyone's actively using it.
2017-10-05 17:14:16 +10:00
Shivaram Lingamneni
26686d7e86 refactor monitor and /oper implementations 2017-10-04 01:19:27 -04:00
Shivaram Lingamneni
23a66fa502 fix various data races, including 2 introduced by #139 2017-10-02 04:42:50 -04:00
Daniel Oaks
275449e6cc caps: Move most capability-handling types into the caps package 2017-09-29 17:25:58 +10:00
Daniel Oaks
9bfdc4fdfb Move caps to their own package to prevent conflicts 2017-09-29 12:07:52 +10:00
Daniel Oaks
830484feb6 AWAY: Send correct mode string (thanks for pointing out this silly bug @jwheare!) 2017-09-29 11:56:18 +10:00
Daniel Oaks
ffe7375a68 Fix proxied DLINE/throttle/etc error messages 2017-09-29 07:18:08 +10:00
Shivaram Lingamneni
a9e4ed237e deduplicate d-line and throttle code 2017-09-29 07:05:59 +10:00
Daniel Oaks
8b1f722655 server: Fix the PROXY command 2017-09-29 07:05:22 +10:00
Shivaram Lingamneni
b7b24c34b4 rehash cannot modify the server name 2017-09-28 02:58:09 -04:00
Shivaram Lingamneni
3b0f1ff1cc delete websocket support as per discussion on #139 2017-09-28 02:53:08 -04:00
Shivaram Lingamneni
e8b1870067 refactor the rehash implementation 2017-09-28 02:13:24 -04:00
Daniel Oaks
cd8b4877b6 accounts: Check for account logins correctly, fixes registration. Also fix a typo, thanks squigz! 2017-09-28 15:49:01 +10:00
Daniel Oaks
3b0d9c4db9 Send nick parameter correctly on ERR_NOSUCHNICK numerics 2017-09-26 07:52:43 +10:00
Daniel Oaks
e95c75f87d monitor: Fix a crash around the MONITOR command 2017-09-25 11:29:27 +10:00
Daniel Oaks
acec0e1690 PROXY: Check DLINEs and connection limits/throttle on new proxied connections 2017-09-25 10:52:02 +10:00
Daniel Oaks
38498b752b PROXY: Make sure given IPs are valid and pass them through appropriately 2017-09-25 10:52:01 +10:00
Daniel Oaks
7d140c9e43 PROXY: Update some comments, disallow from registered clients 2017-09-25 10:52:01 +10:00
Shivaram Lingamneni
99f02ede20 restore PROXY protocol support
support for PROXY was removed in 43e28e2fef. After discussion,
it's worth keeping around in case of client compatibility issues,
and until /rehash support is more mature.
2017-09-25 10:52:01 +10:00
Daniel Oaks
8cd016e4c0 server: Fix comments 2017-09-25 10:52:01 +10:00
Shivaram Lingamneni
0f0f2d1314 refactor listener update/destroy code
Don't close and reopen listeners
2017-09-11 18:40:15 -04:00
Shivaram Lingamneni
d5528f6e56 execute rehash() in its own goroutine
This prevents a deadlock:

1. rehash() is executing on the main goroutine
2. it's trying to stop a listener goroutine
3. the listener goroutine needs to hand off a new connection to newConns
4. but the main goroutine is blocked by rehash() so it can't receive it
2017-09-11 14:03:53 -04:00
Shivaram Lingamneni
b1376d5f71 Fix a concurrency error with Server.listeners
See #134; there was a `fatal error: concurrent map read and map write`
due to unsynchronized accesses to `Server.listeners`. Now, `listeners`
is only accessed by `NewServer` and `rehash`, so it doesn't need
synchronization.
2017-09-11 11:29:14 -04:00
Shivaram Lingamneni
333afe1062 make default channel modes configurable 2017-09-06 17:37:29 -04:00
Daniel Oaks
f9ef97b204 modes: Add experimental, untested +R user mode to block messages from unregistered users 2017-09-06 14:38:54 +10:00
Daniel Oaks
97cfc0b629 Print warnings to heavily encourage exposing port 6697 as a TLS port 2017-07-27 23:29:08 +10:00
Euan Kemp
2b155f9b1e server: close connection on parse-ip failure
Close the client's connection if we're unable to parse their IP.

This also simplifies the check to reduce indentation by a level.

Finally, this replaces the two-var construction of the pseudo-const
messages with an inline dereference via a slice to allow constructing
them less noisily.
2017-07-25 22:19:40 -07:00
Daniel Oaks
b807f492ed OPER: If client's already opered-up, ignore new OPER attempts 2017-07-23 22:50:50 +10:00
Daniel Oaks
23a26f83fe client: Show real IP and whether the target's using TLS in WHOIS 2017-06-23 05:15:10 +10:00
Daniel Oaks
c9ed749538 Rename deps 2017-06-15 10:14:19 -06:00
Daniel Oaks
a8fa131244 Move to new repo 2017-06-14 12:00:53 -06:00
Daniel Oaks
309ec8191e Add 'k' snomask for kills (including those coming from dlines and klines) 2017-06-11 10:01:39 -06:00
Daniel Oaks
8a6ba6f9cc LIST: Start implementing ELIST conditions 2017-06-11 07:45:58 -06:00
Daniel Oaks
34863a6320 JOIN: Disable JOIN 0 support, in line with Insp 2017-06-10 17:03:23 -06:00
Daniel Oaks
4128ff6137 server: Check for channel permissions when renaming channels 2017-06-04 20:06:11 -06:00
Daniel Oaks
0f8ab4eaec server: Add proposed RENAME command 2017-06-04 20:01:37 -06:00
Daniel Oaks
53190ef131 Send a whole lot more snomasks 2017-05-28 12:43:09 -06:00
Daniel Oaks
ebb9d629d7 xline: Add ANDKILL param to kill all matching clients 2017-05-24 00:58:36 -06:00
Daniel Oaks
d847d55c06 Fix wordWrap function so it doesn't drop chars, and fix client.Notice() to automagically split very long lines. 2017-05-09 21:09:44 +10:00
Daniel Oaks
9fe7c143c8 server: Remove useless comments, make idle/quit function layouts nicer 2017-05-09 20:37:48 +10:00
Daniel Oaks
fd793d6adb Add very initial snomasks 2017-05-08 09:15:16 +10:00
Daniel Oaks
1afd3b8f78 server: Change localconnect msg to include username/realname 2017-05-01 19:03:04 +10:00
Daniel Oaks
51425b7764 help: Generate index of help topics 2017-04-30 13:53:49 +10:00
Daniel Oaks
2bd4d03ecc Prevent copying locks because that's silly 2017-04-30 11:12:25 +10:00
Daniel Oaks
f665ebac16 channels: Help prevent issues when join/parting 2017-04-18 17:19:44 +10:00
Daniel Oaks
e0035dfa04 types: Make ChannelNameMap use mutexes to fix crash 2017-04-17 21:03:02 +10:00
Daniel Oaks
0046025d60 Enable chanmode +r, fix bug with registering channels 2017-03-28 17:32:03 +10:00
Daniel Oaks
317a804644 Fix dates at top of source files 2017-03-27 22:15:02 +10:00
Daniel Oaks
451c40f170 WHO: Fix a small hang 2017-03-27 14:30:00 +10:00
Daniel Oaks
70b7606996 config: Allow enabling/disabling channel reg 2017-03-24 12:52:38 +10:00
Daniel Oaks
6842d2ead6 Merge master 2017-03-24 12:29:13 +10:00
Daniel Oaks
05074e966d modes: Continue overhauling 2017-03-24 12:23:21 +10:00
Daniel Oaks
f29a5f0e70 socket: Very initial SendQ limit 2017-03-14 08:12:39 +10:00