Commit Graph

327 Commits

Author SHA1 Message Date
J-P Nurmi
2d868a892c makeconf: offer freenode by default 2014-09-08 23:32:20 +02:00
J-P Nurmi
1c72af7d2d makeconf: change the channel input loop to a one-liner
The "would you like to add a channel?" ... "would you like to add
another channel?" loop is very verbose and slow to use. This proposal
makes it a simple one-liner where the user can enter a bunch of chans
using any combination of space/comma/semi-colon as a separator, or
just hit enter to proceed without channels...
2014-09-08 23:10:20 +02:00
J-P Nurmi
b1451a28c4 makeconf: one admin user is enough to get started
Webadmin is more convenient and enabled by default since 7387f00.
2014-09-08 22:47:32 +02:00
J-P Nurmi
bc2c7d0c98 makeconf: one network is enough to get started
Webadmin is more convenient and enabled by default since 7387f00.
2014-09-08 16:52:04 +02:00
J-P Nurmi
44c3a04462 makeconf: one server is enough to get started
Webadmin is more convenient and enabled by default since 7387f00.
2014-09-08 16:52:04 +02:00
J-P Nurmi
40aa1bb34d makeconf: promote webadmin 2014-09-07 22:57:13 +02:00
J-P Nurmi
25609ec0bb makeconf: improve alternate location handling 2014-09-07 22:57:12 +02:00
J-P Nurmi
6ec56778e5 makeconf: just warn if the config exists
Don’t require typing yes to continue, it’s inconvenient.
2014-09-07 22:57:12 +02:00
J-P Nurmi
a489304a0e makeconf: offer SSL by default if the port is 6697 2014-09-07 22:57:12 +02:00
J-P Nurmi
69e38cafe2 makeconf: use username instead of nick as ident
Username and ident are more likely to match.
2014-09-07 22:57:12 +02:00
J-P Nurmi
139282fe38 makeconf: kill buffer and chan mode questions
Use webadmin/controlpanel to configure buffers and default chan modes
2014-09-07 21:25:07 +02:00
J-P Nurmi
396bdb1eba Utils: improve password prompt
Check if the password is empty before asking to confirm it.
2014-09-07 21:23:28 +02:00
J-P Nurmi
b4c0522e78 Utils: fix indentation of bold messages 2014-09-07 21:23:28 +02:00
J-P Nurmi
d260d6888f Utils: don't capitalize password 2014-09-07 21:23:28 +02:00
Alexey Sokolov
8ec2a0940c Merge pull request #629 from jpnurmi/help
Revise *status and *controlpanel help output
2014-09-07 16:24:49 +01:00
J-P Nurmi
df08352148 Revise *controlpanel help output
Make the output easier to read by wrapping mandatory argument names
with angle brackets (just like in *status help), and make it possible
to output help for given command(s). Furthermore, output only relevant
variable lists and align casing & arguments in general help & command
specific usage output.
2014-09-07 10:54:00 +02:00
J-P Nurmi
2e42f3103c Fix #624: Can´t rename network via webinterface 2014-09-06 23:15:50 +02:00
J-P Nurmi
aec99ea213 Revise *status help output
Make it possible to output help for given command(s) and align
casing & arguments in general help & command specific usage output.
2014-09-06 21:14:35 +02:00
BtbN
40d1dc1883 Initialize OpenSSL locking functions 2014-09-05 16:34:36 +02:00
Alexey Sokolov
5f480afad2 Merge pull request #632 from jpnurmi/altnick
Fix #631: ZNC fails at finding an available nick name
2014-09-04 07:41:30 +01:00
Alexey Sokolov
487ff9acc4 Revert "Initialize OpenSSL locking functions" 2014-09-04 06:13:15 +01:00
Alexey Sokolov
7274340b26 Merge pull request #612 from BtbN/opensslthreads
Initialize OpenSSL locking functions
2014-09-04 00:23:50 +01:00
J-P Nurmi
c087355c48 makeconf: fix indentation of LoadModule lines
7387f00 missed the tabs
2014-09-03 23:47:06 +02:00
J-P Nurmi
e6a7bbab75 Fix #631: ZNC fails at finding an available nick name 2014-08-19 18:15:26 +02:00
J-P Nurmi
7387f00408 Get rid of the module questions during --makeconf
The following modules are enabled by default:
- global: webadmin
- user: controlpanel, chansaver
- network: simple_away

