Skip to content

Commit bb4c320

Browse files
committed
Merge branch 'develop' of https://github.com/furlongm/patchman into develop
2 parents 68a6ca7 + afc3501 commit bb4c320

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+297
-462
lines changed

.github/workflows/create-release-and-upload-assets.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
git config user.name 'Marcus Furlong'
5151
- name: Install dependencies
5252
run: |
53-
sudo apt -y install python-setuptools debhelper dh-exec dh-python git-buildpackage
53+
sudo apt -y install python3-setuptools debhelper dh-exec dh-python git-buildpackage
5454
- name: Update repo version if required
5555
env:
5656
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -143,14 +143,12 @@ jobs:
143143
needs: update-version-and-changelog
144144
runs-on: ubuntu-latest
145145
container:
146-
image: centos:7
146+
image: centos:8
147147
steps:
148148
- name: Install build dependencies
149149
run: |
150-
yum -y install epel-release
151-
yum -y install https://repo.ius.io/ius-release-el7.rpm
152-
yum makecache
153-
yum -y install rpm-build python-setuptools git222
150+
dnf -y install epel-release
151+
dnf -y install rpm-build python-setuptools git
154152
- uses: actions/checkout@v2
155153
with:
156154
fetch-depth: 0

.github/workflows/lint-and-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
max-parallel: 4
1010
matrix:
11-
python-version: [2.7]
11+
python-version: [3.6, 3.7, 3.8]
1212
steps:
1313
- uses: actions/checkout@v1
1414
- name: Set up Python ${{ matrix.python-version }}

INSTALL.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ mysql or postgresql instead, see the database configuration section.
55

66

