Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/furlongm/patchman into d…
Browse files Browse the repository at this point in the history
…evelop
  • Loading branch information
furlongm committed Dec 2, 2020
2 parents 68a6ca7 + afc3501 commit bb4c320
Show file tree
Hide file tree
Showing 89 changed files with 297 additions and 462 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/create-release-and-upload-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
git config user.name 'Marcus Furlong'
- name: Install dependencies
run: |
sudo apt -y install python-setuptools debhelper dh-exec dh-python git-buildpackage
sudo apt -y install python3-setuptools debhelper dh-exec dh-python git-buildpackage
- name: Update repo version if required
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -143,14 +143,12 @@ jobs:
needs: update-version-and-changelog
runs-on: ubuntu-latest
container:
image: centos:7
image: centos:8
steps:
- name: Install build dependencies
run: |
yum -y install epel-release
yum -y install https://repo.ius.io/ius-release-el7.rpm
yum makecache
yum -y install rpm-build python-setuptools git222
dnf -y install epel-release
dnf -y install rpm-build python-setuptools git
- uses: actions/checkout@v2
with:
fetch-depth: 0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [2.7]
python-version: [3.6, 3.7, 3.8]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
Expand Down
54 changes: 27 additions & 27 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ mysql or postgresql instead, see the database configuration section.


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


### Ubuntu 18.04 (bionic)
### Ubuntu 20.04 (focal)

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

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

Expand All @@ -42,9 +43,9 @@ baseurl=https://repo.openbytes.ie/yum
enabled=1
gpgcheck=0
EOF
yum install -y epel-release
yum makecache
yum install -y patchman patchman-client
dnf -y install epel-release
dnf makecache
dnf -y install patchman patchman-client
systemctl restart httpd
patchman-manage createsuperuser
```
Expand All @@ -54,8 +55,8 @@ patchman-manage createsuperuser
TBD - not working yet

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

### Source

#### Ubuntu 18.04 (bionic)
#### Ubuntu 20.04 (focal)

1. Install dependencies

```shell
apt -y install python-django-tagging python-django python-requests \
python-django-extensions python-argparse python-defusedxml python-rpm python-debian \
python-pygooglechart python-cracklib python-progressbar libapache2-mod-wsgi \
python-djangorestframework apache2 python-colorama python-humanize liblzma-dev \
python-magic python-lxml
apt -y install python3-django python3-django-tagging python3-django-extensions \
python3-djangorestframework python3-defusedxml python3-lxml python3-requests \
python3-rpm python3-debian python3-colorama python3-humanize python3-magic \
apache2 libapache2-mod-wsgi-py3 python3-pip python3-progressbar
```

2. Install django-bootstrap3

```shell
pip install django-bootstrap3==11.1.0
pip3 install django-bootstrap3
```

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

```shell
apt -y install default-mysql-server python-mysqldb python-pymysql
apt -y install default-mysql-server python3-mysqldb
```

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

```shell
apt -y install postgresql python-psycopg2
apt -y install postgresql python3-psycopg2
```

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

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

#### CentOS / RHEL

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

```

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

```shell
apt -y install memcached python-memcache # (debian/ubuntu)
yum -y install memcached python-memcached # (centos/rhel)
apt -y install memcached python3-memcache # (debian/ubuntu)
dnf -y install memcached python3-memcached # (centos/rhel)
systemctl restart memcached
```

Expand Down
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,19 +92,20 @@ optional arguments:
```
python-django
python-django-tagging
python-django-extensions
python-django-bootstrap3
python-djangorestframework
python-debian
python-rpm
python-progressbar
python-lxml
python-defusedxml
python-argparse
python-requests
python-humanize
python3-django
python3-django-tagging
python3-django-extensions
python3-django-bootstrap3
python3-djangorestframework
python3-debian
python3-rpm
python3-progressbar
python3-lxml
python3-defusedxml
python3-requests
python3-colorama
python3-magic
python3-humanize
```
The server can optionally make use of celery to asynchronously process the
Expand Down
6 changes: 1 addition & 5 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,8 @@
* record the history of installed packages on a host
* also store package descriptions/tags/urls
* check for unused repos
* rdns checks off by default
* suggest names for repos with the same checksum
* helper script to change paths (e.g. /usr/lib/python2.7/dist-packages/patchman)
* process reports in background
* helper script to change paths (e.g. /usr/lib/python3/dist-packages/patchman)
* Dockerfile/Dockerimage
* compressed reports
* modularity support
* add cronjobs to built packages
* install celery/rabbit/memcache with packages
4 changes: 1 addition & 3 deletions arch/admin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright 2012 VPAC, http://www.vpac.org
# Copyright 2013-2016 Marcus Furlong <[email protected]>
# Copyright 2013-2020 Marcus Furlong <[email protected]>
#
# This file is part of Patchman.
#
Expand All @@ -15,8 +15,6 @@
# You should have received a copy of the GNU General Public License
# along with Patchman. If not, see <http://www.gnu.org/licenses/>

from __future__ import unicode_literals

from django.contrib import admin
from arch.models import PackageArchitecture, MachineArchitecture

Expand Down
4 changes: 1 addition & 3 deletions arch/apps.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019 Marcus Furlong <[email protected]>
# Copyright 2019-2020 Marcus Furlong <[email protected]>
#
# This file is part of Patchman.
#
Expand All @@ -14,8 +14,6 @@
# You should have received a copy of the GNU General Public License
# along with Patchman. If not, see <http://www.gnu.org/licenses/>

from __future__ import unicode_literals

from django.apps import AppConfig


