[Haifux] SVN quota

Maxim Kovgan kovganm at gmail.com
Mon Jan 18 21:27:51 MSK 2010


I think there is a problem to run the quota query from a web server,
b/c the UID of the webserver process is not allowed to run quota stuff,
and all the web technologies usually limit setuid() related stuff.
And you don't want to run a CGI script as root, you really don't.

So, the only relatively safe solution would be to build 2 scripts:
1. script to generate the quota database, and it should run once per 1-5 minutes
2. CGI/FastCGI/WSCGI script to query that database

If users' repositories reside on the expense of their home
directories, maybe a webmin/usermin web application allows to watch
quota status with some nice module,

SQLite looks like a good candidate, but even CSV is ok, as long as
you make sure you use flock() like functions to lock the db file
properly when you read/write, etc.


Regards.


On Mon, Jan 18, 2010 at 4:07 PM, Maxim Kovgan <kovganm at gmail.com> wrote:
> well, I'm not aware of anything ready to use, but there might be one -
> a CGI/FastCGI or WSGI something.
> you're interested in just showing quota command output with proper args.
> If you choose Perl, you may use Quota;
>
>
> On Mon, Jan 18, 2010 at 12:03 PM, Shahar Dag <dag at cs.technion.ac.il> wrote:
>> Max
>>
>> Writing  pre-commit script & writing a cron-job that test the quota are
>> almost equal effort.
>> I am not sure which one is better.
>> What I am looking for is a tool that will enable the users check the quota
>> on the svn machine
>>
>> Shahar
>>
>> ----- Original Message -----
>> From: "Maxim Kovgan" <kovganm at gmail.com>
>> To: "Shahar Dag" <dag at cs.technion.ac.il>
>> Cc: "Haifaux" <haifux at haifux.org>
>> Sent: Monday, January 18, 2010 9:56 AM
>> Subject: Re: [Haifux] SVN quota
>>
>>
>>> hi Shahar!
>>> A possible solution if your svn repository is stored on a filesystem could
>>> be
>>> a "pre-commit hook" script, that would basically:
>>> * check user's/project's repository quota against filesystem
>>> * act accordingly to the result, upon:
>>>   * OK - do commit
>>>   * Warning (quota threshold reached) - print the result, and commit
>>>   * Quota exceeded - print the result and NOT commit
>>> Of course take care of the return values of the script properly.
>>> The script may even send an email to the user, if you have email in NIS.
>>>
>>> I do not know how different SVN clients would respond to the
>>> non-standard messages in the output of SVN client.
>>> This is what you will have to check for yourself.
>>>
>>> Regards,
>>> M.
>>>
>>> 2010/1/18 Shahar Dag <dag at cs.technion.ac.il>:
>>>> Hello
>>>>
>>>> I have a LINUX server (RHE 4) that among other things serves as SVN
>>>> server
>>>> (the SVN server runs over apache).
>>>> Users can access their repository via https, but they can't login to the
>>>> server (not even with ssh).
>>>> To access the SVN, users must supply their NIS user name & password.
>>>> Every SVN repository has it's own quota limitation.
>>>>
>>>> The question is: do SVN users have any way to test their quota?
>>>> (I don't want to write a cron job that warns the users when they are over
>>>> 80% of the quota)
>>>>
>>>> Thanks
>>>> Shahar
>>>> _______________________________________________
>>>> Haifux mailing list
>>>> Haifux at haifux.org
>>>> http://hamakor.org.il/cgi-bin/mailman/listinfo/haifux
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Maxim Kovgan
>>> _______________________________________________
>>> Haifux mailing list
>>> Haifux at haifux.org
>>> http://hamakor.org.il/cgi-bin/mailman/listinfo/haifux
>>>
>>
>> _______________________________________________
>> Haifux mailing list
>> Haifux at haifux.org
>> http://hamakor.org.il/cgi-bin/mailman/listinfo/haifux
>>
>
>
>
> --
> Maxim Kovgan
>



-- 
Maxim Kovgan



More information about the Haifux mailing list