Skip to content

Commit

Permalink
Merge branch 'py3.6-fixes' of github.com:garberg/NIPAP into py3.6-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
garberg committed Sep 24, 2023
2 parents 366c7ce + be2c3b6 commit 033b220
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 14 deletions.
23 changes: 19 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
pull_request:
branches: [ master ]

env:
ACTIONS_RUNNER_DEBUG: true
ACTIONS_STEP_DEBUG: true

jobs:
test:

Expand Down Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}
Expand All @@ -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
2 changes: 1 addition & 1 deletion nipap-www/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Source: nipap-www
Section: web
Priority: optional
Maintainer: Lukas Garberg <[email protected]>
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
Expand Down
4 changes: 2 additions & 2 deletions nipap-www/debian/pydist-overrides
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Jinja2 python-jinja2
pynipap python-pynipap
Jinja2 python3-jinja2
pynipap python3-pynipap
nipap nipap-common
6 changes: 3 additions & 3 deletions nipap/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ 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.


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.
2 changes: 1 addition & 1 deletion nipap/debian/nipapd.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion nipap/nipap/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand Down
1 change: 0 additions & 1 deletion nipap/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion whoisd/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 033b220

Please sign in to comment.