newseparate mysql connections per db restore
After each call to mysql to restore the sql file, it's possible the internal mysql connect DA uses could have timed out.
The solution is to call mysql_ping to see if the connection is alive.
On some binary compiles this command itself will restore the connection if the binary supports the mysql reconnect option. For the ones that don't, the mysql_ping will return an error, so DA will just drop that connection and start a new one.
newprocess list (SKINS)
This will be considered BETA for this DirectAdmin release.
It's only available in the enhanced skin for the time being.
FreeBSD: /usr/bin/top -b -d 1 Debian/Linux: /usr/bin/top -b -n 1
Output it shown to the Admin.
At the bottom, the root password can be entered to authenticate.
This gives the Admin the ability to send signals to any process (eg, 9 - kill, 1 - HUP, etc)
Also, the screen's scroll position is also maintained.. and a default of 295 is used to line up the beginning of the top output with the top of the browser. This hides the DirectAdmin header/icons, which are not relevant when viewing the top output. The scroll can be changed mid-count, and it will stick upon the next refresh.
Can be called by anyone.
numcpus= int, number of cpus on the box
0=mhz=1662.519&model_name=AMD Sempron(tm) 2400 &vendor_id=AuthenticAMD
(1=mhz..etc.. for multiple CPUs)
MemTotal= number in human readible format with Kb/Mb, etc.
uptime=42 Days, 23 Hours and 43 Minutes
proftpd=1.3.2|*** Stopped ***
etc.. for each service
newuser=username for action=rewrite&value=filter
user=username for action=rewrite&value=filter
echo "action=rewrite&value=filter&user=bob" >> /usr/local/directadmin/data/task.queue
newpagination for api results
Ability to specify the number of items per page site, and page number, allowing DA to only give you the range you want. Just like the tables in DA, but for API output.
For most CMD_API calls with a config type output, simply pass:
where pagination_ipp is the number of items per page
and pagination_page is the page number.
Only use values greater than 0.
If you wish for DA to also output the total number of pages, then also include:
if the pagination_pagecount=1 value is passed, then DA will return:
with the appropriate number of pages the command has available.
It is the responsibility of the code to remove the pagination_pagecount value in the case that you're just looping through all items of data.. as it's not likely relevant to the data itself, hence you must check for it and ignore it.
pagination is not available for list-type output at this time, or some API call with a non-standard output format.
This does not apply to json tables. For json tables, use the same page/sorting that the Advanced Search in the GUI would use.
newpipe and email in forwarder
big code cleanup in the FormCheck function for list of comma separated emails.
Each comma separated entry can be a pipe, email, or the account's username (eg: 'admin')
Previously a pipe could could only exist on it's own.
Remember that a pipe must be in the form:
You must not have any spaces between the first " and the | characters.
You must not have any spaces between the | and the / first character.
newbutton to delete bayes_* file (SKINS)
button to delete bayes files, to allow easy removal when they get too big.
Button to remove them is found at the bottom of the SpamAssassin page.
This button is simply a POST form that uses CMD_FILE_MANAGER, which is already implemented. It will isssue a standard delete command, as if it were the FileManager form. The resulting page will be the results from the FileManager.
If the files in question do not exist, an error saying so will appear. Users can ignore this error if they've hit the button already, or files simply were not there.
Files in question are in:
added to the bottom:
<br> <br> <hr width=50%><br>
This button will remove data learned by spamassassin.
<br>It will free up some space, but will reset any
<br>learned progress SpamAssassin has previously made.
<form name=tableform action='/CMD_FILE_MANAGER/' method='POST'> <input type=hidden name=select0 value="/.spamassassin/auto-whitelist"> <input type=hidden name=select1 value="/.spamassassin/bayes_seen"> <input type=hidden name=select2 value="/.spamassassin/bayes_journal"> <input type=hidden name=select3 value="/.spamassassin/bayes_toks"> <input type=hidden name=action value="multiple"> <input type=hidden name=button value="delete"> <input type=hidden name=overwrite value="no"> <input type=hidden name=path value="/.spamassassin"> <input type=submit value="Delete Bayes Data"> </form>
newAdd /var/tmp to open_basedir
/var/tmp is now included in the open_basedir path.
For any admin's who have /var/tmp as it's own directory (not a symlink) AND who use noexec,nosuid on /tmp, then it would be adviseable to link /var/tmp to /tmp so you gain the benefits of noexec,nosuid. To do this, type:
cd /var rm -rf tmp ln -s /tmp ./tmp
Similar to the already existing user_restore_post.sh, adding user_restore_pre.sh.
returning a non-zero return value will abort the restore process, and any text is displayed.
newsimple_disk_usage for tally
Option to use a simple_disk_usage for tally.
By default this is set to 0 internally.
If you wish to enable it, use:
to your directadmin.conf and the tally will not do manual directory traversing for usage.
This will rely entirely on the repquota command.
Note that this feature is designed for systems where disk usage isn't too important, but lowering the amount of disk access during tha tally is important.
Apache owned files will not be seen or counted.
Email and Domain disk usage breakdown will show 0
MySQL will still be checked and counted as it's done differently.
System Quotas are relied upon completely
newAdmin Backup/Transfer in power_user (SKINS)
Added Admin Backup/Transfer into the power_user skin.
newRestores to use backup_nice=19
The default value:
used for backups, will now also be used for restores to lower the load of the system during a restore. No changes are required.
newoutput when an IP is blacklisted
When an IP becomes blacklisted within DA for too many login attempts, output is now generated telling the client "Your IP is blacklisted" to help with the confusion, as DA used to simply closed the socket and not explain why the connection failed.
newNegation of User selection in backup creation (SKINS)
The only 2 previous options were:
Select All Users
for which Users to backup.
Now, there is anoter option:
- All Users Except Selected Users
which allows Admin and Resellers to create a backup of all accounts, except the ones selected.
The reason this is handy, is because many Admins/Resellers have backup cronjobs to create nightly backups of all of their Users. The issue is that on occation, some accounts do not need, or cannot handle nightly backups. For example static websites, or oversized websites.
This option allows Admins/Resellers to create new User accounts, which will automatically be included in the list of backups, but still allow some other Users to be skipped. Previously, if he wished to skip anyone, for any new User added, he would have to also add that new User to the bacukp list manually. This negates the need for this extra manual step.
add this code just after the "All Users"
<tr> <td class=listtitle align=center> <input type=radio name=who value="except" |WHO_EXCEPT_CHECKED|> </td> <td class=listtitle> - All Users Except Selected Users </td> </tr>
same as the above steps, except include the |WHO_EXCEPT_CHECKED| token inside the who=except radio button.
newAbility to specify blacklist times (SKINS)
2 new options in the directadmin.conf (internally by default, you won't see them)
The brute_force_time_limit is the number of seconds after the last failed login attempt until that count of failed logins is reset to 0. For example, the default of 2 minutes (120 seconds), if there is (lets assume) a brute force count limit of 10, then the User could do 9 failed logins, and after the 9th, wait 120 seconds, then try another 9, without being blacklisted. If the full 10 attempts were made without waiting 120 seconds in between any of the attempts, then they would be blacklisted. Note that the 2 minutes is not from the first failed login, but the time after the last failed login.
The clear_blacklist_ip_time, default 0 zero (which means never), will remove an IP that has been blacklisted after this many minutes (not seconds)
<tr> <td class=list> Time before failed login count resets </td> <td class=list> <input type=text name=brute_force_time_limit value="|BRUTE_FORCE_TIME_LIMIT|" size=4> seconds after the last attempt </td> </tr> <tr> <td class=list> Remove an IP from the blacklist after </td> <td class=list> <input type=text name=clear_blacklist_ip_time value="|CLEAR_BLACKLIST_IP_TIME|" size=4> (minutes) </td> </tr>
fixedbandwidth breakdown not showing all days
The shift of the days by 1 in the last release of DA caused the day counter to not get incrememented, so the breakdown ended up only showing data all on the last tallied day of the month. Solution was to add an "if" for the first day to get the counter incrememented until it was synced up with the previous code context, then it continued fine. This issue bypassed testing because the bandwidth.tally.cache file was not recreated during testing. The issue was one level below that.
fixedcheck for non-owner-subdomains on domain rename
Fix will check to also prevent the renaming of a domain to a sub.domain.com where domain.com belongs to another user. Previously, it only prevented it's creation.
This assumes that the above id=925 feature is turned on.
fixedAdded --fqdn to the hostname call in nightly hostname check
Added --fqdn to the hostname call in nightly hostname check for non-FreeBSD systems:
some OS's return just "server" instead of "server.domain.com" with the basic:
call. This is valid functionality, so we include the --fqdn to get the full output each time.
FreeBSD boxes will still use just /bin/hostname, since they don't support the --fqdn option.
fixedfreebsd 64-bit shows high total ram
The sysctl call on freebsd 64-bit is reportedly showing usage far higher than it should be. Change the internal sysctlbyname call should be swapped with a command line sysctl call for a more reliable result.
fixedsegfault in dns read with round robin records
The quicksort algorithm wasn't designed for duplicate entries, so in certain situations, a negative index reference was called causing a segfault. A simple <0 check was added to ensure that doesn't happen.
fixed/etc/virtual/domain.com/quota has duplicate entries
The quota file will acquire duplicate entires if you restore a backup overtop of an account with existing data. The result of this is that changing the quota for a pop account may no longer have any noticeable effect because DA would be changing the value for one record, but showing the other since there are 2. The cause was an optimization in the loading of the quota file at restore time where-by a sort wasn't done until after the read, but since data could exist in both the main quota file, and the bacukp quota file, this was incorrect. The read was changed to use the newer insertion method read, which places each record in order as it reads, which is both fast, and doesn't end up with duplicates.
fixedautoresponders not being backed up with suspended account
autoresponders were not being backed up with suspended account.
fixedadd increased timeout for User deletion
Added a "timeout x 10" value for deleting Users in DA.
This means that if you have a 60 second timeout set in Admin Settings, when deleting a User, you'll have 600 seconds for each User (10 minutes). The timer resets itself and starts over for each User if you delete multiple Users at once.
fixedanonymous nobody data in public_ftp wasn\'t being included in quotas
Any files being uploaded to the public_ftp folder as the anonymous account are owned by the nobody user. This data was not counted by DA in the tally. Added a few lines of code to include it.