rejetto forum

Software => HFS ~ HTTP File Server => Topic started by: AYEHAN on March 14, 2009, 12:38:13 PM

Title: Download Quota
Post by: AYEHAN on March 14, 2009, 12:38:13 PM
is there a way to limit the downloaded bytes per hour or daily basis? for logged in users only

1) X Mb is allowed to download per hour or per day
2) X files are are allowed to download per day ... no counting about downloaded size in total

which ever is possible .. both will do the same :) for me atleast
Title: Re: Download Quota
Post by: Kremlin on March 14, 2009, 08:20:06 PM
I find this idea also quite interesting, for example when you have large amounts of files of which anyone has access, sometimes they will list too many on their download manager preventing others from having a chance to download something else with good speed, or on the other hand not overloading Upload bandwidth on limited home connections.

Anyway template wise you would have to log how much has been downloaded from the server at a certain time and suspend sharing upon reaching the logged download total + limit, but i doubt that's possible at this time and would be easier if done with a HFS option (more work for rejetto  :P).

Some programs like KerioWinRoute Firewall have such account quota manager abilities, but with that they would need to login to the Kerio System before entering your server.
Title: Re: Download Quota
Post by: rejetto on March 16, 2009, 12:25:02 PM
the idea of the quota is interesting and already in to-do.
BUT
what should be the rule?
AYEHAN made 2 examples, but i fear there are infinite cases, and needs.
i think this must be solved with macros.

i guess a mixture of event [download complete] and setting account notes will do.
setting account notes is not available yet. but will be soon.
Title: Re: Download Quota
Post by: Kremlin on March 16, 2009, 12:48:19 PM
x MB/Files per Day/Week/Month per IP/User I think would cover a lot although the file bit might get tricky when pause/resuming in download manager a file.

Edit: i've now read your reply better and an issed 'download complete' would indeed solve the pause/resuming problem.
Title: Re: Download Quota
Post by: r][m on March 17, 2009, 05:14:48 AM
event [download complete] and setting account notes will do.
http://www.rejetto.com/forum/index.php?topic=6719.msg1041717#msg1041717 (http://www.rejetto.com/forum/index.php?topic=6719.msg1041717#msg1041717)
When I tested [download complete] in events to use with special log I found
it lists everything that loads/downloads on the page, .gif,/~img, etc. Setting file mask for
the folder didn't help. Even setting don't log on each individual file didn't work.
Unless theres a macro fix for this wouldn't it be hard to accurately set a quota?
Title: Re: Download Quota
Post by: Kremlin on March 17, 2009, 10:55:59 AM
Why not filter everything within the template folder? On the other hand could be solved using MB instead of nº of files
Title: Re: Download Quota
Post by: rejetto on March 17, 2009, 11:44:15 AM
mmm, yes, we must decide what to do with it.

1. we may fire the event only for what HFS consider downloads, instead of every file.
difference may be as [request completed] and [download completed].

here another question arises: should [download completed] be followed by a [request completed] ? (a download is also a request, and indeed [request] is fired before [download])

2. i may rename [download completed] to [request completed] and then offer a symbol %type% that will turn to "download", or "archive" or "other" (for all other requests).



do you like any of these paths, or want to suggest another?
opinions welcome
Title: Re: Download Quota
Post by: Kremlin on March 17, 2009, 12:18:10 PM
When 'Fully Downloaded message' is triggered we simply add 1 file to the IP/User quota. Couldn't understand quite well your last statement (the 2 path's i meen).

PS. Limiting through nº of files would only 'work' in a server which hosts similar size files, with the MB system having a larger adaptation.
Title: Re: Download Quota
Post by: rejetto on March 17, 2009, 01:20:32 PM
my last post was not about quota, but focused on how the [event] should work.

both ways will be ok for the quota system, it's a matter of taste.

