Giter Site home page Giter Site logo

quakenet / newserv Goto Github PK

View Code? Open in Web Editor NEW
24.0 11.0 16.0 21.71 MB

QuakeNet's modular services

Home Page: https://development.quakenet.org/

License: Other

Makefile 0.13% C++ 0.06% C 99.17% Python 0.08% Perl 0.22% Lua 0.30% Lex 0.02% Yacc 0.03%
irc irc-services quakenet ircu

newserv's Introduction

newserv

C/C++ CI

Introduction

newserv is a P10 protocol services daemon developed for the QuakeNet IRC network.

It is modular, fast and easily customisable.

The official website for newserv is https://development.quakenet.org/

Please refer to the LICENSE file for licensing details.

Features

  • Role-based access checks for oper commands
  • Search functionality
  • Scripting (Lua)
  • Proxy detection (P)
  • Connection limits ("trusts")
  • Transactional g:line support
  • Jupes
  • Chanfix
  • Chanserv (Q9)
  • Help Service (G)
  • Channel Service Request (R)
  • QA/Tutor Bots
  • Server list with latency checks

Requirements

  • IRC Server running the P10 Protocol. Full support for all modules may require use of QuakeNet's snircd IRC server, which is based upon Undernet's ircu.
  • Linux system (BSDs may work, but not actively tested)
  • flex
  • bison
  • GNU Make
  • Python 2.4

Support & development

Please read the documentation provided before you ask us for support. You may find some assistance in #dev on QuakeNet for specific questions.

If you've found any bugs or you're working on any cool new features please give us a shout.

Installation

First run configure script:

$ ./configure

The configure script will list any missing dependencies. If you're unsure why a certain library or header file was not found you can run the configure script with the -v option or check the .configure.log file after your first configure run.

Please refer to the "Local Settings" section in this file if you're using non-standard library/header search paths. Once you've resolved all dependency issues you can build newserv:

$ make

After all modules are built you can install newserv:

$ make install

By default the newserv binary and the modules are installed into your source tree. The recommended setup is to now create a separate directory and symlink the "newserv" binary and the "modules" directory into it:

$ cd
$ mkdir newserv-install && cd newserv-install
$ ln -s ../newserv-src/newserv
$ ln -s ../newserv-src/modules

You will also need to copy the newserv.conf.example configuration file to your installation directory and rename it to newserv.conf.

The MODULES file has a list of available modules and their configuration settings.

After you have updated your newserv.conf file you can start newserv:

$ ./newserv

newserv does not detach from the console. Consider running it in a screen(1) session.

User accounts

You can create a user on your control instance using /msg N hello (where N is the nick of your control user). You need to be opered and authed in order to use this command.

If your network does not have an authentication service that supports account IDs you can load the "auth" module. Note that this module lets opers set arbitrary account names and IDs and therefore should probably not be loaded on production networks.

Once you have an account you should have a look at /msg N showcommands for a list of available commands.

Local settings

If you are using non-standard library/include paths you can create a file called configure.ini.local (using configure.ini.local.example as a template) to override some of the settings.

newserv's People

Contributors

anders avatar antonlindgren avatar gunnarbeutner avatar hiddn avatar mantis avatar pandame avatar philsjh avatar retropc avatar splidge-quakenet avatar thommey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

newserv's Issues

Support for longer tickets

Make the ticket command more consitent with the other commands on G and use :reason instead of "reason" (or simply support both).

Also, do not ignore the ticket reason when longer than 128 chars, just allow the max on IRC, 512 chars so that it always fits and always gets through.

(originally reported by wiebe)

TRUSTLOGGREP showing ID and trust limit the wrong way round

Reported by modul8:

[18:39:39] -> n trustgroupadd
[18:39:39] N $A$ From: [email protected]/Wineasy: trustgroupadd
[18:39:39] N Usage: trustgroupadd ?comment?
[18:40:47] -> n trustgroupadd test 25 1 1 Wineasy trust testing group
[18:40:47] N $A$ From: [email protected]/Wineasy: trustgroupadd test 25 1 1 Wineasy trust testing group
[18:40:47] N Group added.
[18:40:47] N $t$ [email protected]/Wineasy TRUSTGROUPADD'ed 'test'
[18:41:08] -> n TRUSTLOGGREP test
[18:41:08] N $A$ From: [email protected]/Wineasy: TRUSTLOGGREP test
[18:41:09] N [2013-11-08 12:40:47] #7/test (Wineasy) Created trust group 'test' (ID #25): howmany=7, enforceident=1, maxperident=1, createdby=#Wineasy, contact=Wineasy, comment=trust testing group
[18:41:09] N — Done. Found 4 entries.

Fix attached:

