gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [ascension] 38/45: renamed project to ascension


From: gnunet
Subject: [GNUnet-SVN] [ascension] 38/45: renamed project to ascension
Date: Fri, 25 Jan 2019 10:02:38 +0100

This is an automated email from the git hooks/post-receive script.

rexxnor pushed a commit to branch master
in repository ascension.

commit 1cf160afcf98be8d88ba10f684541ce7cdba7026
Author: rexxnor <address@hidden>
AuthorDate: Mon Jan 7 12:52:17 2019 +0100

    renamed project to ascension
---
 README.md                                          |  28 +++++-----
 {gnsmigrator => ascension}/__init__.py             |   0
 .../gnsmigrator.py => ascension/ascension.py       |  34 ++++++------
 {gnsmigrator => ascension}/gnunet.py               |   0
 {gnsmigrator => ascension}/test/basic_named.conf   |   0
 {gnsmigrator => ascension}/test/gnunet.zone        |   0
 ascension/test/managed-keys.bind                   |  33 ++++++++++++
 ascension/test/managed-keys.bind.jnl               | Bin 0 -> 14262 bytes
 ascension/test/test_gns_lookup.conf                |  57 +++++++++++++++++++++
 .../test/test_gnsmigrator_simple.sh                |  10 ++--
 .../test/test_namestore_multiple.sh                |   6 +--
 .../test/test_unit_gnsmigrator.py                  |  22 ++++----
 setup.py                                           |  14 ++---
 13 files changed, 148 insertions(+), 56 deletions(-)

diff --git a/README.md b/README.md
index 3715d36..6ac54af 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,10 @@
-# GNS Migrator
+# Ascension
 
 The main goal is to develop a tool to easily migrate existing DNS Zones to the
 GNU Name System using (incremental) Zone Transfers. (AXFR/IXFR)
 
 ## How to install
-To install the gnsmigrator simply execute one of the following commands:
+To install the ascension simply execute one of the following commands:
 
 ```bash
 # System wide installation
@@ -25,20 +25,20 @@ python3 setup.py develop
 ```
 
 ## How to use
-If you have installed it, simply execute gnsmigrator with one of several 
options.
-You can also just run the file gnsmigrator.py itself directly.
+If you have installed it, simply execute ascension with one of several options.
+You can also just run the file ascension.py itself directly.
 
-Taken from the dosctring of the gnsmigrator.py file:
+Taken from the dosctring of the ascension.py file:
 ```
-GNS Migrator
+Ascension
 
 Usage:
-    gnsmigrator.py <domain> [-d]
-    gnsmigrator.py <domain> -p <port> [-d]
-    gnsmigrator.py <domain> -ns <transferns> [-d]
-    gnsmigrator.py <domain> -ns <transferns> -p <port> [-d]
-    gnsmigrator.py -h | --help
-    gnsmigrator.py -v | --version
+    ascension.py <domain> [-d]
+    ascension.py <domain> -p <port> [-d]
+    ascension.py <domain> -ns <transferns> [-d]
+    ascension.py <domain> -ns <transferns> -p <port> [-d]
+    ascension.py -h | --help
+    ascension.py -v | --version
 
 Options:
     <port>          Port for zone transfer
@@ -52,7 +52,7 @@ Options:
 Example use:
 ```
 # Transfers the sy TLD from ns1.tld.sy.
-gnsmigrator sy -ns ns1.tld.sy.
+ascension sy -ns ns1.tld.sy.
 # Transfers the nu TLD from zonedata.iis.se with debug options enabled
