patchman 3.0.19__tar.gz → 4.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- patchman-4.0.0/INSTALL.md +536 -0
- {patchman-3.0.19 → patchman-4.0.0}/MANIFEST.in +2 -0
- patchman-4.0.0/PKG-INFO +232 -0
- patchman-4.0.0/README.md +178 -0
- patchman-4.0.0/VERSION.txt +1 -0
- {patchman-3.0.19 → patchman-4.0.0}/arch/admin.py +2 -1
- {patchman-3.0.19 → patchman-4.0.0}/arch/serializers.py +1 -1
- patchman-4.0.0/arch/tests/test_api.py +121 -0
- patchman-4.0.0/arch/tests/test_models.py +83 -0
- patchman-4.0.0/arch/utils.py +52 -0
- {patchman-3.0.19 → patchman-4.0.0}/arch/views.py +4 -3
- {patchman-3.0.19 → patchman-4.0.0}/domains/admin.py +1 -0
- patchman-4.0.0/domains/tests/test_api.py +83 -0
- patchman-4.0.0/domains/tests/test_models.py +52 -0
- patchman-4.0.0/errata/admin.py +26 -0
- patchman-4.0.0/errata/apps.py +21 -0
- patchman-4.0.0/errata/managers.py +22 -0
- patchman-4.0.0/errata/migrations/0001_initial.py +43 -0
- patchman-4.0.0/errata/migrations/0002_alter_erratumreference_unique_together.py +17 -0
- patchman-4.0.0/errata/migrations/0003_delete_erratumreference_alter_erratum_references.py +26 -0
- patchman-4.0.0/errata/migrations/0004_rename_packages_erratum_fixed_packages.py +18 -0
- patchman-4.0.0/errata/migrations/0005_erratum_affected_packages_and_more.py +24 -0
- patchman-4.0.0/errata/migrations/0006_alter_erratum_options.py +17 -0
- patchman-4.0.0/errata/migrations/0007_alter_erratum_fixed_packages.py +19 -0
- patchman-4.0.0/errata/models.py +165 -0
- patchman-4.0.0/errata/serializers.py +25 -0
- patchman-4.0.0/errata/sources/distros/alma.py +165 -0
- patchman-4.0.0/errata/sources/distros/arch.py +219 -0
- patchman-4.0.0/errata/sources/distros/centos.py +163 -0
- patchman-4.0.0/errata/sources/distros/debian.py +355 -0
- patchman-4.0.0/errata/sources/distros/rocky.py +257 -0
- patchman-4.0.0/errata/sources/distros/ubuntu.py +245 -0
- patchman-4.0.0/errata/sources/repos/yum.py +232 -0
- patchman-4.0.0/errata/tables.py +111 -0
- patchman-4.0.0/errata/tasks.py +94 -0
- patchman-4.0.0/errata/templates/errata/erratum_detail.html +82 -0
- patchman-4.0.0/errata/templates/errata/erratum_list.html +7 -0
- {patchman-3.0.19/patchman → patchman-4.0.0/errata/tests}/__init__.py +1 -3
- patchman-4.0.0/errata/tests/test_api.py +166 -0
- patchman-4.0.0/errata/tests/test_integration.py +74 -0
- patchman-4.0.0/errata/tests/test_models.py +122 -0
- {patchman-3.0.19/packages → patchman-4.0.0/errata}/urls.py +5 -6
- patchman-4.0.0/errata/utils.py +102 -0
- patchman-4.0.0/errata/views.py +94 -0
- {patchman-3.0.19 → patchman-4.0.0}/etc/patchman/apache.conf.example +1 -1
- patchman-4.0.0/etc/patchman/celery.conf +5 -0
- patchman-4.0.0/etc/patchman/local_settings.py +115 -0
- patchman-4.0.0/etc/systemd/system/patchman-celery-beat.service +21 -0
- patchman-4.0.0/etc/systemd/system/patchman-celery-worker.service +25 -0
- {patchman-3.0.19 → patchman-4.0.0}/hosts/admin.py +1 -0
- {patchman-3.0.19 → patchman-4.0.0}/hosts/forms.py +1 -1
- {patchman-3.0.19 → patchman-4.0.0}/hosts/migrations/0001_initial.py +23 -15
- patchman-4.0.0/hosts/migrations/0004_remove_host_tags_host_tags.py +45 -0
- patchman-4.0.0/hosts/migrations/0005_rename_os_host_osvariant.py +18 -0
- patchman-4.0.0/hosts/migrations/0006_migrate_to_tz_aware.py +22 -0
- patchman-4.0.0/hosts/migrations/0007_alter_host_tags.py +20 -0
- patchman-4.0.0/hosts/migrations/0008_alter_host_options.py +17 -0
- patchman-4.0.0/hosts/migrations/0009_host_errata.py +19 -0
- {patchman-3.0.19 → patchman-4.0.0}/hosts/models.py +96 -94
- {patchman-3.0.19 → patchman-4.0.0}/hosts/serializers.py +3 -1
- patchman-4.0.0/hosts/tables.py +120 -0
- patchman-4.0.0/hosts/tasks.py +80 -0
- {patchman-3.0.19 → patchman-4.0.0}/hosts/templates/hosts/host_delete.html +13 -14
- {patchman-3.0.19 → patchman-4.0.0}/hosts/templates/hosts/host_detail.html +65 -52
- patchman-4.0.0/hosts/templates/hosts/host_list.html +37 -0
- {patchman-3.0.19 → patchman-4.0.0}/hosts/templatetags/report_alert.py +12 -15
- patchman-4.0.0/hosts/tests/test_api.py +383 -0
- patchman-4.0.0/hosts/tests/test_find_updates.py +364 -0
- patchman-4.0.0/hosts/tests/test_managers.py +205 -0
- patchman-4.0.0/hosts/tests/test_models.py +130 -0
- {patchman-3.0.19 → patchman-4.0.0}/hosts/urls.py +2 -0
- patchman-4.0.0/hosts/utils.py +90 -0
- patchman-4.0.0/hosts/views.py +296 -0
- {patchman-3.0.19 → patchman-4.0.0}/modules/admin.py +1 -0
- patchman-4.0.0/modules/migrations/0004_alter_module_options.py +17 -0
- patchman-4.0.0/modules/migrations/0005_alter_module_unique_together.py +19 -0
- {patchman-3.0.19 → patchman-4.0.0}/modules/models.py +2 -2
- patchman-4.0.0/modules/tables.py +72 -0
- {patchman-3.0.19 → patchman-4.0.0}/modules/utils.py +31 -22
- {patchman-3.0.19 → patchman-4.0.0}/modules/views.py +9 -16
- {patchman-3.0.19 → patchman-4.0.0}/operatingsystems/admin.py +5 -4
- patchman-4.0.0/operatingsystems/fixtures/os.json +66 -0
- patchman-4.0.0/operatingsystems/fixtures/osgroup.json +58 -0
- {patchman-3.0.19 → patchman-4.0.0}/operatingsystems/forms.py +12 -12
- patchman-4.0.0/operatingsystems/managers.py +22 -0
- patchman-4.0.0/operatingsystems/migrations/0003_osgroup_codename.py +18 -0
- patchman-4.0.0/operatingsystems/migrations/0004_alter_osgroup_unique_together.py +17 -0
- patchman-4.0.0/operatingsystems/migrations/0005_rename_osgroup_osrelease_rename_os_osvariant_and_more.py +36 -0
- patchman-4.0.0/operatingsystems/migrations/0006_osrelease_cpe_name_osvariant_codename.py +23 -0
- patchman-4.0.0/operatingsystems/migrations/0007_alter_osrelease_unique_together.py +17 -0
- patchman-4.0.0/operatingsystems/migrations/0008_alter_osrelease_options_alter_osvariant_options.py +21 -0
- patchman-4.0.0/operatingsystems/models.py +71 -0
- {patchman-3.0.19 → patchman-4.0.0}/operatingsystems/serializers.py +7 -7
- patchman-4.0.0/operatingsystems/tables.py +168 -0
- patchman-4.0.0/operatingsystems/templates/operatingsystems/os_landing.html +18 -0
- patchman-4.0.0/operatingsystems/templates/operatingsystems/osrelease_delete.html +47 -0
- patchman-4.0.0/operatingsystems/templates/operatingsystems/osrelease_detail.html +72 -0
- patchman-4.0.0/operatingsystems/templates/operatingsystems/osrelease_list.html +26 -0
- patchman-4.0.0/operatingsystems/templates/operatingsystems/osvariant_delete.html +45 -0
- patchman-4.0.0/operatingsystems/templates/operatingsystems/osvariant_delete_multiple.html +56 -0
- patchman-4.0.0/operatingsystems/templates/operatingsystems/osvariant_detail.html +65 -0
- patchman-4.0.0/operatingsystems/templates/operatingsystems/osvariant_list.html +32 -0
- patchman-4.0.0/operatingsystems/tests/__init__.py +15 -0
- patchman-4.0.0/operatingsystems/tests/test_api.py +232 -0
- patchman-4.0.0/operatingsystems/tests/test_models.py +102 -0
- patchman-4.0.0/operatingsystems/urls.py +35 -0
- patchman-4.0.0/operatingsystems/utils.py +79 -0
- patchman-4.0.0/operatingsystems/views.py +361 -0
- patchman-4.0.0/packages/__init__.py +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/packages/admin.py +10 -8
- patchman-4.0.0/packages/migrations/0002_auto_20250207_1319.py +36 -0
- patchman-4.0.0/packages/migrations/0002_delete_erratum_delete_erratumreference.py +19 -0
- patchman-4.0.0/packages/migrations/0003_auto_20250207_1746.py +18 -0
- patchman-4.0.0/packages/migrations/0004_alter_package_options_alter_packagecategory_options_and_more.py +25 -0
- patchman-4.0.0/packages/migrations/0005_alter_package_packagetype.py +18 -0
- patchman-4.0.0/packages/migrations/__init__.py +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/packages/models.py +58 -66
- {patchman-3.0.19 → patchman-4.0.0}/packages/serializers.py +1 -15
- patchman-4.0.0/packages/tables.py +120 -0
- patchman-4.0.0/packages/templates/packages/package_detail.html +36 -0
- patchman-3.0.19/packages/templates/packages/package_detail.html → patchman-4.0.0/packages/templates/packages/package_name_detail.html +7 -2
- patchman-4.0.0/packages/templates/packages/package_name_list.html +7 -0
- patchman-4.0.0/packages/tests/__init__.py +0 -0
- patchman-4.0.0/packages/tests/test_api.py +304 -0
- patchman-4.0.0/packages/tests/test_models.py +202 -0
- patchman-4.0.0/packages/tests/test_version_compare.py +316 -0
- patchman-4.0.0/packages/urls.py +30 -0
- patchman-4.0.0/packages/utils.py +344 -0
- patchman-4.0.0/packages/views.py +206 -0
- patchman-4.0.0/patchman/__init__.py +22 -0
- {patchman-3.0.19 → patchman-4.0.0}/patchman/celery.py +3 -6
- {patchman-3.0.19 → patchman-4.0.0}/patchman/receivers.py +33 -27
- {patchman-3.0.19 → patchman-4.0.0}/patchman/settings.py +27 -11
- {patchman-3.0.19 → patchman-4.0.0}/patchman/signals.py +6 -6
- patchman-4.0.0/patchman/sqlite3/base.py +25 -0
- patchman-4.0.0/patchman/static/css/base.css +64 -0
- patchman-4.0.0/patchman/static/js/expandable-text.js +8 -0
- patchman-4.0.0/patchman/static/js/sidebar.js +52 -0
- {patchman-3.0.19 → patchman-4.0.0}/patchman/urls.py +15 -7
- {patchman-3.0.19 → patchman-4.0.0}/patchman/wsgi.py +1 -2
- patchman-4.0.0/patchman.egg-info/PKG-INFO +232 -0
- patchman-4.0.0/patchman.egg-info/SOURCES.txt +332 -0
- patchman-4.0.0/patchman.egg-info/requires.txt +25 -0
- {patchman-3.0.19 → patchman-4.0.0}/patchman.egg-info/top_level.txt +2 -0
- patchman-4.0.0/reports/__init__.py +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/reports/admin.py +1 -0
- patchman-4.0.0/reports/migrations/0003_remove_report_accessed.py +17 -0
- patchman-4.0.0/reports/migrations/0004_migrate_to_tz_aware.py +19 -0
- patchman-4.0.0/reports/migrations/0005_alter_report_options.py +17 -0
- patchman-4.0.0/reports/migrations/__init__.py +0 -0
- patchman-4.0.0/reports/models.py +238 -0
- patchman-4.0.0/reports/serializers.py +103 -0
- patchman-4.0.0/reports/tables.py +114 -0
- patchman-4.0.0/reports/tasks.py +87 -0
- patchman-4.0.0/reports/templates/reports/report_detail.html +146 -0
- patchman-4.0.0/reports/templates/reports/report_list.html +37 -0
- patchman-4.0.0/reports/tests/__init__.py +0 -0
- patchman-4.0.0/reports/tests/test_api.py +325 -0
- patchman-4.0.0/reports/tests/test_edge_cases.py +302 -0
- patchman-4.0.0/reports/tests/test_integration.py +274 -0
- patchman-4.0.0/reports/tests/test_models.py +476 -0
- patchman-4.0.0/reports/tests/test_parsing.py +180 -0
- patchman-4.0.0/reports/tests/test_serializers.py +290 -0
- patchman-4.0.0/reports/tests/test_tasks.py +271 -0
- patchman-4.0.0/reports/tests/test_utils.py +539 -0
- {patchman-3.0.19 → patchman-4.0.0}/reports/urls.py +2 -1
- patchman-4.0.0/reports/utils.py +653 -0
- patchman-4.0.0/reports/views.py +369 -0
- patchman-4.0.0/repos/__init__.py +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/repos/admin.py +2 -1
- {patchman-3.0.19 → patchman-4.0.0}/repos/forms.py +26 -20
- patchman-4.0.0/repos/migrations/0002_alter_repository_repotype.py +18 -0
- patchman-4.0.0/repos/migrations/0003_migrate_to_tz_aware.py +19 -0
- patchman-4.0.0/repos/migrations/0004_rename_file_checksum_mirror_package_checksum.py +18 -0
- patchman-4.0.0/repos/migrations/0005_rename_package_checksum_mirror_packages_checksum.py +18 -0
- patchman-4.0.0/repos/migrations/0006_mirror_errata_checksum_mirror_modules_checksum.py +23 -0
- patchman-4.0.0/repos/migrations/__init__.py +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/repos/models.py +56 -38
- patchman-4.0.0/repos/repo_types/__init__.py +0 -0
- patchman-4.0.0/repos/repo_types/arch.py +119 -0
- patchman-4.0.0/repos/repo_types/deb.py +118 -0
- patchman-4.0.0/repos/repo_types/gentoo.py +307 -0
- patchman-4.0.0/repos/repo_types/rpm.py +104 -0
- patchman-4.0.0/repos/repo_types/yast.py +70 -0
- patchman-4.0.0/repos/repo_types/yum.py +256 -0
- {patchman-3.0.19 → patchman-4.0.0}/repos/serializers.py +4 -6
- patchman-4.0.0/repos/tables.py +165 -0
- patchman-4.0.0/repos/tasks.py +58 -0
- {patchman-3.0.19 → patchman-4.0.0}/repos/templates/repos/mirror_delete.html +2 -2
- {patchman-3.0.19 → patchman-4.0.0}/repos/templates/repos/mirror_detail.html +2 -2
- patchman-4.0.0/repos/templates/repos/mirror_list.html +26 -0
- {patchman-3.0.19 → patchman-4.0.0}/repos/templates/repos/mirror_with_repo_list.html +2 -2
- {patchman-3.0.19 → patchman-4.0.0}/repos/templates/repos/repo_delete.html +2 -2
- {patchman-3.0.19 → patchman-4.0.0}/repos/templates/repos/repo_detail.html +8 -6
- {patchman-3.0.19 → patchman-4.0.0}/repos/templates/repos/repo_edit.html +0 -4
- patchman-4.0.0/repos/templates/repos/repo_list.html +37 -0
- patchman-4.0.0/repos/templatetags/__init__.py +0 -0
- patchman-4.0.0/repos/tests/__init__.py +0 -0
- patchman-4.0.0/repos/tests/test_api.py +295 -0
- patchman-4.0.0/repos/tests/test_managers.py +170 -0
- patchman-4.0.0/repos/tests/test_mirror_sync.py +141 -0
- patchman-4.0.0/repos/tests/test_models.py +193 -0
- {patchman-3.0.19 → patchman-4.0.0}/repos/urls.py +8 -5
- patchman-4.0.0/repos/utils.py +330 -0
- patchman-4.0.0/repos/views.py +612 -0
- patchman-4.0.0/requirements.txt +25 -0
- {patchman-3.0.19 → patchman-4.0.0}/sbin/patchman +117 -265
- {patchman-3.0.19 → patchman-4.0.0}/sbin/patchman-manage +14 -16
- patchman-4.0.0/scripts/rpm-post-install.sh +60 -0
- patchman-4.0.0/security/__init__.py +0 -0
- patchman-4.0.0/security/admin.py +24 -0
- patchman-4.0.0/security/apps.py +21 -0
- patchman-4.0.0/security/managers.py +22 -0
- patchman-4.0.0/security/migrations/0001_initial.py +48 -0
- patchman-4.0.0/security/migrations/0002_alter_cve_options.py +17 -0
- patchman-4.0.0/security/migrations/0003_alter_cve_description_alter_cwe_description.py +23 -0
- patchman-4.0.0/security/migrations/0004_alter_cve_options.py +17 -0
- patchman-4.0.0/security/migrations/0005_reference_cve_references.py +29 -0
- patchman-4.0.0/security/migrations/0006_alter_cve_options_alter_cvss_unique_together.py +21 -0
- patchman-4.0.0/security/migrations/0007_remove_cve_title.py +17 -0
- patchman-4.0.0/security/migrations/__init__.py +0 -0
- patchman-4.0.0/security/models.py +267 -0
- patchman-4.0.0/security/serializers.py +38 -0
- patchman-4.0.0/security/tables.py +177 -0
- patchman-4.0.0/security/tasks.py +95 -0
- patchman-4.0.0/security/templates/security/cve_detail.html +103 -0
- patchman-4.0.0/security/templates/security/cve_list.html +7 -0
- patchman-4.0.0/security/templates/security/cwe_detail.html +22 -0
- patchman-4.0.0/security/templates/security/cwe_list.html +7 -0
- patchman-4.0.0/security/templates/security/reference_list.html +7 -0
- patchman-4.0.0/security/templates/security/security_landing.html +20 -0
- patchman-4.0.0/security/tests/__init__.py +0 -0
- patchman-4.0.0/security/tests/test_api.py +216 -0
- patchman-4.0.0/security/tests/test_models.py +180 -0
- patchman-4.0.0/security/urls.py +30 -0
- patchman-4.0.0/security/utils.py +166 -0
- patchman-4.0.0/security/views.py +176 -0
- {patchman-3.0.19 → patchman-4.0.0}/setup.cfg +13 -4
- {patchman-3.0.19 → patchman-4.0.0}/setup.py +11 -3
- patchman-4.0.0/util/__init__.py +299 -0
- patchman-4.0.0/util/context_processors.py +106 -0
- {patchman-3.0.19 → patchman-4.0.0}/util/filterspecs.py +15 -19
- patchman-4.0.0/util/logging.py +87 -0
- patchman-4.0.0/util/management/__init__.py +0 -0
- patchman-4.0.0/util/management/commands/__init__.py +0 -0
- patchman-4.0.0/util/management/commands/create_api_key.py +43 -0
- patchman-4.0.0/util/management/commands/list_api_keys.py +52 -0
- patchman-4.0.0/util/management/commands/revoke_api_key.py +63 -0
- patchman-4.0.0/util/tables.py +26 -0
- patchman-4.0.0/util/tasks.py +39 -0
- patchman-4.0.0/util/templates/base.html +40 -0
- patchman-4.0.0/util/templates/bulk_actions.html +90 -0
- {patchman-3.0.19 → patchman-4.0.0}/util/templates/dashboard.html +33 -31
- patchman-4.0.0/util/templates/navbar.html +50 -0
- patchman-4.0.0/util/templates/objectlist.html +28 -0
- {patchman-3.0.19 → patchman-4.0.0}/util/templates/searchbar.html +3 -0
- patchman-4.0.0/util/templates/table.html +118 -0
- patchman-4.0.0/util/templatetags/__init__.py +0 -0
- patchman-4.0.0/util/templatetags/common.py +144 -0
- patchman-4.0.0/util/tests/__init__.py +0 -0
- patchman-4.0.0/util/tests/test_commands.py +176 -0
- patchman-4.0.0/util/tests/test_utils.py +261 -0
- {patchman-3.0.19 → patchman-4.0.0}/util/urls.py +1 -1
- {patchman-3.0.19 → patchman-4.0.0}/util/views.py +36 -30
- patchman-3.0.19/INSTALL.md +0 -396
- patchman-3.0.19/PKG-INFO +0 -250
- patchman-3.0.19/README.md +0 -204
- patchman-3.0.19/VERSION.txt +0 -1
- patchman-3.0.19/etc/patchman/local_settings.py +0 -49
- patchman-3.0.19/hosts/templates/hosts/host_list.html +0 -7
- patchman-3.0.19/hosts/templates/hosts/host_table.html +0 -26
- patchman-3.0.19/hosts/utils.py +0 -62
- patchman-3.0.19/hosts/views.py +0 -194
- patchman-3.0.19/modules/templates/modules/module_table.html +0 -27
- patchman-3.0.19/operatingsystems/models.py +0 -58
- patchman-3.0.19/operatingsystems/templates/operatingsystems/operatingsystem_table.html +0 -21
- patchman-3.0.19/operatingsystems/templates/operatingsystems/operatingsystemgroup_table.html +0 -17
- patchman-3.0.19/operatingsystems/templates/operatingsystems/os_delete.html +0 -77
- patchman-3.0.19/operatingsystems/templates/operatingsystems/os_detail.html +0 -63
- patchman-3.0.19/operatingsystems/templates/operatingsystems/os_list.html +0 -19
- patchman-3.0.19/operatingsystems/templates/operatingsystems/osgroup_delete.html +0 -46
- patchman-3.0.19/operatingsystems/templates/operatingsystems/osgroup_detail.html +0 -72
- patchman-3.0.19/operatingsystems/templates/operatingsystems/osgroup_list.html +0 -7
- patchman-3.0.19/operatingsystems/urls.py +0 -31
- patchman-3.0.19/operatingsystems/views.py +0 -218
- patchman-3.0.19/packages/templates/packages/package_table.html +0 -17
- patchman-3.0.19/packages/utils.py +0 -390
- patchman-3.0.19/packages/views.py +0 -143
- patchman-3.0.19/patchman/static/css/base.css +0 -13
- patchman-3.0.19/patchman/static/img/icon-alert.gif +0 -0
- patchman-3.0.19/patchman/static/img/icon-no.gif +0 -0
- patchman-3.0.19/patchman/static/img/icon-yes.gif +0 -0
- patchman-3.0.19/patchman/static/js/ajax-jquery.js +0 -29
- patchman-3.0.19/patchman/static/js/button-post.js +0 -23
- patchman-3.0.19/patchman.egg-info/PKG-INFO +0 -250
- patchman-3.0.19/patchman.egg-info/SOURCES.txt +0 -180
- patchman-3.0.19/patchman.egg-info/requires.txt +0 -18
- patchman-3.0.19/reports/models.py +0 -196
- patchman-3.0.19/reports/tasks.py +0 -29
- patchman-3.0.19/reports/templates/reports/report_detail.html +0 -118
- patchman-3.0.19/reports/templates/reports/report_list.html +0 -7
- patchman-3.0.19/reports/templates/reports/report_table.html +0 -23
- patchman-3.0.19/reports/utils.py +0 -411
- patchman-3.0.19/reports/views.py +0 -153
- patchman-3.0.19/repos/templates/repos/mirror_edit_repo.html +0 -33
- patchman-3.0.19/repos/templates/repos/mirror_list.html +0 -7
- patchman-3.0.19/repos/templates/repos/mirror_table.html +0 -35
- patchman-3.0.19/repos/templates/repos/repo_list.html +0 -7
- patchman-3.0.19/repos/templates/repos/repository_table.html +0 -25
- patchman-3.0.19/repos/templatetags/repo_buttons.py +0 -54
- patchman-3.0.19/repos/utils.py +0 -758
- patchman-3.0.19/repos/views.py +0 -404
- patchman-3.0.19/requirements.txt +0 -18
- patchman-3.0.19/scripts/rpm-post-install.sh +0 -32
- patchman-3.0.19/util/__init__.py +0 -241
- patchman-3.0.19/util/templates/base.html +0 -37
- patchman-3.0.19/util/templates/navbar.html +0 -38
- patchman-3.0.19/util/templates/objectlist.html +0 -37
- patchman-3.0.19/util/templatetags/common.py +0 -109
- {patchman-3.0.19 → patchman-4.0.0}/AUTHORS +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/COPYING +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/arch/__init__.py +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/arch/apps.py +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/arch/migrations/0001_initial.py +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/arch/migrations/__init__.py +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/arch/models.py +0 -0
- {patchman-3.0.19/domains → patchman-4.0.0/arch/tests}/__init__.py +0 -0
- {patchman-3.0.19/domains/migrations → patchman-4.0.0/domains}/__init__.py +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/domains/apps.py +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/domains/migrations/0001_initial.py +0 -0
- {patchman-3.0.19/hosts → patchman-4.0.0/domains/migrations}/__init__.py +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/domains/models.py +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/domains/serializers.py +0 -0
- {patchman-3.0.19/hosts/migrations → patchman-4.0.0/domains/tests}/__init__.py +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/domains/views.py +0 -0
- {patchman-3.0.19/hosts/templatetags → patchman-4.0.0/errata}/__init__.py +0 -0
- {patchman-3.0.19/modules → patchman-4.0.0/errata/migrations}/__init__.py +0 -0
- {patchman-3.0.19/modules/migrations → patchman-4.0.0/errata/sources}/__init__.py +0 -0
- {patchman-3.0.19/operatingsystems → patchman-4.0.0/errata/sources/distros}/__init__.py +0 -0
- {patchman-3.0.19/operatingsystems/migrations → patchman-4.0.0/errata/sources/repos}/__init__.py +0 -0
- {patchman-3.0.19/packages → patchman-4.0.0/hosts}/__init__.py +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/hosts/apps.py +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/hosts/managers.py +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/hosts/migrations/0002_initial.py +1 -1
- {patchman-3.0.19 → patchman-4.0.0}/hosts/migrations/0003_host_modules.py +0 -0
- {patchman-3.0.19/packages → patchman-4.0.0/hosts}/migrations/__init__.py +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/hosts/templates/hosts/host_edit.html +0 -0
- {patchman-3.0.19/reports → patchman-4.0.0/hosts/templatetags}/__init__.py +0 -0
- {patchman-3.0.19/reports/migrations → patchman-4.0.0/hosts/tests}/__init__.py +0 -0
- {patchman-3.0.19/repos → patchman-4.0.0/modules}/__init__.py +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/modules/apps.py +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/modules/managers.py +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/modules/migrations/0001_initial.py +1 -1
- {patchman-3.0.19 → patchman-4.0.0}/modules/migrations/0002_auto_20240204_2214.py +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/modules/migrations/0003_alter_module_options.py +0 -0
- {patchman-3.0.19/repos → patchman-4.0.0/modules}/migrations/__init__.py +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/modules/serializers.py +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/modules/templates/modules/module_detail.html +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/modules/templates/modules/module_list.html +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/modules/urls.py +0 -0
- {patchman-3.0.19/repos/templatetags → patchman-4.0.0/operatingsystems}/__init__.py +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/operatingsystems/apps.py +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/operatingsystems/migrations/0001_initial.py +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/operatingsystems/migrations/0002_initial.py +1 -1
- {patchman-3.0.19 → patchman-4.0.0}/operatingsystems/migrations/0003_os_arch.py +1 -1
- {patchman-3.0.19/util/templatetags → patchman-4.0.0/operatingsystems/migrations}/__init__.py +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/packages/apps.py +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/packages/managers.py +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/packages/migrations/0001_initial.py +1 -1
- {patchman-3.0.19 → patchman-4.0.0}/packages/templates/packages/package_list.html +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/patchman.egg-info/dependency_links.txt +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/reports/apps.py +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/reports/migrations/0001_initial.py +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/reports/migrations/0002_report_modules.py +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/reports/templates/reports/report.txt +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/reports/templates/reports/report_delete.html +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/repos/apps.py +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/repos/managers.py +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/repos/migrations/0001_initial.py +1 -1
- {patchman-3.0.19 → patchman-4.0.0}/repos/templates/repos/mirror_edit.html +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/sbin/patchman-set-secret-key +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/scripts/clear-django-logs.py +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/scripts/create_graph.sh +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/scripts/rpm-install.sh +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/util/apps.py +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/util/templates/404.html +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/util/templates/500.html +0 -0
- {patchman-3.0.19 → patchman-4.0.0}/util/templates/registration/login.html +0 -0
|
@@ -0,0 +1,536 @@
|
|
|
1
|
+
# Installation
|
|
2
|
+
|
|
3
|
+
The default installation uses sqlite3 for the django database. To configure
|
|
4
|
+
mysql or postgresql instead, see the database configuration section.
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
## Supported Server Installation Options
|
|
8
|
+
- [Ubuntu 24.04](#ubuntu-2404-noble)
|
|
9
|
+
- [Debian 13](#debian-13-trixie)
|
|
10
|
+
- [Rocky 10](#rocky-10)
|
|
11
|
+
- [virtualenv + pip](#virtualenv--pip)
|
|
12
|
+
- [Source](#source)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Ubuntu 24.04 (noble)
|
|
16
|
+
|
|
17
|
+
```shell
|
|
18
|
+
curl -sS https://repo.openbytes.ie/openbytes.gpg > /usr/share/keyrings/openbytes.gpg
|
|
19
|
+
echo "deb [signed-by=/usr/share/keyrings/openbytes.gpg] https://repo.openbytes.ie/patchman/ubuntu noble-backports main" > /etc/apt/sources.list.d/patchman.list
|
|
20
|
+
apt update
|
|
21
|
+
apt -y install python3-patchman patchman-client
|
|
22
|
+
patchman-manage createsuperuser
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Debian 13 (trixie)
|
|
26
|
+
|
|
27
|
+
```shell
|
|
28
|
+
curl -sS https://repo.openbytes.ie/openbytes.gpg > /usr/share/keyrings/openbytes.gpg
|
|
29
|
+
echo "deb [signed-by=/usr/share/keyrings/openbytes.gpg] https://repo.openbytes.ie/patchman/debian trixie main" > /etc/apt/sources.list.d/patchman.list
|
|
30
|
+
apt update
|
|
31
|
+
apt -y install python3-patchman patchman-client
|
|
32
|
+
patchman-manage createsuperuser
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Rocky 10
|
|
36
|
+
|
|
37
|
+
Currently broken due to missing upstream packages: https://github.com/furlongm/patchman/issues/669
|
|
38
|
+
|
|
39
|
+
This also applies to Alma, RHEL, etc.
|
|
40
|
+
|
|
41
|
+
```shell
|
|
42
|
+
curl -sS https://repo.openbytes.ie/openbytes-2.gpg > /etc/pki/rpm-gpg/RPM-GPG-KEY-openbytes
|
|
43
|
+
cat <<EOF >> /etc/yum.repos.d/openbytes.repo
|
|
44
|
+
[openbytes]
|
|
45
|
+
name=openbytes
|
|
46
|
+
baseurl=https://repo.openbytes.ie/patchman/el10
|
|
47
|
+
enabled=1
|
|
48
|
+
gpgcheck=1
|
|
49
|
+
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-openbytes
|
|
50
|
+
EOF
|
|
51
|
+
dnf -y install epel-release
|
|
52
|
+
dnf makecache
|
|
53
|
+
dnf -y install patchman patchman-client
|
|
54
|
+
systemctl restart httpd
|
|
55
|
+
patchman-manage createsuperuser
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### virtualenv + pip
|
|
59
|
+
|
|
60
|
+
TBD - not working yet
|
|
61
|
+
|
|
62
|
+
```shell
|
|
63
|
+
apt -y install gcc libxml2-dev libxslt1-dev virtualenv python3-dev zlib1g-dev # (debian/ubuntu)
|
|
64
|
+
dnf -y install gcc libxml2-devel libxslt-devel python3-virtualenv # (rocky/alma/redhat)
|
|
65
|
+
mkdir /srv/patchman
|
|
66
|
+
cd /srv/patchman
|
|
67
|
+
python3 -m venv .venv
|
|
68
|
+
. .venv/bin/activate
|
|
69
|
+
pip install --upgrade pip
|
|
70
|
+
pip install patchman gunicorn whitenoise==3.3.1
|
|
71
|
+
patchman-manage migrate
|
|
72
|
+
patchman-manage createsuperuser
|
|
73
|
+
gunicorn patchman.wsgi -b 0.0.0.0:80
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Source
|
|
77
|
+
|
|
78
|
+
#### Ubuntu 24.04 (noble)
|
|
79
|
+
|
|
80
|
+
1. Install dependencies
|
|
81
|
+
|
|
82
|
+
```shell
|
|
83
|
+
apt -y install python3-django python3-django-tagging python3-django-extensions \
|
|
84
|
+
python3-djangorestframework python3-defusedxml python3-lxml python3-requests \
|
|
85
|
+
python3-rpm python3-debian python3-colorama python3-humanize python3-magic \
|
|
86
|
+
apache2 libapache2-mod-wsgi-py3 python3-pip python3-progressbar
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
2. Install django-bootstrap3
|
|
90
|
+
|
|
91
|
+
```shell
|
|
92
|
+
pip3 install django-bootstrap3
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
3. Clone git repo to e.g. /srv/patchman
|
|
96
|
+
|
|
97
|
+
```shell
|
|
98
|
+
cd /srv
|
|
99
|
+
git clone https://github.com/furlongm/patchman
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
4. Copy server settings example file to /etc/patchman
|
|
103
|
+
|
|
104
|
+
```shell
|
|
105
|
+
mkdir /etc/patchman
|
|
106
|
+
cp /srv/patchman/etc/patchman/local_settings.py /etc/patchman/
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
# Configuration
|
|
110
|
+
|
|
111
|
+
## Patchman Server Settings
|
|
112
|
+
|
|
113
|
+
Modify `/etc/patchman/local_settings.py` to configure the patchman server.
|
|
114
|
+
|
|
115
|
+
If installing from source or using virtualenv, the following settings should
|
|
116
|
+
be configured:
|
|
117
|
+
|
|
118
|
+
* ADMINS - set up an admin email address
|
|
119
|
+
* SECRET_KEY - create a random secret key
|
|
120
|
+
* STATIC_ROOT - should point to `/srv/patchman/run/static` if installing from
|
|
121
|
+
source
|
|
122
|
+
|
|
123
|
+
The default settings for errata downloading may include operating systems that
|
|
124
|
+
are not relevant to a given deployment. If this is the case, modify the
|
|
125
|
+
`ERRATA_OS_UPDATES` setting in `/etc/patchman/local_settings.py`. Further
|
|
126
|
+
distribution-specific settings are also available to only download errata
|
|
127
|
+
for specific versions/codenames.
|
|
128
|
+
|
|
129
|
+
## Patchman Client Settings
|
|
130
|
+
|
|
131
|
+
The client comes with a default configuration that will attempt to upload the
|
|
132
|
+
reports to a server at *patchman.example.com*. This configuration needs to be
|
|
133
|
+
updated to connect to the correct patchman server.
|
|
134
|
+
|
|
135
|
+
Change the following lines in `/etc/patchman/patchman-client.conf`:
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
# Patchman server
|
|
139
|
+
server=https://patchman.example.com
|
|
140
|
+
|
|
141
|
+
# Options to curl
|
|
142
|
+
curl_options="--insecure --connect-timeout 60 --max-time 300"
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
* *server* needs to point the URL where the patchman server is running
|
|
146
|
+
* *--insecure* in the curl options tells the client to ignore certificates.
|
|
147
|
+
If the patchman server is set up correctly with certificates this flag can
|
|
148
|
+
be removed to increase security.
|
|
149
|
+
|
|
150
|
+
Patchman supports two report protocols:
|
|
151
|
+
|
|
152
|
+
### Protocol 1 (text)
|
|
153
|
+
The original text-based protocol. Uses multipart form data to upload package
|
|
154
|
+
and repository information. No additional dependencies required on the client.
|
|
155
|
+
|
|
156
|
+
### Protocol 2 (json)
|
|
157
|
+
A JSON-based REST API. Provides better error handling, structured validation,
|
|
158
|
+
and easier debugging. Requires `jq` on the client.
|
|
159
|
+
|
|
160
|
+
To use Protocol 2, update your `patchman-client.conf`:
|
|
161
|
+
|
|
162
|
+
```shell
|
|
163
|
+
protocol=2
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Or use the `-p 2` command line option:
|
|
167
|
+
|
|
168
|
+
```shell
|
|
169
|
+
$ patchman-client -s http://patchman.example.org -p 2
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
## Configure Database
|
|
174
|
+
|
|
175
|
+
The default database backend is sqlite. However, this is not recommended for
|
|
176
|
+
production deployments. MySQL or PostgreSQL are better choices.
|
|
177
|
+
|
|
178
|
+
### SQLite
|
|
179
|
+
|
|
180
|
+
To configure the sqlite database backend:
|
|
181
|
+
|
|
182
|
+
1. Create the database directory specified in the settings file, touch the
|
|
183
|
+
database file and set the journal mode to WAL:
|
|
184
|
+
|
|
185
|
+
```shell
|
|
186
|
+
mkdir -p /var/lib/patchman/db
|
|
187
|
+
touch /var/lib/patchman/db/patchman.db
|
|
188
|
+
sqlite3 /var/lib/patchman/db/patchman.db 'PRAGMA journal_mode=WAL;'
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
2. Modify `/etc/patchman/local_settings.py` as follows:
|
|
192
|
+
|
|
193
|
+
```
|
|
194
|
+
DATABASES = {
|
|
195
|
+
'default': {
|
|
196
|
+
'ENGINE': 'django.db.backends.sqlite3',
|
|
197
|
+
'NAME': '/var/lib/patchman/db/patchman.db',
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
3. Proceed to syncing database.
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
### MySQL
|
|
206
|
+
|
|
207
|
+
To configure the mysql database backend:
|
|
208
|
+
|
|
209
|
+
1. Ensure mysql-server and the python mysql bindings are installed:
|
|
210
|
+
|
|
211
|
+
```shell
|
|
212
|
+
apt -y install default-mysql-server python3-mysqldb
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
2. Create database and users:
|
|
216
|
+
```
|
|
217
|
+
$ mysql
|
|
218
|
+
|
|
219
|
+
mysql> CREATE DATABASE patchman CHARACTER SET utf8 COLLATE utf8_general_ci;
|
|
220
|
+
Query OK, 1 row affected (0.00 sec)
|
|
221
|
+
|
|
222
|
+
mysql> CREATE USER patchman@localhost IDENTIFIED BY 'changeme';
|
|
223
|
+
Query OK, 0 rows affected (0.00 sec)
|
|
224
|
+
|
|
225
|
+
mysql> GRANT ALL PRIVILEGES ON patchman.* TO patchman@localhost;
|
|
226
|
+
Query OK, 0 rows affected (0.00 sec)
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
3. Modify `/etc/patchman/local_settings.py` as follows:
|
|
230
|
+
|
|
231
|
+
```
|
|
232
|
+
DATABASES = {
|
|
233
|
+
'default': {
|
|
234
|
+
'ENGINE': 'django.db.backends.mysql',
|
|
235
|
+
'NAME': 'patchman',
|
|
236
|
+
'USER': 'patchman',
|
|
237
|
+
'PASSWORD': 'changeme',
|
|
238
|
+
'HOST': '',
|
|
239
|
+
'PORT': '',
|
|
240
|
+
'STORAGE_ENGINE': 'INNODB',
|
|
241
|
+
'CHARSET': 'utf8',
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
4. Proceed to syncing database.
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
### PostgreSQL
|
|
250
|
+
|
|
251
|
+
To configure the postgresql database backend:
|
|
252
|
+
|
|
253
|
+
1. Ensure the postgresql server and the python postgres bindings are installed:
|
|
254
|
+
|
|
255
|
+
```shell
|
|
256
|
+
apt -y install postgresql python3-psycopg2
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
2. Create database and users:
|
|
260
|
+
```
|
|
261
|
+
$ sudo su - postgres
|
|
262
|
+
$ psql
|
|
263
|
+
|
|
264
|
+
postgres=# CREATE DATABASE patchman;
|
|
265
|
+
CREATE DATABASE
|
|
266
|
+
postgres=# CREATE USER patchman WITH PASSWORD 'changeme';
|
|
267
|
+
CREATE ROLE
|
|
268
|
+
postgres=# ALTER ROLE patchman SET client_encoding TO 'utf8';
|
|
269
|
+
ALTER ROLE
|
|
270
|
+
postgres=# ALTER ROLE patchman SET default_transaction_isolation TO 'read committed';
|
|
271
|
+
ALTER ROLE
|
|
272
|
+
postgres=# ALTER ROLE patchman SET timezone TO 'UTC';
|
|
273
|
+
ALTER ROLE
|
|
274
|
+
postgres=# GRANT ALL PRIVILEGES ON DATABASE patchman to patchman;
|
|
275
|
+
GRANT
|
|
276
|
+
postgres=# GRANT ALL ON SCHEMA public TO patchman;
|
|
277
|
+
GRANT
|
|
278
|
+
ALTER DATABASE patchman OWNER TO patchman;
|
|
279
|
+
ALTER DATABASE
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
3. Modify `/etc/patchman/local_settings.py` as follows:
|
|
283
|
+
|
|
284
|
+
```
|
|
285
|
+
DATABASES = {
|
|
286
|
+
'default': {
|
|
287
|
+
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
|
288
|
+
'NAME': 'patchman',
|
|
289
|
+
'USER': 'patchman',
|
|
290
|
+
'PASSWORD': 'changeme',
|
|
291
|
+
'HOST': '127.0.0.1',
|
|
292
|
+
'PORT': '',
|
|
293
|
+
'CHARSET': 'utf8',
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
4. Proceed to syncing database.
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
### Sync Database
|
|
302
|
+
|
|
303
|
+
After configuring a database backend, the django database should be synced:
|
|
304
|
+
|
|
305
|
+
1. Initialise the database, perform migrations, create the admin user and
|
|
306
|
+
collect static files:
|
|
307
|
+
|
|
308
|
+
```shell
|
|
309
|
+
patchman-manage migrate --run-syncdb
|
|
310
|
+
patchman-manage createsuperuser
|
|
311
|
+
patchman-manage collectstatic
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
N.B. To run patchman-manage when installing from source, run `./manage.py`
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
2. Restart the web server after syncing the database.
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
### Migrate from sqlite to another database backend
|
|
321
|
+
|
|
322
|
+
The prebuilt package installations use sqlite as the default database backend,
|
|
323
|
+
but this is not recommended in production. To migrate from sqlite to another
|
|
324
|
+
database backend, use the following procedure:
|
|
325
|
+
|
|
326
|
+
1. Dump the sqlite database to a json file
|
|
327
|
+
|
|
328
|
+
```shell
|
|
329
|
+
patchman-manage dumpdata --exclude packages.Packagestring -e contenttypes -e auth.Permission --natural-foreign --natural-primary --indent 4 > patchman-db.json
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
2. Create the new database and add the new database settings to `/etc/patchman/local_settings.py`
|
|
333
|
+
|
|
334
|
+
3. Sync the new database and load the existing data:
|
|
335
|
+
|
|
336
|
+
```
|
|
337
|
+
patchman-manage migrate --run-syncdb
|
|
338
|
+
patchman-manage loaddata patchman-db.json
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
## Configure Web Server
|
|
342
|
+
|
|
343
|
+
### Apache
|
|
344
|
+
|
|
345
|
+
1. If installing from source, enable mod-wsgi and copy the apache conf file:
|
|
346
|
+
|
|
347
|
+
```shell
|
|
348
|
+
a2enmod wsgi
|
|
349
|
+
cp /srv/patchman/etc/patchman/apache.conf.example /etc/apache2/conf-available/patchman.conf
|
|
350
|
+
a2enconf patchman
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
2. Edit the networks allowed to report to apache and reload apache.
|
|
354
|
+
|
|
355
|
+
```shell
|
|
356
|
+
vi /etc/apache2/conf-available/patchman.conf
|
|
357
|
+
systemctl reload apache2
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
3. If installing from source, allow apache access to the settings and to the sqlite db:
|
|
361
|
+
|
|
362
|
+
```shell
|
|
363
|
+
chown -R :www-data /etc/patchman
|
|
364
|
+
chmod -R g+r /etc/patchman
|
|
365
|
+
chown -R :www-data /var/lib/patchman
|
|
366
|
+
chmod -R g+w /var/lib/patchman/db
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
The django interface should be available at http://127.0.0.1/patchman/
|
|
370
|
+
|
|
371
|
+
## Optional Configuration Items
|
|
372
|
+
|
|
373
|
+
### Cronjobs
|
|
374
|
+
|
|
375
|
+
#### Daily cronjob on patchman server
|
|
376
|
+
|
|
377
|
+
A daily cronjob on the patchman server can be run to process reports, perform
|
|
378
|
+
database maintenance, check for upstream updates, and find updates for clients.
|
|
379
|
+
Alternatively, run celery as outlined below for finer granularity over the
|
|
380
|
+
timing of these tasks and for increased concurrency.
|
|
381
|
+
|
|
382
|
+
```
|
|
383
|
+
patchman -a
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
#### Daily cronjob on client to send reports to patchman server
|
|
387
|
+
|
|
388
|
+
```
|
|
389
|
+
patchman-client
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
### Celery
|
|
393
|
+
|
|
394
|
+
Install Celery for realtime processing of reports from clients and for periodic
|
|
395
|
+
maintenance tasks. The celery configuation file is in `/etc/patchman/celery.conf`
|
|
396
|
+
|
|
397
|
+
#### Ubuntu / Debian
|
|
398
|
+
|
|
399
|
+
```shell
|
|
400
|
+
apt -y install python3-celery redis python3-redis python-celery-common
|
|
401
|
+
/usr/bin/celery --broker redis://127.0.0.1:6379/0 --app patchman worker --loglevel info --beat --scheduler django_celery_beat.schedulers:DatabaseScheduler --task-events --pool threads
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
#### Rocky / Alma / RHEL
|
|
405
|
+
|
|
406
|
+
Currently waiting on https://bugzilla.redhat.com/show_bug.cgi?id=2032543
|
|
407
|
+
|
|
408
|
+
```shell
|
|
409
|
+
dnf -y install python3-celery redis python3-redis
|
|
410
|
+
systemctl restart redis
|
|
411
|
+
semanage port -a -t http_port_t -p tcp 6379
|
|
412
|
+
setsebool -P httpd_can_network_connect 1
|
|
413
|
+
/usr/bin/celery --broker redis://127.0.0.1:6379/0 --app patchman worker --loglevel info --beat --scheduler django_celery_beat.schedulers:DatabaseScheduler --task-events --pool threads
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
#### Persistence
|
|
417
|
+
|
|
418
|
+
There is a systemd unit file for celery to make the service persistent over reboot:
|
|
419
|
+
|
|
420
|
+
`etc/systemd/system/patchman-celery.service`
|
|
421
|
+
|
|
422
|
+
If installing from prebuilt packages, this should be enabled by default.
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
### Caching
|
|
426
|
+
|
|
427
|
+
Memcached or Redis can optionally be run to reduce the load on the server.
|
|
428
|
+
Note that caching may result in the web interface showing results that are
|
|
429
|
+
out of date with the database, so this is disabled by default.
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
#### Redis
|
|
433
|
+
|
|
434
|
+
Install Redis:
|
|
435
|
+
|
|
436
|
+
```shell
|
|
437
|
+
apt -y install redis python3-redis # (debian/ubuntu)
|
|
438
|
+
dnf -y install redis python3-redis # (rocky/alma/redhat)
|
|
439
|
+
systemctl restart redis/redis-server
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
and add the following to `/etc/patchman/local_settings.py`
|
|
443
|
+
|
|
444
|
+
```
|
|
445
|
+
CACHES = {
|
|
446
|
+
'default': {
|
|
447
|
+
'BACKEND': 'django.core.cache.backends.redis.RedisCache',
|
|
448
|
+
'LOCATION': 'redis://127.0.0.1:6379',
|
|
449
|
+
'TIMEOUT': 30,
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
#### Memcacached
|
|
455
|
+
|
|
456
|
+
Install Memcached
|
|
457
|
+
|
|
458
|
+
```shell
|
|
459
|
+
apt -y install memcached python3-pymemcache # (debian/ubuntu)
|
|
460
|
+
dnf -y install memcached python3-pymemcache # (rocky/alma/redhat)
|
|
461
|
+
systemctl restart memcached
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
and add the following to `/etc/patchman/local_settings.py`
|
|
465
|
+
|
|
466
|
+
```
|
|
467
|
+
CACHES = {
|
|
468
|
+
'default': {
|
|
469
|
+
'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache',
|
|
470
|
+
'LOCATION': '127.0.0.1:11211',
|
|
471
|
+
'TIMEOUT': 30,
|
|
472
|
+
'OPTIONS': {
|
|
473
|
+
'ignore_exc': True,
|
|
474
|
+
},
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
## API Key Authentication
|
|
480
|
+
|
|
481
|
+
API key authentication is available. Keys are hashed in the database and
|
|
482
|
+
cannot be retrieved after creation.
|
|
483
|
+
|
|
484
|
+
### Server-side setup
|
|
485
|
+
|
|
486
|
+
1. Create an API key:
|
|
487
|
+
|
|
488
|
+
```shell
|
|
489
|
+
$ patchman-manage create_api_key "clients"
|
|
490
|
+
Created API key: clients
|
|
491
|
+
|
|
492
|
+
Key: abc123...
|
|
493
|
+
|
|
494
|
+
Add this to your patchman-client.conf:
|
|
495
|
+
api_key=abc123...
|
|
496
|
+
|
|
497
|
+
Save this key as it cannot be retrieved later.
|
|
498
|
+
```
|
|
499
|
+
|
|
500
|
+
2. List existing keys:
|
|
501
|
+
|
|
502
|
+
```shell
|
|
503
|
+
$ patchman-manage list_api_keys
|
|
504
|
+
```
|
|
505
|
+
|
|
506
|
+
3. Revoke a key:
|
|
507
|
+
|
|
508
|
+
```shell
|
|
509
|
+
$ patchman-manage revoke_api_key <prefix-or-name>
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
API keys can also be managed via the Django admin interface.
|
|
513
|
+
|
|
514
|
+
### Client-side setup
|
|
515
|
+
|
|
516
|
+
Add the API key to `patchman-client.conf`:
|
|
517
|
+
|
|
518
|
+
```shell
|
|
519
|
+
protocol=2
|
|
520
|
+
api_key=abc123...
|
|
521
|
+
```
|
|
522
|
+
|
|
523
|
+
Or use the `-k` command line option:
|
|
524
|
+
|
|
525
|
+
```shell
|
|
526
|
+
$ patchman-client -s http://patchman.example.org -p 2 -k abc123...
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
# Test Installation
|
|
531
|
+
|
|
532
|
+
To test the installation, run the client locally on the patchman server:
|
|
533
|
+
|
|
534
|
+
```shell
|
|
535
|
+
patchman-client -s http://127.0.0.1/patchman/
|
|
536
|
+
```
|