77
## Supported Install Options
8-
- [Ubuntu 18.04](#ubuntu-1804-bionic)
8+
- [Ubuntu 20.04](#ubuntu-2004-bionic)
99
- [Debian 10](#debian-10-buster)
1010
- [CentOS 7](#centos-7)
1111
- [virtualenv + pip](#virtualenv--pip)
1212
- [Source](#source)
1313

1414

15-
### Ubuntu 18.04 (bionic)
15+
### Ubuntu 20.04 (focal)
1616

1717
```shell
1818
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0412F522
19-
echo "deb https://repo.openbytes.ie/ubuntu bionic main" > /etc/apt/sources.list.d/patchman.list
19+
echo "deb https://repo.openbytes.ie/ubuntu focal main" > /etc/apt/sources.list.d/patchman.list
2020
apt update
21-
apt -y install python-patchman patchman-client
21+
apt -y install python3-patchman patchman-client
2222
patchman-manage createsuperuser
2323
```
2424

@@ -28,7 +28,8 @@ patchman-manage createsuperuser
2828
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0412F522
2929
echo "deb https://repo.openbytes.ie/debian buster main" > /etc/apt/sources.list.d/patchman.list
3030
apt update
31-
apt -y install python-patchman patchman-client
31+
apt -t buster-backports -y install python3-django
32+
apt -y install python3-patchman patchman-client
3233
patchman-manage createsuperuser
3334
```
3435

@@ -42,9 +43,9 @@ baseurl=https://repo.openbytes.ie/yum
4243
enabled=1
4344
gpgcheck=0
4445
EOF
45-
yum install -y epel-release
46-
yum makecache
47-
yum install -y patchman patchman-client
46+
dnf -y install epel-release
47+
dnf makecache
48+
dnf -y install patchman patchman-client
4849
systemctl restart httpd
4950
patchman-manage createsuperuser
5051
```
@@ -54,8 +55,8 @@ patchman-manage createsuperuser
5455
TBD - not working yet
5556

5657
```shell
57-
apt -y install gcc libxml2-dev libxslt1-dev virtualenv python-dev zlib1g-dev # (debian/ubuntu)
58-
yum -y install gcc libxml2-devel libxslt-devel python-virtualenv # (centos/rhel)
58+
apt -y install gcc libxml2-dev libxslt1-dev virtualenv python3-dev zlib1g-dev # (debian/ubuntu)
59+
dnf -y install gcc libxml2-devel libxslt-devel python3-virtualenv # (centos/rhel)
5960
mkdir /srv/patchman
6061
cd /srv/patchman
6162
virtualenv .
@@ -69,22 +70,21 @@ gunicorn patchman.wsgi -b 0.0.0.0:80
6970

7071
### Source
7172

72-
#### Ubuntu 18.04 (bionic)
73+
#### Ubuntu 20.04 (focal)
7374

7475
1. Install dependencies
7576

7677
```shell
77-
apt -y install python-django-tagging python-django python-requests \
78-
python-django-extensions python-argparse python-defusedxml python-rpm python-debian \
79-
python-pygooglechart python-cracklib python-progressbar libapache2-mod-wsgi \
80-
python-djangorestframework apache2 python-colorama python-humanize liblzma-dev \
81-
python-magic python-lxml
78+
apt -y install python3-django python3-django-tagging python3-django-extensions \
79+
python3-djangorestframework python3-defusedxml python3-lxml python3-requests \
80+
python3-rpm python3-debian python3-colorama python3-humanize python3-magic \
81+
apache2 libapache2-mod-wsgi-py3 python3-pip python3-progressbar
8282
```
8383

8484
2. Install django-bootstrap3
8585

8686
```shell
87-
pip install django-bootstrap3==11.1.0
87+
pip3 install django-bootstrap3
8888
```
8989

9090
3. Clone git repo to e.g. /srv/patchman
@@ -152,7 +152,7 @@ To configure the mysql database backend:
152152
1. Ensure mysql-server and the python mysql bindings are installed:
153153

154154
```shell
155-
apt -y install default-mysql-server python-mysqldb python-pymysql
155+
apt -y install default-mysql-server python3-mysqldb
156156
```
157157

158158
2. Create database and users:
@@ -193,7 +193,7 @@ To configure the postgresql database backend:
193193
1. Ensure the postgresql server and the python postgres bindings are installed:
194194

195195
```shell
196-
apt -y install postgresql python-psycopg2
196+
apt -y install postgresql python3-psycopg2
197197
```
198198

199199
2. Create database and users:
@@ -311,17 +311,17 @@ Install Celery for realtime processing of reports from clients:
311311
#### Ubuntu / Debian
312312

313313
```shell
314-
apt -y install python-celery python-celery-common rabbitmq-server
315-
C_FORCE_ROOT=1 celery worker --loglevel=info -E -A patchman
314+
apt -y install python3-celery redis python3-redis python-celery-common
315+
C_FORCE_ROOT=1 celery worker --loglevel=info -b redis://127.0.0.1:6379/0 -E -A patchman
316316
```
317317

318318
#### CentOS / RHEL
319319

320320
```shell
321-
yum -y install python-celery rabbitmq-server
322-
systemctl restart rabbitmq-server
323-
semanage port -a -t http_port_t -p tcp 5672
324-
C_FORCE_ROOT=1 celery worker --loglevel=info -E -A patchman
321+
dnf -y install python3-celery redis python3-redis
322+
systemctl restart redis-server
323+
semanage port -a -t http_port_t -p tcp 6379
324+
C_FORCE_ROOT=1 celery worker --loglevel=info -b redis://127.0.0.1:6379/0 -E -A patchman
325325

326326
```
327327

@@ -333,8 +333,8 @@ persistent over reboot.
333333
Memcached can optionally be run to reduce the load on the server.
334334

335335
```shell
336-
apt -y install memcached python-memcache # (debian/ubuntu)
337-
yum -y install memcached python-memcached # (centos/rhel)
336+
apt -y install memcached python3-memcache # (debian/ubuntu)
337+
dnf -y install memcached python3-memcached # (centos/rhel)
338338
systemctl restart memcached
339339
```
340340

README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -92,19 +92,20 @@ optional arguments:
9292
9393
9494
```
95-
python-django
96-
python-django-tagging
97-
python-django-extensions
98-
python-django-bootstrap3
99-
python-djangorestframework
100-
python-debian
101-
python-rpm
102-
python-progressbar
103-
python-lxml
104-
python-defusedxml
105-
python-argparse
106-
python-requests
107-
python-humanize
95+
python3-django
96+
python3-django-tagging
97+
python3-django-extensions
98+
python3-django-bootstrap3
99+
python3-djangorestframework
100+
python3-debian
101+
python3-rpm
102+
python3-progressbar
103+
python3-lxml
104+
python3-defusedxml
105+
python3-requests
106+
python3-colorama
107+
python3-magic
108+
python3-humanize
108109
```
109110
110111
The server can optionally make use of celery to asynchronously process the

TODO

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,8 @@
77
* record the history of installed packages on a host
88
* also store package descriptions/tags/urls
99
* check for unused repos
10-
* rdns checks off by default
1110
* suggest names for repos with the same checksum
12-
* helper script to change paths (e.g. /usr/lib/python2.7/dist-packages/patchman)
13-
* process reports in background
11+
* helper script to change paths (e.g. /usr/lib/python3/dist-packages/patchman)
1412
* Dockerfile/Dockerimage
1513
* compressed reports
1614
* modularity support
17-
* add cronjobs to built packages
18-
* install celery/rabbit/memcache with packages

arch/admin.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Copyright 2012 VPAC, http://www.vpac.org
2-
# Copyright 2013-2016 Marcus Furlong <[email protected]>
2+
# Copyright 2013-2020 Marcus Furlong <[email protected]>
33
#
44
# This file is part of Patchman.
55
#
@@ -15,8 +15,6 @@
1515
# You should have received a copy of the GNU General Public License
1616
# along with Patchman. If not, see <http://www.gnu.org/licenses/>
1717

18-
from __future__ import unicode_literals
19-
2018
from django.contrib import admin
2119
from arch.models import PackageArchitecture, MachineArchitecture
2220

arch/apps.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2019 Marcus Furlong <[email protected]>
1+
# Copyright 2019-2020 Marcus Furlong <[email protected]>
22
#
33
# This file is part of Patchman.
44
#
@@ -14,8 +14,6 @@
1414
# You should have received a copy of the GNU General Public License
1515
# along with Patchman. If not, see <http://www.gnu.org/licenses/>
1616

17-
from __future__ import unicode_literals
18-
1917
from django.apps import AppConfig
2018

2119

arch/models.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Copyright 2012 VPAC, http://www.vpac.org
2-
# Copyright 2013-2016 Marcus Furlong <[email protected]>
2+
# Copyright 2013-2020 Marcus Furlong <[email protected]>
33
#
44
# This file is part of Patchman.
55
#
@@ -15,13 +15,9 @@
1515
# You should have received a copy of the GNU General Public License
1616
# along with Patchman. If not, see <http://www.gnu.org/licenses/>
1717

18-
from __future__ import unicode_literals
19-
20-
from django.utils.encoding import python_2_unicode_compatible
2118
from django.db import models
2219

2320

24-
@python_2_unicode_compatible
2521
class Architecture(models.Model):
2622

2723
name = models.CharField(unique=True, max_length=255)

arch/serializers.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2016 Marcus Furlong <[email protected]>
1+
# Copyright 2016-2020 Marcus Furlong <[email protected]>
22
#
33
# This file is part of Patchman.
44
#
@@ -14,8 +14,6 @@
1414
# You should have received a copy of the GNU General Public License
1515
# along with Patchman. If not, see <http://www.gnu.org/licenses/>
1616

17-
from __future__ import unicode_literals
18-
1917
from rest_framework import serializers
2018

2119
from arch.models import PackageArchitecture, MachineArchitecture

arch/views.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2016 Marcus Furlong <[email protected]>
1+
# Copyright 2016-2020 Marcus Furlong <[email protected]>
22
#
33
# This file is part of Patchman.
44
#
@@ -14,8 +14,6 @@
1414
# You should have received a copy of the GNU General Public License
1515
# along with Patchman. If not, see <http://www.gnu.org/licenses/>
1616

17-
from __future__ import unicode_literals
18-
1917
from rest_framework import viewsets, permissions
2018

2119
from arch.models import PackageArchitecture, MachineArchitecture

0 commit comments

Comments
 (0)