diff -r 3f154eb428a9 trusts/trusts_management.c
--- a/trusts/trusts_management.c    Tue Sep 24 00:35:42 2013 +0100
+++ b/trusts/trusts_management.c    Fri Nov 08 19:04:56 2013 +0100
@@ -207,7 +207,7 @@
   controlwall(NO_OPER, NL_TRUSTS, "%s TRUSTGROUPADD'ed '%s'", controlid(sender), tg->name->content);
   trustlog(tg, sender->authname, "Created trust group '%s' (ID #%d): howmany=%d, enforceident=%d, maxperident=%d, "
     "createdby=%s, contact=%s, comment=%s",
-    tg->name->content, howmany, tg->id, enforceident, maxperident, createdby, contact, comment);
+    tg->name->content, tg->id, howmany, enforceident, maxperident, createdby, contact, comment);

   return CMD_OK;
 }

Add VOICEREG channel flag to chanserv

(Labels: Chanserv Enhancement)

Add a chanflag to chanserv that auto-voices all registered users who join the channel.

Proposed help:

-Q-  +r VOICEREG   Automatically grants voice (+v) on the channel to any registered user who enters,
-Q-                unless they have quiet (+q) chanlev flag.

Rationale:
Delaying the ability to speak in the channel for unregistered people is a good mitigation strategy against the current spam attack.
This can be archived by setting the channel +DM (delay join, reg-only moderated), and auto-voicing anyone who enters with a delay.

Technically, it is not required to voice unregistered users - but this cause envy if only unregistered users are voiced.
Therefore it might be useful to voice anyone who can speak as soon as they enter the channel.
Also, Q can see through +D, making this feature even more useful - as the join and mode change line come together, and are easier to associate in my brain.

Store metadata in ban/censor/ticket/improper entry

G does not store who set what ban/censor/ticket/improper etc., I think it should do that, not only for accountability, but also for finding who to contact regarding a specific ban/censor/ticket etc.

And also for oneself, I know most of the bans/censors I set have reason "get out", "stay out" or "no thanks", but storing the owner's account makes things easier. Also other info should/could be stored, such as timestamp when added, last used, etc.

(originally reported by wiebe)

Enforce ban on nick change

When a ban is set on chanserv's banlist and a user joins the channel - he is kicked and banned. However, when a user changes his nick to fit the banmask - he isn't getting kicked and banned.

Example:

[03/10/13 09:02:04] * blal ([email protected]) has joined #thechannel
[03/10/13 09:02:40] * Q sets mode: +b [S]!@
[03/10/13 09:02:49] * blal is now known as [S]test
[03/10/13 09:03:59] * AnOppedUser sets mode: -b [S]!@
[03/10/13 09:03:59] * Q sets mode: +b [S]!@
[03/10/13 09:03:59] * [S]test was kicked by Q (Banned.)
[03/10/13 09:04:17] * AnOppedUser sets mode: -b [S]!@
[03/10/13 09:04:23] * [S]test ([email protected]) has joined #thechannel
[03/10/13 09:04:23] * Q sets mode: +b [S]!@
[03/10/13 09:04:23] * [S]test was kicked by Q (Banned.)
[03/10/13 09:02:04] * blal ([email protected]) has joined #thechannel
[03/10/13 09:02:40] * Q sets mode: +b [S]!@
[03/10/13 09:02:49] * blal is now known as [S]test
[03/10/13 09:03:59] * AnOppedUser sets mode: -b [S]!@
[03/10/13 09:03:59] * Q sets mode: +b [S]!@
[03/10/13 09:03:59] * [S]test was kicked by Q (Banned.)
[03/10/13 09:04:17] * AnOppedUser sets mode: -b [S]!@
[03/10/13 09:04:23] * [S]test ([email protected]) has joined #thechannel
[03/10/13 09:04:23] * Q sets mode: +b [S]!@
[03/10/13 09:04:23] * [S]test was kicked by Q (Banned.)

(originally reported by NaNg)

Friends cannot be ticketed

Friends on G cannot be given a ticket, G claims they do not need it, but they cannot get to #feds without it. Of course the work around at the moment, is to -peon -ticket -friend them, but it would be nice if this could be corrected.

(originally reported by wiebe)

Add a delayed auto-voice to chanserv

(Labels: Chanserv Enhancement)

Add a channel setting to voice all joining users after a delay.

Rationale:
Delaying the ability to speak in the channel for unregistered people is a good mitigation strategy against the current spam attack.
This can be archived by setting the channel mode +DM (delay join, reg-only moderated), and auto-voicing anyone who enters with a delay.

If a fixed delay is used, a chanflag can be used.
If the delay should be configurable on a per channel basis, then more changes are needed.

