diff --git a/.gitignore b/.gitignore index 9e817ba..87c7e98 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ zones/db.* +*.pyc diff --git a/Makefile b/Makefile index 860c638..658650f 100644 --- a/Makefile +++ b/Makefile @@ -3,3 +3,10 @@ default: container container: docker build --no-cache --pull -t luzifer/dns . docker push luzifer/dns + +.venv: + virtualenv --python=python3 .venv + ./.venv/bin/pip3 install -r requirements.txt + +auto-hook-pre-commit: .venv + ./.venv/bin/python3 checkZonefile.py diff --git a/checkZonefile.py b/checkZonefile.py new file mode 100644 index 0000000..01f8ec7 --- /dev/null +++ b/checkZonefile.py @@ -0,0 +1,162 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +import generateZonefiles as generator + +import re +import sys +import yaml + +MATCH_FQDN = '(?=^.{4,253}$)(^((?!-)[a-zA-Z0-9-]{1,63}(?