PDA

View Full Version : Credit Transfer System


Blisters
01-01-2004, 10:17 AM
Hello, here comes a little information about a script that I have been developing for a while. It's called CTS and was in the beginning a script to transfer credits between ioFTPD, glFTPD and Raiden ftpservers. Today it has grown a little larger and has the following commands (only glFTPD and ioFTPD support thou):

Public irc commands
!affils
list affils. If sitename is include show only that site. All affils are exempted from monthly quota ([user] is in affiliated group [group]....)

!bnc
bnc list. If sitename is included the sitebnc, shows if it's possible to logon to the site

!bw
sitering bandwidth usage (bandwidth show per site and a total)

!credits [login]
Show how much credits you have

!links
Show sites connected to system and theit status (linked, offline or dissabled)

!monthup [login]
Shows Month Up stats on all sites

!monthdn [login]
Shows Month Down stats on all sites

!passed [login]
Check monthly quota

!filter failed|passed|all
Shows all users that have failed|passed quota or if "!filter all" is used then show all users and what their status is

Public PRIVMSG commands
/msg xXx transfer [login] [pass] [from] [to] [amt]
Move credits from site [from] to [to]. User must validate himself as [login]. The creditstransfer is executed for the user [login].

/msg xXx addip [login] [pass] [IP]
Add ip to [login]. Again user validation is done by verifying username/password on local userlist

/msg xXx delip [login] [pass] [IP]
Delip

/msg xXx listip [login] [pass]
List your ips

Operator commands (theese commands require that +O is set on the user in the eggdrop
/msg xXx addftpuser [group] [login] [pass] [ip]
/msg xXx delftpuser [login]
/msg xXx addgroup [group]
/msg xXx delgroup [group]
!opfilter [passed|failed|exempt]

Requirements.

First and most important. The CTS script must be installed on a glFTPD site (2 reasons for it, first script is an addon to f|owmans sitebot and second uservalidation is done against an glFTPD userlist)
The glftpd sites should all use standart outputs on the commands and ioFTPD sites should have ioA installated (site give,take is used)

Almost every aspect of the script configuration is done by using .sset commands on DCC. Meaning that if you have installed the scripts and are up and running then u should not need to access the computer directly, everything can be done from telnet/dcc (including script updates).

Unfortunally the script isn't yet ready to be released in public since I need to remake the configuration so it will be easier, but Im looking for someone who would be interested in beeing a betatester for the script. I have used the script for 2-3 months now and it seems to work fine but need to have it tested an more computer before I release it to the public.

http://www.ioftpd.com/scripts/script.php?id=94

/Blisters aka blisteringbeens

rAWfOX
01-01-2004, 10:41 AM
looks realy cool... good work....

djrob
01-02-2004, 06:51 AM
Yup, I've tried it and it's working great. Nice work :D

peep
01-02-2004, 07:57 AM
Sounds interresting enough.. Wouldn't mind trying it out for you!

djrob
01-07-2004, 06:40 AM
Too bad not more people wanna give this a try :(
There's gotta be plenty of io/gl site-rings out there and this baby works really great :p

Blisters
01-07-2004, 10:41 PM
This a preview of my code. It's in use on atleast 1 sitering and works. I have removed som code from this one so it wount delete all users if configured wrong.

If you wanna try this out be free to pm me on efnet (contact information included in readme file).

Please all included readmes and faq since they contain alot of information on how to use the scripts and sitebot. Do remeber that you shouldn't use this script on a eggdrop that is in use (with that i meen that install it on a fresh eggdrop with an another nick).

All existing users should have the same group on all sites or the output will look funny.

To get the credit transfer to work only the username needs to match on all sites, the user validation is done against the local passwd file found in /glftpd/etc/passwd (if you have an jailed enviroment you need to fix line 105 on sitebot-addon-cts.tcl)

Hope you like it.

PS. Rename file to sitebot-glftpd+cts.tar.gz to unpack it, forum doesn't allow tar.gz files :(


The completed version will be fully skinnable and the configuration will be remade completly

/blisters

rAWfOX
01-08-2004, 01:48 AM
gr8 work... gonna try it out....

djrob
01-22-2004, 04:48 PM
This has been downloaded 41 time(s)... :rolleyes:

Would be very interesting to hear some comments ;)

Blisters
03-05-2004, 09:08 AM
The ioFTPD version is on final testing stage...

Problems that still need to be solved:

CTS and ioBANANA doesn't seem to like to be run on the same server. This since CTS is extremly aggressive on loggin on to the sites and that way hindering ioBANANA to function properly (any ideas why, seems like some commands doesn't work properly when both scripts are run in the same eggdrop). If you have 2 eggdrops running on the same server all seem to work fine.

Response time between the linux version differ quite alot (It seems like irc queues aren't handled quite the same way on windrop and eggdrop)

New functions:

BNC support (winssl_wrap and "alternative ip logon" tested and workin).
Redesigned modular approach.
Extended loggin and debuging support.
Most code is shared between ioFTPD and glftpd versions. The ioFTPD version doesn't need any extra modules (if not using tls witch would require winssl_wrap). The glftpd version requires passchk that comes with sitebot by F|owman

Things to do before 2 is released:

Recode the userman module (better permission handling + more validation on user variables)

CTS for ioFPTD doesn't need any glftpd/linux sites its totally independent
/Blisters

rAWfOX
03-05-2004, 10:49 AM
nice going!!!

peep
03-05-2004, 11:06 AM
Great! Can't wait :-)

ChipMunk666
03-06-2004, 11:55 AM
Same here mate that was the too i was waiting for :D:banana:
I think there are enough ppl that could need it.
And the second bot isnt that of a problem does it?

peep
03-10-2004, 09:03 AM
Just to make sure, this will work with user modules as ioShareDB, right?

Blisters
03-10-2004, 09:27 AM
Originally posted by peep
Just to make sure, this will work with user modules as ioShareDB, right?

Well haven't tried out ioSharedDB, should work if command responses arent altered... My script isn't suitable if you have an ioFTPD (or glftpd) only sitering... For that purpose there are other better scripts around. My script is for those rings with mixed enviroment.

It's not real sharedDB since I the script never has direct access to the userfiles (it only has the access provided from an siteop account using ftp).

Blisters
03-19-2004, 01:30 PM
Here you have it a working example.

http://www.ioftpd.com/scripts/script.php?id=94

Ren
03-21-2004, 03:50 PM
any 1 got a proper documentation on how to get this to work correctly,

had to borrow sha1.tcl from ioBanana to get the thing started, from there !bnc !affils !credits !links work, monthup and dn dont respond, BW gives a tcl error of "Tcl error [cts-misc:bw]: syntax error in expression "+": premature end of expression"

the /msg commands appart from transfer aint responding what so ever

testing it over 2 ioftpd sites at the moment, and the script is installed on 1 sitebot

Blisters
03-22-2004, 09:56 AM
The sha1.tcl was unfortunally missing from the .rar file (the sha1.tcl file provided with ioBANANA will do)...


Make sure that you have configured cts-loader.tcl properly


Install instructions for standalone version

1. unzip package in *drop/scripts

2. Edit cts-loader.tcl (Seperate sites with spaces NOT | !!!

set cts(sites) "one.kewl.site.us:login:pass:io anothet.kewl.site.us:login:pass:gl" <-- good
set cts(sites) "one.kewl.site.us:login:pass:io| anothet.kewl.site.us:login:pass:gl|" <--- BAD

3. Add new ftp user and give the proper flags for taking/giving credits on all sites

4. rehash bot and your good to go

---------------------------------------------------------------------------------------------

Notes

In order for bandwidth to work you need old ioFTPD who output. If you have changed the output of commands then the script might not work. It programmed based on a standart ioFTPD with ioBANANA
---------------------------------------------------------------------------------------------

Ren
03-22-2004, 11:33 AM
um how exactly did the old who output look? any one got templates ?

Ren
03-22-2004, 11:07 PM
ok got the bw issue sorted using old who templates and modify the script to do site swho instead of who, loaded up usermain and have addip/delip working now as well

del user works, but "Tcl error [cts-userman:addftpuser]: missing close-bracket" on adduser

also have quota script working by changing site show to site uinfo....

looking awesome so far, cant wait till quota will disable users

Blisters
03-23-2004, 06:44 AM
userman module will be redone completly...I thinks it's way to much of an quick hack to be used atm.

I would appresiate if you post your modification (swho) and such, ofcourse I would give you credits for your modifications :). I would like to include it and code the script so that one could in the configuration select the command that is used and the script wuold automatically select the correct subruoutines.

Blisters
03-23-2004, 06:52 AM
Originally posted by Ren
ok got the bw issue sorted using old who templates and modify the script to do site swho instead of who, loaded up usermain and have addip/delip working now as well

del user works, but "Tcl error [cts-userman:addftpuser]: missing close-bracket" on adduser

also have quota script working by changing site show to site uinfo....

looking awesome so far, cant wait till quota will disable users

hmm... "site show" is used only on glftpd sites (make sure that you have configured the correct FTPD in cts-loader.tcl):

The routine that checks monthup is this (using "site stats monthup limit [username]"):

io {
set reply [split [[lindex $n 0]::Quote SITE STATS MONTHUP LIMIT $user] "\n"]
foreach line $reply {
if { [regexp $user* $line] } {
set Uploaded [string trim [lindex [split $line '|] 3]]
set group [string trim [lindex [split [lindex [split $line '@'] 1] '|'] 0]]
}
}
putlog "$Uploaded - $group"
if { $Uploaded == -1 && $group == "NotFound" } {
set Uploaded -550
}

Ren
03-23-2004, 07:34 AM
yeah month up works fine without any mod's as its a io only site ring, the only cmd that aint working is the ftpadduser

PiP42o
03-26-2004, 01:18 PM
Could somebody pls fix the SCT pack on this website,when u guys disabled all the attachments u also removed a few fixed to the script :(

Or e-mail me a complete pack or give me a link.
Thank you
Script is working great i just need the one missing tcl sct-addon.tcl
That one :(

And whatever other patches and fixes were posted

Mouton
03-26-2004, 02:19 PM
Blisters posted his script in ioftpd.com/scripts

If his package is missing some files to make it work, u should ask him to fix his package.

BerMUdaW
04-18-2004, 06:49 AM
when executing the eggie after addind the cts-loader it reports missing cts-logger.tcl and cts-$module.tcl?

Are those missing from the archive?

sid
05-03-2004, 10:16 AM
in all commands i gt
* Last context: tclhash.c/681 []
* Please REPORT this BUG!
* SEGMENT VIOLATION -- CRASHING!

and crash :(
why?

djrob
05-07-2004, 12:52 PM
Seen that to and i don't think it's a CTS thing. Try upgrading your windrop to the latest available :)

RoCa
05-14-2004, 02:17 AM
Is there any help/faq on this addon bc i have some small issues with it 4 xample !bw gives me "Tcl error [cts-misc:bw]: can't read "upload": no such variable" (have tried new/old who and always that error...it works until the sites links but after link =/ )
!addftpuser,listip,addip dont give any response atall..prolly me that have messed it all up but the transfer works great so im kinda confused atm so plz help me =)
//RoCa

R2_2k
05-14-2004, 06:06 AM
bw issue is discussed at the top of this thread, ftp commands are not loaded by defualt and addftp is broke atm, anyway if you message me on efnet nick: R2_2k i will help you sort out

icios
05-27-2004, 11:18 AM
Got no reply from !filter command (i tried all combinations like !filter passed or !filter all)

Other irc commands seem to work properly.

Any help?!?

R2_2k
05-27-2004, 11:47 AM
add qouta too cts(modules) " ???" and rehash then try :)

edit: in cts-loader.tcl

icios
05-27-2004, 06:55 PM
can you pls gimme the EXACT string and tell me where to put it in cts-loader.tcl?

thanks very much dude!

RoCa
05-28-2004, 12:16 AM
These Settings Works 100% For Me...
All In cts-loader.tcl

# What modules to load
set cts(modules) "logger credits userman"

# cts standalone loader
if $enabled(cts) {
putlog "|$cts(progname): Loading main cts modules.."
source $cts(progdir)/cts/cts-main.tcl

putlog "|$cts(progname): Loading $cts(progdir)/ftplib.tcl.."
source $cts(progdir)/cts/ftplib.tcl

putlog "|$cts(progname): Loading cts-misc..."
source $cts(progdir)/cts/cts-misc.tcl

putlog "|$cts(progname): Loading $cts(progdir)/cts-quota.tcl.."
source $cts(progdir)/cts/cts-quota.tcl

icios
05-28-2004, 09:14 AM
It seems that the logger doesn't log the stats.
I got this error in partyline:

File 'scripts/cts/logs/??10-MySiTE-??.monthup' not there!!!

Maybe only few tcl script fixing needed.

thanks for help

Ren
05-28-2004, 11:24 AM
looks like u have bad sitenames ? leave out any weird symbols

icios
05-28-2004, 11:49 AM
nope.

strange symbols are for colours. i tryed without tags but it didn't worked.

the files are NOT generated in /scripts/cts/logs/

help?

RoCa
05-28-2004, 06:05 PM
And u load the logger module to?

# What modules to load
set cts(modules) "logger credits userman"

icios
06-01-2004, 05:20 AM
got it!

as Ren said... colour tags cannot be created in filenames the logger makes... so by removing them, I figured it out!

evo
06-01-2004, 07:18 PM
Hi

I have a problem using cts to add a new user to the linked sites through the main Hub. I get an error when i tried to add using this command /msg HUB addftpuser group name password *@ip

This is the error i got:

Tcl error [cts-userman:addftpuser]: wrong # args: should be "hubsend mtype flag dest args output ?section?"

I dunt seem to understand wats wrong, everything works except this :(

Any help will be appreciated

Thnx..

JoC
06-20-2004, 02:32 PM
The download link for this script in the script section seems to be down. Is it hosted anywhere else?

neoxed
06-20-2004, 02:39 PM
Originally posted by JoC
The download link for this script in the script section seems to be down. Is it hosted anywhere else?
http://www.ioftpd.com/board/showthread.php?s=&threadid=3471

F30R
07-28-2004, 12:02 AM
well i try to set up CTS on a windrop 1.6.15+SSL

i ve got few sites with ioFTPD 5.6.3 + dsz x.x + ioA x.x + ioZ x.x
the CTS script is installed just with a windrop

all cmd works except :

1 > !bw = Tcl error [cts-misc:bw]: can't read "upload": no such variable ( ... )
2 > Move credits: = /msg CTS transfer [login] [pass] [from] [to] [amt] i ve creat a user TEST password TEST and when i try always the same shit : Sorry wrong credentials given..Bye bye
( ... )
3 > /msg CTS addftpuser [group] [login] [pass] [ip]
works for the first site but stop and bugs for th other

ex :

[06:58:49] <xxx> addftpuser iND TEST TEST *@*
[06:58:50] <_xxx_> Adding user TEST/iND with the password "TEST"
[06:58:50] <_xxx_> Ident: *@*
[06:58:50] <_xxx_> Executing "SITE gadduser iND TEST TEST *@*" on all linked sites.
[06:58:50] <_xxx_> site1 OK

and bug in party line it's note
" Tcl error [cts-userman:addftpuser]: missing close-bracket"

if u can resolve this pb pm me on the forum thx a lot

KVS_J
07-29-2004, 02:26 AM
me I have a concern, when it lists the credit it do not hold account of the sections
exemple:
user: test [DVD:20000Mb] [DIVX:15000Mb]

results !credits test
On DVD-DIVX test/iND has 20000 mB

Why plz???

Blisters
07-30-2004, 04:24 PM
No body has a funktion for sectionbased credits so it's not implemented. Ill look into it and check if/when I implemet it


Originally posted by KVS_J
me I have a concern, when it lists the credit it do not hold account of the sections
exemple:
user: test [DVD:20000Mb] [DIVX:15000Mb]

results !credits test
On DVD-DIVX test/iND has 20000 mB

Why plz???

KVS_J
07-31-2004, 04:18 AM
thanks upgradeeeeeeee your progggg
;)

buffi
08-01-2004, 08:54 AM
wow nice mate
thanks alot
gonna test it now
hope it works on DSZBOT

Yip
09-22-2004, 10:49 AM
Hm, i tried to get this working but ...... on the io site it keeps saying NoGroup and not giving correct stats on !credits command.

Is keeps saying Yip/NoGroup has 0 mB and uhm thats not my group and i did give myself credits !

Funny thin is on !passed command it does show credits.....

what goes wrong ?

TIA

Ar3s
11-04-2004, 07:46 AM
hello

[13:42] Tcl error in script for 'timer7271':
[13:42] command returned bad code: 4096

i ve a random error on timer and its blocked the script after!!!

Why plz?

SIGGI_
11-15-2004, 02:41 PM
Hey im curious if there is gonna be more update of this script ?