Expand Down
6 changes: 1 addition & 5 deletions arch/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright 2012 VPAC, http://www.vpac.org
# Copyright 2013-2016 Marcus Furlong <[email protected]>
# Copyright 2013-2020 Marcus Furlong <[email protected]>
#
# This file is part of Patchman.
#
Expand All @@ -15,13 +15,9 @@
# You should have received a copy of the GNU General Public License
# along with Patchman. If not, see <http://www.gnu.org/licenses/>

from __future__ import unicode_literals

from django.utils.encoding import python_2_unicode_compatible
from django.db import models


@python_2_unicode_compatible
class Architecture(models.Model):

name = models.CharField(unique=True, max_length=255)
Expand Down
4 changes: 1 addition & 3 deletions arch/serializers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2016 Marcus Furlong <[email protected]>
# Copyright 2016-2020 Marcus Furlong <[email protected]>
#
# This file is part of Patchman.
#
Expand All @@ -14,8 +14,6 @@
# You should have received a copy of the GNU General Public License
# along with Patchman. If not, see <http://www.gnu.org/licenses/>

from __future__ import unicode_literals

from rest_framework import serializers

from arch.models import PackageArchitecture, MachineArchitecture
Expand Down
4 changes: 1 addition & 3 deletions arch/views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2016 Marcus Furlong <[email protected]>
# Copyright 2016-2020 Marcus Furlong <[email protected]>
#
# This file is part of Patchman.
#
Expand All @@ -14,8 +14,6 @@
# You should have received a copy of the GNU General Public License
# along with Patchman. If not, see <http://www.gnu.org/licenses/>

from __future__ import unicode_literals

from rest_framework import viewsets, permissions

from arch.models import PackageArchitecture, MachineArchitecture
Expand Down
8 changes: 2 additions & 6 deletions debian/README.Debian
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ Configuration of patchman under Ubuntu/Debian
sqlite3 backend
---------------

Install the python sqlite bindings:

$ apt -y install python-pysqlite2

Update /etc/patchman/local_settings.py:

DATABASES = {
Expand All @@ -31,7 +27,7 @@ Configuration of patchman under Ubuntu/Debian

Install mysql-server and the python mysql bindings:

$ apt -y install mysql-server python-mysqldb
$ apt -y install mysql-server python3-mysqldb

Create database and users:

Expand Down Expand Up @@ -62,7 +58,7 @@ Configuration of patchman under Ubuntu/Debian

Install postgresql server and the python postgres bindings:

$ apt -y install postgresql python-psycopg2
$ apt -y install postgresql python3-psycopg2

Create database and users:

Expand Down
22 changes: 11 additions & 11 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ Section: python
Priority: optional
Maintainer: Marcus Furlong <[email protected]>
Uploaders: Marcus Furlong <[email protected]>
Build-Depends: debhelper (>=9.0.0), python (>= 2.7), dh-python, dh-exec
Standards-Version: 3.9.7
Build-Depends: debhelper (>=12), python3 (>= 3.6), dh-python, dh-exec
Standards-Version: 4.3.0
Homepage: https://github.com/furlongm/patchman
Vcs-Git: git://github.com/furlongm/patchman
Vcs-Browser: https://github.com/furlongm/patchman
X-Python-Version: >= 2.7
X-Python3-Version: >= 3.6

Package: python-patchman
Package: python3-patchman
Architecture: all
Homepage: https://github.com/furlongm/patchman
Depends: ${misc:Depends}, python (>= 2.7), python-django (>= 1.11.0),
python-django-tagging, python-debian, python-rpm, python-progressbar,
python-defusedxml, python-django-extensions, python-colorama, python-requests,
python-humanize, python-django-bootstrap3, python-lzma, python-humanize,
python-magic, python-memcache, python-pip, python-lxml,
python-djangorestframework, memcached, libapache2-mod-wsgi,apache2
Suggests: python-django-celery
Depends: ${misc:Depends}, python3 (>= 3.6), python3-django (>= 2.2),
python3-django-tagging, python3-django-extensions, python3-django-bootstrap3,
python3-djangorestframework, python3-debian, python3-rpm, python3-progressbar,
python3-lxml, python3-defusedxml, python3-requests, python3-colorama,
python3-magic, python3-humanize, python3-pip, python3-memcache, memcached,
libapache2-mod-wsgi-py3, apache2
Suggests: python3-django-celery, python3-mysqldb, python3-psycopg2
Description: Django-based patch status monitoring tool for linux systems.
.
Patchman provides a web interface for monitoring host package updates.
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

if [ "$1" = "configure" ] ; then

if ! grep /usr/lib/python2.7/dist-packages/patchman /etc/apache2/conf-available/patchman.conf >/dev/null 2>&1 ; then
sed -i -e "s/^\(Define patchman_pythonpath\).*/\1 \/usr\/lib\/python2.7\/dist-packages/" \
if ! grep /usr/lib/python3/dist-packages/patchman /etc/apache2/conf-available/patchman.conf >/dev/null 2>&1 ; then
sed -i -e "s/^\(Define patchman_pythonpath\).*/\1 \/usr\/lib\/python3\/dist-packages/" \
/etc/apache2/conf-available/patchman.conf
fi

Expand Down
File renamed without changes.
5 changes: 3 additions & 2 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
# -*- makefile -*-

clean::
rm -rf build MANIFEST dist .pybuild
find -name *.pyc -exec rm {} \;
rm -rf debian/python3-patchman build MANIFEST dist .pybuild patchman.egg-info .tox
dh_clean

export PYBUILD_NAME=patchman

%:
dh $@ --with python2 --buildsystem=pybuild
dh $@ --with python3 --buildsystem=pybuild

override_dh_auto_test:
true
Loading

0 comments on commit bb4c320

Please sign in to comment.