| Anonymous | Login | Signup for a new account | 2010-09-08 00:18 UTC |
| Main | My View | View Issues | Change Log | Roadmap |
| Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | |||||||||||
| ID | Category | Severity | Reproducibility | Date Submitted | Last Update | |||||||
| 0001017 | [SysCP] General | feature | always | 2008-11-30 20:08 | 2010-06-13 22:49 | |||||||
| Reporter | monotek | View Status | public | |||||||||
| Assigned To | ||||||||||||
| Priority | normal | Resolution | open | |||||||||
| Status | feedback | Product Version | 1.4.1 | |||||||||
| Summary | 0001017: Proftpd - Quota should be added | |||||||||||
| Description |
I just got this solved via mod_qoutatab_sql by myself. I would really appreciate if this could be implemented. Its only necessary to add 2 tables to syscp db and edit /etc/proftpd/proftpd.conf and /etc/proftpd/modules.conf as follows: 1.) Create Tables in Syscp DB: [code] CREATE TABLE IF NOT EXISTS `ftp_quotalimits` ( `name` varchar(30) default NULL, `quota_type` enum('user','group','class','all') NOT NULL default 'user', `per_session` enum('false','true') NOT NULL default 'false', `limit_type` enum('soft','hard') NOT NULL default 'hard', `bytes_in_avail` float NOT NULL, `bytes_out_avail` float NOT NULL, `bytes_xfer_avail` float NOT NULL, `files_in_avail` int(10) unsigned NOT NULL, `files_out_avail` int(10) unsigned NOT NULL, `files_xfer_avail` int(10) unsigned NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; INSERT INTO `ftp_quotalimits` (`name`, `quota_type`, `per_session`, `limit_type`, `bytes_in_avail`, `bytes_out_avail`, `bytes_xfer_avail`, `files_in_avail`, `files_out_avail`, `files_xfer_avail`) VALUES ('syscp', 'user', 'false', 'hard', 0, 0, 0, 0, 0, 0); CREATE TABLE IF NOT EXISTS `ftp_quotatallies` ( `name` varchar(30) NOT NULL, `quota_type` enum('user','group','class','all') NOT NULL, `bytes_in_used` float NOT NULL, `bytes_out_used` float NOT NULL, `bytes_xfer_used` float NOT NULL, `files_in_used` int(10) unsigned NOT NULL, `files_out_used` int(10) unsigned NOT NULL, `files_xfer_used` int(10) unsigned NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; [/code] 2.) Add to /etc/proftpd/modules.conf: [code] LoadModule mod_quotatab.c LoadModule mod_quotatab_sql.c [/code] 3.) Add to /etc/proftpd/proftpd.conf: [code] QuotaEngine on QuotaShowQuotas on QuotaDisplayUnits Mb QuotaLock /var/lock/ftpd.quotatab.lock QuotaLimitTable sql:/get-quota-limit QuotaTallyTable sql:/get-quota-tally/update-quota-tally/insert-quota-tally SQLNamedQuery get-quota-limit SELECT "ftp_users.username AS name, ftp_quotalimits.quota_type, ftp_quotalimits.per_session, ftp_quotalimits.limit_type, panel_customers.diskspace*1024 AS bytes_in_avail, ftp_quotalimits.bytes_out_avail, ftp_quotalimits.bytes_xfer_avail, ftp_quotalimits.files_in_avail, ftp_quotalimits.files_out_avail, ftp_quotalimits.files_xfer_avail FROM ftp_users, ftp_quotalimits, panel_customers WHERE ftp_users.username = '%{0}' AND panel_customers.loginname = SUBSTRING_INDEX('%{0}', 'ftp', 1) AND quota_type ='%{1}'" SQLNamedQuery get-quota-tally SELECT "name, quota_type, bytes_in_used,bytes_out_used, bytes_xfer_used, files_in_used, files_out_used,files_xfer_used FROM ftp_quotatallies WHERE name = '%{0}' AND quota_type = '%{1}'" SQLNamedQuery update-quota-tally UPDATE "bytes_in_used = bytes_in_used + %{0}, bytes_out_used = bytes_out_used + %{1}, bytes_xfer_used = bytes_xfer_used + %{2}, files_in_used = files_in_used + %{3}, files_out_used= files_out_used + %{4}, files_xfer_used = files_xfer_used + %{5} WHERE name= '%{6}' AND quota_type = '%{7}'" ftp_quotatallies SQLNamedQuery insert-quota-tally INSERT "%{0}, %{1}, %{2}, %{3}, %{4},%{5}, %{6}, %{7}" ftp_quotatallies [/code] Thats it. You have now a hard quota limit (diskspace from table panel_customers) for every Syscp FTP Account. The field "bytes_in_used" of table "ftp_quotatallies" should be updated by cron every night to also count content not uploaded by ftp. https://mantis.syscp.org/view.php?id=693 [^] |
|||||||||||
| Additional Information | ||||||||||||
| Tags | No tags attached. | |||||||||||
| Attached Files |
|
|||||||||||
|
|
||||||||||||
|
Users sponsoring this issue |
|
| Sponsors List |
Total Sponsorship = EUR 10 2010-02-09 18:02: NoPoday (EUR 10) |
|
Relationships |
||||||
|
||||||
Notes |
|
|
(0000179) arieser (reporter) 2008-12-17 01:48 |
# The field "bytes_in_used" of table "ftp_quotatallies" # should be updated by cron every night to also count # content not uploaded by ftp. That's not necessary - since 1.3.1rc1 and later proftpd supports the following setting QuotaOptions ScanOnLogin If configured, this causes mod_quotatab to recursively scan the user's home directory when the user logs in, and to update the tally entry for that user, if any, with the number of bytes and files found. Note that these scans will cause a longer login time for the user, depending on the size of their home directory. That is described here: http://proftpd.org/docs/contrib/mod_quotatab.html#QuotaOptions [^] IMHO ftp-quota is a really important feature for syscp! |
|
(0000180) monotek (reporter) 2008-12-17 10:13 edited on: 2008-12-18 16:47 |
Thanks for the hint but this would not count MySQL & Mail dir sizes of customers and sub ftp accounts like customer1ftp1 would not work, because this accounts gets the quota from customer1. |
|
(0000328) monotek (reporter) 2009-03-03 17:35 edited on: 2009-04-02 20:27 |
This is the final patch (syscp1421_ftpquota.patch) for proftpd and pureftpd quota in syscp 1.4.2.1 (Please delete the other files). admin_settings.php: - new config option "FTP Server" cron_traffic.php: - updating also the column "bytes_in_used" of table "ftp_quotatallies" when "diskspace_used" of table "panel_customers" is updated. - if purftpd is selected in admin_settings.php the .ftpquota files for purftpd quota is created in ftp user dirs tables.inc.php: - added tables "ftp_quotatallies" & "ftp_quotalimits" admin_customers.php: - if a new customer is created there is now also a new user in ftp_qoutatallies created - if admin deletes customer all entries of customer in table ftp_quotatallies are deleted too. update_1.4.inc.php: - added ftpserver to table panel_settings - new tables ftp_quotalimits and ftp_quotatallies - content for ftp_quotalimits - quota for all users in ftp_users is set in ftp_quotatallies syscp.sql: - added ftpserver to table panel_settings - new tables ftp_quotalimits and ftp_quotatallies - content for ftp_quotalimits english.lng.php & german.lng.php:: - Updated with warning, that you also have to change the quota sql query in ftp server config, when changing ftp prefix. - added ftpserver lng strings for admin_settings.php settings_ftpserver.tpl - template for admin_settings.php - configs for all distros |
|
(0000460) kscholz (reporter) 2010-02-08 12:30 |
The patch you supplied works great! I would appreciate an implemantion in syscp. Only pureftpd gives the user no warning as he reaches his quota. Upload of files continues and when it's finished they're simply gone. ;-) But this is an issue with pureftpd i think. |
|
(0000463) NoPoday (reporter) 2010-02-09 18:03 |
Hä ich hab da nicht geklickt wieso 10€? |
|
(0000464) monotek (reporter) 2010-02-16 13:20 edited on: 2010-02-16 13:21 |
This feature will likely be implemted in next froxlor relaese 0.9.2. Froxlor is a Syscp fork. Visit: www.froxlor.org |
|
(0000470) monotek (reporter) 2010-05-03 20:38 |
Its now implemented in Froxlor 0.9.6 :-) |
|
(0000471) kscholz (reporter) 2010-06-11 22:37 |
Is there any chance this patch gets updatet to syscp 1.4.2.2 or is it still working? |
|
(0000472) monotek (reporter) 2010-06-13 22:49 |
No, not by me. But you could give froxlor a try ;-) |
| No SVN - commits yet |