maatma: interface for domain delegation (mostly)
This commit is contained in:
parent
5f83c5cd2c
commit
7ebbf79bda
5 changed files with 407 additions and 24 deletions
|
@ -1,6 +1,7 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
@ -12,6 +13,11 @@ import (
|
||||||
"github.com/julienschmidt/httprouter"
|
"github.com/julienschmidt/httprouter"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
AssociatedDomainSuffix = "adlin2020.p0m.fr"
|
||||||
|
DelegatedDomainSuffix = "srs.p0m.fr"
|
||||||
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
router.GET("/api/adomains/", apiAuthHandler(func (student Student, ps httprouter.Params, body []byte) (interface{}, error) {
|
router.GET("/api/adomains/", apiAuthHandler(func (student Student, ps httprouter.Params, body []byte) (interface{}, error) {
|
||||||
return student.GetAssociatedDomains(), nil
|
return student.GetAssociatedDomains(), nil
|
||||||
|
@ -24,10 +30,56 @@ func init() {
|
||||||
}))
|
}))
|
||||||
|
|
||||||
router.GET("/api/ddomains/", apiAuthHandler(func (student Student, ps httprouter.Params, body []byte) (interface{}, error) {
|
router.GET("/api/ddomains/", apiAuthHandler(func (student Student, ps httprouter.Params, body []byte) (interface{}, error) {
|
||||||
return student.GetDelegatedDomains()
|
return []string{student.MyDelegatedDomain()}, nil
|
||||||
}))
|
}))
|
||||||
router.GET("/api/ddomains/:dn", apiAuthHandler(func (student Student, ps httprouter.Params, body []byte) (interface{}, error) {
|
router.GET("/api/ddomains/:dn/", apiAuthHandler(func (student Student, ps httprouter.Params, body []byte) (interface{}, error) {
|
||||||
return student.GetDelegatedDomain(ps.ByName("dn"))
|
return student.getRRDelegatedDomain(ps.ByName("dn"), "")
|
||||||
|
}))
|
||||||
|
router.GET("/api/ddomains/:dn/NS", apiAuthHandler(func (student Student, ps httprouter.Params, body []byte) (interface{}, error) {
|
||||||
|
return student.getRRDelegatedDomain(ps.ByName("dn"), "NS")
|
||||||
|
}))
|
||||||
|
router.POST("/api/ddomains/:dn/NS", apiAuthHandler(func (student Student, ps httprouter.Params, body []byte) (interface{}, error) {
|
||||||
|
var ue Entry
|
||||||
|
if err := json.Unmarshal(body, &ue); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return true, student.UpdateNSDelegatedDomain(ps.ByName("dn"), ue.TTL, ue.Values[0])
|
||||||
|
}))
|
||||||
|
router.DELETE("/api/ddomains/:dn/NS", apiAuthHandler(func (student Student, ps httprouter.Params, body []byte) (interface{}, error) {
|
||||||
|
return true, student.DeleteRRDelegatedDomain(ps.ByName("dn"), "NS")
|
||||||
|
}))
|
||||||
|
router.GET("/api/ddomains/:dn/GLUE", apiAuthHandler(func (student Student, ps httprouter.Params, body []byte) (interface{}, error) {
|
||||||
|
return student.getRRDelegatedDomain(ps.ByName("dn"), "AAAA")
|
||||||
|
}))
|
||||||
|
router.POST("/api/ddomains/:dn/AAAA", apiAuthHandler(func (student Student, ps httprouter.Params, body []byte) (interface{}, error) {
|
||||||
|
var ue Entry
|
||||||
|
if err := json.Unmarshal(body, &ue); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return true, student.UpdateGLUEDelegatedDomain(ps.ByName("dn"), ue.TTL, ue.Values[0])
|
||||||
|
}))
|
||||||
|
router.POST("/api/ddomains/:dn/GLUE", apiAuthHandler(func (student Student, ps httprouter.Params, body []byte) (interface{}, error) {
|
||||||
|
var ue Entry
|
||||||
|
if err := json.Unmarshal(body, &ue); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return true, student.UpdateGLUEDelegatedDomain(ps.ByName("dn"), ue.TTL, ue.Values[0])
|
||||||
|
}))
|
||||||
|
router.DELETE("/api/ddomains/:dn/AAAA", apiAuthHandler(func (student Student, ps httprouter.Params, body []byte) (interface{}, error) {
|
||||||
|
return true, student.DeleteRRDelegatedDomain(ps.ByName("dn"), "AAAA")
|
||||||
|
}))
|
||||||
|
router.GET("/api/ddomains/:dn/DS", apiAuthHandler(func (student Student, ps httprouter.Params, body []byte) (interface{}, error) {
|
||||||
|
return student.getRRDelegatedDomain(ps.ByName("dn"), "DS")
|
||||||
|
}))
|
||||||
|
router.POST("/api/ddomains/:dn/DS", apiAuthHandler(func (student Student, ps httprouter.Params, body []byte) (interface{}, error) {
|
||||||
|
var ue Entry
|
||||||
|
if err := json.Unmarshal(body, &ue); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return true, student.UpdateDSDelegatedDomain(ps.ByName("dn"), ue.TTL, ue.Values)
|
||||||
|
}))
|
||||||
|
router.DELETE("/api/ddomains/:dn/DS", apiAuthHandler(func (student Student, ps httprouter.Params, body []byte) (interface{}, error) {
|
||||||
|
return true, student.DeleteRRDelegatedDomain(ps.ByName("dn"), "DS")
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,13 +121,13 @@ func parseKnotZoneRead(args ...string) (rr []Entry, err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (student Student) myAssociatedDomain() (string) {
|
func (student Student) myAssociatedDomain() (string) {
|
||||||
return fmt.Sprintf("%s.adlin2020.p0m.fr.", student.Login)
|
return fmt.Sprintf("%s.%s.", student.Login, AssociatedDomainSuffix)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (student Student) GetAssociatedDomains() (ds []string) {
|
func (student Student) GetAssociatedDomains() (ds []string) {
|
||||||
studentDomain := student.myAssociatedDomain()
|
studentDomain := student.myAssociatedDomain()
|
||||||
|
|
||||||
if _, err := parseKnotZoneRead("adlin2020.p0m.fr", studentDomain); err == nil {
|
if _, err := parseKnotZoneRead(AssociatedDomainSuffix, studentDomain); err == nil {
|
||||||
ds = append(ds, studentDomain)
|
ds = append(ds, studentDomain)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,7 +147,7 @@ func (student Student) GetAssociatedDomain(dn string) (rrs []Entry, err error) {
|
||||||
err = errors.New(fmt.Sprintf("Unable to find domain %q.", dn))
|
err = errors.New(fmt.Sprintf("Unable to find domain %q.", dn))
|
||||||
}
|
}
|
||||||
|
|
||||||
rrs, err = parseKnotZoneRead("adlin2020.p0m.fr", dn)
|
rrs, err = parseKnotZoneRead(AssociatedDomainSuffix, dn)
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -103,16 +155,17 @@ func (student Student) GetAssociatedDomain(dn string) (rrs []Entry, err error) {
|
||||||
func (student Student) AddAssociatedDomains() (err error) {
|
func (student Student) AddAssociatedDomains() (err error) {
|
||||||
for _, d := range []string{student.myAssociatedDomain()} {
|
for _, d := range []string{student.myAssociatedDomain()} {
|
||||||
for _, cmd := range [][]string{
|
for _, cmd := range [][]string{
|
||||||
[]string{"zone-begin", "adlin2020.p0m.fr"},
|
[]string{"zone-begin", AssociatedDomainSuffix},
|
||||||
[]string{"zone-set", "adlin2020.p0m.fr", d, "900", "A", "82.64.31.248"},
|
[]string{"zone-set", AssociatedDomainSuffix, d, "900", "A", "82.64.31.248"},
|
||||||
[]string{"zone-set", "adlin2020.p0m.fr", d, "900", "AAAA", studentIP(student.Id) + "1"},
|
[]string{"zone-set", AssociatedDomainSuffix, d, "900", "AAAA", studentIP(student.Id) + "1"},
|
||||||
[]string{"zone-commit", "adlin2020.p0m.fr"},
|
[]string{"zone-commit", AssociatedDomainSuffix},
|
||||||
} {
|
} {
|
||||||
var out []byte
|
var out []byte
|
||||||
out, err = runKnotc(cmd...)
|
out, err = runKnotc(cmd...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err = errors.New(fmt.Sprintf("An error occurs on command '%s': %s", strings.Join(cmd, " "), err.Error()))
|
err = errors.New(fmt.Sprintf("An error occurs on command '%s': %s", strings.Join(cmd, " "), err.Error()))
|
||||||
log.Println(string(out))
|
log.Println(string(out))
|
||||||
|
runKnotc("zone-abort", AssociatedDomainSuffix)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -122,14 +175,137 @@ func (student Student) AddAssociatedDomains() (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
type DelegatedDomain struct {
|
func (student Student) MyDelegatedDomain() (string) {
|
||||||
|
return fmt.Sprintf("%s.%s.", student.Login, DelegatedDomainSuffix)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (student Student) GetDelegatedDomain(dn string) (d DelegatedDomain, err error) {
|
func (student Student) getRRDelegatedDomain(dn string, rr string) (rrs []Entry, err error) {
|
||||||
|
domains := []string{student.MyDelegatedDomain()}
|
||||||
|
found := false
|
||||||
|
for _, d := range domains {
|
||||||
|
if d == dn {
|
||||||
|
found = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if !found {
|
||||||
|
err = errors.New(fmt.Sprintf("Unable to find domain %q.", dn))
|
||||||
|
}
|
||||||
|
|
||||||
|
rrs, err = parseKnotZoneRead(DelegatedDomainSuffix, dn, rr)
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (student Student) GetDelegatedDomains() (ds []DelegatedDomain, err error) {
|
func (student Student) UpdateNSDelegatedDomain(dn string, ttl uint64, ns string) (err error) {
|
||||||
|
for _, d := range []string{student.MyDelegatedDomain()} {
|
||||||
|
for _, cmd := range [][]string{
|
||||||
|
[]string{"zone-begin", DelegatedDomainSuffix},
|
||||||
|
[]string{"zone-unset", DelegatedDomainSuffix, d, "NS"},
|
||||||
|
[]string{"zone-set", DelegatedDomainSuffix, d, fmt.Sprintf("%d", ttl), "NS", ns},
|
||||||
|
[]string{"zone-commit", DelegatedDomainSuffix},
|
||||||
|
} {
|
||||||
|
var out []byte
|
||||||
|
out, err = runKnotc(cmd...)
|
||||||
|
if err != nil && cmd[0] != "zone-unset" {
|
||||||
|
err = errors.New(fmt.Sprintf("An error occurs on command '%s': %s", strings.Join(cmd, " "), err.Error()))
|
||||||
|
log.Println(string(out))
|
||||||
|
runKnotc("zone-abort", DelegatedDomainSuffix)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
func (student Student) UpdateGLUEDelegatedDomain(dn string, ttl uint64, aaaa string) (err error) {
|
||||||
|
domains := []string{student.MyDelegatedDomain()}
|
||||||
|
found := false
|
||||||
|
for _, d := range domains {
|
||||||
|
if strings.HasSuffix(dn, d) {
|
||||||
|
found = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if !found {
|
||||||
|
err = errors.New(fmt.Sprintf("Unable to find domain %q in your whitelist.", dn))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, cmd := range [][]string{
|
||||||
|
[]string{"zone-begin", DelegatedDomainSuffix},
|
||||||
|
[]string{"zone-unset", DelegatedDomainSuffix, student.MyDelegatedDomain(), "AAAA"},
|
||||||
|
[]string{"zone-unset", DelegatedDomainSuffix, dn, "AAAA"},
|
||||||
|
[]string{"zone-set", DelegatedDomainSuffix, dn, fmt.Sprintf("%d", ttl), "AAAA", aaaa},
|
||||||
|
[]string{"zone-commit", DelegatedDomainSuffix},
|
||||||
|
} {
|
||||||
|
var out []byte
|
||||||
|
out, err = runKnotc(cmd...)
|
||||||
|
if err != nil && cmd[0] != "zone-unset" {
|
||||||
|
err = errors.New(fmt.Sprintf("An error occurs on command '%s': %s", strings.Join(cmd, " "), err.Error()))
|
||||||
|
log.Println(string(out))
|
||||||
|
runKnotc("zone-abort", DelegatedDomainSuffix)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
func (student Student) UpdateDSDelegatedDomain(dn string, ttl uint64, ds []string) (err error) {
|
||||||
|
for _, d := range []string{student.MyDelegatedDomain()} {
|
||||||
|
for _, cmd := range [][]string{
|
||||||
|
[]string{"zone-begin", DelegatedDomainSuffix},
|
||||||
|
[]string{"zone-unset", DelegatedDomainSuffix, d, "DS"},
|
||||||
|
[]string{"zone-set", DelegatedDomainSuffix, d, fmt.Sprintf("%d", ttl), "DS", strings.Join(ds, " ")},
|
||||||
|
[]string{"zone-commit", DelegatedDomainSuffix},
|
||||||
|
} {
|
||||||
|
var out []byte
|
||||||
|
out, err = runKnotc(cmd...)
|
||||||
|
if err != nil && cmd[0] != "zone-unset" {
|
||||||
|
err = errors.New(fmt.Sprintf("An error occurs on command '%s': %s", strings.Join(cmd, " "), err.Error()))
|
||||||
|
log.Println(string(out))
|
||||||
|
runKnotc("zone-abort", DelegatedDomainSuffix)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
func (student Student) DeleteRRDelegatedDomain(dn string, rr string) (err error) {
|
||||||
|
domains := []string{student.MyDelegatedDomain()}
|
||||||
|
found := false
|
||||||
|
for _, d := range domains {
|
||||||
|
if strings.HasSuffix(dn, d) {
|
||||||
|
found = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if !found {
|
||||||
|
err = errors.New(fmt.Sprintf("Unable to find domain %q in your whitelist.", dn))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, cmd := range [][]string{
|
||||||
|
[]string{"zone-begin", DelegatedDomainSuffix},
|
||||||
|
[]string{"zone-unset", DelegatedDomainSuffix, dn, rr},
|
||||||
|
[]string{"zone-commit", DelegatedDomainSuffix},
|
||||||
|
} {
|
||||||
|
var out []byte
|
||||||
|
out, err = runKnotc(cmd...)
|
||||||
|
if err != nil {
|
||||||
|
err = errors.New(fmt.Sprintf("An error occurs on command '%s': %s", strings.Join(cmd, " "), err.Error()))
|
||||||
|
log.Println(string(out))
|
||||||
|
runKnotc("zone-abort", DelegatedDomainSuffix)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,7 +154,7 @@ angular.module("AdLinApp")
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
.controller("DomainsController", function($scope, $http, $interval) {
|
.controller("DomainsController", function($scope, $http, $interval, $location) {
|
||||||
$scope.updateAssociationD = function() {
|
$scope.updateAssociationD = function() {
|
||||||
$http({
|
$http({
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
|
@ -182,9 +182,25 @@ angular.module("AdLinApp")
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.updateAssociationD();
|
$scope.updateAssociationD();
|
||||||
|
|
||||||
|
$scope.updateDelegatedD = function() {
|
||||||
|
$http({
|
||||||
|
method: 'GET',
|
||||||
|
url: "/api/ddomains/",
|
||||||
|
headers: {
|
||||||
|
'Authorization': "Bearer " + sessionStorage.token
|
||||||
|
},
|
||||||
|
}).then(function(response) {
|
||||||
|
response.data.forEach(function(domain) {
|
||||||
|
$scope.ddomains = response.data;
|
||||||
|
}, function(response) {
|
||||||
|
alert(response.data.errmsg);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
$scope.updateDelegatedD();
|
||||||
|
|
||||||
$scope.newAssociationD = function() {
|
$scope.newAssociationD = function() {
|
||||||
$scope.pleaseWaitNewAssociation = true;
|
$scope.pleaseWaitNewAssociation = true;
|
||||||
$http({
|
$http({
|
||||||
|
@ -202,4 +218,104 @@ angular.module("AdLinApp")
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$scope.updateNS = function(domain) {
|
||||||
|
$scope.nsrr = {
|
||||||
|
"domain": domain,
|
||||||
|
"ttl": 900,
|
||||||
|
"rr": "NS",
|
||||||
|
"value": "",
|
||||||
|
}
|
||||||
|
$('#NSModal').modal('show');
|
||||||
|
}
|
||||||
|
$scope.updateGLUE = function(domain) {
|
||||||
|
$scope.nsrr = {
|
||||||
|
"domain": domain,
|
||||||
|
"ttl": 900,
|
||||||
|
"rr": "AAAA",
|
||||||
|
"value": "",
|
||||||
|
}
|
||||||
|
$('#NSModal').modal('show');
|
||||||
|
}
|
||||||
|
$scope.updateDS = function(domain) {
|
||||||
|
$scope.nsrr = {
|
||||||
|
"domain": domain,
|
||||||
|
"ttl": 900,
|
||||||
|
"rr": "DS",
|
||||||
|
"labels": ["Key Tag", "Flag", "Algorithme", "Clef publique (base64)"],
|
||||||
|
"values": ["", "", "", ""],
|
||||||
|
}
|
||||||
|
$('#NSModal').modal('show');
|
||||||
|
}
|
||||||
|
|
||||||
|
$scope.saveNSRR = function(nsrr) {
|
||||||
|
if (nsrr.values === undefined)
|
||||||
|
nsrr.values = [nsrr.value];
|
||||||
|
|
||||||
|
$http({
|
||||||
|
method: 'POST',
|
||||||
|
url: "/api/ddomains/" + nsrr.domain + "/" + nsrr.rr,
|
||||||
|
headers: {
|
||||||
|
'Authorization': "Bearer " + sessionStorage.token
|
||||||
|
},
|
||||||
|
data: nsrr,
|
||||||
|
}).then(function(response) {
|
||||||
|
$('#NSModal').modal('hide');
|
||||||
|
$location.url("./domains");
|
||||||
|
}, function(response) {
|
||||||
|
alert(response.data.errmsg);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
$scope.delNSRR = function(nsrr) {
|
||||||
|
$http({
|
||||||
|
method: 'DELETE',
|
||||||
|
url: "/api/ddomains/" + nsrr.domain + "/" + nsrr.rr,
|
||||||
|
headers: {
|
||||||
|
'Authorization': "Bearer " + sessionStorage.token
|
||||||
|
},
|
||||||
|
}).then(function(response) {
|
||||||
|
$('#NSModal').modal('hide');
|
||||||
|
$location.url("./domains");
|
||||||
|
}, function(response) {
|
||||||
|
alert(response.data.errmsg);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
.controller("NSDomainsController", function($scope, $http) {
|
||||||
|
$http({
|
||||||
|
method: 'GET',
|
||||||
|
url: "/api/ddomains/" + $scope.domain + "/NS",
|
||||||
|
headers: {
|
||||||
|
'Authorization': "Bearer " + sessionStorage.token
|
||||||
|
},
|
||||||
|
}).then(function(response) {
|
||||||
|
$scope.domainNS = response.data;
|
||||||
|
});
|
||||||
|
})
|
||||||
|
|
||||||
|
.controller("GLUEDomainsController", function($scope, $http) {
|
||||||
|
$http({
|
||||||
|
method: 'GET',
|
||||||
|
url: "/api/ddomains/" + $scope.domain + "/GLUE",
|
||||||
|
headers: {
|
||||||
|
'Authorization': "Bearer " + sessionStorage.token
|
||||||
|
},
|
||||||
|
}).then(function(response) {
|
||||||
|
$scope.domainGLUE = response.data;
|
||||||
|
});
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
.controller("DSDomainsController", function($scope, $http) {
|
||||||
|
$http({
|
||||||
|
method: 'GET',
|
||||||
|
url: "/api/ddomains/" + $scope.domain + "/DS",
|
||||||
|
headers: {
|
||||||
|
'Authorization': "Bearer " + sessionStorage.token
|
||||||
|
},
|
||||||
|
}).then(function(response) {
|
||||||
|
$scope.domainDS = response.data;
|
||||||
|
});
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
2
token-validator/htdocs/js/jquery-3.3.1.slim.min.js
vendored
Normal file
2
token-validator/htdocs/js/jquery-3.3.1.slim.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -35,6 +35,8 @@
|
||||||
|
|
||||||
<div class="container mt-1" ng-view></div>
|
<div class="container mt-1" ng-view></div>
|
||||||
|
|
||||||
|
<script src="js/jquery-3.3.1.slim.min.js"></script>
|
||||||
|
<script src="js/bootstrap.min.js"></script>
|
||||||
<script src="js/angular.min.js"></script>
|
<script src="js/angular.min.js"></script>
|
||||||
<script src="js/i18n/angular-locale_fr-fr.js"></script>
|
<script src="js/i18n/angular-locale_fr-fr.js"></script>
|
||||||
<script src="js/angular-resource.min.js"></script>
|
<script src="js/angular-resource.min.js"></script>
|
||||||
|
|
|
@ -47,20 +47,52 @@
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody style="font-family: monospace">
|
<tbody style="font-family: monospace">
|
||||||
<tr>
|
<tr ng-repeat="domain in ddomains">
|
||||||
<td>{{ isLogged.login }}.srs2020.p0m.fr</td>
|
<td>{{ domain }}</td>
|
||||||
<td>ns.{{ isLogged.login }}.srs2020.p0m.fr</td>
|
<td ng-controller="NSDomainsController">
|
||||||
<td>2a01:e0a:2b:2252:{{ isLogged.id.toString(16) }}::1</td>
|
<span ng-if="!domainNS" class="badge badge-pill badge-danger">Non défini</span>
|
||||||
<td>
|
<div ng-repeat="rr in domainNS">
|
||||||
<span class="badge badge-pill badge-success" ng-show="false">Activé</span>
|
{{ rr.domain }}
|
||||||
<span class="badge badge-pill badge-danger">Non configuré</span>
|
{{ rr.ttl }}
|
||||||
|
{{ rr.rr }}
|
||||||
|
<span ng-repeat="val in rr.values">{{ val }} </span>
|
||||||
|
</div>
|
||||||
|
<button class="btn btn-primary" ng-click="updateNS(domain)">
|
||||||
|
Mettre à jour
|
||||||
|
</button>
|
||||||
|
</td>
|
||||||
|
<td ng-controller="GLUEDomainsController">
|
||||||
|
<span ng-if="!domainGLUE" class="badge badge-pill badge-danger">Non défini</span>
|
||||||
|
<div ng-repeat="rr in domainGLUE">
|
||||||
|
{{ rr.domain }}
|
||||||
|
{{ rr.ttl }}
|
||||||
|
{{ rr.rr }}
|
||||||
|
<span ng-repeat="val in rr.values">{{ val }} </span>
|
||||||
|
</div>
|
||||||
|
<br>
|
||||||
|
<button class="btn btn-primary" ng-click="updateGLUE(domain)">
|
||||||
|
Mettre à jour
|
||||||
|
</button>
|
||||||
|
</td>
|
||||||
|
<td ng-controller="DSDomainsController">
|
||||||
|
<span class="badge badge-pill badge-danger" ng-show="!domainDS">Non configuré</span>
|
||||||
|
<div ng-repeat="rr in domainDS">
|
||||||
|
{{ rr.domain }}
|
||||||
|
{{ rr.ttl }}
|
||||||
|
{{ rr.rr }}
|
||||||
|
<span ng-repeat="val in rr.values">{{ val }} </span>
|
||||||
|
</div>
|
||||||
|
<br>
|
||||||
|
<button class="btn btn-primary" ng-click="updateDS(domain)">
|
||||||
|
Mettre à jour
|
||||||
|
</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
<tfoot>
|
<tfoot>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="4">
|
<td colspan="4">
|
||||||
<button class="btn btn-primary" ng-click="newDelegation()">
|
<button class="btn btn-primary" ng-click="newDelegation()" disabled>
|
||||||
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true" ng-show="pleaseWaitNewDelegation"></span>
|
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true" ng-show="pleaseWaitNewDelegation"></span>
|
||||||
Demander un nouveau nom de domaine
|
Demander un nouveau nom de domaine
|
||||||
</button>
|
</button>
|
||||||
|
@ -68,3 +100,58 @@
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
<div class="modal" id="NSModal" tabindex="-1" role="dialog">
|
||||||
|
<div class="modal-dialog" role="document">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title" ng-if="nsrr.rr == 'NS'">Modifier la liste des serveurs de noms de la zone</h5>
|
||||||
|
<h5 class="modal-title" ng-if="nsrr.rr == 'AAAA'">Modifier les enregistrements GLUE du domaine</h5>
|
||||||
|
<h5 class="modal-title" ng-if="nsrr.rr == 'DS'">Modifier les clefs DNSSEC de la zone parente</h5>
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<form class="ml-2 mr-2">
|
||||||
|
<div class="form-group row">
|
||||||
|
<label class="col-sm-2 col-form-label">Domaine</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<input class="form-control-plaintext" ng-model="nsrr.domain" ng-if="nsrr.rr == 'NS' || nsrr.rr == 'DS'" readonly>
|
||||||
|
<input class="form-control" ng-model="nsrr.domain" ng-if="nsrr.rr == 'AAAA'">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group row">
|
||||||
|
<label for="ttl" class="col-sm-2 col-form-label">TTL</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<input class="form-control" id="ttl" ng-model="nsrr.ttl">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group row">
|
||||||
|
<label class="col-sm-2 col-form-label">Type</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<input class="form-control-plaintext" ng-model="nsrr.rr" readonly>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group row" ng-if="nsrr.value !== undefined">
|
||||||
|
<label for="value" class="col-sm-2 col-form-label">Valeur</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<input class="form-control" id="value" ng-model="nsrr.value" autofocus>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group row" ng-repeat="v in nsrr.values track by $index">
|
||||||
|
<label for="value{{$index}}" class="col-sm-2 col-form-label">{{ nsrr.labels[$index] }}</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<input class="form-control" id="value{{$index}}" ng-model="nsrr.values[$index]">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Annuler</button>
|
||||||
|
<button type="button" class="btn btn-primary" ng-click="saveNSRR(nsrr)">Enregistrer</button>
|
||||||
|
<button type="button" class="btn btn-danger" ng-click="delNSRR(nsrr)">Supprimer</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
Reference in a new issue