pqsql/chanserv: Does not survive PostgreSQL server restart

pqsql currently does not survive the PostgreSQL server restarting or going away at all.

If the PostgreSQL server goes away, it will send some input, signaling PQisBusy == false, but we may not even have queryhead != NULL at the time, leading to a crash. To avoid the crash, queryhead == NULL would first need to be checked, then PQresultStatus(PQgetResult(dbconn)) should be verified to be PGRES_FATAL_ERROR, else the connection may continue to function as intended.

The discussion about PostgreSQL bug 5837 has yielded that the API is meant to be used with PQisBusy to immediately go ahead to PQgetResult, which will then inform about the fatal error. PQstatus will still return CONNECTION_OK despite it obviously not being okay.

However, even if that were to be detected correctly, then there is no reasonable recovery plan:

  1. Reconnecting is very risky. Should the connectdb() function hang due to its nature of connecting in a blocking manner, all network I/O will stall, possibly sendq'ing newserv off the network.
  2. At the very least, the chanserv does not survive a reload the pqsql module, it crashes at least somewhere around dbhandler/loadmaillocksdone/csc_dochanstat/chanservstdmessage due to invalid parameters. Due to this, waiting for the PostgreSQL server to be confirmed working and then reloading pqsql manually is no option. More modules may or may not fail in similar ways.

PostgreSQL servers may go away even over local connections when admins enable automatic security updates on Linux distributions and the like, due to it being restarted in the process.

copy/paste error in nickrate/nickrate.c

There are confusing error messages originating from the nickrate module: it claims to be proxyscan.

Attached a patch (created using hg export).

(originally reported by anders)

Add account name to nicksearch output

Add account info in output from nicksearch to the usermode part.
For example: nick!user@host [ip](+ixr account) (realname)

(originally reported by wiebe)

Add splitadd command

In case a split entry is removed in error, there is currently no way to fix that (apart from using O to jupe it, but then the server cannot link probably..), so it may be an idea to add a splitadd command.

(originally reported by wiebe)

Add noticeflags system to Q

Add noticeflag system on Q like the newserv instances have, allowing opers to choose what to receive.

Also add notices about things like, but not limited to, usage of addchan/delchan by opers (perhaps not R), chanlev and chanflags changes which are only possible by oper priv, suspendchan/unsuspendchan, etc.

(originally reported by wiebe)

explain please about sql for newserv

Hello i read readme and what i only see it configure file but i`m not see explain about create sql for newserv i happy if this possible set explain about this

Save and restore topic after temporarily leaving empty channel

Q leaves empty channels after about 5 minutes and then rejoins when a user joins it. It may be a nice feature if Q saves the topic when leaving, and restore it upon rejoin.

Or only when chanflag +f is set and a topic was set with /msg Q settopic.

(originally reported by wiebe)

Add timestamp to staff comment field

Add an additional field to the whois output, to display the timestamp of when a staff comment was last set.

The field would not be shown unless a staff comment is present.

(originally reported by Bazerka)

nterfacer protocol lacks forward secrecy

The nterfacer protocol has no forward security: Once the password for any connection that was fully recorded is known, the key derivation algorithm allows decryption of all data. If the session in question is still going on, creating valid MACs becomes viable as the key becomes known.

Assuming best case, brute-forcing passwords is infeasible. Best case is all characters other than \n and \0 are actually used in the password. The maximum password length is 255 - strlen("password=") - 1 == 245. This leads to a potential maximum password strength of meaning 245 bytes with each byte having 253 potential values, which is entirely unreasonable to brute-force. However, should it ever be leaked or cracked due to a weak password (matching /^[a-z]{8}$/, for example), all previous captured communications would be compromised.

(There are other somewhat scary things, such as using memcmp instead of a function with constant timing for HMAC comparison, but it apparently can't be abused since the connection is immediately dropped on invalid MAC, plus keys are only per-session as well as not generated until after authentication of the other party. Additionally, CBC here shouldn't have any issues with its predictable PKCS#7 padding since the nterfacer protocol is correctly encrypt-then-MAC.)

modify ping/pong routine to its uplink include info for AsLL

newserv's ping/pong routine with its uplink current does not support the ping time or the info for AsLL. I think it might be nice if it did. It does not need to reply to remote AsLL requests, simply providing the needed info in the ping/pong routine should make the AsLL info available on its uplink. See example below.

xx.cc.quakenet.org AsLL for hub.xx.quakenet.org – RTT: 2ms Upstream: -28ms Downstream: 30ms
xx.cc.quakenet.org AsLL for services.cc.quakenet.org – [unknown]
xx.cc.quakenet.org AsLL for *: 2 local servers matched

(originally from wiebe)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.