Go to file
tracer 86822f4cbb added more exception handling
Signed-off-by: tracer <tracer@24unix.net>
2022-02-20 19:39:54 +01:00
.idea updates .idea-settings 2022-02-05 20:27:31 +01:00
bin added more exception handling 2022-02-20 19:39:54 +01:00
public fixed filestructure 2022-02-20 12:22:58 +01:00
src added error check on domain creation 2022-02-13 16:35:38 +01:00
tests added Logger and config 2022-02-06 17:41:04 +01:00
.gitignore added local copy of swagger-ui 2022-02-05 20:25:26 +01:00
composer.json added name and author 2022-02-12 19:39:47 +01:00
composer.lock upgraded composer requirenments 2022-02-06 19:14:06 +01:00
config.json.sample clenaed dir tree 2022-01-24 13:31:35 +01:00
log.txt changed setup 2022-01-25 20:51:12 +01:00
phpunit.xml added swaggerui 2022-02-05 20:26:32 +01:00
README.md changed order of images 2022-02-20 14:45:58 +01:00

  1. Overview
  2. Features
  3. Installation
  4. Configuration
  5. The API
  6. Conclusion

1. Overview

This package provides an API for the Bind nameserver. It consists of two parts, the API itself and a CLI tool to configure the available functions.

2. Features

2.1. CLI

CLI Interface

The CLI is used to perform configuration and some checks:

  • check
    • Permissions: The API needs to be able to access some files and create new ones
    • Panels: This checks one or all panels if every nameserver is aware of all domains
    • Domain: TODO
  • panels
    • List: List all panels which are configured on this server
    • Create: Adds a new panel to the configuration
    • Update: Changes one or more parameters of the panel
    • Delete: Deletes the given panel
    • ApiPing: Calls the /ping endpoint of the given server or all if no Panel is specified
    • some additional API call might be added
  • nameservers
    • similar to panels, but for the nameservers
  • domains
    • similar usage to panels/domains, manage all slave zones
  • apikeys
    • manage the keys to access this nameserver via API

2.2. API

OpenAPI

The APi is a RESTful API, there is a self explaining Swagger/OpenAPI available.

On the site you can authorize with an API key (creation of the key is described later in this document).

Authorize

Enter Apikey

After successful authorization you can use the APi via the OpenAPI Interface, e.g. call the /ping endpoint to check if the API is alive.

You have to click on „Try it out“:

Try it out

Of course, you can issue the same command in your shell:

curl -X 'GET' \ 'https://ns1.24unix.net/api/ping' \ -H 'accept: application/json' \ -H 'X-API-Key: 61f27a57c9d1f.[truncated]'

A helpful tool when dealing with API is Postman, if offers the same options as from the OpenAPI interface or via shell with curl.

Php Interpreter

3. Installation

You can install the bindAPi on either a standalone server or an existing KeyHelp Panel. However, slave zones are only managed for masters which lie on Keyhelp panels.

3.1. Installation on a KeyHelp panel

In KeyHelp, install PHP 8.1. This is mandatory, the API relies on features only available since PHP 8.0. It might run on PHP 8.0 but has not been tested as there is no reason not to install PHP 8.1.

So head over to: Settings => Configuration => Feature Settings => PHP Interpreter Php Interpreter

Set the checkmark and press Save.

Wait about a minute, the installation is started via a cronjob which runs every minute. Install Php Interpreter

xxx Php Interpreter

Next create a domain, e.g. ns1.24unix.net:

Php Interpreter

Configuration

The API

Conclusion

Php Interpreter

As root (or via sudo):

apt install git

Creat a new user for the domain, adn then a new domain, e.g. ns3.24unix.net.

Set the PHP Version to 8.1: