From 95c51be923ac33419d404a248340f62530040e76 Mon Sep 17 00:00:00 2001 From: Charlie Jacomme Date: Mon, 25 Jun 2018 17:15:48 +0200 Subject: [PATCH] Ajout dnssec reverse bool for iptypes --- machines/forms.py | 4 +- machines/models.py | 8 + machines/templates/machines/#machine.html# | 178 ++++++++++++++++++++ machines/templates/machines/aff_iptype.html | 2 + 4 files changed, 191 insertions(+), 1 deletion(-) create mode 100644 machines/templates/machines/#machine.html# diff --git a/machines/forms.py b/machines/forms.py index 38928e9c..eda62c7c 100644 --- a/machines/forms.py +++ b/machines/forms.py @@ -218,7 +218,8 @@ class IpTypeForm(FormRevMixin, ModelForm): class Meta: model = IpType fields = ['type', 'extension', 'need_infra', 'domaine_ip_start', - 'domaine_ip_stop', 'prefix_v6', 'vlan', 'ouverture_ports'] + 'domaine_ip_stop', 'dnssec_reverse_v4', 'prefix_v6', + 'dnssec_reverse_v6', 'vlan', 'ouverture_ports'] def __init__(self, *args, **kwargs): prefix = kwargs.pop('prefix', self.Meta.model.__name__) @@ -231,6 +232,7 @@ class EditIpTypeForm(IpTypeForm): synchroniser les objets iplist""" class Meta(IpTypeForm.Meta): fields = ['extension', 'type', 'need_infra', 'prefix_v6', 'vlan', + 'dnssec_reverse_v4', 'dnssec_reverse_v6', 'ouverture_ports'] diff --git a/machines/models.py b/machines/models.py index 7ee58bc9..a0a84a8e 100644 --- a/machines/models.py +++ b/machines/models.py @@ -328,11 +328,19 @@ class IpType(RevMixin, AclMixin, models.Model): need_infra = models.BooleanField(default=False) domaine_ip_start = models.GenericIPAddressField(protocol='IPv4') domaine_ip_stop = models.GenericIPAddressField(protocol='IPv4') + dnssec_reverse_v4 = models.BooleanField( + default=False, + help_text="Activer DNSSEC sur le reverse DNS IPv4", + ) prefix_v6 = models.GenericIPAddressField( protocol='IPv6', null=True, blank=True ) + dnssec_reverse_v6 = models.BooleanField( + default=False, + help_text="Activer DNSSEC sur le reverse DNS IPv6", + ) vlan = models.ForeignKey( 'Vlan', on_delete=models.PROTECT, diff --git a/machines/templates/machines/#machine.html# b/machines/templates/machines/#machine.html# new file mode 100644 index 00000000..f481b148 --- /dev/null +++ b/machines/templates/machines/#machine.html# @@ -0,0 +1,178 @@ +{% extends "machines/sidebar.html" %} +{% comment %} +Re2o est un logiciel d'administration développé initiallement au rezometz. Il +se veut agnostique au réseau considéré, de manière à être installable en +quelques clics. + +Copyright © 2017 Gabriel Détraz +Copyright © 2017 Goulven Kermarec +Copyright © 2017 Augustin Lemesle +Copyright © 2017 Maël Kervella + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +{% endcomment %} + +{% load bootstrap3 %} +{% load massive_bootstrap_form %} + +{% block title %}Création et modification de machines{% endblock %} + +{% block content %} +{% if machineform %} + {% bootstrap_form_errors machineform %} +{% endif %} +{% if interfaceform %} + {% bootstrap_form_errors interfaceform %} +{% endif %} +{% if domainform %} + {% bootstrap_form_errors domainform %} +{% endif %} +{% if iptypeform %} + {% bootstrap_form_errors iptypeform %} +{% endif %} +{% if machinetypeform %} + {% bootstrap_form_errors machinetypeform %} +{% endif %} +{% if extensionform %} + {% bootstrap_form_errors extensionform %} +{% endif %} +{% if mxform %} + {% bootstrap_form_errors mxform %} +{% endif %} +{% if nsform %} + {% bootstrap_form_errors nsform %} +{% endif %} +{% if txtform %} + {% bootstrap_form_errors txtform %} +{% endif %} +{% if srvform %} + {% bootstrap_form_errors srvform %} +{% endif %} +{% if aliasform %} + {% bootstrap_form_errors aliasform %} +{% endif %} +{% if serviceform %} + {% bootstrap_form_errors serviceform %} +{% endif %} +{% if roleform %} + {% bootstrap_form_errors roleform %} +{% endif %} +{% if vlanform %} + {% bootstrap_form_errors vlanform %} +{% endif %} +{% if nasform %} + {% bootstrap_form_errors nasform %} +{% endif %} +{% if ipv6form %} + {% bootstrap_form_errors ipv6form %} +{% endif %} +{% if sshfingerprintform %} + {% bootstrap_form_errors sshfingerprintform %} +{% endif %} +{% if sshfpralgoform %} + {% bootstrap_form_errors sshfpralgoform %} +{% endif %} + + + + +
+ {% csrf_token %} + {% if machineform %} +

Machine

+ {% massive_bootstrap_form machineform ' ' %} + {% endif %} + {% if interfaceform %} +

Interface

+ {% if i_mbf_param %} + {% massive_bootstrap_form interfaceform 'ipv4,machine' mbf_param=i_mbf_param %} + {% else %} + {% massive_bootstrap_form interfaceform 'ipv4,machine' %} + {% endif %} + {% endif %} + {% if domainform %} +

Domaine

+ {% bootstrap_form domainform %} + {% endif %} + {% if iptypeform %} +

Type d'IP

+ {% bootstrap_form iptypeform %} + {% endif %} + {% if machinetypeform %} +

Type de machine

+ {% bootstrap_form machinetypeform %} + {% endif %} + {% if extensionform %} +

Extension

+ {% massive_bootstrap_form extensionform 'origin' %} + {% endif %} + {% if soaform %} +

Enregistrement SOA

+ {% bootstrap_form soaform %} + {% endif %} + {% if mxform %} +

Enregistrement MX

+ {% massive_bootstrap_form mxform 'name' %} + {% endif %} + {% if nsform %} +

Enregistrement NS

+ {% massive_bootstrap_form nsform 'ns' %} + {% endif %} + {% if txtform %} +

Enregistrement TXT

+ {% bootstrap_form txtform %} + {% endif %} + {% if srvform %} +

Enregistrement SRV

+ {% massive_bootstrap_form srvform 'target' %} + {% endif %} + {% if aliasform %} +

Alias

+ {% bootstrap_form aliasform %} + {% endif %} + {% if serviceform %} +

Service

+ {% massive_bootstrap_form serviceform 'servers' %} + {% endif %} + {% if roleform %} +

Role

+ {% massive_bootstrap_form roleform 'servers' %} + {% endif %} + {% if vlanform %} +

Vlan

+ {% bootstrap_form vlanform %} + {% endif %} + {% if nasform %} +

NAS

+ {% bootstrap_form nasform %} + {% endif %} + {% if ipv6form %} +

Ipv6

+ {% bootstrap_form ipv6form %} + {% endif %} + {% if sshfingerprintform %} +

SshFingerprint

+ {% bootstrap_form sshfingerprintform %} + {% endif %} + {% if sshfpralgoform %} +

Algorithme de fingerprint ssh

+ {% bootstrap_form sshfpralgoform %} + {% endif %} + {% bootstrap_button action_name button_type="submit" icon="star" %} +
+
+
+
+{% endblock %} diff --git a/machines/templates/machines/aff_iptype.html b/machines/templates/machines/aff_iptype.html index 1a76e303..576c404d 100644 --- a/machines/templates/machines/aff_iptype.html +++ b/machines/templates/machines/aff_iptype.html @@ -32,6 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc., Nécessite l'autorisation infra Plage ipv4 Préfixe v6 + DNSSEC reverse v4/v6 Sur vlan Ouverture ports par défault @@ -45,6 +46,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {{ type.need_infra }} {{ type.domaine_ip_start }}-{{ type.domaine_ip_stop }} {{ type.prefix_v6 }} + {{ type.dnssec_reverse_v4 }}/{{ type.dnssec_reverse_v6 }} {{ type.vlan }} {{ type.ouverture_ports }}