i guess method 1 is easier for the people.
Title: Re: Download Quota
Post by: Mars on March 17, 2009, 11:39:24 PM
It is easier  to have several different sections, by knowing which one makes what, and only what with what she is made for. Or then to have a single section and to have to make a continuation of macro
[request completed]
{.if|%type%=download| ..... .}
{.if|%type%=archive| ....... .}
{.if|%type%=upload| ....... .}
{.if|%type%= xxxxxx| ....... .}

If we are reduced to these obligations then for my part I would make an entorce to it by using the call to the other sections for reduce the possible errors during the conception of the template

[request completed]
{.$%type% completed.}

[download completed]
DOWNLOAD ACTION
[archive completed]
ARCHIVE ACTION
[upload completed]
UPLOAD ACTION
[xxxxx completed]
xxxxxACTION
........

It will be also easy as the old method  :D
Title: Re: Download Quota
Post by: rejetto on March 18, 2009, 12:39:41 PM
[request completed]
{.$%type% completed.}

haha, nice workaround
Title: Re: Download Quota
Post by: Mars on March 18, 2009, 07:04:05 PM
[request completed]
{.$%type% completed.}

haha, nice workaround

I was going to forget to indicate the possibility of using  macro switch switch

[request completed]
{.switch|%type%|download|{.$download completed.}|upload|{.$upload completed.}|archive|{.$archive completed.}|{.$default completed.}.}

 ;)

Quote
that event is for actions, that html stuff will be just discarded

 ;D ;)
Title: Re: Download Quota
Post by: rejetto on March 19, 2009, 02:45:32 AM
that event is for actions, that html stuff will be just discarded
Title: Re: Download Quota
Post by: r][m on March 19, 2009, 06:14:15 AM
Now I'm confused (not unusual for me) :)
I had  [download completed] and [upload completed] with
append to special log in HFS Events working in 229 test directory.
In build 230 it no longer works and I assume it was changed, but to what?
I've tried the code in this thread in various ways, with no luck?
Title: Re: Download Quota
Post by: rejetto on March 19, 2009, 02:55:04 PM
please post the code that used to work forr you
Title: Re: Download Quota
Post by: r][m on March 20, 2009, 07:24:15 AM
Its at this link.
http://www.rejetto.com/forum/index.php?topic=6719.msg1041655#msg1041655 (http://www.rejetto.com/forum/index.php?topic=6719.msg1041655#msg1041655)
Even more confusing, now in 230 only [upload completed] is not working. All work in 229
Title: Re: Download Quota
Post by: rejetto on March 25, 2009, 12:33:08 PM
ok, i'm sorry for the time it took.
fixed in next build.
Title: Re: Download Quota
Post by: r][m on March 25, 2009, 02:20:46 PM
ok, i'm sorry for the time it took.
fixed in next build.

No Problem, 
Many, Many thanks, for all you do!
Title: Re: Download Quota
Post by: rejetto on April 08, 2009, 12:51:00 AM
ok, from next build you'll get [download completed] only for "true" downloads.
all kind of requests instead (pages, icons, etc) will fire a [request completed]
Title: Re: Download Quota
Post by: AYEHAN on April 09, 2009, 08:36:35 PM
okay ...

i installed SoftPerfect Bandwidth Manager in my PC and tried to lock the bandwidth with it, its counting data that sent & recieve but no limit is imposed :/

tried in both way incomming & outgoing but dunno why its not working any idea? i use this software for bandwidth shapping with ISA server perfectly, maybe it works only with a proxy server :/
Title: Re: Download Quota
Post by: rejetto on April 10, 2009, 09:09:01 PM
i don't know this software, and can't help, but it seems to be interesting.
anyway, now we should have all we need to script a quota system.
any bold scripter? :D
Title: Re: Download Quota
Post by: AYEHAN on April 13, 2009, 08:25:41 PM
hmm ok but if you wanna test this app here i uploaded it for you

xxxxxxxxxxxxx
Title: Re: Download Quota
Post by: MarkV on April 14, 2009, 12:49:59 PM
I really wouldn't post warez here... There's a trial at http://softperfect.com/products/bandwidth .
Title: Re: Download Quota
Post by: rejetto on April 14, 2009, 01:14:43 PM
i accept your advice markv