2015-12-13 09:34:12 +00:00
{% extends "base.html" %}
2018-08-18 11:41:59 +00:00
{% set active_page = "new_domain" %}
2018-08-18 15:42:18 +00:00
{% block title %}< title > Add Domain - {{ SITE_NAME }}< / title > {% endblock %}
2015-12-13 09:34:12 +00:00
{% block dashboard_stat %}
2016-06-18 04:41:01 +00:00
<!-- Content Header (Page header) -->
2016-04-22 00:37:33 +00:00
< section class = "content-header" >
< h1 >
Domain
< small > Create new< / small >
< / h1 >
< ol class = "breadcrumb" >
< li > < a href = "{{ url_for('dashboard') }}" > < i class = "fa fa-dashboard" > < / i > Home< / a > < / li >
< li > < a href = "{{ url_for('dashboard') }}" > Domain< / a > < / li >
< li class = "active" > Add Domain< / li >
< / ol >
< / section >
2015-12-13 09:34:12 +00:00
{% endblock %}
{% block content %}
2016-04-24 03:04:03 +00:00
< section class = "content" >
2016-04-22 00:37:33 +00:00
< div class = "row" >
2016-06-18 04:41:01 +00:00
< div class = "col-md-4" >
< div class = "box box-primary" >
< div class = "box-header with-border" >
< h3 class = "box-title" > Create new domain< / h3 >
< / div >
<!-- /.box - header -->
<!-- form start -->
< form role = "form" method = "post" action = "{{ url_for('domain_add') }}" >
2018-11-21 03:24:33 +00:00
< input type = "hidden" name = "_csrf_token" value = "{{ csrf_token() }}" >
2016-06-18 04:41:01 +00:00
< div class = "box-body" >
< div class = "form-group" >
< input type = "text" class = "form-control" name = "domain_name" id = "domain_name" placeholder = "Enter a valid domain name (required)" >
< / div >
Initial support for Accounts
This adds initial support for accounts a concept meant to signify a customer, a department or any other entity that somehow owns or manages one or more domains.
The purpose is to be able to assign an account to any number of domains, making it easy to track who owns or manages a domain, significantly improving manageability in setups with a large number of domains.
An account consists of a mandatory, unique `name` and optional `description`, `contact` name and `mail` address. The account `name` is stripped of spaces and symbols, and lower cased before getting stored in the database and in PowerDNS, to help ensure some type of predictability and uniqueness in the database.
The term *account* is actually taken from the PowerDNS database, where the `domains.account` column is used to store the account relationship, in in the form of the account `name`.
The link to a domain in PowerDNS-Admin is done through the `domain.account_id` FOREIGN KEY, that is linked to the `account.id` PRIMARY KEY.
(cherry picked from commits 4e95f33dfb0676d1c401a033c28bca3be7d6ec26, da0d596bd019a339549e2c59630a8fdee65d0e22, 7f06e6aaf4fd8011c784f24b7bbbba5f52aef319, 1c624dad8749024033d1d15dd6242ca52b39f135)
2018-06-04 15:10:02 +00:00
< select name = "accountid" class = "form-control" style = "width:15em;" >
< option value = "0" > - No Account -< / option >
{% for account in accounts %}
< option value = "{{ account.id }}" > {{ account.name }}< / option >
{% endfor %}
< / select > < br / >
2016-06-18 04:41:01 +00:00
< div class = "form-group" >
< label > Type< / label >
< div class = "radio" >
< label >
< input type = "radio" name = "radio_type" id = "radio_type_native" value = "native" checked > Native
< / label >
< label >
2018-08-18 11:41:59 +00:00
< input type = "radio" name = "radio_type" id = "radio_type_master" value = "master" > Master
2016-06-18 04:41:01 +00:00
< / label >
< label >
< input type = "radio" name = "radio_type" id = "radio_type_slave" value = "slave" > Slave
< / label >
< / div >
< / div >
2018-01-22 15:22:19 +00:00
< div class = "form-group" >
< label > Select a template< / label >
< select class = "form-control" id = "domain_template" name = "domain_template" >
< option value = "0" > No template< / option >
{% for template in templates %}
< option value = "{{ template.id }}" > {{ template.name }}< / option >
{% endfor %}
< / select >
< / div >
2016-06-18 04:41:01 +00:00
< div class = "form-group" style = "display: none;" id = "domain_master_address_div" >
< input type = "text" class = "form-control" name = "domain_master_address" id = "domain_master_address" placeholder = "Enter valid master ip addresses (separated by commas)" >
< / div >
< div class = "form-group" >
< label > SOA-EDIT-API< / label >
< div class = "radio" >
< label >
2018-05-24 18:12:12 +00:00
< input type = "radio" name = "radio_type_soa_edit_api" id = "radio_default" value = "DEFAULT" checked > DEFAULT
2016-06-18 04:41:01 +00:00
< / label >
< / div >
< div class = "radio" >
< label >
2018-05-24 18:12:12 +00:00
< input type = "radio" name = "radio_type_soa_edit_api" id = "radio_increase" value = "INCREASE" > INCREASE
2016-06-18 04:41:01 +00:00
< / label >
< / div >
< div class = "radio" >
< label >
< input type = "radio" name = "radio_type_soa_edit_api" id = "radio_epoch" value = "EPOCH" > EPOCH
< / label >
< / div >
< div class = "radio" >
< label >
2018-05-24 18:12:12 +00:00
< input type = "radio" name = "radio_type_soa_edit_api" id = "radio_off" value = "OFF" > OFF
2016-06-18 04:41:01 +00:00
< / label >
< / div >
< / div >
< / div >
<!-- /.box - body -->
2015-12-13 09:34:12 +00:00
2016-06-18 04:41:01 +00:00
< div class = "box-footer" >
< button type = "submit" class = "btn btn-flat btn-primary" > Submit< / button >
2018-03-30 09:40:53 +00:00
< button type = "button" class = "btn btn-flat btn-default" onclick = "window.location.href='{{ url_for('dashboard') }}'" > Cancel< / button >
2016-06-18 04:41:01 +00:00
< / div >
< / form >
< / div >
<!-- /.box -->
< / div >
< div class = "col-md-8" >
< div class = "box box-primary" >
< div class = "box-header with-border" >
< h3 class = "box-title" > Help with creating a new domain< / h3 >
< / div >
< div class = "box-body" >
< dl class = "dl-horizontal" >
< dt > Domain name< / dt >
< dd > Enter your domain name in the format of name.tld (eg. powerdns-admin.com). You can also enter sub-domains to create a sub-root zone (eg. sub.powerdns-admin.com) in case you want to delegate sub-domain management to specific users.< / dd >
< dt > Type< / dt >
< dd > The type decides how the domain will be replicated across multiple DNS servers.
< ul >
< li >
Native - PowerDNS will not perform any replication. Use this if you only have one PowerDNS server or you handle replication via your backend (MySQL).
< / li >
< li >
Master - This PowerDNS server will serve as the master and will send zone transfers (AXFRs) to other servers configured as slaves.
< / li >
< li >
Slave - This PowerDNS server will serve as the slave and will request and receive zone transfers (AXFRs) from other servers configured as masters.
< / li >
< / ul >
< / dd >
< dt > SOA-EDIT-API< / dt >
2018-05-24 18:12:12 +00:00
< dd > The SOA-EDIT-API setting defines how the SOA serial number will be updated after a change is made to the domain.
2016-06-18 04:41:01 +00:00
< ul >
2018-05-24 18:12:12 +00:00
< li >
DEFAULT - Generate a soa serial of YYYYMMDD01. If the current serial is lower than the generated serial, use the generated serial. If the current serial is higher or equal to the generated serial, increase the current serial by 1.
2016-06-18 04:41:01 +00:00
< / li >
< li >
2018-05-24 18:12:12 +00:00
INCREASE - Increase the current serial by 1.
2016-06-18 04:41:01 +00:00
< / li >
< li >
2018-05-24 18:12:12 +00:00
EPOCH - Change the serial to the number of seconds since the EPOCH, aka unixtime.
2016-06-18 04:41:01 +00:00
< / li >
< li >
2018-05-24 18:12:12 +00:00
OFF - Disable automatic updates of the SOA serial.
2016-06-18 04:41:01 +00:00
< / li >
< / ul >
< / dd >
< / dl >
< p > Find more details at < a href = "https://docs.powerdns.com/md/" > https://docs.powerdns.com/md/< / a > < / p >
< / div >
< / div >
< / div >
2016-04-22 00:37:33 +00:00
< / div >
2016-04-24 03:04:03 +00:00
< / section >
2016-04-26 00:07:02 +00:00
{% endblock %}
{% block extrascripts %}
< script >
2016-06-18 04:41:01 +00:00
$("input[name=radio_type]").change(function() {
var type = $(this).val();
if (type == "slave") {
$("#domain_master_address_div").show();
} else {
$("#domain_master_address_div").hide();
}
});
2016-04-26 00:07:02 +00:00
< / script >
2018-05-24 18:12:12 +00:00
{% endblock %}