Skip to content

SpamExperts/directadmin-addon

Repository files navigation

Code Climate Issue Count

DirectAdmin addon

An add-on for DirectAdmin control panel providing integration with SpamExperts services.

Documentation

Documentation can be found here

Using DirectAdmin login keys

To secure the add-on setup it's recommended to use DirectAdmin Login Keys for all communications with DirectAdmin API. In order to use a Login Key the following steps have to be performed.

Login Keys must be enabled

Check your directadmin.conf and make sure that Login Keys are enabled:

login_keys=1

Also make sure that the user that you're going to use for API communications does not have that setting overriden. F.i. in that's the admin, the login_keys value in /usr/local/directadmin/data/users/admin/user.conf should be 1 or On.

If you are making chnages to the configuration file(s) don't forget to reload the directadmin service (e.g. service directadmin restart).

Login Key creation

  1. Log in as the user that you're going to use for the DirectAdmin API communication (it's admin in our case);
  2. Go to http://your.directadmin.host:2222/CMD_LOGIN_KEYS
  3. Create a new Login Key
    1. Pick a meaning Key Name
    2. Use hard-to-guess Key Value
    3. Allow the following commands:
      1. CMD_API_ALL_USER_USAGE
      2. CMD_API_DNS_ADMIN
      3. CMD_API_DNS_MX
      4. CMD_API_SHOW_USER_USAGE
      5. CMD_API_SYSTEM_INFO
    4. Allow your localhost IP address only

Login Key utilization

Once the key is ready use it as the password configuration directive value in the directadminapi.conf file.

Troubleshooting

If you experience issues when using a Login Key it may be useful to turn DirectAdmin into a debug mode and troubleshoot the issue. More info on this can be found here.