This reduces a lot makeconf noise and fixes #541.
2014-08-17 15:37:50 +02:00
Alexey Sokolov
2f9b8f9f52 Fix build on MacOSX.
std::bind conflicted with ::bind
Patch to csocket is already upstream.
2014-08-12 00:20:18 +01:00
Alexey Sokolov
3db0c0bc40 Merge pull request #627 from jpnurmi/overwrite
Make --makeconf warn early about an existing config (#572)
2014-08-11 21:18:10 +01:00
Alexey Sokolov
f464066088 Merge pull request #616 from psychon/module-jobs2
Add support for CJob cancellation and necessary module support
2014-08-11 21:09:57 +01:00
J-P Nurmi
fb0dcc0dd9 Make --makeconf warn early about an existing config (#572) 2014-08-11 10:37:26 +02:00
Uli Schlachter
e0e86e8b02 CThreadPool::cancelJobs(): Add a comment explaining the logic a bit
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-08-11 09:09:38 +02:00
Uli Schlachter
74fdd97a52 CJob: Even cancel finished jobs
When a job was cancelled after its runThread() method finished, but before the
main thread noticed this and reacted, we would just run runMain() before and
pretend the job finished normally.

However, with CModuleJob this means that runMain() might get called for a module
which is currently being destructed. This has bad effects with virtual functions
and thus causes problems. It's better to just really cancel the job instead.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-08-11 09:09:38 +02:00
J-P Nurmi
f238a24190 Fix CChan::SendBuffer()
The CChan::SendBuffer(CClient,CBuffer) overload should just playback
the given buffer and obviously not clear the channel's own buffer
=> auto-clear the buffer in CChan::SendBuffer(CClient) as appropriate.
2014-08-08 23:36:21 +02:00
Uli Schlachter
308df21511 Modules: Add a module version of CJob
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-08-06 15:32:41 +02:00
Uli Schlachter
0fddbba230 CThreadPool: Fix a race when starting threads
There was a race where threads were themselves responsible for increasing the
counter for the number of running threads. This left an open window where the
thread was already started, but our counter was not yet increased. The effect of
this race would be that we start more threads than we should.

Fix this by increasing the counter before actually starting new worker threads.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-08-06 15:20:12 +02:00
Uli Schlachter
1d67e87d90 CThreadPool: Add cancellation support
This adds CThreadPool::cancelJob() and cancelJobs() which can cancel a set of
jobs synchronously. These functions only return when the job was successfully
cancelled.

It tries to cancel the jobs as quickly as possible, skipping any callbacks on
CJob that were not yet called. A job that is already running can use
CJob::wasCancelled() to check if it should quit.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-08-06 15:15:57 +02:00
J-P Nurmi
14a534c953 Full-fledged query buffers
Store query buffers per query the same way it's done for channels.

This allows clients to implement persistent query buffers. Queries
remain open across clients and sessions until a client explicitly
sends a command to clear a (closed) query buffer.

A new config option AutoClearQueryBuffer that default to false
ensures behavioral backwards compatibility, and another config
MaxQueries protects from OOM eg. due to PM attacks.
2014-08-04 10:04:21 +02:00
BtbN
62e13457a9 Initialize OpenSSL locking functions 2014-07-31 10:03:22 +02:00
Uli Schlachter
ba11b8eecf Less magic numbers for timeout settings
Currently the connection timeout handling of znc uses three magic numbers, each
of which is at least repeated in two unrelated places. This commits defines the
numbers in CIRCNetwork and makes the other places just use this number.

This also renames PING_TIMEOUT to PING_FREQUENCY because I feel that describes
this constant better.

I am not really happy about the name NO_TRAFFIC_TIMEOUT that is used for the
real timeout, but I couldn't think of a better name. PING_TIMEOUT isn't good
because that sounds like the time between sending a PING and the resulting
timeout.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-07-14 15:33:36 +02:00
Alexander Færøy
2521d64a1c Add PING_TIMEOUT constant to CIRCNetwork 2014-06-18 21:04:20 +02:00
Alexander Færøy
1e9e029227 Start joining channels as soon as we are connected 2014-06-18 21:04:20 +02:00
Alexander Færøy
299f3aa637 Split CUserTimer into CIRCNetworkPingTimer and CIRCNetworkJoinTimer
This patch splits CUserTimer into two other timers:

CIRCNetworkPingTimer: This timer sends PING messages to connected
client's and IRC servers.

CIRCNetworkJoinTimer: This timer enforces the MaxJoin setting by only
allowing a specified amount of channels to join at the same time.

JoinChans() is modified to reset the ping timer once we hit the MaxJoin.
This allows us to call it from any function without breaking the timing
logic.
2014-06-18 21:04:20 +02:00
Alexey Sokolov
93d2eec4db Update Csocket to ef6bcb9d5c1aecd778c5a57604eabdcb5e1ee06e 2014-06-17 23:22:16 +01:00
Alexey Sokolov
2a656f539d If web requests starts not with URI prefix, redirect to root of the prefix
Before it shown the right result even with wrong path (without prefix),
but it worked only with ZNC directly, not via reverse proxy.

Now it won't work with ZNC directly too.
2014-06-10 21:55:38 +01:00
Alexander Færøy
db0e0995e2 Add OnJoining module hook.
This patch adds an OnJoining module hook that allows a module to allow
or disallow joining any given channel.
2014-05-29 23:10:30 +02:00
Alexey Sokolov
a35385db3a Merge branch 'master' of github.com:znc/znc 2014-04-26 16:45:31 +01:00
Alexey Sokolov
0952ee82e0 Don't set ConnectDelay to zero 2014-04-26 16:45:04 +01:00
Kyle Fuller
ed7119b5bc Update to latest version of Csocket
Fixes #536
2014-04-24 19:28:37 +01:00
Kyle Fuller
5e90bc380b [Csocket] Support and default to TLSv1.2
Updates to 21ac28cc29e9256a21a9aa217e29638360c266d0 of Csocket
2014-04-20 23:35:29 +01:00
Alexey Sokolov
66ea539165 Show username of every http request in -D output 2014-04-20 15:20:39 +01:00
Alexey Sokolov
9cf61ac6d4 Argh, fuck it. Rename fixed (pointer) versions of OnMode to OnMode2 2014-04-12 08:51:04 +01:00