Version 1.34.0

Released: 2009-10-02

separate mysql connections per db restore new

https://forum.directadmin.com/threads/30482

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.

process list (SKINS) new

TOP output.

CMD_PROCESS_MONITOR

This will be considered BETA for this DirectAdmin release.

It's only available in the enhanced skin for the time being.

Command used:

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)

There is javascript reload tool that allows the page to be refreshed at specific intervals. Note that any search and sort used will be maintained through this refresh.

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.

SKINS:

admin/process_monitor.html

CMD_API_SYSTEM_INFO new

CMD_API_SYSTEM_INFO

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.

MemFree=

SwapTotal=

SwapFree=

uptime=42 Days, 23 Hours and 43 Minutes

directadmin=1.33.7|Running

proftpd=1.3.2|*** Stopped ***

etc.. for each service

user=username for action=rewrite&value=filter new

user=username for action=rewrite&value=filter

eg:

echo "action=rewrite&value=filter&user=bob" >> /usr/local/directadmin/data/task.queue

pagination for api results new

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:

pagination_ipp=10
pagination_page=1

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:

pagination_pagecount=1

if the pagination_pagecount=1 value is passed, then DA will return:

pagination_pagecount=7

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.


NOTE:

This does not apply to json tables. For json tables, use the same page/sorting that the Advanced Search in the GUI would use.

pipe and email in forwarder new

https://forum.directadmin.com/posts/159972

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:

"|/path/to/program"

You must not have any spaces between the first " and the | characters.

You must not have any spaces between the | and the / first character.

button to delete bayes_* file (SKINS) new

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:

/home/username/.spamassassin

the files:

auto-whitelist

bayes_journal

bayes_seen

bayes_toks

SKINS:

user/email/spamassassin.html

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>

Add /var/tmp to open_basedir new

/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

user_restore_pre.sh new

Similar to the already existing user_restore_post.sh, adding user_restore_pre.sh.

Variables include:

  • username
  • reseller
  • filename

returning a non-zero return value will abort the restore process, and any text is displayed.

simple_disk_usage for tally new

Option to use a simple_disk_usage for tally.

By default this is set to 0 internally.

If you wish to enable it, use:

simple_disk_usage=1

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.

Notes:

  • 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

Admin Backup/Transfer in power_user (SKINS) new

Added Admin Backup/Transfer into the power_user skin.

Restores to use backup_nice=19 new

The default value:

backup_nice=19

used for backups, will now also be used for restores to lower the load of the system during a restore. No changes are required.

output when an IP is blacklisted new

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.

Negation of User selection in backup creation (SKINS) new

The only 2 previous options were:

  • Select All Users

  • Selected 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.

SKINS:

admin/admin_backup.html

reseller/backup.html

add this code just after the "All Users" </tr>

<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>

admin/admin_backup_modify.html

reseller_modify.html

same as the above steps, except include the |WHO_EXCEPT_CHECKED| token inside the who=except radio button.

Ability to specify blacklist times (SKINS) new

2 new options in the directadmin.conf (internally by default, you won't see them)

brute_force_time_limit=120

clear_blacklist_ip_time=0

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)

SKINS

admin/admin_settings.html

<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>

bandwidth breakdown not showing all days fixed

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.

check for non-owner-subdomains on domain rename fixed

Related:

https://forum.directadmin.com/posts/161034

Option to prevent creating subdomain of a different user.

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.

Added --fqdn to the hostname call in nightly hostname check fixed

Added --fqdn to the hostname call in nightly hostname check for non-FreeBSD systems:

/bin/hostname --fqdn

some OS's return just "server" instead of "server.domain.com" with the basic:

/bin/hostname

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.

freebsd 64-bit shows high total ram fixed

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.

segfault in dns read with round robin records fixed

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.

/etc/virtual/domain.com/quota has duplicate entries fixed

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.

autoresponders not being backed up with suspended account fixed

autoresponders were not being backed up with suspended account.

https://forum.directadmin.com/posts/165631

add increased timeout for User deletion fixed

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.

anonymous nobody data in public_ftp wasn\'t being included in quotas fixed

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.

Last Updated: