Version 1.23.2

Released: 2004-12-10

custom script for renaming domain new

pre/post script for /CMD_CHANGE_DOMAIN

  • domain_change_pre.sh

  • domain_change_post.sh

environemental variables:

domain
newdomain
username
bandwidth
cgi
defaultdomain
ip
php
safemode
ssl
suspended

custom script for saving a dns zone new

/usr/local/directadmin/scripts/custom/dns_write_post.sh

environmental variables:

A : list of a records
CNAME : list of cname records
MX : list of mx records
NS : list of ns records
PTR : list of ptr records
SERIAL : the serial used in the zone
EMAIL : authoritative email
NS1 : authoritative ns zone.
DOMAIN : domain name of the zone
SERVER_IP : server IP
A_TIME : ttl for A records
CNAME_TIME : ttl for CNAME records
NS_TIME : ttl for NS records
PTR_TIME : ttl for PTR records

Newer versions DirectAdmin may include (depending on dns_*= settings in directadmin.conf)

TXT, TIME_TIME, AAAA, AAAA_TIME, SRV, SRV_TIME, SPF, SPF_TIME, TLSA, TLSA_TIME, CAA, CAA_TIME, DS, DS_TIME, MX_FULL, MX_TIME.

You should use MX_FULL and not MX, as MX does not include the "left side" value.

See this entry for MX_FULL examples:

Subdomain MX records (SKINS) (API)


A, CNAME, MX, NS and PTR will be url encoded arrays:

eg: A:

A=ftp=192.168.0.2&localhost=127.0.0.1&mail=192.168.0.2&domain.com.=192.168.0.2&webmail=192.168.0.2&www=192.168.0.2

a non zero return value from the script will output and text from stdout to the interface.

In cases where writing the dns is only a part of the whole action (eg: creating a User or new domain), aborting the script with a non-zero could prevent further actions from happening.

Tokenize hook files for plugins new

Can now run php scripts (as the user) and also make use of all tokenizer functions, including If-Then-Else in skins and all templates

tokens that are passed are:

DOCUMENT_ROOT
LANGUAGE
USERNAME
USER
HOME
SSL
SESSION_KEY
SESSION_ID
HTTP_COOKIE
HTTP_HOST
SERVER_NAME
REMOTE_ADDR
SERVER_SOFTWARE
SERVER_ADDR
SERVER_PORT
REQUEST_METHOD());
REDIRECT_STATUS=CGI
QUERY_STRING
REQUEST_URI
POST
SCRIPT_NAME

example:

|$/usr/local/bin/php
<?
echo "Hello, my name is |USERNAME|";
?>
DONE|

Incremental ftp backups new

Instead of creating all the backups then transferring them, this will create each backup, then upload it, then delete it, one at at time. This will save on the disk space used. (User Backups).

If you don't want to use the incremental ftp backups (the old way), then add:

incremental_ftp=0

to your directadmin.conf and restart DA.

Add a confirmation tool to the task.queue for Includes in the httpd.conf new

Since the main httpd.conf file is shared by everyone for the "Include" lines, if 2 people try to access the file at the same time, only one will get the file lock. The other process will wait, but only for so long. If the time lapses, the 2nd process will give up and the Include won't be added.

This tool will add a "confirm include is the httpd.conf" item to the task.queue file to be checked 1 minute after the include has been added. If it can't find it one minute later, then add it again.

Also added a "confirm removal" for the same files.

added token for the users email address from the user.conf new

added token for the users email address from the user.conf

EMAILADDRESS

Change sysbk to create a file for each user. (SKINS) fixed

Change sysbk to create a backup file for each user intead of creating one large home.tar.gz file. This will also prevent /home/backup from being included in the backups, which can generate very large backup files.

A checkbox will be added to the settings to add all users to the custom directories file. When save is pressed, they'll all be added. When save is pressed without the checkbox they'll all be removed. /home will be removed either way when save is pressed.

Users will be added/removed from the custom directories backup as they are added/removed from the system (assuming the checkbox is set for adding).

SKINS:

admin/system_backup.html

set the mountpoint code to be:

on partition |MOUNT_POINT|

DA will add a list box for the partitions.

Also add,

<tr>
<td class=list><input type=checkbox name="ADD_USERS_TO_LIST" value="yes" |ADD_USERS_TO_LIST|>
|LANG_ADD_USERS|</td>
<td class=list>&nbsp;</td>
</tr>

lang/en/admin/system_backup.html is:

LANG_ADD_USERS=Add user home directories to directory list below

setup logrotate script FreeBSD fixed

will be placed in /etc/newsyslogd.conf

add HTML-Parser if it doesn't exist fixed

install HTML-Parser in the spam.sh if it doesnt exist so spamd will start.

Database restore can't read the gz file fixed

When a user restores a db.gz file, it's uploaded to the tmp directory, then the gunzip/mysql programs are run on it. The problem was the uploaded file was owned by "nobody" and there were not sufficient permissions on the file for the user to read the file to restore it. This fix chmods the file to 755 before executing the gunzip/mysql commands.

As a workaround (if you have ssh access), you can save the file to your home directory, cd to your home directory, then run:

gunzip < dbfile.gz | mysql -uusername -ppassword dbname

Warning: ftp_put(): PORT command successful in - on line 31 fixed

Changed the php ftp script to use pasv mode instead.

If you need the fix now, add:

ftp_pasv($conn_id, true);

after the "ftp_login" command in the /usr/local/directadmin/scripts/ftp_upload.php file.

Enable ~username on all IPs fixed

Currently ~username is only enabled on the server IP. This will enable it on all shared IP's (that are not owned by a user).

Ftp accounts gone when another domain is added to owned IP account fixed

All Ftp accounts disappear from /usr/local/directadmin/data/users/username/ftp.passwd when a 2nd domain is added to an owned IP account.

Filemanager downloaded filesize fixed

Related to: https://forum.directadmin.com/posts/35086

Change how the filesize are counted.

Because the filamanger is jailed, access to the byte logs it no longer available so the filesize is coutned before being downloaded. That causes a problem if the whole file isn't downloaded, as the entire size will be counted against the account.

The fix will

  1. open a file descriptor

  2. jail the DA process to the users home dir as usual

  3. send the file

  4. take the actual number of bytes sent and write it to the previously opened file descriptor which should be writing to the correct bytes log outside of the jail.

Last Updated: