PDA

View Full Version : CTS.ReLoADeD


kiezz
02-04-2005, 10:39 AM
I'm done to public this new version of Credit Transfer Script.
Is a tcl script for eggdrop/windrop, let you manage ioFTPD only rings, glFTPD only rings, or mixed rings.
Let you manage quota, credtis, add/remove/disable/enable user, add/del groups,
add/remove ip, change login/passwd/ratio/speedlimits/group/ whit one command from irc.
Top10 , Top40 , last month quota summary, dispaly ring rules , banned, affils, ring sections.

This is the changelog, more info on readme:

CTS.RELOADED.2.0

Change Log from the CTS 1.9 stand alone version

New Tcl
--Added cts-autodisable.tcl
--Added cts-welcome.tcl
--Added cts-eggmanage.tcl

Bug Fix
--Bug fix on opfilter command
--Bug fix on bw command
--Removed use of flowbot on gl box

New
--!Top10
--!Top40
--!disable
--!sections
--!rehash
--!restart
--!die
--!banned
--!trigger
--enableftpuser [login]
--disableftpuser [login]
--opaddip [login] [IP]
--opdelip [login] [IP]
--chgrp [login] [from] [to]
--chlogin [loginold] [loginnew]
--chpass [login] [newpass]
--change [login] logins [number]
--change [login] flags [+|- <FLAGS>]
--change [login] speedlimit [maxdl] [maxul] ### maxul is facoltative, 0 unlimited
--change [login] ratio [x:y] #### leech = 0
--autodisable/autoenable on part/join of sites bots
--Some documentation

Change
--New quota system
--New rules system
--New theme
--New affils
--More powerfull logger capacity
--More output

TODO
--Trial system
--Gadmin support


I have just a question, i don't know how post this script on ioFTPD.com, someone can help me?

Tnx

Mouton
02-04-2005, 11:02 AM
http://www.ioftpd.com/scripts/new_script.php

kiezz
02-04-2005, 11:20 AM
Tnx.
is out, i hope someone will give a chance...

djrob
02-05-2005, 04:47 AM
Great news :D

EDIT: I use CTS with Io, Gl and drftpd but drftpd isn't mentioned anywhere in the documentation..... is that support removed or did you just forgot about that? Think i'll wait with the upgrade until that's crystal clear since there's no rush. Working fine as it is (even though new stuff always is fun) :p

kiezz
02-05-2005, 06:07 AM
Hi
The support for drftpd was started by Blisters, but i don't know if have made something public, the last time i spoked whit him he say he was realy busy and not too much time for cts.
The version 1.9 was whit support for raiden/glftpd/ioftpd but not for drftpd.
My version is an upgrade for 1.9 , whit more functions and something to improve quota/stability and usability.
But i've not a drftpd box(s) to make some test and see the replyes and core commands.
I will instert drftpd support on todo, or maby if i find blisters somewhere i'll merge my addon on his version (if he work on it).
ByE

Ren
02-05-2005, 12:04 PM
I cant get transfer to work, or any of the op commands even though Im +m on the bot, do I need to set a certain flag

when /msg bot transfer user pass site site amnt

all I get in partyline is "1" no other responce

also bw dont work, but that probably to do with custom site who's, so if possible can it be modded to get bw from swho ?

using gl/io sites on ring

kiezz
02-05-2005, 01:15 PM
I'm sorry
i've found two little bugs on a midnight change, i hope now is fine, i've posted the new pack.
For op commands i think i've fixed, for credit transfer the code is in the most part egual to the original cts and it was working.
For me work, the 1 replyes tell you the sites are correct, try to move less credits.
For the !bw command it use site who to grab stats, surely is something on it.
If you are on efnet you can pm me (N|K) and i will help you.
ByE

hazy
02-05-2005, 01:29 PM
i test it now and work fine :D

Great job !!

kiezz
02-05-2005, 02:56 PM
Hi
i've checkend and the !bw command is a slave of site who.
On ioftpd i've found some different site who output, on gl seams more standard.
My !bw work on a ioFTPD site who like:

ftp> site who
200- ___________ ________
200- _______\_ _/__\ /________
200- \ / | | | _ /
200- | /\ | | | |
200-+-------------------|______________\___|_____|_______|------------------------+
200-| |
200-| xxxxxxxxx@iND - down - 78kBps xxxxxxxxxxxxxxx (%progress)
200-| XXXXXXXX - connected for 0m 11s - idle for 0m 3s
200-| XXXXXX - connected for 1m 3s - idle for 0m 45s
200-| HuB@XXXXXX- connected for 0m 25s - idle for 0m 24s
200-| |
200-+---------------+------------------+--------------------+---------------------+
200-| Users: 4/30 | Up: 0 kBps | Down: 78 kBps | Total: 78 kBps |
200-+---------------+------------------+--------------------+---------------------+
200 Command succesful.

