Commit Graph

803 Commits

Author SHA1 Message Date
Uli Schlachter
b5d77a8ade CListener: Split out common code to setup ssl
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-11-02 12:05:20 +01:00
Uli Schlachter
811f453efb Add support for listening on a unix domain socket
So far this is not integrated with ClientCommand.cpp or webadmin.cpp, so
the only way to actually use this is to hand-editing the config with a
<Listener> section like the following:

<Listener 42>
  Path = /tmp/listen
  SSL = false
</Listener>

So far this received only very basic testing. I did not even test SSL support.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-11-02 12:05:20 +01:00
Uli Schlachter
b8d99f2674 Implement CListener::ToConfig()
This will later reduce some code duplication.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-11-02 12:03:24 +01:00
Uli Schlachter
35da5784ca Split CTCPListener from CListener
This splits up CListener into a TCP-specific class and a general class.
The intention is to later add another class inheriting from CListener
that listens on unix sockets.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-11-02 12:03:24 +01:00
Uli Schlachter
b68fbc64a2 Move listener config writing into CListener
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-11-02 11:41:38 +01:00
Adam Williams
dca012f0b7 Use SameSite=strict cookies consistently (#1450) 2017-10-20 15:31:46 +01:00
Alexey Sokolov
3ba8b0cce3 Stop mixing up ./configure --enable-debug with znc --debug
Close #1449
See #1446
2017-10-15 18:00:33 +01:00
Alexey Sokolov
2ebd358521 Merge pull request #1446 from Zarthus/feature/debug-mode-awareness
transparency: Make the user aware that DEBUG mode is enabled.
2017-10-04 19:09:09 -07:00
Alexey Sokolov
57ad5cd814 Merge pull request #1445 from Zarthus/fix/debug-shows-pass
debugging: Add Filter method to hide filter sensitive data
2017-10-04 19:06:50 -07:00
Alexey Sokolov
023e57485b Revert "Remove several more "size - 1", none of which are dangereous."
This reverts commit bcabf9b55c.

I should test code better...
2017-10-04 04:41:50 +01:00
Alexey Sokolov
bcabf9b55c Remove several more "size - 1", none of which are dangereous. 2017-10-03 15:23:09 +01:00
Alexey Sokolov
d73a4090c8 Fix crash caused by an unsigned overflow.
Thanks to Joseph Bisch for discovery.
This was an artifact of converting ZNC to use CMessage. Released
versions are not affected.
2017-10-03 15:21:56 +01:00
Jos Ahrens
ab501767a1 transperancy: Make the user aware that DEBUG mode is enabled. 2017-10-02 14:46:00 +02:00
Jos Ahrens
f006e31fed debugging: Add Filter method to hide filter sensitive data 2017-10-02 14:09:45 +02:00
Alexey Sokolov
a719ea36aa Make disconkick a module again.
While not kicking upon disconnect can cause desync with client and other
issues, there were multiple complains about the new behavior, and the
user should have the choice.

Revert 2f65dbbc64
Ref #968
2017-08-26 22:18:53 +01:00
Alexey Sokolov
f885699d1a Make list of languages installed discoverable at runtime.
Stop hardcoding Russian in webadmin.
Limit the setting in controlpanel to the known languages, because
untrusted language code might lead to some interesting vulnerabilities.
2017-08-19 18:09:12 +01:00
Alexey Sokolov
328461faf1 Use IETF language tags for configuring language 2017-08-07 23:04:21 +01:00
Alexey Sokolov
0ce6b7c8ba Fix a warning
Reported by s7r
2017-06-26 00:28:57 +01:00
Alexey Sokolov
46c5b2884e Don't send PART to client which sent QUIT
Reported by milky
2017-06-20 21:58:37 +01:00
Rubin
96c92ef8ca Change default flood rates to match RFC1459, prevent excess flood problems
I noticed that the default network flood rates are wrong (for most
networks). It has been very standard since the beginning of IRC to use a
value of 2 seconds per line, with a 10 line head start. Almost all
networks work this way, and if you don't follow, having a lot of
channels or a lot of clients connected to ZNC results in excess flood
disconnections and much frustration for the user.

I think you should make the default value for these 2 and 9 instead of 1
and 4 so that this nasty bug doesn't hit people who will not know how to
debug it. You find these same types of settings built into every IRC
client. 2 and 10 is the standard. 2 and 9 provides a slight buffer so
there is no mistake.

Thanks
-Rubin

Close #1416
2017-06-01 08:22:21 +01:00
Alexey Sokolov
10bfece38c Switch znc.in URLs to https 2017-05-30 22:32:01 +01:00
Fusl Dash
2e90c9ae9e Update link to Configuration wiki page 2017-05-14 08:51:48 +01:00
Eli Young
6d0ec644d0 Support custom message tags
This provides a way for modules to register message tags and updates the
core to send tags to clients if the relevant capabilities are enabled.
2017-05-08 18:01:46 -07:00
Eli Young
823ac07240 Add OnSendToIRCMessage and OnSendToClientMessage
This also alters PutClient such that the CMessage variant handles
sending messages, rather than the CString variant. As a side bonus, this
gives callers better information on whether the message was sent to the
client. Additionally, it eliminates the need for a hook to let modules
set the tags sent to a client, as that can now be done inside
OnSendToClientMessage.
2017-04-18 15:43:16 -07:00
Eli Young
20b635aad7 Don't try to quit multiple times (#1392)
Calls to CIRCSock::Quit() eventually result in the object's destructor
being called, which itself calls CIRCSock::Quit() again. Avoid sending
multiple quit messages to the remote server by checking if the
underlying socket is already marked for closing.
2017-04-10 00:10:00 +01:00
Phansa
3189ce7f8a Welcome to 2017
Welcome to 2017

temp

temp2
2017-03-12 20:34:26 -04:00
Alexey Sokolov
6ddede7779 Revert 3382543917 and
00ddcd302f

ListChans for now will behave as before, and ShowChan isn't currently
needed.

See #914
2017-02-24 23:49:18 +00:00
Alexey Sokolov
a44aa0c699 Revert tables to how they were in 1.4
See #914
2017-02-24 23:49:18 +00:00
Jos Ahrens
14e68299fe cli: help: sort arguments alphabetically (#1367)
Changes the output of `znc --help` to order the arguments
in alphabetical order.
2017-01-21 15:36:12 +00:00
Alexey Sokolov
c7c878adc8 Fix build on macOS Sierra (10.12)
Rename OS X to macOS
Add Sierra to Travis
2017-01-15 23:04:55 +00:00
Alexey Sokolov
b4b085dc2d Partially fix type of function pointer.
Found using UBSan.
Full fix would require adding visibility attribute to CUser,
CIRCNetwork, CModule, CModuleEntry, CModInfo *and* make sure these
attributes are visible to enough code.
The second statement is more difficult to fulfill, because forward
declaration of CUser is not enough, because the attribute is on class
definition. So Modules.h would need to include many other includes.

Probably it should be changed at some point.

See http://stackoverflow.com/questions/27976687/clangs-ubsan-function-pointer-is-this-illegal
2016-12-26 20:09:13 +00:00
Alexey Sokolov
2fcde9f2e1 Fix a couple of issues pointed out by https://scan.coverity.com/ 2016-12-26 17:22:09 +00:00
Alexey Sokolov
b666931883 Add an option to change ping timeout time.
Fix #979
2016-12-26 15:49:26 +00:00
Alexey Sokolov
d9c1da8a68 Make it possible to translate arguments in help text of module commands
Ref #1354
2016-12-25 21:11:02 +00:00
Alexey Sokolov
a1e1591ba5 Add another layer of indirection for translation
To make supporting old modules easier

Ref #1354
2016-12-25 20:31:17 +00:00
Alexey Sokolov
c803a85e13 Rename new On...Message modules callbacks to be more consistent.
OnPrivMessage -> OnPrivTextMessage
OnChanMessage -> OnChanTextMessage

Fix #1191
2016-12-25 15:48:29 +00:00
Alexey Sokolov
30cd0584a1 Fix build on FreeBSD for the latest CIDR commits 2016-12-25 13:53:17 +00:00
Alexey Sokolov
b445ad30e3 Modernize CIDR code. 2016-12-25 13:52:54 +00:00
Alexey Sokolov
6fbab7b44c Add CIDR support to TrustedProxy setting
Fix #1219
2016-12-25 13:00:02 +00:00
Alexey Sokolov
bd1a71cb29 Add Ru translation for existing strings in core.
It's not very big so far.

See #1354
2016-12-24 18:53:25 +00:00
Alexey Sokolov
13049e5fc3 Refactor the way how modules are loaded.
Make version checks more strict.

This finishes attempt to preserve ABI between patch versions. That
didn't work well, and the people who could make it work, left the
project already.

Close #1255
Close #1274
Close #172
2016-12-22 20:49:01 +00:00
Alexey Sokolov
6cde8b3950 Fix #1347 for 1.7 branch.
Commit 51fb6f09f4b8065b82f9a0ab1d1702ad8998f389 in 1.6.x branch has more
details.
2016-12-01 23:34:55 +00:00
Alexey Sokolov
5c524df298 Merge branch '1.6.x' 2016-11-20 18:09:55 +00:00
Alexey Sokolov
6366430870 Fix deletion of users which are connecting.
Close #1342
2016-11-20 17:56:26 +00:00
Alexey Sokolov
0ac3cfc8d5 Fix regression of 1.6.0
Cloning a user caused a non-immediate segfault.
This was fixed already in 1.7 branch (by refactoring).
Fix #1340
2016-11-19 23:35:12 +00:00
Alexey Sokolov
676d105347 Workaround gitter for 1.6
It's fixed properly for 1.7 already.
Fix #1321
2016-11-17 23:45:25 +00:00
lol768
f387dc56c0 More relevant comments for CSRF behaviour 2016-10-05 09:29:40 +01:00
Latchezar Tzvetkoff
a9a7f17910 Allow modules to override CSRF protection.
Useful for Web APIs and all other kinds of things.

API changes:
	- Added public CHTTPSock::GetURI() method
	- Added public CModule::ValidateWebRequestCSRFCheck() method
	- Made CWebSock::GetCSRFCheck() method public so it can be accessed
	  from CModule
	- Added public CWebSock::ValidateCSRFCheck() method

Other changes:
	- Added a Sample Web API module (modules/samplewebapi.cpp) and a
	  simple web form with no CSRF check.

Implements feature request #1180.
2016-10-05 09:29:40 +01:00
Alexey Sokolov
ac0048cc01 Make ZNC faster in the integration test.
This is not appropriate for normal usage.
2016-10-04 01:19:34 +01:00
arza
7c53d2106f Hide passwords in listservers output 2016-09-23 18:13:07 +03:00