diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fd43fc30a..56c484d17 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,10 @@ on: pull_request: branches: [ master ] +env: + ACTIONS_RUNNER_DEBUG: true + ACTIONS_STEP_DEBUG: true + jobs: test: @@ -90,7 +94,8 @@ jobs: # install nipap-cli dependencies sudo -H pip3 install -r nipap-cli/requirements.txt # start nipap backend - nipap/nipapd --no-pid-file -c /etc/nipap/nipap.conf + nipap/nipapd --no-pid-file -c /etc/nipap/nipap.conf -d + sudo ps auxf | grep nipap - name: "Install latest release from apt" if: ${{ matrix.install == 'apt' && matrix.upgrade == true }} @@ -132,14 +137,17 @@ jobs: if [ `grep -c ssl_port /etc/nipap/nipap.conf` -eq 0 ]; then \ # No SSL config in file - add from scratch sudo sed '/^port *=.*/a ssl_port = 1338\nssl_cert_file = \/tmp\/ca\/test.bundle.crt\nssl_key_file = \/tmp\/ca\/test.key' -i /etc/nipap/nipap.conf; \ - else \ + else \ sudo sed -e "s/#ssl_port.\+$/ssl_port = 1338/" -e "s/#ssl_cert_file.\+$/ssl_cert_file = \/tmp\/ca\/test.bundle.crt/" -e "s/#ssl_key_file.\+$/ssl_key_file = \/tmp\/ca\/test.key/" -i /etc/nipap/nipap.conf; \ - fi + fi # create local user for unittests sudo nipap/nipap-passwd add -u unittest -p gottatest -f /etc/nipap/local_auth.db -n "User for running unit tests" sudo nipap/nipap-passwd add -u readonly -p gottatest -f /etc/nipap/local_auth.db --readonly -n "Read-only user for running unit tests" - sudo sed -e "s/db_host *= *[^ ]\+/db_host = localhost/" -i /etc/nipap/nipap.conf + sudo sed -e "s/^db_host *=.*/db_host = localhost/" -e "s/{{SYSLOG}}/true/" -e "s/^debug.\+/debug = true/" -i /etc/nipap/nipap.conf sudo /etc/init.d/nipapd restart + sudo systemctl status nipapd.service + cat /etc/nipap/nipap.conf + sudo ps auxf | grep nipap - name: "Verify pre-upgrade data" if: ${{ matrix.upgrade == true }} @@ -149,9 +157,16 @@ jobs: env: REQUESTS_CA_BUNDLE: /etc/ssl/certs/ca-certificates.crt run: | + cat /etc/nipap/nipap.conf + sudo ps auxf | grep nipap nosetests3 tests/test_xmlrpc.py nosetests3 tests/nipaptest.py nosetests3 tests/test_cli.py nosetests3 tests/test_nipap_ro.py nosetests3 tests/test_rest.py make -C jnipap test + + - name: "Accident analysis" + if: failure() + run: | + sudo cat /var/log/syslog diff --git a/nipap-www/debian/control b/nipap-www/debian/control index 5f020ffae..51c711924 100644 --- a/nipap-www/debian/control +++ b/nipap-www/debian/control @@ -2,7 +2,7 @@ Source: nipap-www Section: web Priority: optional Maintainer: Lukas Garberg -Build-Depends: debhelper (>= 5.0.38), debhelper (>= 7), python3 (>= 3.6), python-setuptools (>= 0.6b3), dh-python +Build-Depends: debhelper (>= 5.0.38), debhelper (>= 7), python3 (>= 3.6), python3-setuptools (>= 0.6b3), dh-python Standards-Version: 4.4.0 Package: nipap-www diff --git a/nipap-www/debian/pydist-overrides b/nipap-www/debian/pydist-overrides index bbef4a327..9302d319c 100644 --- a/nipap-www/debian/pydist-overrides +++ b/nipap-www/debian/pydist-overrides @@ -1,3 +1,3 @@ -Jinja2 python-jinja2 -pynipap python-pynipap +Jinja2 python3-jinja2 +pynipap python3-pynipap nipap nipap-common diff --git a/nipap/debian/control b/nipap/debian/control index a168c0de5..8a415c35d 100644 --- a/nipap/debian/control +++ b/nipap/debian/control @@ -8,8 +8,8 @@ Standards-Version: 4.4.0 Package: nipap-common Architecture: all -Depends: python3 (>= 3.6), ${misc:Depends}, python-ipy -Suggests: python-ldap +Depends: python3 (>= 3.6), ${misc:Depends}, python3-ipy +Suggests: python3-ldap Description: Neat IP Address Planner The Neat IP Address Planner, NIPAP, is a system built for efficiently managing large amounts of IP addresses. This is the common libraries. @@ -17,7 +17,7 @@ Description: Neat IP Address Planner Package: nipapd Architecture: all -Depends: debconf, nipap-common, python3 (>= 3.6), ${misc:Depends}, python3-psycopg2, python3-flask, python3-flask-xml-rpc, python3-flask-restful, python3-flask-compress, python3-tornado, python3-parsedatetime, python3-tz, python3-dateutil, python3-psutil, python3-pyparsing, python3-jwt, python3-requests +Depends: debconf, nipap-common, python3 (>= 3.6), ${misc:Depends}, python3-psycopg2, python3-flask, python3-flask-xml-rpc-re, python3-flask-restful, python3-flask-compress, python3-tornado, python3-parsedatetime, python3-tz, python3-dateutil, python3-psutil, python3-pyparsing, python3-jwt, python3-requests Description: Neat IP Address Planner XML-RPC daemon The Neat IP Address Planner, NIPAP, is a system built for efficiently managing large amounts of IP addresses. This is the XML-RPC daemon. diff --git a/nipap/debian/nipapd.postinst b/nipap/debian/nipapd.postinst index e0ede1f4a..35f5f8c16 100644 --- a/nipap/debian/nipapd.postinst +++ b/nipap/debian/nipapd.postinst @@ -50,7 +50,7 @@ case "$1" in fi # fill in db_host if [ $DB_HOST = "localhost" ]; then - sed -e 's/{{DB_HOST}}/""/' -i /etc/nipap/nipap.conf + sed -e 's/{{DB_HOST}}//' -i /etc/nipap/nipap.conf else sed -e "s/{{DB_HOST}}/$DB_HOST/" -i /etc/nipap/nipap.conf fi diff --git a/nipap/nipap/backend.py b/nipap/nipap/backend.py index 530fd5da2..72b46ef5d 100644 --- a/nipap/nipap/backend.py +++ b/nipap/nipap/backend.py @@ -723,7 +723,7 @@ def _connect_db(self): self._con_pg = psycopg2.connect(**db_args) self._con_pg.set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT) self._curs_pg = self._con_pg.cursor(cursor_factory=psycopg2.extras.DictCursor) - psycopg2.extras.register_hstore(self._con_pg, globally=True, unicode=True) + psycopg2.extras.register_hstore(self._con_pg, globally=True) except psycopg2.Error as exc: if re.search("database.*does not exist", str(exc)): raise NipapDatabaseNonExistentError("Database '%s' does not exist" % db_args['database']) diff --git a/nipap/requirements.txt b/nipap/requirements.txt index 9c578024e..ef817ae79 100644 --- a/nipap/requirements.txt +++ b/nipap/requirements.txt @@ -22,5 +22,4 @@ python-ldap==3.3.1 pytz==2021.1 pyjwt==1.5.3 tornado==6.1 -wsgiref==0.1.2 docutils==0.16 diff --git a/whoisd/debian/control b/whoisd/debian/control index 74864ad46..324d4a1c8 100644 --- a/whoisd/debian/control +++ b/whoisd/debian/control @@ -7,7 +7,7 @@ Standards-Version: 4.4.0 Package: nipap-whoisd Architecture: all -Depends: ${misc:Depends}, python3 (>= 3.6), python-pynipap +Depends: ${misc:Depends}, python3 (>= 3.6), python3-pynipap Description: Neat IP Address Planner The NIPAP whois daemon provides a whois-style interface for querying data in the NIPAP backend. It receives whois queries, translates these into search