Commit Graph

418 Commits

Author SHA1 Message Date
Vladimir Panteleev
03c4c0b165 Use and propagate microsecond-precision timestamps to FormatTime
This enables sub-second precision timestamp formatting for logs and
clients without server-time.
2017-10-26 00:00:51 +00:00
Vladimir Panteleev
901a21e91b Utils: Add FormatTime overload taking timeval
This overload also supports additional format sequences for formatting
the sub-second part of timeval.
2017-10-26 00:00:50 +00:00
Jos Ahrens
f006e31fed debugging: Add Filter method to hide filter sensitive data 2017-10-02 14:09:45 +02: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
289e066e67 Fix build of ZNC 1.7 branch on GCC 7.
Patch by bjoe2k4.

Close #1420
2017-06-22 23:20:34 +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
b46702ec3b Fix OnUserQuitMessage documentation 2017-04-10 14:45:00 -07:00
Phansa
a0a3479d2f Adding liscene information 2017-03-12 20:39:58 -04:00
Phansa
3189ce7f8a Welcome to 2017
Welcome to 2017

temp

temp2
2017-03-12 20:34:26 -04:00
Alexey Sokolov
88d1e27cc6 Fix CMake build:
* VERSION_EXTRA is now supported
* znc-buildmod uses the correct ZNC library instead of one in /usr/share
2017-02-28 23:01:09 +00:00
Alexey Sokolov
80c24b335d Update a comment 2017-02-25 12:13:24 +00:00
Alexey Sokolov
a44aa0c699 Revert tables to how they were in 1.4
See #914
2017-02-24 23:49:18 +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
6fbab7b44c Add CIDR support to TrustedProxy setting
Fix #1219
2016-12-25 13:00:02 +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
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
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
222ae86fcc Fix newest additions to keepnick module and write the test for it.
Fix the documentation.

See #1324 and #1325
2016-10-05 09:21:21 +01:00
Jos Ahrens
b6ffaa6527 Message.h: Add a comment briefly explaining how to use the class, and what exactly a message is. 2016-10-02 00:21:58 +01:00
Alexey Sokolov
cc653efb6b Rename translation methods to be not one letter.
It fixes several warnings, when the name was shadowed by a local "p".
2016-09-12 00:01:45 +01:00
Alexey Sokolov
85984ee4be Merge pull request #1277 from xnrand/master
Add network-specific settings for cert validation
2016-08-20 12:08:41 +01:00
Alexey Sokolov
aff7e25043 Fix cygwin build
(cherry picked from commit f1ef8c79db)
2016-08-13 09:55:00 +01:00
Alexey Sokolov
f1ef8c79db Fix cygwin build 2016-07-20 00:19:19 +01:00
Tor Arne Vestbø
4d5724eb0a Add OnPrivBufferStarting/Ending signals, similar to Chan buffers
Allows hooking into query buffer playback before and after all the
lines of the query buffer are replayed. The EModRet return value
has no effect at the moment, but may be used in the future to e.g.
prevent playback. The Chan version of these signals use EModRet to
skip emitting the status message, but not the whole playback.
2016-07-13 15:15:56 +02:00
Tor Arne Vestbø
02bfb9eaf5 Centralize logic to get current server time
A few different implementations of computing the current time were
spread out through the code base, most of them using gettimeofday().

This centralizes the logic in CUtil::GetTime() for easier maintenance,
and also allows all call sites to get the benefit of the clock_gettime()
code path on systems that support it.
2016-07-06 01:16:15 +02:00
xnrand
409ed4b6bc Add network-specific config for cert validation
Added the following two network-specific configuration options that can
be changed via controlpanel or webadmin:

* TrustAllCerts: Will trust ALL certificates when enabled, effectively
  disabling TLS certificate validation.
  Default value: false
* TrustPKI: Whether or not to trust PKI-valid certificates. Setting this
  to false will make znc trust only trusted certificates added by the
  user.
  Default value: true

With default values, behavior is exactly the same as before.

This is based on the work of Roelf Wichertjes. See YourBNC/znc@5c747598.

See znc/znc#866.
2016-05-20 01:17:26 +02:00
Adam
6bde0fc270 Add config write delay setting 2016-03-26 13:34:02 -04:00
Alexey Sokolov
8893b90e3a Modules web subpages should have translateable titles 2016-02-24 21:31:38 +00:00
Alexey Sokolov
e5ff36eb8e Revert version to 1.6.x after release of 1.6.3 2016-02-23 21:37:38 +00:00
Alexey Sokolov
b49a92b1e6 ZNC 1.6.3-rc1 2016-02-08 21:18:12 +00:00
Alexey Sokolov
8eeeaf71a0 Add framework for translating ZNC to different languages 2016-01-31 20:09:19 +00:00
Alexey Sokolov
561a18054c Yet another attempt to use CMake 2016-01-15 10:50:33 +00:00
Alexey Sokolov
1f226d2ade Add test for #1229 and actually fix it. 2016-01-09 18:00:47 +00:00
Alexey Sokolov
4fe4a45dd6 Disable legacy encoding mode when modpython is loaded.
Python is not happy when using non-unicode text as str.

Fix #1229
2016-01-09 14:18:24 +00:00
Ondřej Nový
6881ca5b8f Fixed few misspellings 2016-01-05 20:45:08 +01:00
Falk Seidel
8f73840e74 Welcome to 2016
🎆  Happy 2016 🎆
2016-01-01 20:11:21 +01:00
Alexey Sokolov
79e979e5cd Fix tabs/spaces inside comments 2015-12-07 01:07:45 +00:00
Alexey Sokolov
d185d6f22d clang-format: switch tabs to spaces
I like tabs, but I have to admit that spaces make source code more
consistent, because every editor/viewer tends to render tabs differently :(
2015-12-07 00:53:30 +00:00
Alexey Sokolov
3861b6a583 Fix several comments broken by clang-format 2015-12-07 00:53:01 +00:00
Alexey Sokolov
33b0627d75 Add clang-format configuration.
For now, it uses tabs like before, to make the diff easier to read/check.
One of following commits will switch it to spaces.
2015-12-07 00:53:01 +00:00
Alexey Sokolov
582cd635f5 Fix --disable-tdns (thanks kerio) 2015-12-06 12:36:16 +00:00
Alexey Sokolov
d45743e0a2 Merge pull request #1174 from DarthGandalf/thread
Rework signal handling and use C++11 threads.
2015-12-06 00:53:58 +00:00
Alexey Sokolov
9c48119897 Use C++11 threads instead of custom pthread wrappers.
Signal handling of CThread was handled in previous commit.
2015-12-06 00:11:15 +00:00
Alexey Sokolov
dfa94d6bc1 Move Unix signal processing to a dedicated thread. 2015-12-06 00:10:06 +00:00