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:
Underchat committed 2026-03-02 00:51:45 +02:00
commit fcb24f6de9
870 files changed
+311128

No files matched your search

+1
View File
@@ -0,0 +1 @@
.arch-ids
+1
View File
@@ -0,0 +1 @@
.arch-ids
+1
View File
@@ -0,0 +1 @@
.arch-ids
+365
View File
@@ -0,0 +1,365 @@
#!/bin/bash
# You can change the above to the good path to your "bash" binary if needed
#
# $Id: Manager1K.sh,v 1.4 2003/07/14 10:35:44 nighty Exp $
#
# some default script values
DBNAME="cservice"
DBHOST="127.0.0.1"
# default information to put in the db for those .., DO NOT USE a BLANK 'LASTMODIF', use "0".
LASTMODIFBY=`basename $0`
LASTMODIF="now()::abstime::int4"
# I suggest you dont modify stuff below this point unless you know what you are doing ;P
PSQLCMD=""
echo -n "Checking for 'psql' binary... "
if [ -x /usr/local/pgsql/bin/psql ]; then
PSQL="1"
PSQLCMD="/usr/local/pgsql/bin/psql"
else
PSQL="0"
if [ -x `which psql | head -n 1` ]; then
PSQL="1"
PSQLCMD="psql"
else
PSQL="0"
fi
fi
if [ "$PSQL" == "0" ]; then
echo "not found."
echo "--> Stopping..."
echo "--> exit(1)"
exit 1
else
echo "Ok."
fi
echo "***********************************************************************"
echo "* *"
echo "* GNUworld/mod.cservice level 1000 management script *"
echo "* *"
echo "* With this script, you can make an existing user become a level 1000 *"
echo "* or create a new user that will be level 1000. *"
echo "* if you Modify a user already level 1000, he will be turned in 999. *"
echo "* *"
echo "* *"
echo "* Warning: This program stops on any input error. *"
echo "* *"
echo "***********************************************************************"
echo "\$Id: Manager1K.sh,v 1.4 2003/07/14 10:35:44 nighty Exp $"
echo "***********************************************************************"
echo "* Released under the GNU Public License *"
echo "***********************************************************************"
echo -n "<-- Database host/IP ? [$DBHOST] "
read -e NEWDBHOST
if [ "$NEWDBHOST" != "" ]; then
echo "--> Using custom: $NEWDBHOST"
DBHOST="$NEWDBHOST"
else
echo "--> Using default: $DBHOST"
fi
echo -n "<-- Database name ? [$DBNAME] "
read -e NEWDBNAME
if [ "$NEWDBNAME" != "" ]; then
echo "--> Using custom: $NEWDBNAME"
DBNAME="$NEWDBNAME"
else
echo "--> Using default: $DBNAME"
fi
echo -n "<-- (M)odify existing user or (C)reate new user ? [M] "
read -e REP1
if [ "$REP1" == "c" ]; then
REP1="C"
fi
if [ "$REP1" == "m" ]; then
REP1="M"
fi
if [ "$REP1" != "C" ]; then
if [ "$REP1" != "M" ]; then
REP1="M"
fi
fi
FROMC="0"
FORCEUSERNAME=""
if [ "$REP1" == "C" ]; then
echo "--> CREATE"
echo -n "<-- User name ? "
read -e REP2
if [ "$REP2" == "" ]; then
echo "--> ERROR: Invalid User name (blank)"
echo "--> Stopping..."
echo "--> exit(1)"
exit 1
fi
NUMCHARU=`echo -n $REP2 | wc -c`
NOTOKU0=`expr $NUMCHARU \> 12`
NOTOKU1=`expr $NUMCHARU \< 2`
if [ "$NOTOKU0" == "1" ]; then
echo "--> ERROR: Too many chars in username ($NUMCHARU). Valid range: 2 to 12."
echo "--> Stopping..."
echo "--> exit(1)"
exit 1
fi
if [ "$NOTOKU1" == "1" ]; then
echo "--> ERROR: Too few chars in username ($NUMCHARU). Valid range: 2 to 12."
echo "--> Stopping..."
echo "--> exit(1)"
exit 1
fi
FORCEUSERNAME="$REP2"
if `echo -n "SELECT id FROM users WHERE lower(user_name)='$REP2'" | $PSQLCMD -h $DBHOST $DBNAME >/dev/null 2>&1`; then
USRID=`echo -n "SELECT id FROM users WHERE lower(user_name)='$REP2'" | $PSQLCMD -h $DBHOST $DBNAME | head -n 3 | tail -n 1 | awk '{ print $1 }'`
if [ "$USRID" != "(0" ]; then
echo "--> ERROR: Invalid User name (already taken)"
echo "--> Stopping..."
echo "--> exit(1)"
exit 1
fi
else
echo "--> ERROR: Credentials provided for database connection are either invalid or database setup isn't correct."
echo "--> ERROR: Connection to database '$DBNAME' at '$DBHOST' failed."
echo "--> Stopping..."
echo "--> exit(2)"
exit 2
fi
echo -n "<-- E-Mail address ? "
read -e REP2
if [ "$REP2" == "" ]; then
echo "--> ERROR: Invalid E-Mail address (blank)"
echo "--> Stopping..."
echo "--> exit(1)"
exit 1
fi
USRID=`echo -n "SELECT id FROM users WHERE lower(email)='$REP2'" | $PSQLCMD -h $DBHOST $DBNAME | head -n 3 | tail -n 1 | awk '{ print $1 }'`
if [ "$USRID" != "(0" ]; then
echo "--> ERROR: Invalid E-Mail address (already taken)"
echo "--> Stopping..."
echo "--> exit(1)"
exit 1
else
UEMAIL="$REP2"
echo "!!! NOTICE: E-Mail is OK (not in use), but not checked against SYNTAX/NOREG/DOMAINLOCK. Assuming you know what you do ;P"
fi
echo "--> (1) What's your mother's maiden name ?"
echo "--> (2) What's your dog's (or cat's) name ?"
echo "--> (3) What's your father's birth date ?"
echo -n "<-- What verification question (1, 2 or 3) ? [2] "
read -e REP2
REPOK="0"
if [ "$REP2" == "" ]; then
REP2="2"
fi
if [ "$REP2" == "1" ]; then
REPOK="1"
fi
if [ "$REP2" == "2" ]; then
REPOK="1"
fi
if [ "$REP2" == "3" ]; then
REPOK="1"
fi
if [ "$REPOK" == "0" ]; then
echo "--> ERROR: Invalid verification question choice ($REP2)"
echo "--> Stopping..."
echo "--> exit(1)"
exit 1
fi
UQID="$REP2"
echo -n "<-- Answer to the verification question (4 chars minimum) ? "
read -e REP2
if [ "$REP2" == "" ]; then
echo "--> ERROR: Invalid answer (blank)"
echo "--> Stopping..."
echo "--> exit(1)"
exit 1
fi
NUMCHAR=`echo -n $REP2 | wc -c`
NOTOK=`expr $NUMCHAR \< 4`
if [ "$NOTOK" == "1" ]; then
echo "--> ERROR: You need at least 4 chars !"
echo "--> Stopping..."
echo "--> exit(1)"
exit 1
fi
UVA="$REP2"
echo -n "<-- Please specify the user password (no thing will be displayed on screen, 6 chars minimum) : "
read -es PASS1
echo ""
NUMCHARP=`echo -n $PASS1 | wc -c`
NOTOKP=`expr $NUMCHARP \< 6`
if [ "$NOTOKP" == "1" ]; then
echo "--> ERROR: You need at least 6 chars !"
echo "--> Stopping..."
echo "--> exit(1)"
exit 1
fi
echo -n "<-- Please, this password again : "
read -es PASS2
echo ""
if [ "$PASS1" != "$PASS2" ]; then
echo "--> ERROR: Password mismatch"
echo "--> Stopping..."
echo "--> exit(1)"
exit 1
fi
GENSALT=`mcookie | cut -b-8`
ENCPART=`echo -n $GENSALT$PASS1 | md5sum | cut -f1 -d' '`
ENCPASS="$GENSALT$ENCPART"
echo "--> Crypted password : $ENCPASS"
echo "--> ENCODED : [$ENCPART]"
echo "--> SALT : [$GENSALT]"
echo "--> Adding user '$FORCEUSERNAME'..."
DAQRY="INSERT INTO users (user_name,password,email,url,question_id,verificationdata,language_id,public_key,last_updated_by,last_updated,signup_cookie,signup_ip,tz_setting) VALUES ('$FORCEUSERNAME','$ENCPASS','$UEMAIL','',$UQID,'$UVA',1,'','$LASTMODIFBY',now()::abstime::int4,'Added from the console','127.0.0.1','')"
echo "--> DB: `echo -n \"$DAQRY\" | $PSQLCMD -h $DBHOST $DBNAME`"
FROMC="1"
REP1="M"
fi
if [ "$REP1" == "M" ]; then
if [ "$FORCEUSERNAME" == "" ]; then
echo "--> MODIFY"
echo -n "<-- User name ? "
read -e REP2
if [ "$REP2" == "" ]; then
echo "--> ERROR: Invalid User name (blank)"
echo "--> Stopping..."
echo "--> exit(1)"
exit 1
fi
else
REP2="$FORCEUSERNAME"
fi
if `echo -n "SELECT id FROM users WHERE lower(user_name)='$REP2'" | $PSQLCMD -h $DBHOST $DBNAME >/dev/null 2>&1`; then
USRID=`echo -n "SELECT id FROM users WHERE lower(user_name)='$REP2'" | $PSQLCMD -h $DBHOST $DBNAME | head -n 3 | tail -n 1 | awk '{ print $1 }'`
if [ "$USRID" == "(0" ]; then
echo "--> ERROR: Invalid User name (non existant)"
echo "--> Stopping..."
echo "--> exit(1)"
exit 1
fi
else
echo "--> ERROR: Credentials provided for database connection are either invalid or database setup isn't correct."
echo "--> ERROR: Connection to database '$DBNAME' at '$DBHOST' failed."
echo "--> Stopping..."
echo "--> exit(2)"
exit 2
fi
if [ "$FROMC" == "1" ]; then
if [ "$USRID" == "1" ]; then
echo "--> NOTICE: It's the first user inserted.. which means you probably never used 'cservice.addme.sql' on that database ($DBNAME)"
echo "--> NOTICE: We will be running what should be at this moment just like if you ran 'cservice.addme.sql'"
echo "--> NOTICE: You will NOT need to run 'cservice.addme.sql' anymore, so don't run it ;P"
ADDADMCHAN="INSERT into channels (name,flags,channel_ts,registered_ts,last_updated) VALUES ('*',1,now()::abstime::int4,31337,now()::abstime::int4)"
ADDCODERCHAN="INSERT into channels (name,flags,channel_ts,registered_ts,last_updated) VALUES ('#coder-com',1,now()::abstime::int4,31337,now()::abstime::int4)"
ADDCODERACCESS="INSERT into levels (channel_id,user_id,access,added_by,added,last_modif_by,last_modif,last_updated) VALUES (2,1,500,'$LASTMODIFBY',$LASTMODIF,'$LASTMODIFBY',$LASTMODIF,now()::abstime::int4)"
echo "--> Inserting ADMIN (*) channel..."
echo "--> DB: `echo -n \"$ADDADMCHAN\" | $PSQLCMD -h $DBHOST $DBNAME`"
echo "--> Inserting CODER (#coder-com) channel..."
echo "--> DB: `echo -n \"$ADDCODERCHAN\" | $PSQLCMD -h $DBHOST $DBNAME`"
echo "--> Inserting level 500 access for '$FORCEUSERNAME' on '#coder-com'..."
echo "--> DB: `echo -n \"$ADDCODERACCESS\" | $PSQLCMD -h $DBHOST $DBNAME`"
fi
fi
ADMINLVL=`echo -n "SELECT access FROM levels WHERE channel_id=1 AND user_id=$USRID" | $PSQLCMD -h $DBHOST $DBNAME | head -n 3 | tail -n 1 | awk '{ print $1 }'`
echo -n "--> users.id = $USRID current admin level = "
if [ "$ADMINLVL" == "(0" ]; then
echo "0"
else
echo $ADMINLVL
fi
if [ "$ADMINLVL" == "1000" ]; then
echo "--> Modifying ADMIN access from $ADMINLVL to 999..."
DAQRY="UPDATE levels SET access=999,last_modif_by='$LASTMODIFBY',last_modif=$LASTMODIF,last_updated=now()::abstime::int4 WHERE channel_id=1 AND user_id=$USRID AND access=$ADMINLVL"
echo "--> DB: `echo -n \"$DAQRY\" | $PSQLCMD -h $DBHOST $DBNAME`"
else
if [ "$ADMINLVL" == "(0" ]; then
echo "--> Adding ADMIN access at level 1000..."
DAQRY="INSERT INTO levels (channel_id,user_id,access,added_by,added,last_modif_by,last_modif,last_updated) VALUES (1,$USRID,1000,'$LASTMODIFBY',$LASTMODIF,'$LASTMODIFBY',$LASTMODIF,now()::abstime::int4)"
echo "--> DB: `echo -n \"$DAQRY\" | $PSQLCMD -h $DBHOST $DBNAME`"
else
echo "--> Modifying ADMIN access from $ADMINLVL to 1000..."
DAQRY="UPDATE levels SET access=1000,last_modif_by='$LASTMODIFBY',last_modif=$LASTMODIF,last_updated=now()::abstime::int4 WHERE channel_id=1 AND user_id=$USRID AND access=$ADMINLVL"
echo "--> DB: `echo -n \"$DAQRY\" | $PSQLCMD -h $DBHOST $DBNAME`"
fi
fi
fi
echo "--> Job finished !"
echo "--> NOTICE: Remember your CService bot updates his cache on a regular basis"
echo "--> NOTICE: depending on your cservice.conf file this can take a few minutes for the changes/addition to be available on IRC."
echo "--> Stopping..."
echo "--> exit(0)"
exit 0
# EOF
+288
View File
@@ -0,0 +1,288 @@
#!/bin/bash
# You can change the above to the good path to your "bash" binary if needed
#
# $Id: WipeUser.sh,v 1.7 2003/07/14 10:35:44 nighty Exp $
#
# some default script values
DBNAME="cservice"
DBHOST="127.0.0.1"
# I suggest you dont modify stuff below this point unless you know what you are doing ;P
PSQLCMD=""
echo -n "Checking for 'psql' binary... "
if [ -x /usr/local/pgsql/bin/psql ]; then
PSQL="1"
PSQLCMD="/usr/local/pgsql/bin/psql"
else
PSQL="0"
if [ -x `which psql | head -n 1` ]; then
PSQL="1"
PSQLCMD="psql"
else
PSQL="0"
fi
fi
if [ "$PSQL" == "0" ]; then
echo "not found."
echo "--> Stopping..."
echo "--> exit(1)"
exit 1
else
echo "Ok."
fi
echo "***********************************************************************"
echo "* *"
echo "* GNUworld/mod.cservice Username Removal Tool *"
echo "* *"
echo "* With this script, you can totally remove a user's entry in your db *"
echo "* *"
echo "* Warning: This program stops on any input error. *"
echo "* *"
echo "***********************************************************************"
echo "\$Id: WipeUser.sh,v 1.7 2003/07/14 10:35:44 nighty Exp $"
echo "***********************************************************************"
echo "* Released under the GNU Public License *"
echo "***********************************************************************"
echo -n "<-- Database host/IP ? [$DBHOST] "
read -e NEWDBHOST
if [ "$NEWDBHOST" != "" ]; then
echo "--> Using custom: $NEWDBHOST"
DBHOST="$NEWDBHOST"
else
echo "--> Using default: $DBHOST"
fi
echo -n "<-- Database name ? [$DBNAME] "
read -e NEWDBNAME
if [ "$NEWDBNAME" != "" ]; then
echo "--> Using custom: $NEWDBNAME"
DBNAME="$NEWDBNAME"
else
echo "--> Using default: $DBNAME"
fi
echo -n "<-- User name to totally remove ? "
read -e REP2
if [ "$REP2" == "" ]; then
echo "--> ERROR: Invalid User name (blank)"
echo "--> Stopping..."
echo "--> exit(1)"
exit 1
fi
FORCEUSERNAME="$REP2"
if `echo -n "SELECT id FROM users WHERE lower(user_name)='$REP2'" | $PSQLCMD -h $DBHOST $DBNAME >/dev/null 2>&1`; then
USRID=`echo -n "SELECT id FROM users WHERE lower(user_name)='$REP2'" | $PSQLCMD -h $DBHOST $DBNAME | head -n 3 | tail -n 1 | awk '{ print $1 }'`
if [ "$USRID" == "(0" ]; then
echo "--> ERROR: Invalid User name (non existant)"
echo "--> Stopping..."
echo "--> exit(1)"
exit 1
fi
else
echo "--> ERROR: Credentials provided for database connection are either invalid or database setup isn't correct."
echo "--> ERROR: Connection to database '$DBNAME' at '$DBHOST' failed."
echo "--> Stopping..."
echo "--> exit(2)"
exit 2
fi
if [ "$USRID" == "1" ]; then
echo "--> ERROR: Cannot remove master user (ID = 1)"
echo "--> Stopping..."
echo "--> exit(1)"
exit 1
fi
QC001="SELECT COUNT(user_id) FROM userlog WHERE user_id=$USRID"
QC002="SELECT COUNT(user_id) FROM levels WHERE user_id=$USRID"
QC003="SELECT COUNT(user_id) FROM levels WHERE access=500 AND user_id=$USRID"
QC004="SELECT COUNT(user_id) FROM supporters WHERE user_id=$USRID"
QC005="SELECT COUNT(user_id) FROM objections WHERE user_id=$USRID"
QC006="SELECT COUNT(user_id) FROM users_lastseen WHERE user_id=$USRID"
QC007="SELECT COUNT(manager_id) FROM pending WHERE manager_id=$USRID"
QC008="SELECT COUNT(user_id) FROM pending_emailchanges WHERE user_id=$USRID"
QC009="SELECT COUNT(user_id) FROM pending_pwreset WHERE user_id=$USRID"
QC010="SELECT COUNT(user_id) FROM acl WHERE user_id=$USRID"
QC011="SELECT COUNT(manager_id) FROM pending_mgrchange WHERE manager_id=$USRID"
QC012="SELECT COUNT(new_manager_id) FROM pending_mgrchange WHERE new_manager_id=$USRID"
QC013="SELECT COUNT(user_id) FROM mailq WHERE user_id=$USRID"
QC014="SELECT COUNT(user_id) FROM notes WHERE user_id=$USRID or from_user_id=$USRID"
QC015="SELECT COUNT(user_id) FROM fraud_list_data WHERE user_id=$USRID"
QC016="SELECT COUNT(user_id) FROM notices WHERE user_id=$USRID"
echo "--> Counting records..."
CNT01=`echo -n "$QC001" | $PSQLCMD -h $DBHOST $DBNAME | head -n 3 | tail -n 1 | awk '{ print $1 }' | sed -e 's/(//'`
CNT02=`echo -n "$QC002" | $PSQLCMD -h $DBHOST $DBNAME | head -n 3 | tail -n 1 | awk '{ print $1 }' | sed -e 's/(//'`
CNT03=`echo -n "$QC003" | $PSQLCMD -h $DBHOST $DBNAME | head -n 3 | tail -n 1 | awk '{ print $1 }' | sed -e 's/(//'`
CNT04=`echo -n "$QC004" | $PSQLCMD -h $DBHOST $DBNAME | head -n 3 | tail -n 1 | awk '{ print $1 }' | sed -e 's/(//'`
CNT05=`echo -n "$QC005" | $PSQLCMD -h $DBHOST $DBNAME | head -n 3 | tail -n 1 | awk '{ print $1 }' | sed -e 's/(//'`
CNT06=`echo -n "$QC006" | $PSQLCMD -h $DBHOST $DBNAME | head -n 3 | tail -n 1 | awk '{ print $1 }' | sed -e 's/(//'`
CNT07=`echo -n "$QC007" | $PSQLCMD -h $DBHOST $DBNAME | head -n 3 | tail -n 1 | awk '{ print $1 }' | sed -e 's/(//'`
CNT08=`echo -n "$QC008" | $PSQLCMD -h $DBHOST $DBNAME | head -n 3 | tail -n 1 | awk '{ print $1 }' | sed -e 's/(//'`
CNT09=`echo -n "$QC009" | $PSQLCMD -h $DBHOST $DBNAME | head -n 3 | tail -n 1 | awk '{ print $1 }' | sed -e 's/(//'`
CNT10=`echo -n "$QC010" | $PSQLCMD -h $DBHOST $DBNAME | head -n 3 | tail -n 1 | awk '{ print $1 }' | sed -e 's/(//'`
CNT11=`echo -n "$QC011" | $PSQLCMD -h $DBHOST $DBNAME | head -n 3 | tail -n 1 | awk '{ print $1 }' | sed -e 's/(//'`
CNT12=`echo -n "$QC012" | $PSQLCMD -h $DBHOST $DBNAME | head -n 3 | tail -n 1 | awk '{ print $1 }' | sed -e 's/(//'`
CNT13=`echo -n "$QC013" | $PSQLCMD -h $DBHOST $DBNAME | head -n 3 | tail -n 1 | awk '{ print $1 }' | sed -e 's/(//'`
CNT14=`echo -n "$QC014" | $PSQLCMD -h $DBHOST $DBNAME | head -n 3 | tail -n 1 | awk '{ print $1 }' | sed -e 's/(//'`
CNT15=`echo -n "$QC015" | $PSQLCMD -h $DBHOST $DBNAME | head -n 3 | tail -n 1 | awk '{ print $1 }' | sed -e 's/(//'`
CNT16=`echo -n "$QC016" | $PSQLCMD -h $DBHOST $DBNAME | head -n 3 | tail -n 1 | awk '{ print $1 }' | sed -e 's/(//'`
echo "--> The following entries would be removed if confirmed :"
echo "-->"
echo "--> $CNT01 userlog entries"
echo "--> $CNT02 channel accesses ($CNT03 level 500 (channels would be PURGED))"
echo "--> $CNT04 channel support entries"
echo "--> $CNT05 application objections"
echo "--> $CNT06 last_seen entry"
echo "--> $CNT07 channel applications (old and present)"
echo "--> $CNT08 pending email change entries"
echo "--> $CNT09 pending verif q/a reset entries"
echo "--> $CNT10 ACL entry"
echo "--> $CNT11 pending manager changes (user is old manager, channel will be PURGED)"
echo "--> $CNT12 pending manager changes (user is temp manager, channel will be PURGED)"
echo "--> $CNT13 mailq entries"
echo "--> $CNT14 notes sent/received"
echo "--> $CNT15 fraud list entries"
echo "--> $CNT16 notices entries"
echo "--> 1 user entry"
echo "-->"
echo -n "<-- Are you sure you want to totally and definetively remove those entries from your databse [y/N] ? [N] "
read -e YOUSURE
if [ "$YOUSURE" != "y" ]; then
if [ "$YOUSURE" != "Y" ]; then
YOUSURE="N"
else
YOUSURE="Y"
fi
else
YOUSURE="Y"
fi
if [ "$YOUSURE" == "N" ]; then
echo "--> You're such a weenie ;P"
echo "--> Aborting upon user request (nothing was removed)"
echo "--> Stopping..."
echo "--> exit(0)"
exit 0
fi
echo "--> Removing entries..."
QR001="DELETE FROM userlog WHERE user_id=$USRID"
QR002="DELETE FROM levels WHERE user_id=$USRID AND (access!=500 OR channel_id=1)"
QR003="SELECT channel_id FROM levels WHERE access=500 AND user_id=$USRID" # first set of channels to purge
QR004="DELETE FROM supporters WHERE user_id=$USRID"
QR005="DELETE FROM objections WHERE user_id=$USRID"
QR006="DELETE FROM users_lastseen WHERE user_id=$USRID"
QR007="DELETE FROM pending WHERE manager_id=$USRID"
QR008="DELETE FROM pending_emailchanges WHERE user_id=$USRID"
QR009="DELETE FROM pending_pwreset WHERE user_id=$USRID"
QR010="DELETE FROM acl WHERE user_id=$USRID"
QR011="SELECT channel_id FROM pending_mgrchange WHERE manager_id=$USRID" # second set of channels to purge
QR012="DELETE FROM pending_mgrchange WHERE new_manager_id=$USRID"
QR013="DELETE FROM mailq WHERE user_id=$USRID"
QR014="DELETE FROM notes WHERE user_id=$USRID or from_user_id=$USRID"
QR015="DELETE FROM fraud_list_data WHERE user_id=$USRID"
QR016="DELETE FROM notices WHERE user_id=$USRID"
QR099="DELETE FROM users WHERE id=$USRID"
REM01=`echo -n "$QR001" | $PSQLCMD -h $DBHOST $DBNAME`
echo "--> DB: $REM01"
REM02=`echo -n "$QR002" | $PSQLCMD -h $DBHOST $DBNAME`
echo "--> DB: $REM02"
echo -n "$QR003" | $PSQLCMD -h $DBHOST $DBNAME | grep "." | grep -v -- "--" | grep -v "rows" | grep -v "channel_id" | awk '{ print "DELETE FROM levels WHERE channel_id=" $1 }' | $PSQLCMD -h $DBHOST $DBNAME | xargs echo "--> DB:"
echo -n "$QR003" | $PSQLCMD -h $DBHOST $DBNAME | grep "." | grep -v -- "--" | grep -v "rows" | grep -v "channel_id" | awk '{ print "DELETE FROM channels WHERE id=" $1 }' | $PSQLCMD -h $DBHOST $DBNAME | xargs echo "--> DB:"
REM04=`echo -n "$QR004" | $PSQLCMD -h $DBHOST $DBNAME`
echo "--> DB: $REM04"
REM05=`echo -n "$QR005" | $PSQLCMD -h $DBHOST $DBNAME`
echo "--> DB: $REM05"
REM06=`echo -n "$QR006" | $PSQLCMD -h $DBHOST $DBNAME`
echo "--> DB: $REM06"
REM07=`echo -n "$QR007" | $PSQLCMD -h $DBHOST $DBNAME`
echo "--> DB: $REM07"
REM08=`echo -n "$QR008" | $PSQLCMD -h $DBHOST $DBNAME`
echo "--> DB: $REM08"
REM09=`echo -n "$QR009" | $PSQLCMD -h $DBHOST $DBNAME`
echo "--> DB: $REM09"
REM10=`echo -n "$QR010" | $PSQLCMD -h $DBHOST $DBNAME`
echo "--> DB: $REM10"
echo -n "$QR011" | $PSQLCMD -h $DBHOST $DBNAME | grep "." | grep -v -- "--" | grep -v "rows" | grep -v "channel_id" | awk '{ print "DELETE FROM pending_mgrchanges WHERE channel_id=" $1 }' | $PSQLCMD -h $DBHOST $DBNAME | xargs echo "--> DB:"
echo -n "$QR011" | $PSQLCMD -h $DBHOST $DBNAME | grep "." | grep -v -- "--" | grep -v "rows" | grep -v "channel_id" | awk '{ print "DELETE FROM channels WHERE id=" $1 }' | $PSQLCMD -h $DBHOST $DBNAME | xargs echo "--> DB:"
REM12=`echo -n "$QR012" | $PSQLCMD -h $DBHOST $DBNAME`
echo "--> DB: $REM12"
REM13=`echo -n "$QR013" | $PSQLCMD -h $DBHOST $DBNAME`
echo "--> DB: $REM13"
REM14=`echo -n "$QR014" | $PSQLCMD -h $DBHOST $DBNAME`
echo "--> DB: $REM14"
REM15=`echo -n "$QR015" | $PSQLCMD -h $DBHOST $DBNAME`
echo "--> DB: $REM15"
REM16=`echo -n "$QR016" | $PSQLCMD -h $DBHOST $DBNAME`
echo "--> DB: $REM16"
REM99=`echo -n "$QR099" | $PSQLCMD -h $DBHOST $DBNAME`
echo "--> DB: $REM99"
echo "--> Username '$FORCEUSERNAME' has been totally removed."
echo "--> Job finished !"
echo "--> NOTICE: Remember your CService bot updates his cache on a regular basis"
echo "--> NOTICE: depending on your cservice.conf file this can take a few minutes for the changes/addition to be available on IRC."
echo "--> Stopping..."
echo "--> exit(0)"
exit 0
# EOF
+11
View File
@@ -0,0 +1,11 @@
-- This script removes old pending_traffic records to conserve storage space.
-- Select those applications where status is one of the following, and remove
-- the pending_traffic records - they are no longer required for runtime checking.
-- 3 - 'Completed'
-- 4 - 'Cancelled'
-- 9 - 'Rejected'
SELECT channel_id INTO to_die_pending FROM pending WHERE status = 3 OR status = 4 OR status = 9;
BEGIN;
DELETE FROM pending_traffic where channel_id = to_die_pending.channel_id;
DROP TABLE to_die_pending;
END;
+31
View File
@@ -0,0 +1,31 @@
#!/bin/bash
#
# $Id: enc_pass.sh,v 1.5 2003/07/14 10:35:44 nighty Exp $
#
# Just for the fun of it ;)
#
GENSALT=`mcookie | cut -b-8`
if [ "$1" != "" ]; then
NUMCHAR=`echo -n $1 | wc -c`
if [ `expr $NUMCHAR \= 8` == 1 ]; then
echo "*** Using custom SALT : $1"
GENSALT="$1"
else
echo "ERROR: Custom SALT has an invalid number of chars (needs to be 8)"
echo "*** Using SALT : $GENSALT"
fi
else
echo "*** Using SALT : $GENSALT"
fi
echo -n "Cleartext password : "
read -se CTPASS
echo ""
ENCPART=`echo -n $GENSALT$CTPASS | md5sum | cut -f1 -d' '`
echo "----> SALT : $GENSALT"
echo "----> ENCODED : $ENCPART"
echo "----> CRYPT PASS : $GENSALT$ENCPART"
exit 0
+194
View File
@@ -0,0 +1,194 @@
#!/bin/bash
####################################################################################################
#
# "$Id: fixDOS.sh,v 1.7 2003/07/14 10:35:44 nighty Exp $"
#
# fixDOS.sh : a small bash script to convert all .php, .inc etc.. files in your current
# directory from DOS (\r\n) to UNIX (\n) CRLF/LF Format.
#
# Use 'fixDOS.sh --help' for more informations.
#
#
# 2002-01-09 : <nighty@undernet.org>, first release.
#
#
####################################################################################################
if [ "$1" == "--help" ]; then
echo "HELP for '`basename $0`' :"
echo "-"
echo "- Usage '`basename $0` [xxx] [-nobackup]'"
echo "- [xxx] would be another file format you want to fix (e.g. *.xxx)"
echo "- [-nobackup] must be used either alone, or as second parameter,"
echo "- it prevents the program from keeping trace of 'old' files."
echo "- Default will fix following extensions :"
echo "- PHP, INC, HTML, HTM, C, CC, H, PHP3, TXT."
exit 0
fi
#
# Check files
echo -n "Checking files... "
SEDPROGRAM=`which sed | head -n 1 | cut -d\ -f1 `
if [ "$SEDPROGRAM" == "which:" ]; then
echo "(failed, could'nt find 'sed' in the path)"
exit 1
fi
echo "(ok)"
#
# Fix every .php, .inc, and any passer <.xxx> argument
# thus removing ^M's from files (DOS->Unix format)
FILE="0"
echo "Fixing files in `pwd` :"
echo -n "Fixing .PHP files ["
for fichphp in ./*.php; do
if `sed -e 's/\r//g' $fichphp > /tmp/$fichphp-TMP.$$ 2>/dev/null`; then
mv $fichphp $fichphp.bakFD
mv /tmp/$fichphp-TMP.$$ $fichphp
echo -n "."
FILE="1"
else
echo -n "no file"
fi
done
echo "] (ok)"
echo -n "Fixing .INC files ["
for fichinc in ./*.inc; do
if `sed -e 's/\r//g' $fichinc > /tmp/$fichinc-TMP.$$ 2>/dev/null`; then
mv $fichinc $fichinc.bakFD
mv /tmp/$fichinc-TMP.$$ $fichinc
echo -n "."
FILE="1"
else
echo -n "no file"
fi
done
echo "] (ok)"
echo -n "Fixing .HTML files ["
for fichinc in ./*.html; do
if `sed -e 's/\r//g' $fichinc > /tmp/$fichinc-TMP.$$ 2>/dev/null`; then
mv $fichinc $fichinc.bakFD
mv /tmp/$fichinc-TMP.$$ $fichinc
echo -n "."
FILE="1"
else
echo -n "no file"
fi
done
echo "] (ok)"
echo -n "Fixing .HTM files ["
for fichinc in ./*.htm; do
if `sed -e 's/\r//g' $fichinc > /tmp/$fichinc-TMP.$$ 2>/dev/null`; then
mv $fichinc $fichinc.bakFD
mv /tmp/$fichinc-TMP.$$ $fichinc
echo -n "."
FILE="1"
else
echo -n "no file"
fi
done
echo "] (ok)"
echo -n "Fixing .C files ["
for fichinc in ./*.c; do
if `sed -e 's/\r//g' $fichinc > /tmp/$fichinc-TMP.$$ 2>/dev/null`; then
mv $fichinc $fichinc.bakFD
mv /tmp/$fichinc-TMP.$$ $fichinc
echo -n "."
FILE="1"
else
echo -n "no file"
fi
done
echo "] (ok)"
echo -n "Fixing .CC files ["
for fichinc in ./*.cc; do
if `sed -e 's/\r//g' $fichinc > /tmp/$fichinc-TMP.$$ 2>/dev/null`; then
mv $fichinc $fichinc.bakFD
mv /tmp/$fichinc-TMP.$$ $fichinc
echo -n "."
FILE="1"
else
echo -n "no file"
fi
done
echo "] (ok)"
echo -n "Fixing .H files ["
for fichinc in ./*.h; do
if `sed -e 's/\r//g' $fichinc > /tmp/$fichinc-TMP.$$ 2>/dev/null`; then
mv $fichinc $fichinc.bakFD
mv /tmp/$fichinc-TMP.$$ $fichinc
echo -n "."
FILE="1"
else
echo -n "no file"
fi
done
echo "] (ok)"
echo -n "Fixing .PHP3 files ["
for fichinc in ./*.php3; do
if `sed -e 's/\r//g' $fichinc > /tmp/$fichinc-TMP.$$ 2>/dev/null`; then
mv $fichinc $fichinc.bakFD
mv /tmp/$fichinc-TMP.$$ $fichinc
echo -n "."
FILE="1"
else
echo -n "no file"
fi
done
echo "] (ok)"
echo -n "Fixing .TXT files ["
for fichinc in ./*.txt; do
if `sed -e 's/\r//g' $fichinc > /tmp/$fichinc-TMP.$$ 2>/dev/null`; then
mv $fichinc $fichinc.bakFD
mv /tmp/$fichinc-TMP.$$ $fichinc
echo -n "."
FILE="1"
else
echo -n "no file"
fi
done
echo "] (ok)"
if [ "$1" != "-nobackup" ]; then
if [ "$1" != "" ]; then
echo -n "Fixing .$1 files ["
for ficharg in ./*.$1; do
if `sed -e 's/\r//g' $ficharg > /tmp/$ficharg-TMP.$$ 2>/dev/null`; then
mv $ficharg $ficharg.bakFD
mv /tmp/$ficharg-TMP.$$ $ficharg
echo -n "."
FILE="1"
else
echo -n "no file"
fi
done
echo "] (ok)"
fi
if [ "$2" != "-nobackup" ]; then
if [ "$FILE" == "1" ]; then
echo -n "Backing up files in '`pwd`/backup-fixDOS-$$.tar.gz'... "
tar -cOpf backup-fixDOS-$$.tar *.bakFD
gzip -9 backup-fixDOS-$$.tar
rm -f *.bakFD
echo "(ok)"
fi
else
rm -f *.bakFD
fi
else
rm -f *.bakFD
fi
echo "Cleanup finished."
echo "-"
exit 0
+1
View File
@@ -0,0 +1 @@
.arch-ids
+235
View File
@@ -0,0 +1,235 @@
#!/usr/local/pgsql/bin/pgtclsh
# $Id: appjudge,v 1.12 2003/08/29 13:52:33 nighty Exp $
# Author: sengaia@undernet.org, 20010619
# Last modif: nighty@undernet.org, 20030823 (fixed the feature, added more traps, packed a couple of procs, added ability of running the judge remotely)
# This script automates a good part of the channel-registration process, you need
# to set up sensible settings in appjudge-config for it to do you any good though.
# Load configuration
source [file dirname $argv0]/appjudge-config
proc clock_stamp {} {
return [clock format [clock seconds] -format "%Y%m%d %H:%M"]
}
proc log_channel {hDB channel_id state areason acode} {
global AS_REJECTED AS_COMPLETED
# who manager? he manager!
pg_select $hDB "SELECT channel_id,manager_id FROM pending WHERE channel_id=$channel_id" mgr_res { set mgr_id [lindex [array get mgr_res "manager_id"] 1] }
pg_select $hDB "SELECT id,user_name,flags FROM users WHERE id=$mgr_id" mgr_res {
set mgr_name [lindex [array get mgr_res "user_name"] 1]
set mgr_flags [lindex [array get mgr_res "flags"] 1]
set mgr_what "$mgr_name ($mgr_id"
if {[expr $mgr_flags & 8]} { set mgr_what "${mgr_what}, fraud)" } else { set mgr_what "${mgr_what})" }
}
# gather the supporters
set supporter_ids ""
pg_select $hDB "SELECT channel_id,user_id FROM supporters WHERE (channel_id = $channel_id)" sup_res {
lappend supporter_ids [lindex [array get sup_res "user_id"] 1]
}
set sup_list ""
foreach sup_id $supporter_ids {
pg_select $hDB "SELECT id,user_name,flags FROM users where id=$sup_id" user_res {
set user_name [lindex [array get user_res "user_name"] 1]
set user_flags [lindex [array get user_res "flags"] 1]
set user_what "$user_name ($sup_id"
if {[expr $user_flags & 8]} { set user_what "${user_what}, fraud)" } else { set user_what "${user_what})" }
set sup_list "${sup_list}, $user_what"
}
}
set sup_list [string trim $sup_list ", "]
set log_msg "\[The Judge\]: Application ${state}. ${areason} Applicant: ${mgr_what}. Supporters: ${sup_list}."
pg_exec $hDB "INSERT INTO channellog (ts,channelid,event,message,last_updated) VALUES(now()::abstime::int4,$channel_id,$acode,'\[The Judge\]: Application ${state}. ${areason} Applicant: ${mgr_what}. Supporters: ${sup_list}.',now()::abstime::int4)"
}
proc get_channel {hDB channel_id} {
pg_select $hDB "SELECT id,name FROM channels WHERE id=$channel_id" chname { return [lindex [array get chname "name"] 1]}
}
proc reject_app {hDB channel_id reason} {
global AS_REJECTED REVIEWER_ID
puts [format "%s: Rejecting application for channel %s: %s" [clock_stamp] [get_channel $hDB $channel_id] $reason]
log_channel $hDB $channel_id "REJECTED" $reason 13
pg_exec $hDB "UPDATE pending SET status=$AS_REJECTED, last_updated=now()::abstime::int4, reviewed_by_id=$REVIEWER_ID, decision_ts=now()::abstime::int4, decision='Rejected: $reason' WHERE channel_id=$channel_id"
# Need the associated userid
pg_select $hDB "SELECT channel_id,manager_id FROM pending WHERE channel_id=$channel_id" res_ch {
set notify_user [lindex [array get res_ch "manager_id"] 1]
}
}
proc check_comments {hDB channel_id} {
global AS_PENDREVIEW
set check_res 0
# Check for objections
pg_select $hDB "SELECT COUNT(*) AS objcount FROM objections WHERE channel_id=$channel_id" res_obj {
set objcount [lindex [array get res_obj "objcount"] 1]
if {$objcount} {
puts [format "%s: Moving channel %s to status %d (there are %d objections/comments)" [clock_stamp] [get_channel $hDB $channel_id] $AS_PENDREVIEW $objcount]
pg_exec $hDB "UPDATE pending SET status=$AS_PENDREVIEW,last_updated=now()::abstime::int4 WHERE channel_id=$channel_id"
set check_res 1
}
}
# Check wether or not the application was labeled for review
pg_select $hDB "SELECT channel_id,comments FROM pending WHERE channel_id=$channel_id" res_cmt {
set comments [string trim [lindex [array get res_cmt "comments"] 1]]
if {[string match "REVIEW:*" $comments]} {
puts [format "%s: Moving channel %s to status %d (it was labeled for review)" [clock_stamp] [get_channel $hDB $channel_id] $AS_PENDREVIEW]
pg_exec $hDB "UPDATE pending SET status=$AS_PENDREVIEW, last_updated=now()::abstime::int4 WHERE channel_id=$channel_id"
set check_res 1
}
}
return $check_res
}
proc check_fraudulous {hDB chan_id mgr_id} {
global AS_PENDREVIEW
set supporter_ids ""
pg_select $hDB "SELECT channel_id,user_id FROM supporters WHERE (channel_id = $chan_id)" sup_res {
lappend supporter_ids [lindex [array get sup_res "user_id"] 1]
}
# check for fraudulous users
set isfraud 0
foreach sup_id $supporter_ids {
pg_select $hDB "SELECT id,user_name,flags FROM users where id=$sup_id" user_res {
set user_flags [lindex [array get user_res "flags"] 1]
if {[expr $user_flags & 8]} { incr isfraud }
}
}
pg_select $hDB "SELECT id,user_name,flags FROM users where id=$mgr_id" user_res {
set user_flags [lindex [array get user_res "flags"] 1]
if {[expr $user_flags & 8]} { incr isfraud }
}
if {$isfraud > 0} {
# move it to 'Ready for review' if anyone is fraudulous
puts [format "%s: Moving channel %s to status %d (%d fraudulent applicant/supporters found)" [clock_stamp] [get_channel $hDB $chan_id] $AS_PENDREVIEW $isfraud]
pg_exec $hDB "UPDATE pending SET status=$AS_PENDREVIEW,last_updated=now()::abstime::int4 WHERE channel_id=$chan_id"
}
return $isfraud
}
proc check_suspended {hDB chan_id mgr_id} {
global AS_REJECTED
set supporter_ids ""
pg_select $hDB "SELECT channel_id,user_id FROM supporters WHERE (channel_id = $chan_id)" sup_res {
lappend supporter_ids [lindex [array get sup_res "user_id"] 1]
}
# check for suspended applicant/supporter
set issusp 0
foreach sup_id $supporter_ids {
pg_select $hDB "SELECT id,user_name,flags FROM users where id=$sup_id" user_res {
set user_flags [lindex [array get user_res "flags"] 1]
if {[expr $user_flags & 1]} { incr issusp }
}
}
pg_select $hDB "SELECT id,user_name,flags FROM users where id=$mgr_id" user_res {
set user_flags [lindex [array get user_res "flags"] 1]
if {[expr $user_flags & 1]} { incr issusp }
}
if {$issusp > 0} {
# reject the channel if any suspended found !
puts [format "%s: Moving channel %s to status %d (%d suspended applicant/supporters found)" [clock_stamp] [get_channel $hDB $chan_id] $AS_REJECTED $issusp]
reject_app $hDB $chan_id "The applicant and/or one or more of the supporters are suspended."
}
return $issusp
}
# Open the DB
if {$SQL_PASS == ""} {
set hSQL [pg_connect -conninfo "host=$SQL_HOST dbname=$SQL_DB user=$SQL_USER"]
} else {
set hSQL [pg_connect -conninfo "host=$SQL_HOST dbname=$SQL_DB password=$SQL_PASS user=$SQL_USER"]
}
puts [format "%s: The court is now in session." [clock_stamp]]
# Step 0.5: Reject applications that are still in status 0 after x days.
set sup_timeout [expr $DAY * $SUPPORT_DAYS]
pg_select $hSQL "SELECT channel_id,status,check_start_ts FROM pending WHERE (status = $AS_PENDING_SUPPORT) AND (now()::abstime::int4 > (created_ts + $sup_timeout))" sup_expired {
set chan_id [lindex [array get sup_expired "channel_id"] 1]
reject_app $hSQL $chan_id "One or more of the supporters did not confirm their support."
}
# Step 1: reject applications that failed to pass the activity test within the required timeframe
set app_timeout [expr $DAY * $MAX_DAYS]
pg_select $hSQL "SELECT channel_id,status,check_start_ts,unique_join_count FROM pending WHERE (status = $AS_TRAFFIC_CHECK) AND (now()::abstime::int4 > (check_start_ts + $app_timeout))" t_expired {
set chan_id [lindex [array get t_expired "channel_id"] 1]
set joins [lindex [array get t_expired "unique_join_count"] 1]
# Were there less than $MIN_SUPPORTERS?
pg_select $hSQL "SELECT COUNT(*) AS supcount FROM supporters WHERE (channel_id = $chan_id) AND (join_count > 0)" sup_res {
set sup_joins [lindex [array get sup_res "supcount"] 1]
}
if {$sup_joins < $MIN_SUPPORTERS} {
reject_app $hSQL $chan_id "Not enough supporter activity in the channel."
} else {
# Does it pass the unique join check?
if {$joins >= $UNIQUE_JOINS} {
# Yes - Label it for human inspection and pass it on
# get supporter count
pg_select $hSQL "SELECT COUNT(*) AS supcount FROM supporters WHERE channel_id=$chan_id" res_supc { set sup_joins [lindex [array get sup_res "supcount"] 1] }
puts [format "%s: Moving channel %s to status %d (application labeled for human inspection)" [clock_stamp] [get_channel $hSQL $chan_id] $AS_NOTIFICATION]
pg_exec $hSQL "UPDATE pending SET status=$AS_NOTIFICATION,check_start_ts=now()::abstime::int4,comments='REVIEW: Only $sup_joins supporters have been seen.', last_updated=now()::abstime::int4 WHERE channel_id=$chan_id"
} else {
# No - Reject
reject_app $hSQL $chan_id "Not enough activity in the channel."
}
}
}
# Step 2: pass along applications that have passed the activity test
pg_select $hSQL "SELECT channel_id,status FROM pending WHERE (status=$AS_TRAFFIC_CHECK) AND (unique_join_count >= $UNIQUE_JOINS)" t_check {
# check if supporters joined often enough
set chan_id [lindex [array get t_check "channel_id"] 1]
pg_select $hSQL "SELECT COUNT(*) AS supcount FROM supporters WHERE (channel_id = $chan_id) AND (join_count > 0)" sup_res {
set sup_joins [lindex [array get sup_res "supcount"] 1]
}
if {$sup_joins >= $MIN_SUPPORTERS} {
puts [format "%s: Moving channel %s to status %d (traffic check passed)" [clock_stamp] [get_channel $hSQL $chan_id] $AS_NOTIFICATION]
pg_exec $hSQL "UPDATE pending SET status=$AS_NOTIFICATION,check_start_ts=now()::abstime::int4,last_updated=now()::abstime::int4 WHERE channel_id=$chan_id"
}
}
# Step 3: check for end of notify period
set notify_delay [expr $DAY * $NOTIFY_DAYS]
pg_select $hSQL "SELECT channel_id,status,manager_id,reviewed FROM pending WHERE (status = $AS_NOTIFICATION) AND ((check_start_ts + $notify_delay) < now()::abstime::int4)" t_notified {
set chan_id [lindex [array get t_notified "channel_id"] 1]
set mgr_id [lindex [array get t_notified "manager_id"] 1]
set reviewed [lindex [array get t_notified "reviewed"] 1]
# Figure out what to do
if {![check_comments $hSQL $chan_id]} { # NO objection found !, good.
# Has a human being seen this application?
if {$reviewed == "Y"} {
if {![check_suspended $hSQL $chan_id $mgr_id]} {
if {![check_fraudulous $hSQL $chan_id $mgr_id]} {
# Register the channel
log_channel $hSQL $chan_id "ACCEPTED" "All checks passed." 7
puts [format "%s: Moving channel %s to status %d (notify period ended)" [clock_stamp] [get_channel $hSQL $chan_id] $AS_COMPLETED]
pg_exec $hSQL "UPDATE pending SET status=$AS_COMPLETED,reviewed_by_id=$REVIEWER_ID,decision_ts=now()::abstime::int4,decision='Accepted by The Judge', last_updated=now()::abstime::int4 WHERE channel_id=$chan_id"
puts [format "%s: Registering channel %s (all checks passed)" [clock_stamp] [get_channel $hSQL $chan_id]]
pg_exec $hSQL "UPDATE channels SET registered_ts=now()::abstime::int4, last_updated = now()::abstime::int4 WHERE id=$chan_id"
pg_exec $hSQL "INSERT INTO levels (channel_id,user_id,access,added,added_by,last_modif,last_modif_by,last_updated) VALUES($chan_id,$mgr_id,500,now()::abstime::int4,'The Judge',now()::abstime::int4,'The Judge',now()::abstime::int4)"
}
}
} else {
# No, label it for review if no one is suspended on it
if {![check_suspended $hSQL $chan_id $mgr_id]} {
puts [format "%s: Moving channel %s to status %d (it was never reviewed)" [clock_stamp] [get_channel $hSQL $chan_id] $AS_PENDREVIEW]
pg_exec $hSQL "UPDATE pending SET status=$AS_PENDREVIEW,last_updated=now()::abstime::int4 WHERE channel_id=$chan_id"
}
}
} else {
# Objections found, label it for review if no one is suspended on it ;)
if {![check_suspended $hSQL $chan_id $mgr_id]} {
puts [format "%s: Moving channel %s to status %d (it was never reviewed)" [clock_stamp] [get_channel $hSQL $chan_id] $AS_PENDREVIEW]
pg_exec $hSQL "UPDATE pending SET status=$AS_PENDREVIEW,last_updated=now()::abstime::int4 WHERE channel_id=$chan_id"
}
}
}
# Now that wasn't so hard...
pg_disconnect $hSQL
+39
View File
@@ -0,0 +1,39 @@
#
# $Id: appjudge-config,v 1.7 2003/08/23 16:02:25 nighty Exp $
# original code by Sengaia
#
# Database name (duh)
set SQL_DB "cservice"
set SQL_USER "gnuworld"
set SQL_PASS ""
set SQL_HOST "127.0.0.1"
# Number of seconds in a day, I suggest you do not change this ;)
set DAY 86400
# Number of days an application has to pass the activity test
set MAX_DAYS 99
# Number of unique IP's that must visit a channel during the activity test
set UNIQUE_JOINS 99
# Number of supporters that must visit the channel during the activity test
set MIN_SUPPORTERS 99
# Duration of the notify period
set NOTIFY_DAYS 99
# Number of days supporters have to confirm their support
set SUPPORT_DAYS 99
# The Judge's Reviewer ID
set REVIEWER_ID 0
# These are better left alone
set AS_PENDING_SUPPORT 0
set AS_TRAFFIC_CHECK 1
set AS_NOTIFICATION 2
set AS_COMPLETED 3
set AS_CANCELLED 4
set AS_PENDREVIEW 8
set AS_REJECTED 9
+3
View File
@@ -0,0 +1,3 @@
15,45 * * * * /usr/local/pgsql/regproc/appjudge >> /usr/local/pgsql/regproc/judge.log
59 23 * * * /usr/local/pgsql/regproc/cycle-judge
+20
View File
@@ -0,0 +1,20 @@
#!/bin/sh
# "$Id: cycle-judge,v 1.6 2004/01/02 01:59:04 nighty Exp $"
# Changes: use gzip when present to compress files, and give users the option to control the behaviour
# "Alexander Maassen" <outsider@key2peace.org>
#
# Fixed cycle-judge so it WORKS!
# "Reed Loden" <reed@reedloden.com>
# Change the setting below to the location where your judge.log resides without the trailing slash
SRCPATH=/usr/local/pgsql/regproc
# Change the setting below if you want the archived logs somewhere else
DSTPATH=/usr/local/pgsql/regproc/logs
if [ -f $SRCPATH/judge.log ]; then
gzip -9 $SRCPATH/judge.log
mv $SRCPATH/judge.log.gz $DSTPATH/judge.log.`date +%Y%m%d`.gz
touch $SRCPATH/judge.log
else
echo "No logs found. Aborting..."
fi
+1
View File
@@ -0,0 +1 @@
.arch-ids
+1
View File
@@ -0,0 +1 @@
.arch-ids
+1
View File
@@ -0,0 +1 @@
.arch-ids
+1
View File
@@ -0,0 +1 @@
.arch-ids
+1
View File
@@ -0,0 +1 @@
.arch-ids
+61
View File
@@ -0,0 +1,61 @@
<HTML>
<!-- CMaster Channel Services Website. -->
<!-- $Id: faq.html,v 1.2 2001/10/22 19:48:00 gte Exp $ -->
<!-- Here is the FAQ Table Template (Until we do this in a database properly ;) -->
<!--
<P>
<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR><TD BGCOLOR=#DDDDDD><FONT FACE="Tahoma, Times New Roman" SIZE=2><B>
Q: How the hell does this thing work?!
</B></FONT></TD></TR>
<TR><TD BGCOLOR=#EEEEEE><FONT FACE="Tahoma, Times New Roman" SIZE=2>
dunno
</FONT></TD></TR></TABLE>
<P>
-->
<HEAD>
</HEAD>
<BODY>
<FONT FACE="Tahoma, Times New Roman" SIZE=2>
<FONT SIZE=+2>Frequenty Asked Questions</FONT>
<P>
<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR><TD BGCOLOR=#DDDDDD><FONT FACE="Tahoma, Times New Roman" SIZE=2><B>
Q: How do I give myself admin access to X?
</B></FONT></TD></TR>
<TR><TD BGCOLOR=#EEEEEE><FONT FACE="Tahoma, Times New Roman" SIZE=2>
A:<BR>Run the cservice.addme.sql script in the doc/ directory.<BR> Eg:<BR>
psql &ltdatabasename&gt &ltcservice.addme.sql
</FONT></TD></TR></TABLE>
<P>
<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR><TD BGCOLOR=#DDDDDD><FONT FACE="Tahoma, Times New Roman" SIZE=2><B>
Q: Whats the full command to start X?
</B></FONT></TD></TR>
<TR><TD BGCOLOR=#EEEEEE><FONT FACE="Tahoma, Times New Roman" SIZE=2>
A:<BR> After installation, the binary is contained in the gnuworld/bin directory.<BR>
If you don't want to see debug output, the best way to run gnuworld is:<P>
./gnuworld -c -f GNUWorld.conf >/dev/null 2>1 &
</FONT></TD></TR></TABLE>
<P>
<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR><TD BGCOLOR=#DDDDDD><FONT FACE="Tahoma, Times New Roman" SIZE=2><B>
Q: I get this error: PostgreSQL error message: connectDBStart() -- connect() failed: Connection refused
</B></FONT></TD></TR>
<TR><TD BGCOLOR=#EEEEEE><FONT FACE="Tahoma, Times New Roman" SIZE=2>
A: <BR>
Make sure you are starting the PostgreSQL server with the -i parameter (To listen on TCP sockets).
</FONT></TD></TR></TABLE>
<P>
<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR><TD BGCOLOR=#DDDDDD><FONT FACE="Tahoma, Times New Roman" SIZE=2><B>
Q: I get this error: checking for libpq++.h... configure: error: Unable to find PostGreSQL
</B></FONT></TD></TR>
<TR><TD BGCOLOR=#EEEEEE><FONT FACE="Tahoma, Times New Roman" SIZE=2>
A:<BR>
Are you sure you have installed PostgreSQL? It can be downloaded from <A HREF="http://www.postgresql.org">http://www.postgresql.org.</A><BR>
Also, ensure you read the PostgreSQL documentation and add the configuration switch --with-CXX to install the PostgreSQL C++ API.
</FONT></TD></TR></TABLE>
<P>
Last Updated: 22/10/2001. [<A HREF="index.html">Back</A>] [<A HREF="mailto:gte@undernet.org">Webmaster</A>]
</FONT>
</BODY>
</HTML>
+41
View File
@@ -0,0 +1,41 @@
<HTML>
<!-- CMaster Channel Services Website. -->
<!-- $Id: index.html,v 1.3 2001/12/22 22:42:15 gte Exp $ -->
<HEAD>
</HEAD>
<BODY>
<FONT FACE="Tahoma, Times New Roman" SIZE=2>
<FONT SIZE=+2>
CMaster Channel Services
</FONT>
<P>
Welcome to the Homepages of the "CMaster" - The Undernet Channel Services server!<BR><BR>
Development on the service began in October 2000 and was a joint venture between the
<A HREF="http://www.coder-com.undernet.org">Coder Comittee</A>
and <A HREF="http://www.cservice.undernet.org">Channel Service Commitee</A>. It has almost been running a year now, and has developed considerably since the
first version.<P>
The current version is 1.1pl2, available from <A HREF="http://sourceforge.net/cvs/?group_id=6921">CVS</A>.
<P>
<FONT SIZE=+2>Information Available:</FONT><BR>
<UL>
<LI><A HREF="faq.html">Frequently Asked Questions</A></LI>
<LI><A HREF="manual.html">GNUWorld Manual (Contributed by Cti- &ltcti@zurna.org&gt)</A></LI>
<LI><A HREF="install.html">Installation Instructions</A> [<A HREF="http://sourceforge.net/forum/forum.php?forum_id=21470">Help Forum</A>]</LI>
<LI><A HREF="web.html">Web Interface Information</A></LI>
<LI><A HREF="webfaces.html">3rd Party Web Interfaces</A></LI>
<LI><A HREF="mailto:bugs@undernet.org?Subject=Bug Report for CMaster">Report Bugs</A></LI>
<LI><A HREF="future.html">Future Enhancements [<A HREF="http://sourceforge.net/forum/forum.php?forum_id=21469">Forum</A>]</LI>
<LI><A HREF="language.html">Multilingual Support</A></LI>
<LI><A HREF="changelog.html">Changelog</A></LI>
<LI><A HREF="contrib.html">Contributions</A></LI>
</UL>
<P>
Last Updated: 22/12/2001. [<A HREF="mailto:gte@undernet.org">Webmaster</A>]
</FONT>
</BODY>
</HTML>
+21
View File
@@ -0,0 +1,21 @@
<HTML>
<!-- CMaster Channel Services Website. -->
<!-- $Id: install.html,v 1.1 2001/10/20 23:57:51 gte Exp $ -->
<HEAD>
</HEAD>
<BODY>
<FONT FACE="Tahoma, Times New Roman" SIZE=2>
<FONT SIZE=+2>Installation Instructions</FONT>
<P>
The "<A HREF="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/gnuworld/gnuworld/doc/">doc</A>" directory in the
CVS repository/distribution contains a number of documents on installing GNUWorld/CMaster/PostgreSQL. They are
reproduced here for Convenience :)
<P>
Last Updated: 20/10/2001. [<A HREF="index.html">Back</A>] [<A HREF="mailto:gte@undernet.org">Webmaster</A>]
</FONT>
</BODY>
</HTML>
+671
View File
@@ -0,0 +1,671 @@
<html>
<!-- CMaster Channel Services Website. -->
<!-- $Id: manual.html,v 1.3 2001/12/22 22:46:17 gte Exp $ -->
<head>
<title>GNUWorld / CMaster / CControl Manual</title>
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#003366" vlink="#003366" alink="#003366">
<p><font face="Geneva, Arial, Helvetica, san-serif" size="+2">GNUWorld / CMaster
/ CControl Manual </font></p>
<p>************************************************************************************************************************<br>
************************************************************************************************************************<br>
<br>
<b>Version : 1.1<br>
Author : Cti- <a href="mailto:cti@zurna.org">Cti@zurna.org</a><br>
Language : English<br>
Document : General info (manual)<br>
Last Update: 22/12/2001<br>
Web Address: http://gnuworld.undernet.org/cmaster/manual.htm</b></p>
<p>UPDATES:</p>
<p>1.1 - Fixed missing sections (2.2, 2.3, 3.1) - Added links for easy use - Rewrite
HTML.<br>
<br>
<br>
************************************************************************************************************************<br>
<br>
This file contains general information about<br>
the manuals. There are four main manuals you can find.<br>
manual.gnuworld : GNUWorld installation guide<br>
manual.ccontrol : ccontrol installation guide (EUworld)<br>
manual.cservice : cservice installation guide (X)<br>
manual.website : Customized Web Interface guide<br>
<br>
************************************************************************************************************************<br>
<br>
These manuals does NOT include problems occured during the compiling of GNUWorld,
I accept that<br>
you compiled and configured GNUWorld correctly. But you can still find a quick
installation guide<br>
inside the manual.gnuworld. For details refer to the README file by GNUWorld
development team.<br>
If you still have some errors visit us at #coder-com on Undernet, if you are
lucky you can find <br>
someone to help you there.<br>
<br>
************************************************************************************************************************<br>
ccontrol.manual includes <br>
************************************************************************************************************************<br>
Short description of ccontrol module<br>
Setting up ccontrol for the first time<br>
Example *.conf file<br>
F.A.Q (not yet)<br>
<br>
<br>
************************************************************************************************************************<br>
cservice.manual includes<br>
************************************************************************************************************************<br>
Short description of cservice module<br>
Setting up cservice for the first time<br>
Example *.conf file<br>
How to add extra level 1000's to DB<br>
F.A.Q<br>
<br>
************************************************************************************************************************<br>
manual.website includes<br>
************************************************************************************************************************<br>
Short description of website<br>
How to install Apache for your box<br>
How to install an PHP interpreter<br>
Config files for apache and php<br>
Explanation on config.inc<br>
F.A.Q (again)<br>
<br>
If you have any questions regarding these fallowing topics please feel free
to mail to <br>
"<a href="mailto:gnuworld-devel@lists.sourceforge.net">gnuworld-devel@lists.sourceforge.net</a>"
and we will insert it as soon as possible.<br>
************************************************************************************************************************<br>
<font size="+2">INDEX </font><br>
************************************************************************************************************************<br>
<font size="+1"><a href="#part1">PART I - MANUAL.GNUWORLD</a></font><br>
<b><a href="#11">Section 1.1 - Obtaining GNUWorld with CVS</a><br>
<a href="#12">Section 1.2 - Building GNUWorld</a><br>
<a href="#13">Section 1.3 - Editing the config file (localhost.conf)</a><br>
<a href="#14">Section 1.4 - Running GNUWorld</a></b><br>
<font size="+1"><a href="#part2">PART II - MANUAL.CSERVICE</a></font><br>
<b><a href="#21">Section 2.1 - Setting up cservice module for the first time</a><br>
<a href="#22">Section 2.2 - Editing cservice.conf file</a><br>
<a href="#23">Section 2.3 - Adding Extra Level 1000 accounts to DB</a></b><br>
<font size="+1"><a href="#part3">PART III - MANUAL.CCONTROL</a></font><br>
<b><a href="#31">Section 3.1 - Setting up ccontrol module for the first time</a><br>
<a href="#32">Section 3.2 - Editing ccontrol.conf file</a></b><br>
<font size="+1"><a href="#part4">PART IV - MANUAL.WEBSITE</a></font><br>
<b><a href="#41">Section 4.1 - Obtaining Apache & PHP interpreter</a><br>
<a href="#42">Section 4.2 - Compiling Apache & PHP interpreter</a><br>
<a href="#43">Section 4.3 - Configuring Apache & PHP interpreter</a><br>
<a href="#43">Section 4.4 - Editing config.inc file</a></b><br>
<font size="+1"><a href="#part5">PART V - PostGreS Short Manual</a></font><br>
<br>
<br>
************************************************************************************************************************<br>
************************************************************************************************************************<br>
************************************************************************************************************************<br>
<br>
<a name="part1"></a>PART I - MANUAL.GNUWORLD<br>
<br>
We assume that you have the fallowing stuff installed<br>
and working properly on your box to run GNUWorld<br>
<br>
- A working PostGreSQL server with right permissions<br>
- An uplink IRC server with the proper U Lines<br>
- Copy of GNUWorld (check section 1.1 to how to get)<br>
- A machine to run GNUWorld<br>
<br>
For the customized web site you also need the<br>
following services working properly<br>
<br>
- Running web server (Recommended Apache)<br>
(get latest apache server relase from <a href="http://www.apache.org">http://www.apache.org</a>)<br>
- PHP interpreter<br>
(get latest relase from <a href="http://www.php.net">http://www.php.net</a>)<br>
************************************************************************************************************************<br>
<a name="11"></a>Section 1.1 * Obtaining GNUWorld and Web site with CVS<br>
************************************************************************************************************************<br>
<br>
1- cvs -d :pserver:anonymous@cvs.gnuworld.sourceforge.net:/cvsroot/gnuworld<br>
login<br>
2- When prompted for a password, hit the return key<br>
3- cvs -z3 -d :pserver:anonymous@cvs.gnuworld.sourceforge.net:/cvsroot/gnuworld<br>
co gnuworld<br>
4- cvs -z3 -d :pserver:anonymous@cvs.gnuworld.sourceforge.net:/cvsroot/gnuworld<br>
co website<br>
(Execute the above commands on a single line in your shell) Line 3 will create<br>
a directory under your current directory named "gnuworld" in which all of<br>
GNUWorld's files will be placed. Line 4 will create a directory under your<br>
current directory named "website" in which all of website files will be<br>
placed.<br>
<br>
If you downloaded the tar gzipped version of GNUWorld use<br>
the fallowing command to unpack the archive as fallows:<br>
<br>
gzip -cd gnuworld.xxx.tar.gz | tar xf -<br>
<br>
where xxx is the version of GNUWorld you have obtained.<br>
<br>
<br>
************************************************************************************************************************<br>
<a name="12"></a>Section 1.2 * Building GNUWorld<br>
************************************************************************************************************************<br>
<br>
To build GNUWorld you need a complier that supports ANSI C++ Standart.<br>
(gmake also recommended).<br>
1- cd gnuworld<br>
<br>
2- ./configure<br>
(if you do not want to load all the modules but a specific one<br>
use the following commands as needed)<br>
<br>
CONFIGURE FOR ONLY THE CSERVICE CLIENT:<br>
./configure --enable-modules=cservice<br>
CONFIGURE FOR ONLY THE CCONTROL CLIENT:<br>
./configure --enable-modules=ccontrol<br>
CONFIGURE BOTH THE CSERVICE & CCONTROL MODULES:<br>
./configure --enable-modules=cservice,ccontrol<br>
<br>
Configure will build the Makefiles that GNUWorld will use to<br>
compile its source.<br>
<br>
3- make<br>
This will build all the libraries and binaries.<br>
<br>
4- make install<br>
To install the binaries and library.<br>
<br>
************************************************************************************************************************<br>
<a name="13"></a>Section 1.3 * Editing the config file<br>
************************************************************************************************************************<br>
<br>
Switch to the /bin directory and edit the localhost.conf<br>
<br>
uplink = 25.202.242.30 # The server we will connect to<br>
port = 5500 # The port we will connect to<br>
password = santa # Our server password in Uplink's C: Line<br>
name = channels.undernet.org # Our server name<br>
description = Channel Service # The description will be seen in /links<br>
numeric = 63 # Our server numeric (must be unique on the network)<br>
maxclients = 50 # maxclients we can run<br>
<br>
<br>
module = libcservice.la (related conf file)<br>
module = libccontrol.la (related conf file)<br>
<br>
Example: <br>
<br>
module = libcservice.la cservice.conf<br>
(This will load the cservice module and looks for cservice.conf file for its
configration. If you have a <br>
differnt name than cservice.conf, like X.conf etc. specify it here like : module
= libcservice.la X.conf )<br>
<br>
Don't touch the rest of the file for fine tuning.<br>
<br>
************************************************************************************************************************<br>
Section 1.4 * Running GNUWorld<br>
************************************************************************************************************************<br>
<br>
Simply type <br>
./gnuworld -f localhost.conf<br>
<br>
EOP ( End of Part :P )<br>
************************************************************************************************************************<br>
************************************************************************************************************************<br>
************************************************************************************************************************<br>
<br>
<br>
<a name="part2"></a>PART II - MANUAL.CSERVICE<br>
CService module is used to maintain channels over the network and keep them
open<br>
<br>
********************************************************************************<br>
<a name="21"></a>Section 2.1 * Setting up cservice for the first time<br>
********************************************************************************<br>
<br>
We assume that pgSQL is running and configured and you have the right permissions
to create and<br>
modify a database.<br>
<br>
<br>
1- Create the database for cservice module<br>
>createdb cservice<br>
<br>
(assume cservice database does not exist)<br>
<br>
2- Install the PL Language<br>
> createlang plpgsql cservice -L /usr/local/pgsql/lib<br>
<br>
3- Switch to gnuworld/doc directory<br>
<br>
4- Load the schema <br>
> psql cservice </p>
<cservice.sql><br>
> psql cservice <languages.sql><br>
> psql cservice <language.table.sql><br>
> psql cservice <cservice.web.sql><br>
<br>
5- Add the administrator account<br>
> psql cservice <cservice.addme.sql><br>
<br>
This will create an account with level 1000 on channel "*"<br>
NOTE: "*" is not a physical channel that you can not /join it.<br>
<br>
6- Connect to the IRC Server and login to your admin account.<br>
<b><br>
Username: Admin<br>
Password: temPass<br>
<br>
Be sure to change your password.</b><br>
<br>
************************************************************************************************************************<br>
<a name="22"></a>Section 2.2 * Example conf file<br>
************************************************************************************************************************<br>
<br>
The default conf file is cservice.conf. You can find it under /bin directory.<br>
<br>
sql_host = 127.0.0.1 # Hostname/IP of PostGreSQL server<br>
sql_port = 5432 # Port of PostGreSQL server<br>
sql_db = Database name<br>
(If you did everything as we told you it have to be cmaster,sql_db = cservice )<br>
<br>
sql_user = gnuworld # sql_user is the username to pass to PostGreSQL<br>
on connection.Usefull if your accoount name is<br>
not the same as your Database username.<br>
<br>
nickname = E42-b # Bot name (X on Undernet)<br>
username = cservice # Bot username (Cservice on Undernet)<br>
hostname = undernet.org # Bot Hostname (undernet.org on Undernet)<br>
userdescription = # Client description For help type: /msg X help<br>
mode = +idk # Usermodes<br>
<br>
relay_channel = #cmaster.info # Channel to relay useful information.<br>
<br>
debug_channel = #cmaster.debug # Channel to relay debug information.<br>
<br>
You can get info about other values in the conf file itself.<br>
<br>
<br>
************************************************************************************************************************<br>
<a name="23"></a>Section 2.3 * Adding Extra level 1000 admin accounts.<br>
************************************************************************************************************************<br>
<br>
Adding extra 1000's has two ways. First one is adding them directly to the database and second one is editing<br>
cservice.addme.sql file and loading it with: psql cservice <cservice.addme.sql><br>
<br>
Its suggested that, add any extra level 1000 accounts before adding any new channels/usernames to database.<br>
<br>
<br>
INSERT into users (user_name,password,language_id,last_updated)<br>
VALUES ('the_user_name','07d976a29bdb3ff42e10c102852151b28097bbad',1,now()::abstime::int4);<br>
<br>
INSERT into levels (channel_id,user_id,access,last_updated)<br>
VALUES (1,the_user_id,1000,now()::abstime::int4);<br>
<br>
* the_user_name should be the username will be added with level 1000<br>
<br>
* the_user_id should be the "current users +1". If you only added the admin<br>
account it should be 2 now. When adding a third person it should be 3<br>
and go on...<br>
<br>
The password of the newuser will be temPass again.<br>
<br>
Change the values in cservice.addme.sql and load it with the command above or switch to<br>
pgsql's directory (default is /usr/local/pgsql/bin) type psql and hit enter.<br>
After that copy and paste the changed values (the ones above)into the shell and hit enter.<br>
<br>
EOP<br>
************************************************************************************************************************<br>
************************************************************************************************************************<br>
************************************************************************************************************************<br>
<br>
<a name="part3"></a>PART III - MANUAL.CCONTROL<br>
<br>
CControl is an IRC Operator Service which is also in use on Undernet now.<br>
This part dedicated to ccontrol :P<br>
<br>
********************************************************************************<br>
<a name="31"></a>Section 3.1 * Setting up ccontrol module for the first time<br>
********************************************************************************<br>
<br>
Follow these steps to setup the database for the ccontrol module. This<br>
file assumes that postgresql is running and configured, and that you have<br>
access to add and modify databases within it.<br>
<br>
1- Create the database if you didn't do it before<br>
> createdb ccontrol<br>
<br>
2- Switch to doc directory <br>
cd doc<br>
<br>
3- Load the schema<br>
> psql ccontrol < ccontrol.sql<br>
> psql ccontrol < ccontrol.help.sql<br>
<br>
4- Add yourself to the bot<br>
> psql ccontrol < ccontrol.addme.sql<br>
<br>
This will add the user Admin with *!*@* hostmask and all the commands enabled.<br>
Handle: Admin password: temPass<br>
(This script should be run once and before any modifications to database)<br>
<br>
Do NOT forget to change your hostmask for your needs after your first login.<br>
You can get more info by: /msg bot help modoper<br>
<br>
********************************************************************************<br>
<a name="32"></a>Section 3.2 * Editing ccontrol.conf file<br>
********************************************************************************<br>
<br>
The default conf file is ccontrol.conf you can find it under /bin directory<br>
<br>
sql_host = 127.0.0.1 # Host/IP of the PostGreSQL server<br>
sql_port = 5432 # Port of SQL server<br>
sql_db = database name (default ccontrol)<br>
<br>
## Bot Info ##<br>
<br>
username = KWorld2 # Bot's username<br>
nickname = KWorld2 # Bot's nickname<br>
hostname = KWorld2.krushnet.org # Bot's hostname<br>
userdescription = KWorld2 # Information seen in /whois<br>
operchanmodes = +isn # IRC Operator channel modes to set<br>
mode = +iodkw # Default Bot modes<br>
operchan = #valhalla # IRC Operator channel<br>
msgchan = #gnuworld.message # Channel where useful info relayed<br>
glength = 3600 # Default gline length (in seconds)<br>
operchanreason = Oper only channel # Default reason for adding an oper chan<br>
abuse_mail = abuse@yournet.org # the email that the report should be emailed to<br>
ccemail = ccontrol@yournet.org # the email that ccontrol will put in the from field of the report<br>
sendmail = /usr/sbin/sendmail # Full path to the sendmail program<br>
mail_report = 0 # set 1 for the bot to mail the report , 0 if you dont want a report to be mailed<br>
gline_interval = 3600 # the interval in which ccontrol should check for expired glines<br>
max_connection = 5 # the maximum connections a host can have before glined<br>
max_GLen = 86400 # the length of the gline the for excessive connection (in seconds)<br>
<br>
<br>
EOP<br>
************************************************************************************************************************<br>
************************************************************************************************************************<br>
************************************************************************************************************************<br>
<br>
<a name="part4"></a>PART IV - MANUAL.GNUWORLD<br>
<br>
Here is the part where everybody is waiting for...<br>
<br>
********************************************************************************<br>
<a name="41"></a>Section 4.1 * Obtaining Apache Web Server & PHP interpreter<br>
********************************************************************************<br>
<br>
You can get the latest relase of apache web server at:<br>
http://httpd:apache.org/distbinaries/linux/<br>
<br>
You can get the latest relase of PHP interpreter at:<br>
http://www.php.net<br>
<br>
<br>
********************************************************************************<br>
<a name="42"></a>Section 4.2 * Compiling Apache Web Server & PHP interpreter<br>
********************************************************************************<br>
<br>
Be sure that Complete Source Codes of both these are in the same directory.<br>
Name of the apache should be something like that: apapche_1.3.x.tar.gz<br>
<br>
1- After downloading the latest version of Apache untar it:<br>
> gunzip -c apache_1.3.x.tar.gz | tar -xf <br>
where x is the version you have just downloaded.<br>
2- Unpack the php-4.0.x.tar.gz file<br>
> gunzip -c php-4.0.x.tar.gz | tar -xf<br>
again x is the version info.<br>
<br>
After these two steps we have two new directories. One for Apache and one for PHP.<br>
Now let's switch to apache and configure it <br>
<br>
3- After you unpack, switch to Apache's directory.<br>
cd apache_1.3.x<br>
<br>
4- Run the configure script:<br>
./configure<br>
<br>
5- Then part apache's directory<br>
cd ..<br>
<br>
It's PHP interpreters turn now... Well performance is important for us so we will<br>
use module installation of PHP. And we will use Static Module where we insert <br>
PHP into Apache. They will work like 1 program :)<br>
<br>
6- Switch to PHP's directory<br>
cd php-4.0.x<br>
7- And configure it:<br>
./configure-with-pgsql-with-apache=../apache_1.3.x-enable-track-vars<br>
!!! IMPORTANT !!!<br>
After "apache=" specify the directory of apache...<br>
8- If you want to use PHP with graphics also you will need GD Library<br>
like we insert apache and pgsql support with "-with" tag we will insert<br>
GD library with "-with-gd"<br>
./configure-with-pgsql-with-gd-with-apache=../apache_1.3.x-enable-track-vars<br>
<br>
9- Make and install it (depends on your box this will take 2-8 minutes)<br>
make<br>
make install<br>
<br>
<br>
After compiling switch back to Apache's directory<br>
<br>
10- cd ../apache_1.3.x<br>
<br>
11- Configure it<br>
./configure-prefix=/www-active-module=src/modules/php4/libphp4.a<br>
<br>
the -prefix=/www paramater tells where to install apache. If you want to install it to /home/httpd<br>
than you have to use -prefix=/home/httpd<br>
<br>
12- make and install again (this time apache)<br>
make<br>
make install<br>
<br>
13- After that copy the php.ini file to /usr/local/lib/ and edit it with a text editor.<br>
cd ../php-4.0.x<br>
cp php.ini-dist /usr/local/lib/php.ini<br>
<br>
14- Now add some little info to apache's conf file (httpd.conf) for PHP.<br>
you can find that file under apache_1.3.x/conf/<br>
<br>
Addtype application/x-httpd-php .php<br>
Addtype application/x-httpd-php .php3<br>
Addtype application/x-httpd-php .php4<br>
<br>
15- Pray to god and start apache<br>
./apactrl start<br>
<br>
16- To check if its running type:<br>
ps -aux | grep 'httpd'<br>
<br>
<br>
<br>
********************************************************************************<br>
<a name="43"></a>Section 4.3 * Configuring Apache & PHP interpreter<br>
********************************************************************************<br>
<br>
This section includes the *must* variables you have to set in apache and php's conf <br>
files before you run them... For more details of conf file of Apache see Section 4.5<br>
<br>
To run apache properly you have to set some variables in httpd.conf. You can find this<br>
file under /conf directory of apache. Simply open httpd.conf with a text editor<br>
<br>
!!!IMPORTANT!!! Edit these variables to suit your needs. Do not copy paste.<br>
<br>
ServerRoot "/www" -- The top directory which server conf files and error files kept.<br>
KeepAlive On -- To allow persistant connectios. On or Off. GNUWorld needs this value on.<br>
ServerAdmin you@yournet -- The Server Administrator's info<br>
Port 80 -- The listening port for standalone servers.<br>
DocumentRoot "/home/root" -- The directory out of which you will serve your documents. <br>
By default, all requests are taken from this directory, <br>
but symbolic links and aliases may be used to point to other locations.<br>
<br>
ServerName "www.your.net" -- Specifies your server's name. In older relases apache won't run if you <br>
do not define this.<br>
<br>
<Directory "/home/root">
<p>-- This should be the same as DocumentRoot. <br>
<br>
*****************************<br>
<br>
in the php.ini file edit these<br>
<br>
[PostgresSQL]<br>
; Allow or prevent persistent links.<br>
pgsql.allow_persistent = On<br>
<br>
[extension_dir]<br>
; Directory in which the loadable extensions (modules) reside.<br>
extension_dir = ./<br>
<br>
<br>
This is the basic stuff for apache and php. If you have more questions come
and ask in #coder-com<br>
But do not forget we are not apache experts but couple of ppl coding for Undernet
on our free<br>
times. <br>
<br>
********************************************************************************<br>
<a name="44"></a>Section 4.4 * Editing config.inc file<br>
********************************************************************************<br>
<br>
Config.inc file is the only file you have to EDIT for your *very own* customized<br>
Web Interface. If you don't have PHP experience don't play with the other files<br>
that you might have screw them up.<br>
<br>
define(LIVE_LOCATION,"/live"); define this to "" if you dont put it in a subdirectory
like '/live' (default) but in '/' for example.<br>
define(IFACE_URL,"http://cservice.undernet.org/live/"); // The GUI main URL
(the one to access it)<br>
define(SERVICE_CHANNEL,"#cservice"); // The CService Official Channel<br>
<br>
/* NOTE: to FORGE reply adresses, user 'nobody' needs a 'Tnobody' line added
in /etc/sendmail.cf (or equiv.) */<br>
define(NETWORK_NAME,"Undernet"); // Define this to your network name... better
to be a "normal" single word ;)<br>
define(BOT_NAME,"X"); // You bot's name, defines some strings in the website
to fit more your configuration.<br>
define(IRC_SERVER,"irc.undernet.org"); // Default server for irc:// option.<br>
define(NETWORK_EMAIL,"cservice@undernet.org"); // the email of your network
(default).<br>
<br>
define(PURGE_EMAIL,"purge@undernet.org"); // the email where channel purge request
form is sent.<br>
define(XAT_EMAIL,"x@undernet.org"); // the email where manager change form is
sent.<br>
<br>
define(FROM_NEWUSER,"cmaster@undernet.org"); // the From: email for a NEWUSER
registration email.<br>
define(FROM_NEWUSER_SUBJECT,"Your Undernet Channel Service Account"); // the
subject of that mail.<br>
<br>
define(FROM_FPASS,"cmaster-recovery@undernet.org"); // the From: email for a
FORGOTTEN PASSWORD email.<br>
define(FROM_FPASS_SUBJECT,"Your Undernet Channel Service Password for "); //
the sujbect of that mail. 'username' is added at this string's end.<br>
<br>
/******************************/<br>
/* LOCAL DATABASE DEFINITIONS */<br>
/******************************/<br>
define(LOCALDB_NAME,"local_db"); // the local database that contains the gnuworld/doc/local_db.sql
information.<br>
define(LOCALDB_USER,"gnuworld"); // the local user that has full access to LOCALDB_NAME.<br>
define(LOCALDB_PASS,""); // the password, use blank if you dont use passwords.<br>
<br>
/*******************************/<br>
/* REMOTE DATABASE DEFINITIONS */<br>
/*******************************/<br>
define(REMOTEDB_NAME,"cservice"); // the remote databasr that contains cservice.sql,
cservice.web.sql information.<br>
define(REMOTEDB_USER,"gnuworld"); // the user that has access remotely to that
db<br>
define(REMOTEDB_PASS,""); // the password, use blank if you dont use passwords.<br>
define(REMOTEDB_HOST,"127.0.0.1"); // define to whatever host/IP of the "remote"
db is.<br>
<br>
/*******************************/<br>
/* LOCAL WEBSITE CONFIGURATION */<br>
/*******************************/<br>
define(HEAD_LOGO,"cservice-head.jpg"); // this points to an existing image in
website/docs/gnuworld/images. 59 pixels max height.<br>
define(HOSTING_LOGO,""); // this image should go in website/docs/gnuworld/images
and be maximum 250*33 pixels.<br>
define(HOSTING_URL,"");<br>
<br>
define(CSERVICE_SITE_URL,"../");<br>
<br>
those options are only used when using multiple mirrors of your CService website<br>
if you dont do mirrors at all, just leave those options as they are, this wont
affect anything.<br>
if you do mirrors, the following options means that if the website is accessed
with "ROUNDROBIN",<br>
it will automatically redirect accesses to "LOCALMIRROR".<br>
<br>
define(LOCALMIRROR,"cservice-live.xx.undernet.org");<br>
define(ROUNDROBIN,"cservice-live.undernet.org");<br>
<br>
<br>
/* IP CHECK OPTIONS */<br>
<br>
define(IPCHK_MAXHITS,3); // Number of failed forgotten_pass/login attempts before
IP_LOCK<br>
define(IPCHK_BANTIME,86400); // Time your IP/username is locked (seconds) when
caught into IPCHK_MAXHITS+ failed attempts.<br>
<br>
define(LREQ_TIME,600); // min time between forgotten password requests to avoid
flooding, set this to 0 to disable.<br>
define(UNETUB_TIME,14400); // 4 hours before being able to create another user
from the same IP. set to 0 to disable.<br>
<br>
<br>
<br>
<b>!!!! DONT FORGET TO REMOVE THE LAST LINE ON THE CONFIG.INC OR IT WILL NOT
WORK... !!!!</b><br>
<br>
<br>
<br>
<br>
For More questions you know what to do !!! Send them to me and I will add them
on the next relase of this help file.<br>
<br>
<br>
EOP<br>
************************************************************************************************************************<br>
************************************************************************************************************************<br>
************************************************************************************************************************<br>
<br>
<a name="part5"></a>PART V - PostGre Short Installation<br>
<br>
This is the file that you can find also in the INSTALL file.<br>
If you have questions please send them to cti@zurna.org<br>
and I will add them to FAQ's when I do it. Cti-<br>
<br>
(You have to switch to Super User -Root- to do these steps)<br>
<br>
./configure<br>
gmake<br>
gmake install<br>
adduser postgres<br>
su - postgres<br>
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data<br>
/usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data >logfile 2>&1 &<br>
adduser cmaster<br>
<br>
When it asked you "this user can add other users? y/n" Hit no (or yes)<br>
and when it asked "this user can create databases" hit YES<br>
<br>
After that switch to cmaster ( or whatever your username is)<br>
and type /usr/local/pgsql/bin createdb cmaster (or what you want your database
name to be)<br>
<br>
And its ready now !!!!</p>
<p><a href="http://gnuworld.undernet.org/cmaster/index.html">[Go Back]</a> - <a href="mailto:cti@zurna.org">[Maintainer]</a><br>
<br>
<br>
</p>
</body>
</html>
+19
View File
@@ -0,0 +1,19 @@
<HTML>
<!-- CMaster Channel Services Website. -->
<!-- $Id: web.html,v 1.1 2001/10/20 23:57:51 gte Exp $ -->
<HEAD>
</HEAD>
<BODY>
<FONT FACE="Tahoma, Times New Roman" SIZE=2>
<FONT SIZE=+2>Web Interface Information</FONT>
<P>
Coming in the not too distant future.
<P>
Last Updated: 20/10/2001. [<A HREF="index.html">Back</A>] [<A HREF="mailto:gte@undernet.org">Webmaster</A>]
</FONT>
</BODY>
</HTML>