Is very popular but is not standard, soon i'll wrote for a :

.-------------------------------------------------------------------.
| User Group Action |
|-----------+-----------+-------------------------------------------|
| xxxxxx siteOP IDLE for 00m 13s Online: 00:00:34 |
| In path: / |
|-----------+-----------+-------------------------------------------|
| Up: 0@0 KB/s Down: 0@0 KB/s Total: 0@0 KB/s |
| |
`---------------------------------------------------------[ 01/20 ]-'

ByE

Ren
02-07-2005, 01:50 PM
so what needs changing to update to latest v ? nothing in readme or changelog

kiezz
02-07-2005, 02:57 PM
The problem is on your customized site who, i need to see the output.
My solution is quite standard, and it seams work where i've tested.
I've made few bug fix on the latest but are not about bw.
ByE

Ren
02-08-2005, 09:17 AM
that doesnt explain to those who have it installed allready, who dont want to have to delete the whole package and start again for 2 lines of code change... what scripts of yours have you changed ?

Mouton
02-08-2005, 10:48 AM
There's dozens of tools that can tell you what has changed. Beyond Compare is one of those.
Select two directories, and it will show u all different files (files added, removed, or content changed). Files you didn't touch to config, you can simply overwrite with the newer version. Files you changed, you'll have to use the built-in file merger to merge the new file into your existing file (or the otherway around, if there's more new content than old content...)

Very easy to use, and there's a trial version.

kiezz
02-09-2005, 05:56 AM
I'm sorry i was not so detailed on my change log, the bug fix are on cts-loader.tcl , cts-userman.tcl.
But the configuration part it take just take few variables to change (or copy and paste), i don't see a big problem.
I repeat, if you need help or support i'll be pleased to speak whit you on efnet.
ByE

PopWeasel
03-04-2005, 08:08 PM
Quota across sites works ok but please add trial support, it's important. :o Also, auto-deluser needs to be an option for the failed, nobody is gonna pay attention to doing that manual. It's very easy to implement, just needs to send one cmd to all ftp's: site deluser <user> or on gl, site change <user> flags +6 also works. If host box is gl, crontab could trigger the checking if users passed at end of week/month. If host box is io, you'll hafta think of a way, maybe scheduler can do it.

kiezz
03-05-2005, 06:29 AM
I'm testing a new version, 3.0, it have a basic trial, !rank and few improuvement.
About deluser i'm thinking about but is not so easy.
I've see whit my personal experience the people often don't set correctly affils/excluded groups.
Often site's clock can be not set correctly , maybe the hour is wrong (+- 1 at least) can false the last day's quota.
Another problem is the eggdrop doing recursive ftp command can crash, that can stop the delete process.
The last problem i've see is related to glFTPD, if you do site monthup it give only users who have uploaded 1+ MB , if a user have uploaded 0 Mb he will not be displayed.
I think a check on the first day of month is needed, on the next days i'll try to make some test about that.
ByE

jeza
03-05-2005, 09:55 AM
check this


set iojTQ(year) [clock format [clock seconds] -format "%Y" -gmt true]
set iojTQ(month) [clock format [clock seconds] -format "%m" -gmt true]
set iojTQ(time_month_begin) [clock scan "$iojTQ(month)/01/$iojTQ(year) 00:00:00" -gmt true]
set iojTQ(nmonth) [expr int([format %f [clock format [clock seconds] -format "%m" -gmt true]])+1]
if {$iojTQ(nmonth) == 13} {
set iojTQ(nmonth) 1
set iojTQ(year) [expr $iojTQ(year)+1]
}
set iojTQ(time_month_end) [clock scan "$iojTQ(nmonth)/01/$iojTQ(year) 00:00:00" -gmt true]

kiezz
03-07-2005, 12:21 PM
Hi jeza , i'm glad you are looking on my project :D .
Tcl 8.5+ bring new improuvment on clock command , very very usefull:
(http://www.tcl.tk/man/tcl8.5/TclCmd/clock.htm)

clock add timeVal ?count unit...? ?-option value?

I've tested this under Linux , whit this is very simple, also for trial time across month end.
My code whit this is :

set u_trial [lindex $text 0]
putlog "user in trial: $u_trial"
set trial_list [open $cts(progdir)/cts/logs/cts.trials.users a]
set now [clock format [clock seconds] -format {%m/%d/%Y@%H:%M:%S}]
set c_now [clock seconds]
---> set a [clock add $c_now $cts(tday) days] <-----
set end [clock format $a -format {%m/%d/%Y@%H:%M:%S}]
puts $trial_list "$u_trial|$now|$end"
close $trial_list


However on Windrop is unrecognised (do to tcl 8.4), whitout that the code is:

set u_trial [lindex $text 0]
putlog "user in trial: $u_trial"
set trial_list [open $cts(progdir)/cts/logs/cts.trials.users a]
set now [clock format [clock seconds] -format {%m/%d/%Y@%H:%M:%S}]
set day [clock format [clock seconds] -format {%d}]
set nday [expr $day + 7]
set month [clock format [clock seconds] -format {%m}]
set year [clock format [clock seconds] -format {%Y}]
set time [clock format [clock seconds] -format {%H:%M:%S}]
set c_now [clock seconds]
set end "$month/$nday/$year@$time"
puts $trial_list "$u_trial|$now|$end"
close $trial_list

But the problem is if you want start a trial of 7 days starting the 28 you get the end trial day on 35 ....

Thanks for help , ByE

PopWeasel
03-07-2005, 08:21 PM
If I may make a suggestion: I think most people would find dynamic trial/quota periods to be better than static periods. What does this mean? It means the periods don't depend on calendar weeks/months. So for instance, trial doesn't start on Sunday and end on Saturday and quota doesn't start on 1st and end on 30th. Using dynamic periods, trial starts the day user was added and ends 7 days after and quota starts the day user was added to a quota group and ends 30 days after. This way users always get a fair trial/quota period and 'user managers' don't have to worry about time of week/month they add users. I'm not sure if it's harder to code it this way or maybe it can even offer a solution to the calendar problem you mentioned (if we can move away from using calendar days). If you want an idea how to do it just take a peek at ss-trial (http://ss5.moredhel.net/direct.html) because it has dynamic trial periods.

But, if this way is harder for you then forget about it. Working trial+quota across slaves is more important than having it be dynamic. ;)

jeza
03-08-2005, 02:03 AM
i use this - io example
get date from SysOp.log




proc iojTQ:DateAdded { user } {
...
if { [lindex $n 5] == "io" } {
if {[regexp -nocase -- ".*created user '$user'.*" $line]} {
#if { $iojTQ(debug) } { putlog "..iojTQ...: $line" }
set iojTQ(date_found) true
set temp [split [lindex $line 1] "-"]
set iojTQ(time) [clock scan "[lindex $temp 0]/[lindex $temp 1]/[lindex $temp 2] [lindex $line 2]" -gmt true]
}
};#io
...
}

set iojTQ(date_added) [iojTQ:DateAdded $iojTQ(user)]

...

set iojTQ(trial_end) [expr $iojTQ(date_added)+[expr $iojTQ(trial_days)*86400]]

if { $iojTQ(trial_end) <= $iojTQ(time_now) }
-> failed


...

PopWeasel
03-09-2005, 11:29 AM
Question: how to get tagline to show in top10 output?

Sjon
03-13-2005, 01:23 PM
lo m8 great work on CTS i love it! :D

but can you plz tell me how the summary is working ? (maybe someone else ? ) cause when i do !summary all it says is ... "I CAN'T FIND THE FILE WHIT THE SUMMARY OF MONTH's END" so i search for some save options but cant find them plz help cause i think this is very handy..

typhon|wk
03-13-2005, 07:03 PM
how can i fix this error ?

[23:30] Tcl error [cts-quota:end.quota.ontime]: couldn't open "scripts/cts/logs/cts.quota.day.13:03:2005": invalid argument

im getting it every day.

PopWeasel
03-19-2005, 07:47 PM
kiezz, your post about v3.0 sounds promising, have you been able to make any progress with it? Let me know if you'd like any collaboration on your project, I'll try to help if I can. I can't code but I can offer feedback and give input on features. :)

PopWeasel
04-09-2005, 06:23 PM
How about adding a !rank cmd?

<user> !rank johnny
<@bot> MONTH-RANK -> johnny/lewsers is #23 with 221F @ 4.4GB (avg. speed 5.7MB/s) needs to upload 161.7MB to beat mary/workers


Showing number of files and the speed they were upped isn't important, but you get the idea...

CyberAL
04-11-2005, 09:43 AM
is there any way to get this script to work with blowfish?

foxmaster
06-05-2005, 09:52 AM
Having a bit of truble using !passed error I get in partyline is [16:48] Tcl error [cts-quota:passedasync]: syntax error in expression "round(STAFF)": variable references require preceding $

someone have any ide ?

Foxmaster

kiezz
06-06-2005, 04:13 AM
Dear Foxmaster

Your problem is do to a bad reply by one of your ftp.
The CTS.Bot do a site monthup on every site, but one of yours is giving a bad reply and instead of getting a number value it got the word "STAFF".
My tip is to have a look on the monthup files manually, whit a text editor and see which is having problems.
In case you fix it on ftp you have to stop the bot running, delete the monthup and monthup.last files, then restart it and do on query saveusers.
This shoud fix it.

I'm on testing, RC level, whit CTS.ReLoAdeD 3.0 , i hope to not found more bugs and publish soon it.
I'm in lack whit tester, if somebody have some time to spent i will be glad to give around some pre release.
You can find me on irc, on efnet or linknet (NiK or N|K).

Thanks, ByE