Commit initial: GNUWorld servicii IRC cu README.md complet in limba romana - Analiza arhitecturala completa a proiectului - Documentatie ierarhie clase, bucla de evenimente, protocol P10 - Identificare probleme memorie si recomandari modernizare
This commit is contained in:
commit
fcb24f6de9
870 files changed
+311128
No files matched your search
@@ -0,0 +1,48 @@
|
||||
Introduction
|
||||
--------------------------------------------------------------------------------------
|
||||
|
||||
* What is mod.Chanfix exactly?
|
||||
|
||||
mod.ChanFix is an open source port of OpenChanfix for IRCu 2.10.11.X+ oompatible networks.
|
||||
Designed as a module for GNUWorld. The service creates a continuous dynamic database of
|
||||
channel operators, automatically reopping channels which lose channel ops. Furthermore,
|
||||
the service can be manually invoked by mod.Chanfix administrators to reverse recent
|
||||
channel takeovers.
|
||||
|
||||
By default, mod.Chanfix observes channels with at least 4 clients, and retains channel
|
||||
op score records for 2 weeks.
|
||||
|
||||
* How does it keep track of which people have been opped?
|
||||
|
||||
mod.Chanfix makes a temporary list of all unique AC accounts in a given channel.
|
||||
Thereafter, the account is registered in the database as channel operators. For every
|
||||
scored round, a given account will receive one point. Channel ops are scored whenever
|
||||
the IRC network is judged to be intact (i.e. not split), and by default every channel
|
||||
is scored once every 5 minutes. Thus, assuming no large network splits, a given account
|
||||
can achieve a maximum of 288 points per 24 hour period.
|
||||
|
||||
* When does mod.Chanfix take action?
|
||||
|
||||
There are two cases in which mod.Chanfix will take action.
|
||||
|
||||
The first is whenever a channel with scores in the database becomes opless. mod.Chanfix
|
||||
will look at the scores in the database and match those against the clients currently
|
||||
present on the channel, and give ops to the clients with the highest scores.
|
||||
|
||||
This is called an automatic fix; whenever a channel becomes opless, mod.Chanfix will
|
||||
attempt to fix it automatically.
|
||||
|
||||
The second is when a channel has been taken over. An IRC Operator with an account on
|
||||
mod.Chanfix with the right flag can issue a manual fix. If this is issued, all clients
|
||||
on the channel are deopped, and mod.Chanfix will join the channel and remove all bans
|
||||
and modes. This allows the channel regulars to rejoin the channel. Then, after a short
|
||||
while, mod.Chanfix will join the channel again and will reop the channel using the same
|
||||
autofix logic.
|
||||
|
||||
For more information about the exact algorithm used, see the opping logic section.
|
||||
|
||||
* How does one interface with mod.Chanfix?
|
||||
|
||||
When loading the mod.Chanfix module into your GNUWorld, a client is connected. By default,
|
||||
its nickname is C. All oper <-> mod.Chanfix interaction goes via NOTICE to C, this can be
|
||||
changed to PRIVMSG's if desired.
|
||||
@@ -0,0 +1,51 @@
|
||||
Example:
|
||||
|
||||
Let's look at an example channel, #mod.Chanfix. Currently, the following people
|
||||
are on #mod.Chanfix:
|
||||
|
||||
Users on #mod.Chanfix:
|
||||
|
||||
[@Beige ] [@cryogen] [@sabre2th] [+cfan ] [morfie]
|
||||
[@cfgaar] [@Garion ] [@smurf ] [+Domilijn] [as4 ]
|
||||
#mod.Chanfix: Total of 10 nicks [6 ops, 2 voices, 2 normal]
|
||||
|
||||
Here is a list of all the hostmasks of the users on #mod.Chanfix:
|
||||
|
||||
@ Beige beige@oper.suid.sh
|
||||
@ cfgaar garion@open.chanfix
|
||||
@ cryogen ~cryogen@bin.bash.sh
|
||||
@ Garion garion@hub.nl
|
||||
@ sabre2th sabre2th@feed.your.supermind
|
||||
@ smurf smurf@80.60.12.241
|
||||
+ cfan cfan@jd-163-76.doc.aca.mmu.ac.uk
|
||||
+ Domilijn domilijn@kansloos.carnique.nl
|
||||
morfie morf@217-195-236-172.dsl.esined.net
|
||||
as4 as@CPE-65-28-140-90.neb.rr.com
|
||||
|
||||
Now, #mod.Chanfix has existed for several weeks now, so there are scores for
|
||||
the channel in the mod.Chanfix database. These scores are:
|
||||
|
||||
1. 3651 garion@open.chanfix
|
||||
2. 3548 beige@oper.suid.sh
|
||||
3. 3498 domilijn@kansloos.carnique.nl
|
||||
4. 3289 garion@hub.nl
|
||||
5. 3176 ivo@echelon.schaapje.org
|
||||
6. 3006 sabre2th@feed.your.supermind
|
||||
7. 1252 smurf@80.60.12.241
|
||||
|
||||
As you can see, cryogen, whilst being opped, doesn't have a record in the
|
||||
database. The reason that he doesn't have a score is that he is not idented;
|
||||
you can see this because he has a tilde (~) before his username.
|
||||
Let's ask C what he thinks about the status of the channel as it is now.
|
||||
|
||||
<Garion> score #mod.Chanfix
|
||||
<C> Top 10 scores for channel "#mod.Chanfix" in the database:
|
||||
<C> 3651, 3548, 3498, 3289, 3176, 3006, 1252.
|
||||
<C> Top 10 scores for ops in channel "#mod.Chanfix" in the database:
|
||||
<C> 3651, 3548, 3289, 3006, 1252.
|
||||
<C> Top 10 scores for non-ops in channel "#mod.Chanfix" in the database:
|
||||
<C> 3498.
|
||||
|
||||
From these scores you can see that the scores of the opped people are the same
|
||||
as the top scores in the database, so the channel is currently with the
|
||||
"rightful" owners.
|
||||
@@ -0,0 +1,40 @@
|
||||
Example:
|
||||
|
||||
Users on #mod.Chanfix:
|
||||
|
||||
[@Beige ] [as4 ] [cryogen ] [Garion] [sabre2th]
|
||||
[+cfgaar] [cfan] [Domilijn] [morfie] [smurf ]
|
||||
#mod.Chanfix: Total of 10 nicks [1 ops, 1 voices, 8 normal]
|
||||
|
||||
Beige's connection has some problems:
|
||||
|
||||
* Beige (beige@oper.suid.sh) has quit [Connection reset by peer]
|
||||
* Beige (beige@oper.suid.sh) has joined #mod.Chanfix
|
||||
|
||||
The situation is now like this:
|
||||
Users on #mod.Chanfix:
|
||||
|
||||
[+cfgaar] [as4 ] [cryogen ] [Garion] [sabre2th]
|
||||
[ Beige ] [cfan] [Domilijn] [morfie] [smurf ]
|
||||
#mod.Chanfix: Total of 10 nicks [0 ops, 1 voices, 9 normal]
|
||||
|
||||
mod.Chanfix will detect that #mod.Chanfix has become opless. Then it will look
|
||||
in the database if there are scores known for #mod.Chanfix, and it will check
|
||||
if there are currently clients with high enough scores present in the channel.
|
||||
If that is the case, and here that certainly is, C will join the channel and op
|
||||
a few clients:
|
||||
|
||||
* C (chanfix@open.chanfix) has joined #mod.Chanfix
|
||||
* irc.open.chanfix sets mode #mod.Chanfix: +o C
|
||||
* C sets mode #mod.Chanfix: +oooo cfgaar Beige Domilijn Garion
|
||||
* <C> 4 clients should have been opped.
|
||||
* C (chanfix@open.chanfix) has left #mod.Chanfix []
|
||||
|
||||
After the fix, the channel looks like this:
|
||||
Users on #mod.Chanfix:
|
||||
|
||||
[@Beige ] [@Domilijn] [as4 ] [cryogen] [sabre2th]
|
||||
[@cfgaar] [@Garion ] [cfan] [morfie ] [smurf ]
|
||||
#mod.Chanfix: Total of 10 nicks [4 ops, 0 voices, 6 normal]
|
||||
|
||||
In OPLOGIC you can find out why these 4 clients have been opped and not any others.
|
||||
@@ -0,0 +1,77 @@
|
||||
Example:
|
||||
|
||||
Someone has taken over #mod.Chanfix, set it invite-only and kicked and banned
|
||||
almost all the regulars. The situation:
|
||||
|
||||
Users on #mod.Chanfix:
|
||||
[@IHateC ] [@takebot2] [as4 ] [henkje]
|
||||
[@takebot] [@v ] [Domilijn] [p33n ]
|
||||
#mod.Chanfix: Total of 8 nicks [4 ops, 0 voices, 4 normal]
|
||||
|
||||
The modes on the channel are as follows:
|
||||
|
||||
+iknmst closed
|
||||
+b *!chanfix@open.chanfix
|
||||
+b *!beige@oper.suid.sh
|
||||
+b *!garion@*
|
||||
|
||||
Asking mod.Chanfix about the scores gives the following result:
|
||||
|
||||
<Garion> score #mod.Chanfix
|
||||
<C> Top 10 scores for channel "#mod.Chanfix" in the database:
|
||||
<C> 3651, 3548, 3498, 3289, 3176, 3006, 1252, 7, 6, 6.
|
||||
<C> Top 10 scores for ops in channel "#mod.Chanfix" in the database:
|
||||
<C> 7, 6, 6, 3.
|
||||
<C> Top 10 scores for non-ops in channel "#mod.Chanfix" in the database:
|
||||
<C> 3498.
|
||||
|
||||
From these scores, it is clear that the channel has been taken over. Nobody
|
||||
with high scores is currently opped. So, time for a manual chanfix:
|
||||
|
||||
<Garion> chanfix #mod.Chanfix
|
||||
<C> Manual chanfix acknowledged for channel "#mod.Chanfix".
|
||||
|
||||
This manual chanfix occurs in two stages. First, all modes of the channel are
|
||||
cleared:
|
||||
|
||||
* TS for #mod.Chanfix changed from 1029226431 to 1029226430
|
||||
* irc.open.chanfix sets mode #mod.Chanfix: -ik
|
||||
* irc.open.chanfix sets mode #mod.Chanfix: -oooo IHateC takebot takebot2 v
|
||||
* C (chanfix@open.chanfix) has joined #mod.Chanfix
|
||||
* irc.open.chanfix sets mode #mod.Chanfix: +o C
|
||||
<C> Channel fix in progress, please stand by.
|
||||
* C sets mode #mod.Chanfix: -bbb *!chanfix@open.chanfix *!beige@oper.suid.sh
|
||||
*!garion@*
|
||||
* C (chanfix@open.chanfix) has left #mod.Chanfix
|
||||
|
||||
The channel is clear and open again:
|
||||
|
||||
Users on #mod.Chanfix:
|
||||
[as4 ] [henkje] [p33n ] [takebot2]
|
||||
[Domilijn] [IHateC] [takebot] [v ]
|
||||
#mod.Chanfix: Total of 8 nicks [0 ops, 0 voices, 8 normal]
|
||||
|
||||
Now, mod.Chanfix will wait a while to allow the channel regulars to rejoin the
|
||||
channel:
|
||||
|
||||
* Beige (beige@oper.suid.sh) has joined #mod.Chanfix
|
||||
* Garion (garion@hub.nl) has joined #mod.Chanfix
|
||||
* cfgaar (garion@open.chanfix) has joined #mod.Chanfix
|
||||
* cryogen (~cryogen@bin.bash.sh) has joined #mod.Chanfix
|
||||
* sabre2th (sabre2th@feed.your.supermind) has joined #mod.Chanfix
|
||||
* henkje (henk@i.aml33t.cx) has parted #mod.Chanfix
|
||||
And after that pause, C will enter to give ops to the people who deserve it:
|
||||
* C (chanfix@open.chanfix) has joined #mod.Chanfix
|
||||
* irc.open.chanfix sets mode #mod.Chanfix: +o C
|
||||
* C sets mode #mod.Chanfix: +oooo cfgaar Beige Domilijn Garion
|
||||
* <C> 4 clients should have been opped.
|
||||
* C (chanfix@open.chanfix) has left #mod.Chanfix []
|
||||
|
||||
This leaves the channel in the following state:
|
||||
|
||||
Users on #mod.Chanfix:
|
||||
[@Beige ] [@Domilijn] [as4 ] [IHateC] [sabre2th] [takebot2]
|
||||
[@cfgaar] [@Garion ] [cryogen] [p33n ] [takebot ] [v ]
|
||||
#mod.Chanfix: Total of 12 nicks [4 ops, 0 voices, 8 normal]
|
||||
|
||||
Back with its rightful owners.
|
||||
@@ -0,0 +1,8 @@
|
||||
Examples
|
||||
|
||||
Here are some examples to help understand what mod.Chanfix does.
|
||||
|
||||
* #mod.Chanfix - users and their scores - EXAMPLE.01
|
||||
* opless - shows what happens if #mod.Chanfix becomes opless - EXAMPLE.02
|
||||
* takeover - shows what happens if #mod.Chanfix is taken over - EXAMPLE.03
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
Admin FAQ
|
||||
--------------------------------------------------------------------------------------
|
||||
|
||||
* I want to run mod.Chanfix on my network, anything I need to be aware of?
|
||||
|
||||
If you are just starting with mod.Chanfix, you should run it in no-fix mode for 1-2 weeks.
|
||||
This allows it to gather scores of channels and avoids people complaining that mod.Chanfix
|
||||
is not fixing their 20-point channel. Furthermore, explain to your users that mod.Chanfix
|
||||
is not similar to channel registration at all, but a last resort service. Point them to
|
||||
the User FAQ if they have questions.
|
||||
|
||||
* Can more than one mod.Chanfix run on the same network?
|
||||
|
||||
Yes. However, you should make sure that never more than one mod.Chanfix has fixing enabled.
|
||||
Having two mod.Chanfix servers both set to perform automatic and manual fixes could lead to
|
||||
confusing or even damaging situations, for example:
|
||||
|
||||
- oper1 tells chanfix1 to manually fix #channel
|
||||
- chanfix1 enters #channel, removing all ops
|
||||
- chanfix2 sees an opless #channel and tries to fix it
|
||||
|
||||
- oper1 tells chanfix1 to manually fix #channel
|
||||
- a few minutes later, oper2 tells chanfix2 to manually fix #channel
|
||||
|
||||
Until a mechanism to communicate between mod.Chanfix servers has been devised, be careful
|
||||
while running more than a single mod.Chanfix instance.
|
||||
|
||||
* I'm running mod.Chanfix but i'm not seeing any scores! What's wrong?
|
||||
|
||||
Make sure that enough servers are linked. You can confirm that via the STATUS command. If
|
||||
chanfix has disabled fixing because not enough servers are linked, it is also not scoring
|
||||
any channels. Second, a channel won't get scores unless it has 4 or more clients in it.
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
Oper FAQ
|
||||
--------------------------------------------------------------------------------------
|
||||
|
||||
* How does mod.Chanfix keep track of who is logged in?
|
||||
|
||||
Whenever you LOGIN to X you will get an account, mod.Chanfix has a list of all accounts
|
||||
with access in its database.
|
||||
|
||||
* What happens in case of a netsplit? Or when my connection drops and I reconnect?
|
||||
|
||||
IRCu will burst your account in a netsplit, so mod.Chanfix will know you are still logged
|
||||
in. However if you reconnect or quit you will be logged out. Thus you will need to relogin
|
||||
to X, or whichever service you use to get an account.
|
||||
@@ -0,0 +1,37 @@
|
||||
User FAQ
|
||||
--------------------------------------------------------------------------------------
|
||||
|
||||
* Is mod.Chanfix like channel registration?
|
||||
|
||||
No. Not all all. mod.Chanfix is a neutral entity which can fix a stable channel (this
|
||||
means that it has existed for at least several days, and has had a group of stable ops)
|
||||
in emergencies. The two emergencies when mod.Chanfix can help are if the channel becomes
|
||||
opless, or if the channel is taken over.
|
||||
|
||||
* When does my channel qualify for mod.Chanfix?
|
||||
|
||||
Every channel with at least 4 clients in it will get points.
|
||||
|
||||
* How do I get a score?
|
||||
|
||||
Every 5 minutes mod.Chanfix will look at the opped clients in each channel that have
|
||||
enough clients. All of the clients that are idented (no ~ in front of their username)
|
||||
will get a point. See the examples for more information.
|
||||
|
||||
* How many points do I need?
|
||||
|
||||
You need at least 163 points (4% of the maximum) for mod.Chanfix to reop you. Below that,
|
||||
mod.Chanfix doesn't do anything. This means your channel must be at least 163 / 12 = 13.6
|
||||
hours old.
|
||||
|
||||
* My channel is opless and I have a score, why isn't mod.Chanfix opping me?
|
||||
|
||||
mod.Chanfix can take up to an hour to fix an opless channel. The higher your score, the
|
||||
faster you are opped. So be patient. Oh, and if your score is below 163, well, you won't
|
||||
be opped.
|
||||
|
||||
* After 2 hours, mod.Chanfix has still not been to my channel! What's going on?
|
||||
|
||||
The most probable explanation is that you have fewer than 3 clients in your channel. You
|
||||
must have at least 4 clients in your opless channel before mod.Chanfix will come to fix it.
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
Opping logic
|
||||
--------------------------------------------------------------------------------------
|
||||
|
||||
* Automatic fix
|
||||
|
||||
If a channel becomes opless, and there are scores in mod.Chanfix's database for this
|
||||
channel, mod.Chanfix will try to fix this channel. In other words, it will give ops
|
||||
to the clients it thinks deserve it the most.
|
||||
|
||||
For each automatic opless channel fix (autofix), a time window of 60 minutes is
|
||||
reserved. During this window, mod.Chanfix will join zero or more times, opping at
|
||||
least one client each time.
|
||||
|
||||
There are, of course, requirements to the minimum score that you need to have before
|
||||
mod.Chanfix will op you. This minimum score is determined both from the absolute
|
||||
maximum score that can be obtained, and from the maximum score available in the
|
||||
channel that is being fixed.
|
||||
|
||||
The first time that mod.Chanfix joins, it will only op clients with:
|
||||
|
||||
- at least 90% of channel_max_score (variable)
|
||||
- and at least 40% of max_score (default: 0.4 * 4032 = 1613)
|
||||
|
||||
The last time that mod.Chanfix can possibly join (which is after the
|
||||
autofix_time_maximum has passed), it will only op clients with:
|
||||
|
||||
- at least 30% of channel_max_score (variable)
|
||||
- and at least min_score (default: 0.04 * 4032 = 162)
|
||||
|
||||
In between, mod.Chanfix will use a linear formula to determine the decrease of
|
||||
these values over time.
|
||||
|
||||
Channel #a has a maximum score of 2400. The last opped client leaves.
|
||||
|
||||
When mod.Chanfix first joins, only clients with at least 0.9 * 2400 = 2160 and
|
||||
at least 0.4 * 4032 = 1613 will be opped, so only clients with more than 2159
|
||||
points will be opped.
|
||||
|
||||
If mod.Chanfix would join a last time at the end of the 60 minutes, it would op
|
||||
clients with at least 0.33 * 2400 = 800 points. Lower scores will never be opped.
|
||||
|
||||
When mod.Chanfix joins after 20 minutes (which is 1/3rd of the total window for
|
||||
fixing), it will only op clients with
|
||||
|
||||
at least 2160 - 0.33 * (0.9-0.3) * 2160 = 1728
|
||||
and at least 1613 - 0.33 * (1613-100) = 1109
|
||||
points, i.e. at least 1728 points.
|
||||
|
||||
* Determining the end of a fix
|
||||
|
||||
As soon as autofix_num_opped clients are opped in the channel, either by mod.Chanfix
|
||||
or by the clients which were opped earlier, the fix is considered complete.
|
||||
|
||||
If the channel has fewer than autofix_num_opped clients, then the fix is considered
|
||||
complete as soon as all clients are opped.
|
||||
|
||||
As soon as mod.Chanfix can see that there is at least 1 opped client and no more
|
||||
clients have a score that is high enough to get opped, the fix is considered complete.
|
||||
|
||||
Under no circumstances will mod.Chanfix give ops if that would result in having
|
||||
more than autofix_num_opped opped clients (mod.Chanfix itself excluded).
|
||||
|
||||
Under no circumstances will mod.Chanfix give ops to any client with a score lower than
|
||||
min_score.
|
||||
|
||||
Under no circumstances will mod.Chanfix give ops to any client with a score lower than
|
||||
0.3 * channel_max_score.
|
||||
|
||||
* Manual fix
|
||||
|
||||
Now, for a manual mod.Chanfix the procedure is as follows:
|
||||
|
||||
- First, C joins with TS-1 and removes all modes and bans.
|
||||
- Then, C waits chanfix_initial_interval minutes.
|
||||
- After that, autofixing starts with exactly the same algorithms as described above.
|
||||
@@ -0,0 +1,17 @@
|
||||
-- "$Id: chanfix.addme.sql,v 1.4 2006/12/09 00:29:20 buzlip01 Exp $"
|
||||
-- 2005-08-13 : reed
|
||||
--
|
||||
-- This script will add an account for user "Admin" with owner (+o) access.
|
||||
-- Please modify the default user ("Admin") to your account name.
|
||||
--
|
||||
-- This script may be used to create (not modify) multiple owner
|
||||
-- accounts provided that the account name is changed each time.
|
||||
--
|
||||
|
||||
INSERT INTO users (user_name,created,last_updated,last_updated_by,language_id,flags)
|
||||
VALUES ('Admin',extract(epoch FROM now())::int,extract(epoch FROM now())::int,'(added via addme script)',1,16);
|
||||
|
||||
INSERT INTO hosts (user_id,host)
|
||||
VALUES (1,'*!*@*');
|
||||
|
||||
-- END HERE
|
||||
@@ -0,0 +1,60 @@
|
||||
-- Help information.
|
||||
--
|
||||
-- $Id: chanfix.help.sql,v 1.5 2006/12/26 14:36:08 buzlip01 Exp $
|
||||
|
||||
DELETE FROM help;
|
||||
|
||||
COPY "help" FROM stdin;
|
||||
ADDFLAG 1 Adds the specified flag to the specified user. Possible flags:\na - Can manage users for local server/group\nb - Can block/unblock channels\nc - Can add/delete notes for channels\nf - Can perform manual chanfix\no - Can do anything\nu - Can manage users globally\nNote: You can only add one flag at a time.
|
||||
ADDHOST 1 Adds the specified hostmask to the user's list of hostmasks.
|
||||
ADDNOTE 1 Adds a note to the specified channel.
|
||||
ADDUSER 1 Adds a new user, without flags, and optionally with the specified hostmask.
|
||||
ALERT 1 Puts a channel on ALERT status\nChannels in alert status have information contained in notes that should be considered before fixing the channel. These channels also require the OVERRIDE flag to manually fix them.
|
||||
BLOCK 1 Blocks a channel from being fixed, both automatically and manually.\nThe reason will be shown when doing INFO <channel>.
|
||||
CANFIX 1 Lists the ops that can fix the specified channel without requiring oper assistance.
|
||||
CHECK 1 Shows the number of ops and total clients in the specified channel.
|
||||
CSCORE 1 Shows the same as SCORE, but in a compact output. See /msg C HELP SCORE.
|
||||
CHANFIX 1 Performs a manual fix on the specified channel. Append OVERRIDE, YES, or an exclamation mark (!) to force a manual fix. Append CONTACT if you wish that the top 10 ops for the channel be noticed about the fix before the fix happens.
|
||||
DELFLAG 1 Removes the specified flag from a user. See /msg C HELP ADDFLAG.
|
||||
DELHOST 1 Deletes the specified hostmask from a user's list of hostmasks.
|
||||
DELNOTE 1 Deletes a note matching the specified id from the specified channel. You can only delete the notes you have added.
|
||||
DELUSER 1 Deletes the specified user.
|
||||
QUOTE 1 This command should never be used.\nUsing it would be bad.\nHow bad?\nTry to imagine all life stopping instantaneously, and every molecule in your body exploding at the speed of light.
|
||||
HELP 1 Shows help about the specified command. With no command specified, all commands that you have access to use are listed.
|
||||
HISTORY 1 Shows the times that the specified channel has been manually fixed.
|
||||
INFO 1 Shows all notes of the specified channel and whether the channel is actively blocked.
|
||||
LASTCOM 1 Shows all the last commands which where issued to the bot.
|
||||
LISTBLOCKED 1 Lists all of the channels that chanfix will not score.
|
||||
LISTHOSTS 1 With no username specified, it lists the hostmasks chanfix recognizes you by. Otherwise, it views the specified username's host list.\nNOTE: Server admins (+a) can only view host lists of users within their own server group. Users lower than server admin status can only view their own host lists.
|
||||
LISTTEMPBLOCKED 1 Lists all of the channels that chanfix will not score temporarly.
|
||||
OPLIST 1 Shows the top 10 op accounts and their scores for the specified channel. Possible flags\n-all (or ALL or !) - Lists all scores.\n-days - Displays a small bar of the 2 week scoring period showing when a person was opped (. means never opped, 0 means 0-10%, 9 means 91-100%)
|
||||
OPNICKS 1 Shows the nicknames currently opped on the specified channel.
|
||||
REHASH 1 Reloads the translations, configuration, or help values based on the specified target.
|
||||
RELOAD 1 Completely reloads chanfix.\nNOTE: This will subject chanfix to a reconnection which will also include a large netburst that takes time to process, so use with caution.
|
||||
REQUESTOP 1 Performs a fix on the specified channel. Append CONTACT if you wish that the top 10 ops for the channel be noticed about the fix before the fix happens.
|
||||
SCORE 1 Without extra arguments, shows the top scores of <channel>.\nOtherwise, it shows the score of either an <account> or a currently online client <=nick> for <channel>.
|
||||
SET 1 Sets various configuration options to the specified values.\nBoolean settings: ENABLE_AUTOFIX, ENABLE_CHANFIX, ENABLE_CHANNEL_BLOCKING.\nInteger settings: NUM_SERVERS.
|
||||
SIMULATE 1 Performs a simulated fix on the specified channel. Append AUTO or MANUAL to choose what type of fix to simulate upon the channel.
|
||||
STATUS 1 Shows current statistics such as: uptime, percentage network presence, fix and block settings.
|
||||
SUSPEND 1 Suspends the specified user.
|
||||
TEMPBLOCK 1 Temporary blocks a channel from being fixed, both automatically and manually.\nThe reason will be shown when doing INFO <channel>.
|
||||
UNALERT 1 Removes a channel from alert status.
|
||||
UNBLOCK 1 Removes a channel from the blocklist causing it to be fixable again.
|
||||
UNTEMPBLOCK 1 Removes a channel from the temporary blocklist causing it to be fixable again.
|
||||
USET 1 Sets options on your account. Possible settings:\nNOTICE - receive notices, if no then PRIVMSG's will be sent.\nLANG - What language chanfix will communicate with you in; available languages: EN - English.
|
||||
WHOIS 1 Shows account information for the specified user.
|
||||
SETGROUP 1 Sets the group for the specified user.
|
||||
SHUTDOWN 1 Saves the database and shuts GNUWorld down.
|
||||
UNSUSPEND 1 Unsuspends the specified user.
|
||||
USERSCORES 1 Shows all scores for the given account over all channels.
|
||||
WHOGROUP 1 Shows all users in the specified group along with their flags. If no argument is given, all groups are listed.
|
||||
<INDEXNORMAL> 1 \002Normal User\002: CANFIX REQUESTOP
|
||||
<INDEXOPER> 1 \002Oper Level\002: CHANFIX SIMULATE SCORE CSCORE CHECK HISTORY INFO OPLIST OPNICKS STATUS
|
||||
<INDEXLOGGEDIN> 1 \002Logged In\002: LISTHOSTS USET USERSCORES WHOIS WHOFLAG
|
||||
<INDEXBLOCK> 1 \002Blocker (+b)\002: BLOCK UNBLOCK LISTBLOCKED
|
||||
<INDEXCOMMENT> 1 \002Commenter (+c)\002: ADDNOTE DELNOTE ALERT UNALERT
|
||||
<INDEXCHANFIX> 1 \002Chanfixer (+f)\002: CHANFIX SIMULATE
|
||||
<INDEXOWNER> 1 \002Owner (+o)\002: LASTCOM REHASH RELOAD SET SHUTDOWN
|
||||
<INDEXSERVERADMIN> 1 \002Server Admin (+a)\002: ADDUSER DELUSER ADDHOST DELHOST ADDFLAG DELFLAG WHOGROUP SUSPEND UNSUSPEND
|
||||
<INDEXUSERADMIN> 1 \002User Manager (+u)\002: ADDUSER DELUSER ADDHOST DELHOST ADDFLAG DELFLAG SETGROUP WHOGROUP SUSPEND UNSUSPEND
|
||||
\.
|
||||
@@ -0,0 +1,225 @@
|
||||
-- Language Definition Table for chanfix.
|
||||
--
|
||||
-- Language: English (1)
|
||||
-- Author: evilnet development <http://evilnet.sourceforge.net>
|
||||
--
|
||||
-- $Id: chanfix.language.english.sql,v 1.7 2007/02/01 14:11:17 buzlip01 Exp $
|
||||
|
||||
|
||||
DELETE FROM translations;
|
||||
|
||||
COPY "translations" FROM stdin;
|
||||
1 1 You may only add one flag per ADDFLAG command. 31337 0
|
||||
1 2 No such user %s. 31337 0
|
||||
1 3 Only an owner can add the owner flag. 31337 0
|
||||
1 4 Only an owner can add the user management flag. 31337 0
|
||||
1 5 You cannot add a flag to a user in a different group. 31337 0
|
||||
1 6 You cannot add a block flag. 31337 0
|
||||
1 7 You cannot add a serveradmin flag. 31337 0
|
||||
1 8 User %s already has flag '%c'. 31337 0
|
||||
1 9 Added flag '%c' to user %s. 31337 0
|
||||
1 10 You cannot add a host to a user in a different group. 31337 0
|
||||
1 11 User %s already has hostmask %s. 31337 0
|
||||
1 12 Failed adding hostmask %s to user %s. 31337 0
|
||||
1 13 Added hostmask %s to user %s. 31337 0
|
||||
1 14 %s is an invalid channel name. 31337 0
|
||||
1 15 Note recorded for channel %s. 31337 0
|
||||
1 16 User %s already exists. 31337 0
|
||||
1 17 Created user %s (%s). 31337 0
|
||||
1 18 Created user %s. 31337 0
|
||||
1 19 Error creating user %s. (Insertion failed) 31337 0
|
||||
1 20 The channel %s already has the ALERT flag. 31337 0
|
||||
1 21 ALERT flag added to channel %s 31337 0
|
||||
1 22 Channel blocking is disabled. 31337 0
|
||||
1 23 The channel %s is already blocked. 31337 0
|
||||
1 24 The channel %s has been blocked. 31337 0
|
||||
1 25 Sorry, manual chanfixes are currently disabled. 31337 0
|
||||
1 26 Sorry, chanfix is currently disabled because not enough servers are linked. 31337 0
|
||||
1 27 No such channel %s. 31337 0
|
||||
1 28 %s cannot be chanfixed as it uses oplevels (+A/+U). If this channel has been taken over and needs to be returned to the original owners, use \002OPLIST %s\002 to see the real owners and then use an appropriate oper service to fix the channel manually. 31337 0
|
||||
1 29 %s is a registered channel. 31337 0
|
||||
1 30 There are no scores in the database for %s. 31337 0
|
||||
1 31 The channel %s is already being manually fixed. 31337 0
|
||||
1 32 The highscore in channel %s is %d which is lower than the minimum score required (%.2f * %d = %d). 31337 0
|
||||
1 33 The channel %s is being automatically fixed. Append the OVERRIDE flag to force a manual fix. 31337 0
|
||||
1 34 The channel %s is BLOCKED. 31337 0
|
||||
1 35 Alert: The channel %s has notes. Use \002INFO %s\002 to read them. Append the OVERRIDE flag to force a manual fix. 31337 0
|
||||
1 36 Manual chanfix acknowledged for %s 31337 0
|
||||
1 37 I see %d opped out of %d total clients in %s. 31337 0
|
||||
1 38 You may only remove one flag per DELFLAG command. 31337 0
|
||||
1 39 Only an owner can delete the owner flag. 31337 0
|
||||
1 40 Only an owner can delete the user management flag. 31337 0
|
||||
1 41 You cannot delete a flag from a user in a different group. 31337 0
|
||||
1 42 You cannot remove a block flag. 31337 0
|
||||
1 43 You cannot remove a serveradmin flag. 31337 0
|
||||
1 44 User %s does not have flag '%c'. 31337 0
|
||||
1 45 Deleted flag '%c' from user %s. 31337 0
|
||||
1 46 You cannot delete a host from a user in a different group. 31337 0
|
||||
1 47 User %s doesn't have hostmask %s. 31337 0
|
||||
1 48 Failed deleting hostmask %s from user %s. 31337 0
|
||||
1 49 Deleted hostmask %s from user %s. 31337 0
|
||||
1 50 There is no entry in the database for %s. 31337 0
|
||||
1 51 The channel %s does not have any notes. 31337 0
|
||||
1 52 An unknown error occured while checking the note id. 31337 0
|
||||
1 53 There is no such note with that note_id. 31337 0
|
||||
1 54 No such note #%d for channel %s. 31337 0
|
||||
1 55 Note #%d for channel %s was not added by you. You can only delete notes that you added. 31337 0
|
||||
1 56 Note #%d for channel %s is not a manually added note. You can only delete notes that were manually added. 31337 0
|
||||
1 57 Note #%d for channel %s deleted. 31337 0
|
||||
1 58 You cannot delete an owner unless you're an owner. 31337 0
|
||||
1 59 You cannot delete a user manager unless you're an owner. 31337 0
|
||||
1 60 You cannot delete a user in a different group. 31337 0
|
||||
1 61 Deleted user %s. 31337 0
|
||||
1 62 Error deleting user %s. 31337 0
|
||||
1 63 Channel %s has never been manually fixed. 31337 0
|
||||
1 64 An unknown error occurred while reading this channel's notes. 31337 0
|
||||
1 65 Channel %s has been manually fixed on: 31337 0
|
||||
1 67 End of list. 31337 0
|
||||
1 68 No information on %s in the database. 31337 0
|
||||
1 69 Information on %s: 31337 0
|
||||
1 70 %s is BLOCKED. 31337 0
|
||||
1 71 %s is being chanfixed. 31337 0
|
||||
1 72 %s is being autofixed. 31337 0
|
||||
1 73 Notes (%d): 31337 0
|
||||
1 74 End of information. 31337 0
|
||||
1 75 %s is ALERTED. 31337 0
|
||||
1 76 [%d:%s] %s \002%s\002%s%s 31337 0
|
||||
1 77 Could not find channel %s on the network. 31337 0
|
||||
1 78 I am not in %s. 31337 0
|
||||
1 79 You are already in %s! 31337 0
|
||||
1 80 Top %d unique op accounts in channel %s: 31337 0
|
||||
1 81 Found %d unique op accounts in channel %s: 31337 0
|
||||
1 82 Rank Score Account -- Time first opped / Time last opped / Nick 31337 0
|
||||
1 83 Opped clients on channel %s: 31337 0
|
||||
1 84 I see 1 opped client in %s. 31337 0
|
||||
1 85 I see %u opped clients in %s. 31337 0
|
||||
1 86 Successfully reloaded help tables. %i entries in table. 31337 0
|
||||
1 87 Successfully rehashed configuration file. 31337 0
|
||||
1 88 Reloading client...see you on the flip side 31337 0
|
||||
1 89 Score for %s (%s) in channel %s: %u. (Ranked #%u of %d) 31337 0
|
||||
1 90 ~U %s no@such.nick 0 31337 0
|
||||
1 91 No such nick %s. 31337 0
|
||||
1 92 None. 31337 0
|
||||
1 93 Top %u scores for channel %s in the database: 31337 0
|
||||
1 94 Top %u scores for current ops in %s in the database: 31337 0
|
||||
1 95 Top %u scores for current non-ops in %s in the database: 31337 0
|
||||
1 96 Please use SET NUM_SERVERS <integer number>. 31337 0
|
||||
1 97 NUM_SERVERS is now %d. 31337 0
|
||||
1 98 Enabled autofix. 31337 0
|
||||
1 99 Disabled autofix. 31337 0
|
||||
1 100 Please use SET ENABLE_AUTOFIX <on/off>. 31337 0
|
||||
1 101 Enabled manual chanfix. 31337 0
|
||||
1 102 Disabled manual chanfix. 31337 0
|
||||
1 103 Please use SET ENABLE_CHANFIX <on/off>. 31337 0
|
||||
1 104 Enabled channel blocking. 31337 0
|
||||
1 105 Disabled channel blocking. 31337 0
|
||||
1 106 Please use SET ENABLE_CHANNEL_BLOCKING <on/off>. 31337 0
|
||||
1 107 This setting does not exist. 31337 0
|
||||
1 108 User %s is already in group %s. 31337 0
|
||||
1 109 Set group %s for user %s. 31337 0
|
||||
1 110 Shutting down the server as per your request. 31337 0
|
||||
1 111 Uptime: \002%s\002 31337 0
|
||||
1 112 Automatic fixing is: \002%s\002 31337 0
|
||||
1 113 Manual fixing is: \002%s\002 31337 0
|
||||
1 114 Channel blocking is: \002%s\002 31337 0
|
||||
1 115 Required amount of servers linked is %u%% of %u, which is a minimum of %u servers. 31337 0
|
||||
1 116 Splitmode enabled: only %i servers linked. 31337 0
|
||||
1 117 Splitmode disabled. There are %i servers linked. 31337 0
|
||||
1 118 You cannot suspend a user in a different group. 31337 0
|
||||
1 119 User %s is already suspended. 31337 0
|
||||
1 120 Suspended user %s indefinitely. 31337 0
|
||||
1 121 The channel %s does not have the ALERT flag. 31337 0
|
||||
1 122 ALERT flag removed from channel %s 31337 0
|
||||
1 123 The channel %s is not blocked. 31337 0
|
||||
1 124 Channel %s has been unblocked. 31337 0
|
||||
1 125 You cannot unsuspend a user in a different group. 31337 0
|
||||
1 126 User %s is not currently suspended. 31337 0
|
||||
1 127 Unsuspended user %s. 31337 0
|
||||
1 128 Language is set to %s. 31337 0
|
||||
1 129 I will now send you notices. 31337 0
|
||||
1 130 I will now send you privmsgs. 31337 0
|
||||
1 131 Please use USET NOTICE <on/off>. 31337 0
|
||||
1 134 You can only WHOGROUP on your group. 31337 0
|
||||
1 135 Users with group %s [username (flags)]: 31337 0
|
||||
1 136 Number of users: %d. 31337 0
|
||||
1 137 List of all users: 31337 0
|
||||
1 138 User: %s, Flags: %s, Group: %s 31337 0
|
||||
1 140 --SUSPENDED-- 31337 0
|
||||
1 142 Group: %s 31337 0
|
||||
1 143 Flags: none. 31337 0
|
||||
1 144 Flags: +%s 31337 0
|
||||
1 145 Sorry, I do not accept commands during a burst. 31337 0
|
||||
1 146 Unknown command. 31337 0
|
||||
1 147 Your access to this service is suspended. 31337 0
|
||||
1 148 Your current host does not match any registered hosts for your username. 31337 0
|
||||
1 149 You need to authenticate to use this command. 31337 0
|
||||
1 150 This command requires flag '%c'. 31337 0
|
||||
1 151 This command requires one of these flags: \"%s\". 31337 0
|
||||
1 152 This command requires authentication and flag '%c'. 31337 0
|
||||
1 153 This command requires authentication and one of these flags: \"%s\". 31337 0
|
||||
1 154 SYNTAX: 31337 0
|
||||
1 155 Language: %s (%s) 31337 0
|
||||
1 156 ~U %s no@score.for.account 0 31337 0
|
||||
1 157 No score for account %s on channel %s. 31337 0
|
||||
1 158 Score for account %s in channel %s: %u. (Ranked #%u of %d) 31337 0
|
||||
1 159 Suspending yourself is not a very wise thing to do. 31337 0
|
||||
1 160 Last modified: %s (%s ago) 31337 0
|
||||
1 161 NeedOper: Yes 31337 0
|
||||
1 162 NeedOper: No 31337 0
|
||||
1 163 You cannot view hosts of a user in a different group. 31337 0
|
||||
1 164 Host list for %s: 31337 0
|
||||
1 165 End of host list. 31337 0
|
||||
1 166 No score for %s on %s. 31337 0
|
||||
1 167 ~U %s no@score.for.nick 0 31337 0
|
||||
1 168 List of all groups: 31337 0
|
||||
1 169 Number of groups: %d. 31337 0
|
||||
1 170 Removed the default hostmask of *!*@* from user %s. 31337 0
|
||||
1 171 Channel service linked. New channels will be scored. 31337 0
|
||||
1 172 Channel service not linked. New channels will not be scored. 31337 0
|
||||
1 173 This command cannot proceed while an update is in progress. Please try again later. 31337 0
|
||||
1 174 Total number of channels recorded: %u 31337 0
|
||||
1 175 Total number of channel ops recorded: %u 31337 0
|
||||
1 176 Last used the service: %s ago 31337 0
|
||||
1 177 Last used the service: Never 31337 0
|
||||
1 178 WARNING: Channel %s is being manually fixed; aborting fix as per BLOCK. 31337 0
|
||||
1 179 WARNING: Channel %s is being automatically fixed; aborting fix as per BLOCK. 31337 0
|
||||
1 180 You cannot suspend an owner unless you're an owner. 31337 0
|
||||
1 181 You cannot suspend a user manager unless you're an owner. 31337 0
|
||||
1 182 You cannot unsuspend an owner unless you're an owner. 31337 0
|
||||
1 183 You cannot unsuspend a user manager unless you're an owner. 31337 0
|
||||
1 184 You cannot delete a host from an owner unless you're an owner. 31337 0
|
||||
1 185 You cannot delete a host from a user manager unless you're an owner. 31337 0
|
||||
1 186 You cannot add a host to an owner unless you're an owner. 31337 0
|
||||
1 187 You cannot add a host to a user manager unless you're an owner. 31337 0
|
||||
1 188 %s is temporarily blocked. (Use OVERRIDE to bypass) 31337 0
|
||||
1 189 %s is temporarily blocked due to oper intervention via EUWorld within the last hour. Please append the OVERRIDE flag to force a manual fix. 31337 0
|
||||
1 190 List of all blocked channels: 31337 0
|
||||
1 191 %d channels blocked. 31337 0
|
||||
1 192 Current fix has been running for %s 31337 0
|
||||
1 193 Current fix is on hold (waiting for ops to join) 31337 0
|
||||
1 194 Channel Score -- Time first opped / Time last opped 31337 0
|
||||
1 195 Account %s doesn't have any scores in the database. 31337 0
|
||||
1 196 You score for %s is not high enough to issue a fix. 31337 0
|
||||
1 197 Accounts who can issue fixes in channel %s: 31337 0
|
||||
1 198 Account -- Time first opped / Time last opped 31337 0
|
||||
1 199 You do not have a high enough score for %s to check canfix list. 31337 0
|
||||
1 200 Sorry, chanfix cannot fix channels at the moment, please try again soon. 31337 0
|
||||
1 201 The channel %s is being automatically fixed. You cannot issue another fix at the moment. 31337 0
|
||||
1 202 The channel %s cannot be fixed, please contact a help channel for further information. 31337 0
|
||||
1 203 Sorry, I'm too busy at the moment. Please try again soon. 31337 0
|
||||
1 204 Sorry, I cant fix channels at the moment. 31337 0
|
||||
1 205 Fixing %s, please wait. 31337 0
|
||||
1 206 You must wait %s seconds before %s can be fixed again with this command, or contact a help channel. 31337 0
|
||||
1 207 End of OPLIST for %s 31337 0
|
||||
1 208 You cannot see logs more than one year ago. 31337 0
|
||||
1 209 Listing last %d messages from day %d. 31337 0
|
||||
1 210 End of LASTCOM report. 31337 0
|
||||
1 211 The channel %s is TEMPBLOCKED. To fix it, please append the OVERRIDE flag. 31337 0
|
||||
1 214 %s is TEMPBLOCKED. (Use OVERRIDE to bypass) 31337 0
|
||||
1 221 Simulate complete for %s 31337 0
|
||||
1 222 (%s) Opping: %s (%d Clients) 31337 0
|
||||
1 223 (%s) Channel modes have been removed. 31337 0
|
||||
1 224 Simulate for %s (%s) starting at next fixing round (Current C time %s). 31337 0
|
||||
1 225 NOTE: This is only an estimate, if ops with points join or part it could affect who gets opped. 31337 0
|
||||
1 226 You may only WHOFLAG one flag. 31337 0
|
||||
\.
|
||||
@@ -0,0 +1,8 @@
|
||||
-- Use this file to populate the 'languages' table.
|
||||
--
|
||||
-- $Id: chanfix.languages.sql,v 1.4 2006/12/09 00:29:20 buzlip01 Exp $
|
||||
|
||||
DELETE FROM languages;
|
||||
COPY "languages" FROM stdin;
|
||||
1 EN English 31337 0
|
||||
\.
|
||||
@@ -0,0 +1,128 @@
|
||||
-- mod.chanfix SQL Database Script
|
||||
-- (c) 2003 Matthias Crauwels <ultimate_@wol.be>
|
||||
-- (c) 2005 Reed Loden <reed@reedloden.com>
|
||||
-- $Id: chanfix.sql,v 1.4 2006/12/09 00:29:20 buzlip01 Exp $
|
||||
|
||||
CREATE TABLE languages (
|
||||
id SERIAL,
|
||||
code VARCHAR( 16 ) UNIQUE,
|
||||
name VARCHAR( 16 ),
|
||||
last_updated INT4 NOT NULL,
|
||||
deleted INT2 DEFAULT '0',
|
||||
PRIMARY KEY(id)
|
||||
);
|
||||
|
||||
CREATE TABLE translations (
|
||||
language_id INT4 CONSTRAINT translations_language_id_ref REFERENCES languages ( id ),
|
||||
response_id INT4 NOT NULL DEFAULT '0',
|
||||
text TEXT,
|
||||
last_updated INT4 NOT NULL,
|
||||
deleted INT2 DEFAULT '0',
|
||||
|
||||
PRIMARY KEY (language_id, response_id)
|
||||
);
|
||||
|
||||
CREATE TABLE help (
|
||||
topic VARCHAR(20) NOT NULL,
|
||||
language_id INT4 CONSTRAINT help_language_id_ref REFERENCES languages ( id ),
|
||||
contents TEXT
|
||||
);
|
||||
|
||||
CREATE INDEX help_topic_idx ON help (topic);
|
||||
CREATE INDEX help_language_id_idx ON help (language_id);
|
||||
|
||||
CREATE TABLE chanOps (
|
||||
channel VARCHAR(200) NOT NULL,
|
||||
account VARCHAR(24) NOT NULL,
|
||||
last_seen_as VARCHAR(128),
|
||||
ts_firstopped INT4 DEFAULT 0,
|
||||
ts_lastopped INT4 DEFAULT 0,
|
||||
day0 INT2 NOT NULL DEFAULT 0,
|
||||
day1 INT2 NOT NULL DEFAULT 0,
|
||||
day2 INT2 NOT NULL DEFAULT 0,
|
||||
day3 INT2 NOT NULL DEFAULT 0,
|
||||
day4 INT2 NOT NULL DEFAULT 0,
|
||||
day5 INT2 NOT NULL DEFAULT 0,
|
||||
day6 INT2 NOT NULL DEFAULT 0,
|
||||
day7 INT2 NOT NULL DEFAULT 0,
|
||||
day8 INT2 NOT NULL DEFAULT 0,
|
||||
day9 INT2 NOT NULL DEFAULT 0,
|
||||
day10 INT2 NOT NULL DEFAULT 0,
|
||||
day11 INT2 NOT NULL DEFAULT 0,
|
||||
day12 INT2 NOT NULL DEFAULT 0,
|
||||
day13 INT2 NOT NULL DEFAULT 0
|
||||
);
|
||||
|
||||
CREATE TABLE channels (
|
||||
id SERIAL,
|
||||
channel TEXT NOT NULL UNIQUE,
|
||||
flags INT4 NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX channels_name_idx ON channels(LOWER(channel));
|
||||
|
||||
CREATE TABLE users (
|
||||
id SERIAL,
|
||||
user_name TEXT NOT NULL UNIQUE,
|
||||
created INT4 NOT NULL DEFAULT 0,
|
||||
last_seen INT4 NOT NULL DEFAULT 0,
|
||||
last_updated INT4 NOT NULL DEFAULT 0,
|
||||
last_updated_by VARCHAR(128),
|
||||
language_id INT4 CONSTRAINT language_id_ref REFERENCES languages (id) NOT NULL DEFAULT 1,
|
||||
faction VARCHAR(128) NOT NULL DEFAULT 'undernet.org',
|
||||
flags INT2 NOT NULL DEFAULT 0,
|
||||
-- 0x01 - server admin (limited access to +u commands)
|
||||
-- 0x02 - can block/unblock channels
|
||||
-- 0x04 - can add/del notes/alerts to channels
|
||||
-- 0x08 - can manual chanfix
|
||||
-- 0x10 - oper not required
|
||||
-- 0x20 - owner
|
||||
-- 0x40 - user management rights
|
||||
-- 0x80 - requires authentication
|
||||
isSuspended BOOLEAN NOT NULL DEFAULT FALSE,
|
||||
-- currently suspended
|
||||
useNotice BOOLEAN NOT NULL DEFAULT TRUE,
|
||||
-- use notice instead of privmsg
|
||||
needOper BOOLEAN NOT NULL DEFAULT TRUE,
|
||||
-- require operator privileges from staff
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
CREATE INDEX users_username_idx ON users( lower(user_name) );
|
||||
|
||||
CREATE TABLE hosts (
|
||||
user_id INT4 CONSTRAINT hosts_user_id_ref REFERENCES users ( id ),
|
||||
host VARCHAR(128) NOT NULL
|
||||
);
|
||||
|
||||
CREATE INDEX hosts_user_id_idx ON hosts(user_id);
|
||||
|
||||
CREATE TABLE notes (
|
||||
id SERIAL,
|
||||
ts INT4,
|
||||
channelID INT4 CONSTRAINT notes_channelID_ref REFERENCES channels ( id ),
|
||||
user_name VARCHAR(128),
|
||||
event INT2 DEFAULT 0,
|
||||
-- Defines the note event type, so we can filter nice reports.
|
||||
-- 1 -- EV_MISC - Uncategorised event.
|
||||
-- 2 -- EV_NOTE - Miscellaneous notes about a channel.
|
||||
-- 3 -- EV_CHANFIX - When someone manual chanfixes a channel.
|
||||
-- 4 -- EV_BLOCK - When someone blocks a channel.
|
||||
-- 5 -- EV_UNBLOCK - When somebody unblocks a channel.
|
||||
-- 6 -- EV_ALERT - When someone sets alert flag on a channel.
|
||||
-- 7 -- EV_UNALERT - When somebody removes alert flag from a channel.
|
||||
-- 8 -- EV_REQUESTOPS - When a normal client requestops a channel.
|
||||
|
||||
message TEXT,
|
||||
PRIMARY KEY(id, channelID)
|
||||
);
|
||||
|
||||
CREATE TABLE comlog (
|
||||
ts INT4 NOT NULL,
|
||||
user_name text,
|
||||
command VARCHAR(512)
|
||||
);
|
||||
|
||||
CREATE INDEX notes_channelID_idx ON notes(channelID);
|
||||
CREATE INDEX notes_event_idx ON notes(event);
|
||||
@@ -0,0 +1,78 @@
|
||||
#!/usr/bin/env python
|
||||
#
|
||||
# Script to check GNUWorld's mod.chanfix translations for mismatched
|
||||
# variable arguments
|
||||
# (C) 2001 Alex Badea <vampire@go.ro>
|
||||
# (C) 2005 Neil Spierling <sirvulcan@gmail.com> (mod.chanfix modifications)
|
||||
#
|
||||
# $Id: checkvarargs.py,v 1.4 2006/12/09 00:29:20 buzlip01 Exp $
|
||||
|
||||
# Change this to suit your system
|
||||
gnuworld_home = "../../"
|
||||
|
||||
# English language ID (or, any language ID that is known to have
|
||||
# valid translated strings)
|
||||
english_id = 1
|
||||
|
||||
# Regular expression (don't ask me how I got to it)
|
||||
regstr = "(%([0123456789]+\\$)?[-\\+ #'0]*[0123456789]*(\\.[0123456789]+)?([hjlLqtzZ]|hh|ll)?[diouxXfeEgGaAcspnm])"
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
import sys
|
||||
import os
|
||||
import re
|
||||
from string import *
|
||||
|
||||
trans = {}
|
||||
|
||||
def read_language_table(fname):
|
||||
print "* Reading translations from %s" % fname
|
||||
f = open(fname, "r")
|
||||
for line in f.readlines():
|
||||
line = strip(line)
|
||||
if len(line) < 2: continue
|
||||
if line[0][:1] == "--": continue
|
||||
if line[0][:1] == "\.": continue
|
||||
|
||||
toks = split(line, '\t')
|
||||
if len(toks) < 4: continue
|
||||
if toks[0] == "DELETE": continue
|
||||
if toks[0] == "COPY": continue
|
||||
|
||||
try:
|
||||
pk = (int(toks[0]), int(toks[1]))
|
||||
except ValueError:
|
||||
print "* Non-numeric IDs, line: %s" % `toks`
|
||||
continue
|
||||
|
||||
if toks[len(toks)-2] != "31337":
|
||||
print "* Translation ID (%d,%d) doesn't have a '31337' timestamp" % pk
|
||||
if toks[len(toks)-1] != "0":
|
||||
print "* Translation ID (%d,%d) doesn't have a '0' deleted flag" % pk
|
||||
if trans.has_key(pk):
|
||||
print "* Duplicate translation ID (%d,%d) Text: '%s' conflicts with '%s'" % (pk[0], pk[1], toks[2], trans[toks[1]])
|
||||
trans[pk] = toks[2]
|
||||
f.close()
|
||||
print "* Read %d translations" % len(trans)
|
||||
|
||||
read_language_table(os.path.join(gnuworld_home, "mod.ocf", "doc", "chanfix.language.english.sql"))
|
||||
|
||||
r = re.compile(regstr)
|
||||
print "* Checking varargs..."
|
||||
for (lang, tr) in trans.keys():
|
||||
if lang == english_id: continue
|
||||
|
||||
ctext = trans[(lang, tr)]
|
||||
cva_list = r.findall(ctext)
|
||||
if not len(cva_list):
|
||||
if count(ctext, '%'): print '* Possible missed vararg:', ctext
|
||||
etext = trans[(english_id, tr)]
|
||||
eva_list = r.findall(etext)
|
||||
|
||||
if cva_list != eva_list:
|
||||
print "* Mismatched vararg list, translation ID %d:" % tr
|
||||
print " %d> %s" % (lang, ctext)
|
||||
print " %d> %s" % (english_id, etext)
|
||||
|
||||
print "* Done"
|
||||
@@ -0,0 +1,129 @@
|
||||
#!/usr/bin/env python
|
||||
#
|
||||
# Script to check GNUWorld's mod.chanfix translations
|
||||
# (C) 2001 Alex Badea <vampire@go.ro>
|
||||
# (C) 2005 Neil Spierling <sirvulcan@gmail.com> (mod.chanfix modifications)
|
||||
#
|
||||
# $Id: chktrans.py,v 1.4 2006/12/09 00:29:20 buzlip01 Exp $
|
||||
|
||||
# Change this to suit your system
|
||||
gnuworld_home = "../../"
|
||||
|
||||
# Language ID to check
|
||||
language_id = "1"
|
||||
|
||||
# The maximum distance, in lines, between a bot->Notice and a getResponse
|
||||
notice_thresh = 2
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
import sys
|
||||
import os
|
||||
from string import *
|
||||
|
||||
responses = {}
|
||||
resp_used = {}
|
||||
trans = {}
|
||||
trans_r = {}
|
||||
alpha = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"
|
||||
|
||||
def read_language_table(fname):
|
||||
f = open(fname, "r")
|
||||
for line in f.readlines():
|
||||
line = strip(line)
|
||||
toks = split(line, '\t')
|
||||
if len(toks) < 4: continue
|
||||
if toks[0] != language_id: continue
|
||||
if toks[len(toks)-2] != "31337": continue
|
||||
if trans.has_key(toks[1]):
|
||||
print "* Duplicate translation ID (%s) Text: '%s' conflicts with '%s' defined by ID %d" % (toks[1], toks[2], trans[toks[1]], trans_r[toks[2]])
|
||||
if trans_r.has_key(toks[2]):
|
||||
print "* Duplicate translation text '%s', ID %s already defined by ID %s" % (toks[2], toks[1], trans_r[toks[2]])
|
||||
trans[toks[1]] = toks[2]
|
||||
trans_r[toks[2]] = toks[1]
|
||||
f.close()
|
||||
print "* Read %d translations from %s" % (len(trans), fname)
|
||||
|
||||
def read_response_table(fname):
|
||||
f = open(fname, "r")
|
||||
for line in f.readlines():
|
||||
line = strip(line)
|
||||
toks = split(line)
|
||||
if len(toks) < 2: continue
|
||||
if toks[0] != "const": continue
|
||||
if toks[1] != "int": continue
|
||||
if responses.has_key(toks[2]):
|
||||
print "* Duplicate response name (%s) ID: %s" % (toks[2], toks[4])
|
||||
responses[toks[2]] = toks[4][:-1]
|
||||
resp_used[toks[2]] = 0
|
||||
f.close()
|
||||
print "* Read %d responses from %s" % (len(responses), fname)
|
||||
|
||||
def parse_file(fname):
|
||||
f = open(os.path.join(gnuworld_home, "mod.ocf", fname), "r")
|
||||
line = f.readline()
|
||||
lineno = 1
|
||||
last_notice = 0
|
||||
while line:
|
||||
# Check the integrity of language:: references
|
||||
try: start = index(line, "language::")
|
||||
except ValueError: start = -1
|
||||
if start >= 0:
|
||||
start = start + 10
|
||||
end = start
|
||||
while (line[end] in alpha) and (end < len(line)):
|
||||
end = end + 1
|
||||
id = line[start:end]
|
||||
numeric = 'UNDEFINED'
|
||||
text = '[UNASSIGNED]'
|
||||
if responses.has_key(id):
|
||||
numeric = responses[id]
|
||||
if trans.has_key(numeric):
|
||||
text = trans[numeric]
|
||||
resp_used[id] = 1
|
||||
print "%s(%d): language::%s (%s) = '%s'" % (fname, lineno, id, numeric, text)
|
||||
#print "%-25s (%4d): %-30s (%4s) -> %s" % (fname, lineno, id, numeric, text)
|
||||
|
||||
# Check for unlisted translations
|
||||
try: start = index(line, "Notice")
|
||||
except ValueError: start = -1
|
||||
notice_done = 0
|
||||
if (start >= 0) and (start == 0 or not line[start-1] in alpha):
|
||||
last_notice = lineno
|
||||
notice_line = strip(line[:-1])
|
||||
if line[-2] == ";": notice_done = 1
|
||||
|
||||
try: start = index(line, "getResponse")
|
||||
except ValueError: start = -1
|
||||
if start >= 0:
|
||||
last_notice = 0
|
||||
|
||||
if last_notice and (lineno > last_notice + notice_thresh or notice_done):
|
||||
print "* Possible untranslated string in %s(%d): %s" % (fname, last_notice, notice_line)
|
||||
last_notice = 0
|
||||
|
||||
|
||||
lineno = lineno + 1
|
||||
line = f.readline()
|
||||
f.close()
|
||||
|
||||
read_language_table(os.path.join(gnuworld_home, "mod.ocf", "doc", "chanfix.language.english.sql"))
|
||||
read_response_table(os.path.join(gnuworld_home, "mod.ocf", "responses.h"))
|
||||
|
||||
files = os.listdir(os.path.join(gnuworld_home, "mod.ocf"))
|
||||
for file in files:
|
||||
if len(file) < 4: continue
|
||||
if file[-3:] != ".cc": continue
|
||||
parse_file(file)
|
||||
|
||||
for resp in resp_used.keys():
|
||||
if not resp_used[resp]:
|
||||
numeric = 'UNDEFINED'
|
||||
text = '[UNASSIGNED]'
|
||||
if responses.has_key(resp):
|
||||
numeric = responses[resp]
|
||||
if trans.has_key(numeric):
|
||||
text = trans[numeric]
|
||||
print "* Unused response language::%s (%s) = '%s'" % (resp, numeric, text)
|
||||
|
||||
print "* Done"
|
||||
@@ -0,0 +1,142 @@
|
||||
#!/usr/bin/env python
|
||||
#
|
||||
# Script to check GNUWorld's mod.chanfix translations
|
||||
# Episode 2 - Check for inconsistent translation strings
|
||||
#
|
||||
# (C) 2001 Alex Badea <vampire@go.ro>
|
||||
# (C) 2005 Neil Spierling <sirvulcan@gmail.com> (mod.chanfix modifications)
|
||||
#
|
||||
# $Id: cparse.py,v 1.4 2006/12/09 00:29:20 buzlip01 Exp $
|
||||
|
||||
# Change this to suit your system
|
||||
gnuworld_home = "../../"
|
||||
|
||||
# Language ID to check
|
||||
language_id = "1"
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
import sys
|
||||
import os
|
||||
from string import *
|
||||
|
||||
responses = {}
|
||||
resp_used = {}
|
||||
trans = {}
|
||||
trans_r = {}
|
||||
alpha = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"
|
||||
|
||||
def read_language_table(fname):
|
||||
f = open(fname, "r")
|
||||
for line in f.readlines():
|
||||
line = strip(line)
|
||||
toks = split(line, '\t')
|
||||
if len(toks) < 4: continue
|
||||
if toks[0] != language_id: continue
|
||||
if toks[len(toks)-2] != "31337": continue
|
||||
if trans.has_key(toks[1]):
|
||||
print "* Duplicate translation ID (%s) Text: '%s' conflicts with '%s' defined by ID %d" % (toks[1], toks[2], trans[toks[1]], trans_r[toks[2]])
|
||||
if trans_r.has_key(toks[2]):
|
||||
print "* Duplicate translation text '%s', ID %s already defined by ID %s" % (toks[2], toks[1], trans_r[toks[2]])
|
||||
trans[toks[1]] = toks[2]
|
||||
trans_r[toks[2]] = toks[1]
|
||||
f.close()
|
||||
print "* Read %d translations from %s" % (len(trans), fname)
|
||||
|
||||
def read_response_table(fname):
|
||||
f = open(fname, "r")
|
||||
for line in f.readlines():
|
||||
line = strip(line)
|
||||
toks = split(line)
|
||||
if len(toks) < 2: continue
|
||||
if toks[0] != "const": continue
|
||||
if toks[1] != "int": continue
|
||||
if responses.has_key(toks[2]):
|
||||
print "* Duplicate response name (%s) ID: %s" % (toks[2], toks[4])
|
||||
responses[toks[2]] = toks[4][:-1]
|
||||
resp_used[toks[2]] = 0
|
||||
f.close()
|
||||
print "* Read %d responses from %s" % (len(responses), fname)
|
||||
|
||||
|
||||
class Parser:
|
||||
def __init__(self, fname):
|
||||
self.fname = fname
|
||||
f = open(os.path.join(gnuworld_home, "mod.ocf", fname), "r")
|
||||
self.buf = f.read()
|
||||
f.close()
|
||||
def pos(self, sub, start=0):
|
||||
try: return index(self.buf, sub, start)
|
||||
except ValueError: return -1
|
||||
def run(self):
|
||||
idx = self.pos("getResponse", 0)
|
||||
while idx != -1:
|
||||
lineno = count(self.buf[:idx], '\n') + 1
|
||||
idx = idx + len("getResponse")
|
||||
while self.buf[idx] != "(":
|
||||
idx = idx + 1
|
||||
idx = idx + 1
|
||||
|
||||
para = 1
|
||||
quote = 0
|
||||
tok = ""
|
||||
tokens = []
|
||||
while 1:
|
||||
ch = self.buf[idx]
|
||||
if quote:
|
||||
if ch == '"':
|
||||
tok = replace(tok, '""', '')
|
||||
quote = 0
|
||||
else:
|
||||
if ch == "(":
|
||||
para = para + 1
|
||||
elif ch == ")":
|
||||
para = para - 1
|
||||
if para == 0:
|
||||
tokens.append(tok)
|
||||
break
|
||||
elif ch == "\"":
|
||||
quote = 1
|
||||
elif ch in " \n\t\r":
|
||||
idx = idx + 1
|
||||
continue
|
||||
elif ch == ",":
|
||||
tokens.append(tok)
|
||||
tok = ""
|
||||
idx = idx + 1
|
||||
continue
|
||||
elif ch == ";":
|
||||
tokens.append(tok)
|
||||
break
|
||||
tok = tok + ch
|
||||
idx = idx + 1
|
||||
if len(tokens) < 3:
|
||||
print "%s(%d): getResponse has less than 3 arguments" % (self.fname, lineno)
|
||||
pass
|
||||
elif len(tokens[1]) < 10 or tokens[1][:10] != "language::":
|
||||
print "%s(%d): Second argument to getResponse doesn't start with 'language::'" % (self.fname, lineno)
|
||||
else:
|
||||
id = tokens[1][10:]
|
||||
numeric = responses[id]
|
||||
trans_text = trans[numeric]
|
||||
text = tokens[2]
|
||||
if text[:12] == "std::string(": text = text[12:]
|
||||
if text[-1] == ")": text = text[:-1]
|
||||
if text[0] == '"': text = text[1:]
|
||||
if text[-1] == '"': text = text[:-1]
|
||||
if len(tokens) > 2 and trans_text != text:
|
||||
print "%s(%d): Default response doesn't match with translation:\n Def: %s\n Trans: %s" % (self.fname, lineno, text, trans_text)
|
||||
|
||||
idx = self.pos("getResponse", idx)
|
||||
|
||||
read_language_table(os.path.join(gnuworld_home, "mod.ocf", "doc", "chanfix.language.english.sql"))
|
||||
read_response_table(os.path.join(gnuworld_home, "mod.ocf", "responses.h"))
|
||||
|
||||
files = os.listdir(os.path.join(gnuworld_home, "mod.ocf"))
|
||||
for file in files:
|
||||
if len(file) < 4: continue
|
||||
if file[-3:] != ".cc": continue
|
||||
Parser(file).run()
|
||||
|
||||
print "* Note: The chanfix.cc error is safe to ignore."
|
||||
print "* Done"
|
||||
@@ -0,0 +1,62 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
# logrotator.pl
|
||||
#
|
||||
# (C) 2006 Jonathan Disher <funjon@undernet.org>
|
||||
#
|
||||
# Threaded application to read chanfix log files from FIFO's, rotate them daily,
|
||||
# and email them to the appropriate destinations.
|
||||
#
|
||||
# Requires: perl 5.8.0 or higher with ithreads, Net::SMTP
|
||||
|
||||
require 5.8.0;
|
||||
use Net::SMTP;
|
||||
use strict;
|
||||
|
||||
##########################
|
||||
##### FILE LOCATIONS #####
|
||||
##########################
|
||||
|
||||
# Chanfix admin log
|
||||
our $adminlog = "/home/chanfix/gnuworld/bin/chanfix-admin.log";
|
||||
|
||||
###########################
|
||||
##### EMAIL ADDRESSES #####
|
||||
###########################
|
||||
|
||||
# admin log destination
|
||||
our $adminemail = 'abuse@mynet.org';
|
||||
|
||||
# Mail exchanger
|
||||
|
||||
our $MX = "mx.mynet.org";
|
||||
|
||||
#################################
|
||||
##### OTHER IMPORTANT STUFF #####
|
||||
#################################
|
||||
|
||||
our $pid = $$;
|
||||
our $logdir = "/home/chanfix/gnuworld/bin";
|
||||
|
||||
system("mv $adminlog $adminlog.roll");
|
||||
system("kill -HUP `pidof gnuworld`");
|
||||
|
||||
$adminlog .= ".roll";
|
||||
|
||||
&maillog($adminlog,$adminemail);
|
||||
|
||||
sub maillog($$)
|
||||
{
|
||||
my ($logfile,$email) = @_;
|
||||
my ($line,$log);
|
||||
|
||||
open(IN, "<$logfile") || die "Cannot open $logfile: $!\n";
|
||||
while ($line = <IN>) { $log .= $line; }
|
||||
close IN;
|
||||
|
||||
my $smtp = new Net::SMTP($MX);
|
||||
$smtp->mail('chanfix@mynet.org');
|
||||
$smtp->to($email);
|
||||
$smtp->data($log);
|
||||
$smtp->quit;
|
||||
}
|
||||
Reference in new issue
Block a user