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

545 Commits

Author SHA1 Message Date
Jeremy Latt
fa5b1e6cf7 Merge pull request #9 from jlatt/gcfg
switch from JSON to gcfg config files
2014-03-05 23:02:22 -08:00
Jeremy Latt
04bb79a610 fix invite message to clients 2014-03-05 22:55:22 -08:00
Jeremy Latt
d6688a3047 allow | in nicks 2014-03-02 13:10:47 -08:00
Jeremy Latt
0874692aa8 send proper replies for cap protocol 2014-03-02 12:54:48 -08:00
Jeremy Latt
92e7a7961f notify on more signals 2014-03-02 11:51:29 -08:00
Jeremy Latt
fa165a9d74 Merge remote-tracking branch 'origin/master' into gcfg
Conflicts:
	ergonomadic.go
	irc/config.go
	irc/server.go
2014-03-02 11:42:43 -08:00
Jeremy Latt
2340464265 Merge pull request #10 from jlatt/cleanup
cleanup
2014-03-02 11:37:06 -08:00
Jeremy Latt
6aa6f0aeaa notify clients when the server shuts down 2014-03-02 11:36:00 -08:00
Jeremy Latt
8f0d2b89ee v.1.2.12 2014-03-02 11:06:02 -08:00
Edmund Huber
857907320d allow underscores in nicks 2014-03-02 19:56:21 +01:00
Jeremy Latt
22c1cfdc3e chdir instead of relativizing paths in config 2014-03-01 21:51:52 -08:00
Jeremy Latt
9aa7debbfe move password handling into a single file 2014-03-01 15:18:49 -08:00
Jeremy Latt
b421971b61 move db init/open functions into a single file 2014-03-01 15:09:58 -08:00
Jeremy Latt
83d021fcb7 switch to gcfg for conf file
- add some validation for config file
- add comments explaining config
- remove TLS listener since most clients can't use it anyway
- remove unused nick generation function
2014-03-01 14:38:01 -08:00
Jeremy Latt
36602c9a3c basic capability negotiation
- multi-prefix is supported as an example
2014-02-28 19:24:38 -08:00
Jeremy Latt
542744d52a fix line parsing function 2014-02-27 21:21:47 -08:00
Jeremy Latt
8c8d371ae2 don't give operator to the first person to enter an empty persistent channel 2014-02-27 20:42:12 -08:00
Jeremy Latt
f17855fce9 check channel emptiness when anyone leaves 2014-02-27 18:33:44 -08:00
Jeremy Latt
e33a65ec72 fix channel persistence 2014-02-26 21:52:17 -08:00
Jeremy Latt
04f0b2c48d trim trailing space from commands 2014-02-26 16:18:52 -08:00
Jeremy Latt
9aeb813cf5 restrict nicknames to proper character set 2014-02-26 13:42:29 -08:00
Jeremy Latt
6f00f89efa relax unicode parsing rules
NFKC was previously used for all text. Now, we use NFKC for all args but
the last, which may be free text. This arg is normalized with NFC to
allow for formatting characters.
2014-02-26 13:11:29 -08:00
Jeremy Latt
4df8ec12f6 allow nick changing 2014-02-26 12:24:52 -08:00
Jeremy Latt
39911a812d handle mode command with trailing empty arguments 2014-02-26 12:08:01 -08:00
Jeremy Latt
66f9b42125 avoid duplicate mode changes 2014-02-25 22:19:21 -08:00
Jeremy Latt
0d277025c1 fix channel insert statement 2014-02-25 21:59:49 -08:00
Jeremy Latt
9dc229b98f skip nick change if there is no difference 2014-02-25 20:47:59 -08:00
Jeremy Latt
e9c5e4794e version 1.2.0 2014-02-25 20:24:30 -08:00
Jeremy Latt
45bb0d05e7 normalize all unicode input from the client 2014-02-25 20:22:07 -08:00
Jeremy Latt
c35d5d1b8a code review
- SEM_VER instead of SEMVER
- persist user limit along with other params
2014-02-25 16:13:47 -08:00
Jeremy Latt
b30e247e77 properly persist channels 2014-02-25 15:57:35 -08:00
Jeremy Latt
a30bb540e9 rewrite parseLine to be much saner about utf8 2014-02-25 13:24:32 -08:00
Jeremy Latt
e409bcec99 simplify new channel insert 2014-02-25 13:12:11 -08:00
Jeremy Latt
02abeeb164 persistent channels persisted to a sqlite db 2014-02-25 11:11:34 -08:00
Jeremy Latt
de5538f5d5 add persistent flag for channels 2014-02-25 10:04:59 -08:00
Jeremy Latt
0531c40481 simplify semantic version constant 2014-02-25 09:42:50 -08:00
Jeremy Latt
6882edeff7 version 1.1.0 2014-02-25 09:14:50 -08:00
Jeremy Latt
1fe73aaa9e kill command 2014-02-25 09:10:16 -08:00
Jeremy Latt
4d2d18caf1 time command 2014-02-25 07:45:40 -08:00
Jeremy Latt
f0305cf01a invite command 2014-02-25 07:35:52 -08:00
Jeremy Latt
d6ec1e719b add a version command for sumeet 2014-02-24 22:04:11 -08:00
Jeremy Latt
f0773c4e9e increase buffer for a server channel 2014-02-24 19:00:09 -08:00
Jeremy Latt
cc6f764c85 minor cleanup 2014-02-24 17:45:04 -08:00
Jeremy Latt
72726a39b8 many changes
- load config sub files relative to config file dir
- load config file by name
- expect bcrypt for passwords
- -genpasswd for generating config-file-safe passwords
- block client thread while checking passwords (PASS and OPER)
2014-02-24 09:48:46 -08:00
Jeremy Latt
be089e7f5f do bcrypt in the client main routine 2014-02-23 22:21:39 -08:00
Jeremy Latt
2229645a39 refactor server command loop 2014-02-23 19:13:45 -08:00
Jeremy Latt
41e6baf9d4 get rid of a race; use pointers where possible 2014-02-23 18:05:06 -08:00
Jeremy Latt
0856a9fa81 flag socket as closed when writes fail 2014-02-23 17:16:35 -08:00
Jeremy Latt
0bf968e19e move command parsing and hostname lookups into the socket routine 2014-02-23 17:04:24 -08:00
Jeremy Latt
ff5656fdb4 aggressively clean up client 2014-02-23 11:08:01 -08:00
Jeremy Latt
3b56b5bf42 expose various go internals as a DEBUG command 2014-02-23 10:04:31 -08:00
Jeremy Latt
f482b6b82f add all channel mask list replies 2014-02-22 15:01:11 -08:00
Jeremy Latt
c5c7469cf0 good ol' fashioned refactoring 2014-02-22 13:15:31 -08:00
Jeremy Latt
c7298c55b9 flesh out channel modes
- deprecate 's' mode
- add user limit
- don't leak key in mode messages to non-members
- begin refactoring Mode()
2014-02-22 13:08:25 -08:00
Jeremy Latt
21337cda7f add error responses for mode command 2014-02-22 12:15:34 -08:00
Jeremy Latt
1283bd35c7 encapsulate client replies in method 2014-02-22 11:40:32 -08:00
Jeremy Latt
39fb4bfb53 restrict new channels to channel regex 2014-02-21 17:19:02 -08:00
Jeremy Latt
c8701febd0 loosen restrictions on WHO replies 2014-02-21 11:09:46 -08:00
Jeremy Latt
f9bf422ba7 be more lax about whitespace when parsing commands from clients 2014-02-20 21:09:56 -08:00
Jeremy Latt
c1edddb9a1 fix whois reply 2014-02-20 20:47:05 -08:00
Jeremy Latt
e1c4c8e8cc don't send prefix on server-originated string coded replies 2014-02-20 20:08:32 -08:00
Jeremy Latt
0ad05abf5f omit prefix for non-numeric replies from the server 2014-02-20 19:55:17 -08:00
Jeremy Latt
23f01ff9ee handle CAP command silently in registration too 2014-02-20 19:55:03 -08:00
Jeremy Latt
b6d8f62674 adjust ping message 2014-02-20 19:22:08 -08:00
Jeremy Latt
52ffc77d8d don't allow double-joining 2014-02-20 18:56:13 -08:00
Jeremy Latt
1486411db1 render a single part string for all channel members 2014-02-20 18:20:07 -08:00
Jeremy Latt
7dffa530c2 send part message from correct source 2014-02-20 16:56:05 -08:00
Jeremy Latt
ad513da486 do hostname lookups in the client read thread 2014-02-20 13:03:33 -08:00
Jeremy Latt
97881b555d async hostname lookups 2014-02-20 11:51:45 -08:00
Jeremy Latt
c0dc733351 don't wait for writing to complete 2014-02-20 11:16:10 -08:00
Jeremy Latt
9960089226 format replies to strings instead of using a Reply struct 2014-02-19 22:20:34 -08:00
Jeremy Latt
25ebab37d3 replies shouldn't contain references to client 2014-02-19 19:30:49 -08:00
Jeremy Latt
9c385ededd synchronize on last writes to client sockets 2014-02-19 18:46:46 -08:00
Jeremy Latt
af6a8ee6f0 remove channel buffering 2014-02-19 18:22:57 -08:00
Jeremy Latt
6265b70622 get rid of goroutines on client socket 2014-02-19 18:13:35 -08:00
Jeremy Latt
95f267ea4f buffer all channels 2014-02-19 17:48:03 -08:00
Jeremy Latt
f090c616b3 reduce writes 2014-02-18 20:28:35 -08:00
Jeremy Latt
dcb4ac90e2 use a buffered channel for socket writing 2014-02-18 17:46:11 -08:00
Jeremy Latt
0cd6be8008 clean up nickname setting logic 2014-02-18 15:36:58 -08:00
Jeremy Latt
86d4cae141 swap refcounting friends for iteration 2014-02-18 15:28:20 -08:00
Jeremy Latt
9e471b5b5d solve quit/connection close race 2014-02-18 13:25:21 -08:00
Jeremy Latt
2bc1b952a0 do idle in the server goroutine instead of the timeout goroutine 2014-02-18 11:22:56 -08:00
Jeremy Latt
4f106e7d3e make server logging consistent with other logs 2014-02-18 10:22:40 -08:00
Jeremy Latt
58517ad4e8 fix closed channel on socket close 2014-02-18 10:13:57 -08:00
Jeremy Latt
9c1ab4f610 fix socket close race 2014-02-17 23:58:02 -08:00
Jeremy Latt
baf83e73d2 support USER from both RFCs 1459 and 2812 2014-02-17 22:10:48 -08:00
Jeremy Latt
bb64d38684 implement who reply like ngircd 2014-02-17 21:30:14 -08:00
Jeremy Latt
b17e62d0b0 names command 2014-02-17 21:02:03 -08:00
Jeremy Latt
046723a709 make whois channels possibly multiline 2014-02-17 20:47:41 -08:00
Jeremy Latt
528588acfc augment whois idle with signon time 2014-02-17 19:56:06 -08:00
Jeremy Latt
9a5f21e78c beef up whois 2014-02-17 19:08:57 -08:00
Jeremy Latt
bd3ca4ae47 fix race in idle timeout; fix some string trimming; fix some replies 2014-02-17 18:10:52 -08:00
Jeremy Latt
1a7f56a903 clean up general command and name handling 2014-02-17 17:58:22 -08:00
Jeremy Latt
a55b912941 enforce nicks via lowercase strings 2014-02-17 15:25:32 -08:00
Jeremy Latt
6d8b381927 convert client bools to a flags map 2014-02-17 13:22:35 -08:00
Jeremy Latt
2ecc66b9d9 add more modes to arg-having modes 2014-02-17 11:46:40 -08:00
Jeremy Latt
f0fc3b492c list command 2014-02-16 23:51:27 -08:00
Jeremy Latt
a9d7f64693 kick command 2014-02-16 23:29:11 -08:00
Jeremy Latt
af5a05f390 use a select in the server commands loop 2014-02-16 22:38:43 -08:00
Jeremy Latt
d5c9681a10 instantiate clients in the server command goroutine 2014-02-16 22:30:01 -08:00
Jeremy Latt
dc5e258f88 don't use a goroutine when initializing clients 2014-02-16 22:26:33 -08:00
Jeremy Latt
cd4503be31 allow blank lines from the client 2014-02-16 22:24:49 -08:00
Jeremy Latt
a894e3f37f parse lines more robustly 2014-02-16 22:22:46 -08:00
Jeremy Latt
4e56ea1bdc get rid of unnecessary concurrency for channels and clients 2014-02-16 22:20:42 -08:00
Jeremy Latt
54ca916c85 stop login timer on destroy 2014-02-16 18:16:13 -08:00
Jeremy Latt
e411dafda7 get rid of mutexes in favor of channel-base syncing 2014-02-16 17:23:47 -08:00
Jeremy Latt
74b8221db7 use mutexes more 2014-02-16 10:42:25 -08:00
Jeremy Latt
81a0f19390 fix bad ref in part command 2014-02-16 09:41:16 -08:00
Jeremy Latt
a17490e801 disable no-topic reply 2014-02-16 09:39:11 -08:00
Jeremy Latt
0f6ee63e6e fix a race 2014-02-15 20:20:37 -08:00
Jeremy Latt
213afc0481 fix another race 2014-02-15 20:01:28 -08:00
Jeremy Latt
ae02596214 get rid of extra topic messages 2014-02-15 19:56:38 -08:00
Jeremy Latt
488b2ccf8f implement channel modes and messages properly 2014-02-15 19:49:20 -08:00
Jeremy Latt
0bfa2fb98f channel mode flags and member modes 2014-02-14 21:57:08 -08:00
Jeremy Latt
6983d1930c RPL_ENDOFNAMES should come from server 2014-02-14 19:38:31 -08:00
Jeremy Latt
33b1e6c582 simplify Replier 2014-02-14 19:35:25 -08:00
Jeremy Latt
ac186a0669 don't close socket send channel 2014-02-14 19:30:58 -08:00
Jeremy Latt
50f1012c92 don't close socket sending channel 2014-02-14 19:30:07 -08:00
Jeremy Latt
87cc184ec0 type numeric codes 2014-02-14 19:25:14 -08:00
Jeremy Latt
3a9027e3dc don't double-close socket 2014-02-14 19:05:30 -08:00
Jeremy Latt
4d9742d033 organize server command into phases 2014-02-14 18:28:36 -08:00
Jeremy Latt
29df88fb7a more race conditions 2014-02-14 09:00:49 -08:00
Jeremy Latt
72a90d5544 don't close channels unless necessary 2014-02-14 08:57:17 -08:00
Jeremy Latt
9600be82a3 fix more data races 2014-02-14 08:42:56 -08:00
Jeremy Latt
6ea3c8f4d1 fix race conditions 2014-02-13 23:16:07 -08:00
Jeremy Latt
7051627fb2 avoid race double-close on replies 2014-02-13 21:10:31 -08:00
Jeremy Latt
3ba928cee6 remove server command mutex 2014-02-13 20:58:13 -08:00
Jeremy Latt
7cef494d28 don't close replies twice 2014-02-13 20:56:15 -08:00
Jeremy Latt
be01a412d9 only quit registered clients 2014-02-13 20:52:42 -08:00
Jeremy Latt
dcc40bbac1 more logging 2014-02-13 20:42:06 -08:00
Jeremy Latt
541a40b056 touch should respect destroyed 2014-02-13 20:38:22 -08:00
Jeremy Latt
e0e61907ce don't trigger connection closed on read and write goroutines 2014-02-13 20:30:51 -08:00
Jeremy Latt
03b6caa597 don't close replies too many times 2014-02-13 20:27:20 -08:00
Jeremy Latt
d35fe6088c attempt to fix hang condition in quit sequence 2014-02-13 20:23:22 -08:00
Jeremy Latt
a9eae872c9 mutex server commands 2014-02-13 20:08:16 -08:00
Jeremy Latt
42ff4410ad more logging 2014-02-13 19:49:31 -08:00
Jeremy Latt
6301d2b47f more logging 2014-02-13 19:44:42 -08:00
Jeremy Latt
8902ee040d more logging; check client for each reply 2014-02-13 19:41:51 -08:00
Jeremy Latt
11537ad975 abstract net operations as Socket 2014-02-13 19:37:37 -08:00
Jeremy Latt
b8bbc7eeb5 add more logging 2014-02-13 18:59:45 -08:00
Jeremy Latt
b6a7d98b64 adjust authorization and add more hang logging 2014-02-13 18:39:33 -08:00
Jeremy Latt
ce931b23a2 simplify net logging 2014-02-13 18:17:20 -08:00
Jeremy Latt
965d8efdf8 add a login timout to close dropped connections 2014-02-13 13:19:26 -08:00
Jeremy Latt
6e0ab99d38 look up PROXY hostnames async 2014-02-13 11:27:04 -08:00
Jeremy Latt
4b98d2a45b clear out old clients; fix NameReply 2014-02-13 11:06:07 -08:00
Jeremy Latt
c805006ab8 save reply source id at init time for nick changes 2014-02-13 10:57:58 -08:00
Jeremy Latt
261aaa128f try to fix nick message sending 2014-02-13 10:19:53 -08:00
Jeremy Latt
c327042c94 destroy clients on socket close with quit 2014-02-13 09:47:10 -08:00
Jeremy Latt
7a2c9db503 don't allow send on closed channels 2014-02-13 09:35:59 -08:00
Jeremy Latt
ca25828804 sanify debug net logging 2014-02-12 21:18:02 -08:00
Jeremy Latt
415ccc7607 maybe fix networking hangs 2014-02-12 21:07:40 -08:00
Jeremy Latt
01fa48c73e clear client channel list on destroy 2014-02-12 18:33:30 -08:00
Jeremy Latt
2aa61b0dbe clean up and fix targets for quit message 2014-02-12 18:27:36 -08:00
Jeremy Latt
52dd2521c2 remove prefix from local replies; fix topic message 2014-02-12 18:14:19 -08:00
Jeremy Latt
db2a21fee0 ignore target in whois 2014-02-12 09:42:47 -08:00
Jeremy Latt
6daf81ea91 notice command 2014-02-11 17:11:59 -08:00
Jeremy Latt
09887b2db3 motd command 2014-02-11 16:35:32 -08:00
Jeremy Latt
a203a3ca16 ison command 2014-02-11 15:58:54 -08:00
Jeremy Latt
08d9d5ab79 away modes 2014-02-11 15:44:58 -08:00
Jeremy Latt
cdae59ecf5 stub motd 2014-02-11 15:33:02 -08:00
Jeremy Latt
887f12cb31 get rid of channel abstraction for buffered socket io 2014-02-11 15:00:19 -08:00
Jeremy Latt
aac0efebee send initial nick message to source client 2014-02-11 14:32:17 -08:00
Jeremy Latt
0e07b29010 avoid nil reference in who reply 2014-02-11 09:09:16 -08:00
Jeremy Latt
a34443f155 fix reverse dns 2014-02-10 19:39:53 -08:00
Jeremy Latt
4379cb8e1c add PROXY protocol support 2014-02-10 18:40:06 -08:00
Jeremy Latt
a8141a0e1c async new connections 2014-02-10 17:54:35 -08:00
Jeremy Latt
8d0adf253d configure ipv4/6 in config file 2014-02-10 13:52:28 -08:00
Jeremy Latt
fb65203805 stub cap command 2014-02-10 11:14:34 -08:00
Jeremy Latt
28bd5a40ba trim . from reverse address lookup 2014-02-09 21:10:36 -08:00
Jeremy Latt
959167cbe7 reverse dns lookup 2014-02-09 21:04:37 -08:00
Jeremy Latt
9b89f1a0fb check permissions before doing channel modes 2014-02-09 20:04:17 -08:00
Jeremy Latt
56cb8512dc relax SSL restrictions 2014-02-09 19:59:45 -08:00
Jeremy Latt
3fd73e3252 don't close socket channels to avoid panics 2014-02-09 19:59:25 -08:00
Jeremy Latt
db0f494604 TLS support 2014-02-09 19:41:00 -08:00
Jeremy Latt
e625f62baa cancel timers when a client quits 2014-02-09 19:06:30 -08:00
Jeremy Latt
035a8f6cde do a type conversion better 2014-02-09 19:03:56 -08:00
Jeremy Latt
f3da4e0286 remove double nick-change message 2014-02-09 15:18:18 -08:00
Jeremy Latt
6653b55416 interpret local ips as localhost 2014-02-09 15:14:53 -08:00
Jeremy Latt
133b91b9f0 idle/quit timeout 2014-02-09 12:13:09 -08:00
Jeremy Latt
8a90634c0a irc operators 2014-02-09 10:07:40 -08:00
Jeremy Latt
6367e4b654 fix ModeString 2014-02-09 08:53:06 -08:00
Jeremy Latt
1787ac8ebf use Reply() to wrap channel 2014-02-09 08:48:11 -08:00
Jeremy Latt
281558072a configure server with json 2014-02-09 07:53:42 -08:00
Jeremy Latt
55d3d6e946 don't overwrite base command 2014-02-08 23:51:51 -08:00
Jeremy Latt
04f881a617 channel 'no outside messages' flag 2014-02-08 23:33:56 -08:00
Jeremy Latt
a3b7441939 type cleanup 2014-02-08 23:15:05 -08:00
Jeremy Latt
20257ec624 use ModeOp everywhere 2014-02-08 22:42:14 -08:00
Jeremy Latt
93f4b6859a more channel mode parsing and bad listing 2014-02-08 22:06:10 -08:00
Jeremy Latt
d370abcd4c minimal who command 2014-02-08 18:49:52 -08:00
Jeremy Latt
d8951e1b48 minimal channel mode command 2014-02-08 18:14:39 -08:00
Jeremy Latt
a0eed1d687 properly implement join/part 2014-02-08 17:53:06 -08:00
Jeremy Latt
c4f457705a minimal whois implementation 2014-02-08 17:43:59 -08:00
Jeremy Latt
06648393a1 implement join/quit and channel messages properly 2014-02-08 17:10:04 -08:00
Jeremy Latt
3f9495cda0 add data structures for decoding mode messages 2014-02-08 14:20:23 -08:00
Jeremy Latt
b9cb539219 organize like a proper go package 2014-02-08 13:19:35 -08:00