-gnsmigrator nu -ns zonedata.iis.se. -d
+ascension nu -ns zonedata.iis.se. -d
 ```
diff --git a/gnsmigrator/__init__.py b/ascension/__init__.py
similarity index 100%
rename from gnsmigrator/__init__.py
rename to ascension/__init__.py
diff --git a/gnsmigrator/gnsmigrator.py b/ascension/ascension.py
similarity index 96%
rename from gnsmigrator/gnsmigrator.py
rename to ascension/ascension.py
index 47f1cfb..cddaf5a 100644
--- a/gnsmigrator/gnsmigrator.py
+++ b/ascension/ascension.py
@@ -1,13 +1,13 @@
 #!/usr/bin/env python3
-"""GNS Migrator
+"""Ascension
 
 Usage:
-    gnsmigrator.py <domain> [-d]
-    gnsmigrator.py <domain> -p <port> [-d]
-    gnsmigrator.py <domain> -ns <transferns> [-d]
-    gnsmigrator.py <domain> -ns <transferns> -p <port> [-d]
-    gnsmigrator.py -h | --help
-    gnsmigrator.py -v | --version
+    ascension.py <domain> [-d]
+    ascension.py <domain> -p <port> [-d]
+    ascension.py <domain> -ns <transferns> [-d]
+    ascension.py <domain> -ns <transferns> -p <port> [-d]
+    ascension.py -h | --help
+    ascension.py -v | --version
 
 Options:
     <port>          Port for zone transfer
@@ -39,7 +39,7 @@ SUPPORTED_RECORD_TYPES = [
     "A", "AAAA", "NS", "MX", "SOA", "SRV", "TXT", "CNAME"
 ]
 
-class GNSMigrator():
+class Ascender():
     """
     Class that provides migration for any given domain
     """
@@ -142,7 +142,7 @@ class GNSMigrator():
         # SOA is different if taken directly from SOA record
         # compared to AXFR/IXFR - changed to respect this
         try:
-            soa_answer = dns.resolver.query(domain + '.', 'SOA')
+            soa_answer = dns.resolver.query(domain, 'SOA')
         except dns.resolver.NoAnswer:
             logging.warning("the domain '%s' does not exist")
         master_answer = dns.resolver.query(soa_answer[0].mname, 'A')
@@ -346,6 +346,8 @@ class GNSMigrator():
                 value = value[:-1]
             else:
                 value = "%s.%s" % (value, zonename)
+            if domain[-1] == ".":
+                domain = domain[:-1]
             if nameserver[-1] == ".":
                 dnsresolver = nameserver[:-1]
             else:
@@ -427,7 +429,7 @@ class GNSMigrator():
         """
         Adds a SRV record to GNS
         """
-        if not GNSMigrator.check_if_record_exists_in_zone(record, zonename):
+        if not Ascender.check_if_record_exists_in_zone(record, zonename):
             value, ttl, rdata = record
             rtype_str = str(dns.rdatatype.to_text(rdata.rdtype))
             dnsname_str = str(rdata).split(' ')[3]
@@ -526,12 +528,12 @@ def main():
         logging.basicConfig(level=logging.DEBUG)
 
     # Initialize class instance
-    migrator = GNSMigrator(domain, transferns, port)
-    serial = migrator.get_zone_serial(domain)
-    migrator.initial_zone_transfer(serial)
-    migrator.bootstrap_zone()
-    migrator.mirror_zone()
-    migrator.add_records_to_gns()
+    ascender = Ascender(domain, transferns, port)
+    serial = ascender.get_zone_serial(domain)
+    ascender.initial_zone_transfer(serial)
+    ascender.bootstrap_zone()
+    ascender.mirror_zone()
+    ascender.add_records_to_gns()
 
 if __name__ == '__main__':
     main()
diff --git a/gnsmigrator/gnunet.py b/ascension/gnunet.py
similarity index 100%
rename from gnsmigrator/gnunet.py
rename to ascension/gnunet.py
diff --git a/gnsmigrator/test/basic_named.conf b/ascension/test/basic_named.conf
similarity index 100%
rename from gnsmigrator/test/basic_named.conf
rename to ascension/test/basic_named.conf
diff --git a/gnsmigrator/test/gnunet.zone b/ascension/test/gnunet.zone
similarity index 100%
rename from gnsmigrator/test/gnunet.zone
rename to ascension/test/gnunet.zone
diff --git a/ascension/test/managed-keys.bind b/ascension/test/managed-keys.bind
new file mode 100644
index 0000000..45385ef
--- /dev/null
+++ b/ascension/test/managed-keys.bind
@@ -0,0 +1,33 @@
+$ORIGIN .
+$TTL 0 ; 0 seconds
+@                      IN SOA  . . (
+                               24         ; serial
+                               0          ; refresh (0 seconds)
+                               0          ; retry (0 seconds)
+                               0          ; expire (0 seconds)
+                               0          ; minimum (0 seconds)
+                               )
+                       KEYDATA 20181113222352 20181020181422 19700101000000 
257 3 8 (
+                               AwEAAagAIKlVZrpC6Ia7gEzahOR+9W29euxhJhVVLOyQ
+                               bSEW0O8gcCjFFVQUTf6v58fLjwBd0YI0EzrAcQqBGCzh
+                               /RStIoO8g0NfnfL2MTJRkxoXbfDaUeVPQuYEhg37NZWA
+                               JQ9VnMVDxP/VHL496M/QZxkjf5/Efucp2gaDX6RS6CXp
+                               oY68LsvPVjR0ZSwzz1apAzvN9dlzEheX7ICJBBtuA6G3
+                               LQpzW5hOA2hzCTMjJPJ8LbqF6dsV6DoBQzgul0sGIcGO
+                               Yl7OyQdXfZ57relSQageu+ipAdTTJ25AsRTAoub8ONGc
+                               LmqrAmRLKBP1dfwhYB4N7knNnulqQxA+Uk1ihz0=
+                               ) ; KSK; alg = RSASHA256; key id = 19036
+                               ; next refresh: Tue, 13 Nov 2018 22:23:52 GMT
+                               ; trusted since: Sat, 20 Oct 2018 18:14:22 GMT
+                       KEYDATA 20181113222352 20181020181422 19700101000000 
257 3 8 (
+                               AwEAAaz/tAm8yTn4Mfeh5eyI96WSVexTBAvkMgJzkKTO
+                               iW1vkIbzxeF3+/4RgWOq7HrxRixHlFlExOLAJr5emLvN
+                               7SWXgnLh4+B5xQlNVz8Og8kvArMtNROxVQuCaSnIDdD5
+                               LKyWbRd2n9WGe2R8PzgCmr3EgVLrjyBxWezF0jLHwVN8
+                               efS3rCj/EWgvIWgb9tarpVUDK/b58Da+sqqls3eNbuv7
+                               pr+eoZG+SrDK6nWeL3c6H5Apxz7LjVc1uTIdsIXxuOLY
+                               A4/ilBmSVIzuDWfdRUfhHdY6+cn8HFRm+2hM8AnXGXws
+                               9555KrUB5qihylGa8subX2Nn6UwNR1AkUTV74bU=
+                               ) ; KSK; alg = RSASHA256; key id = 20326
+                               ; next refresh: Tue, 13 Nov 2018 22:23:52 GMT
+                               ; trusted since: Sat, 20 Oct 2018 18:14:22 GMT
diff --git a/ascension/test/managed-keys.bind.jnl 
b/ascension/test/managed-keys.bind.jnl
new file mode 100644
index 0000000..526f248
Binary files /dev/null and b/ascension/test/managed-keys.bind.jnl differ
diff --git a/ascension/test/test_gns_lookup.conf 
b/ascension/test/test_gns_lookup.conf
new file mode 100644
index 0000000..2b874f8
--- /dev/null
+++ b/ascension/test/test_gns_lookup.conf
@@ -0,0 +1,57 @@
address@hidden@ test_gns_defaults.conf
+
+[namecache]
+DISABLE = YES
+
+[PATHS]
+GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-gns-peer-1/
+
+[dht]
+START_ON_DEMAND = YES
+
+[gns]
+# PREFIX = valgrind --leak-check=full --track-origins=yes
+START_ON_DEMAND = YES
+AUTO_IMPORT_PKEY = YES
+MAX_PARALLEL_BACKGROUND_QUERIES = 10
+DEFAULT_LOOKUP_TIMEOUT = 15 s
+RECORD_PUT_INTERVAL = 1 h
+ZONE_PUBLISH_TIME_WINDOW = 1 h
+DNS_ROOT=PD67SGHF3E0447TU9HADIVU9OM7V4QHTOG0EBU69TFRI2LG63DR0
+
+[namestore]
+#PREFIX = valgrind --leak-check=full --track-origins=yes --log-file=/tmp/ns_log
+
+[revocation]
+WORKBITS = 1
+
+[dhtcache]
+QUOTA = 1 MB
+DATABASE = heap
+
+[topology]
+TARGET-CONNECTION-COUNT = 16
+AUTOCONNECT = YES
+FRIENDS-ONLY = NO
+MINIMUM-FRIENDS = 0
+
+[ats]
+WAN_QUOTA_IN = 1 GB
+WAN_QUOTA_OUT = 1 GB
+
+[transport]
+plugins = tcp
+NEIGHBOUR_LIMIT = 50
+PORT = 2091
+
+[transport-tcp]
+TIMEOUT = 300 s
+
+[nat]
+DISABLEV6 = YES
+BINDTO = 127.0.0.1
+ENABLE_UPNP = NO
+BEHIND_NAT = NO
+ALLOW_NAT = NO
+INTERNAL_ADDRESS = 127.0.0.1
+EXTERNAL_ADDRESS = 127.0.0.1
diff --git a/gnsmigrator/test/test_gnsmigrator_simple.sh 
b/ascension/test/test_gnsmigrator_simple.sh
similarity index 88%
rename from gnsmigrator/test/test_gnsmigrator_simple.sh
rename to ascension/test/test_gnsmigrator_simple.sh
index f0e6eb2..5a262b8 100644
--- a/gnsmigrator/test/test_gnsmigrator_simple.sh
+++ b/ascension/test/test_gnsmigrator_simple.sh
@@ -18,8 +18,8 @@ if ! [ -x "$(command -v named)" ]; then
     exit 1
 fi
 
-if ! [ -x "$(command -v gnsmigrator)" ]; then
-    echo 'gnsmigrator is not installed' >&2
+if ! [ -x "$(command -v ascension)" ]; then
+    echo 'ascension is not installed' >&2
     exit 1
 fi
 
@@ -34,10 +34,10 @@ if [ "$?" -ne 0 ]; then
     exit 1
 fi
 
-# Let gnsmigrator run on gnunet.org test domain
-gnsmigrator gnunet.org -ns 127.0.0.1 -p 5000
+# Let ascension run on gnunet.org test domain
+ascension gnunet.org -ns 127.0.0.1 -p 5000
 if [ "$?" -ne 0 ]; then
-    echo "gnsmigrator failed adding the records!"
+    echo "ascension failed adding the records!"
     cleanup
     exit 1
 fi
diff --git a/gnsmigrator/test/test_namestore_multiple.sh 
b/ascension/test/test_namestore_multiple.sh
similarity index 95%
rename from gnsmigrator/test/test_namestore_multiple.sh
rename to ascension/test/test_namestore_multiple.sh
index f238de1..72862a6 100644
--- a/gnsmigrator/test/test_namestore_multiple.sh
+++ b/ascension/test/test_namestore_multiple.sh
@@ -96,9 +96,9 @@ echo "Testing adding TXT record with -R"
 declare -a arr=('3600 TXT n Pretty_Unicorns')
 testing test8 "address@hidden"
 # 8
-echo "Testing adding TXT record with -R"
-declare -a arr=('3600 SRV n _autodiscover_old._tcp.bfh.ch.')
-testing test8 "address@hidden"
+echo "Testing adding SRV record with -R"
+declare -a arr=('3600 SRV n 0 0 443 testing')
+testing _autodiscover_old._tcp "address@hidden"
 # 9
 echo "Testing adding many A records with -R"
 declare -a arr=('3600 A n 127.0.0.1' '3600 A n 127.0.0.2' '3600 A n 127.0.0.3' 
'3600 A n 127.0.0.4' '3600 A n 127.0.0.5')
diff --git a/gnsmigrator/test/test_unit_gnsmigrator.py 
b/ascension/test/test_unit_gnsmigrator.py
similarity index 72%
rename from gnsmigrator/test/test_unit_gnsmigrator.py
rename to ascension/test/test_unit_gnsmigrator.py
index b04f456..d9a59fa 100644
--- a/gnsmigrator/test/test_unit_gnsmigrator.py
+++ b/ascension/test/test_unit_gnsmigrator.py
@@ -1,16 +1,16 @@
 #!/usr/bin/env python3
 """
-Unittests of gnsmigrator
+Unittests of ascension
 """
 
 import subprocess
 import unittest
 import mock
 from unittest import TestCase
-from gnsmigrator import gnsmigrator
+from ascension import ascension
 
 
-class TestGNSMigrator(TestCase):
+class TestAscender(TestCase):
     """
     Short Unit Tests for WebArchiver
     """
@@ -19,26 +19,26 @@ class TestGNSMigrator(TestCase):
         """
         Prepare data for tests
         """
-        cls.gnsmigrator = gnsmigrator.GNSMigrator(["pretty.fantasy"])
+        cls.ascension = ascension.Ascender(["pretty.fantasy"])
 
     def test_constructor(self):
         """
         Tests constructor
         """
-        self.assertEqual(["pretty.fantasy"], self.gnsmigrator.domainlist)
+        self.assertEqual(["pretty.fantasy"], self.ascension.domainlist)
 
     def test_get_lowest_domain_part(self):
         """
         Tests constructor
         """
-        self.assertEqual("pretty", self.gnsmigrator.get_lowest_domain_part(
-            self.gnsmigrator.domainlist[0]))
+        self.assertEqual("pretty", self.ascension.get_lowest_domain_part(
+            self.ascension.domainlist[0]))
 
     def test_bootstrap_zones(self):
         """
         Tests bootstrapping of zones with mocked subprocess commands
         """
-        self.gnsmigrator.bootstrap_zones()
+        self.ascension.bootstrap_zones()
         # using mocked subprocesses to prevent inconsistent status
         mocked_ident = mock.create_autospec(subprocess.check_output, 
return_value='fantasy PKEY')
         self.assertIn('fantasy', mocked_ident(['gnunet-identity', '-d']))
@@ -51,11 +51,11 @@ class TestGNSMigrator(TestCase):
         """
         Tests different ways of zone transfer not working
         """
-        self.gnsmigrator.initial_zone_transfer()
+        self.ascension.initial_zone_transfer()
 
         # Needs to be done via mock stuff or expect weird stuff
-        #self.assertRaises(dns.resolver.NoAnswer, 
self.gnsmigrator.initial_zone_transfer())
-        #self.assertRaises(dns.resolver.NoAnswer, 
self.gnsmigrator2.initial_zone_transfer())
+        #self.assertRaises(dns.resolver.NoAnswer, 
self.ascension.initial_zone_transfer())
+        #self.assertRaises(dns.resolver.NoAnswer, 
self.ascension2.initial_zone_transfer())
 
     @classmethod
     def tearDownClass(cls):
diff --git a/setup.py b/setup.py
index ba58cad..cfd7f0f 100644
--- a/setup.py
+++ b/setup.py
@@ -9,20 +9,20 @@ with open("README.md", "r") as fh:
     long_description = fh.read()
 
 setuptools.setup(
-    name="gnsmigrator",
-    version="0.1.2",
-    author="Patrick Gerber",
-    author_email="address@hidden",
+    name="ascension",
+    version="0.1.3",
+    author="rexxnor",
+    author_email="address@hidden",
     description="Tool to migrate DNS Zones to the GNU Name System",
     long_description=long_description,
-    url="https://gitlab.ti.bfh.ch/gerbp6/gnsmigrator";,
-    packages=['gnsmigrator'],
+    url="https://gnunet.org/git/ascension.git/";,
+    packages=['ascension'],
     classifiers=[
         "Programming Language :: Python :: 3",
     ],
     entry_points={
         'console_scripts': [
-            'gnsmigrator=gnsmigrator.gnsmigrator:main',
+            'ascension=ascension.ascension:main',
         ],
     },
 )

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]