From 5a5e885a4a1de27bf4207b92f6a0364eafed9ef0 Mon Sep 17 00:00:00 2001 From: Patrick Reichel Date: Wed, 23 Oct 2024 18:14:05 +0200 Subject: [PATCH 1/3] NetBox: Build RPM for version 4.1.5 --- SPECS/netbox.spec | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/SPECS/netbox.spec b/SPECS/netbox.spec index 1368296..1094554 100644 --- a/SPECS/netbox.spec +++ b/SPECS/netbox.spec @@ -1,6 +1,10 @@ -%define __python /opt/rh/rh-python38/root/usr/bin/python +%define __python3 python3.12 +%define __python3_binary /usr/bin/%{__python3} +%define __psql_version 16 +%define __psql_binary /usr/pgsql-%{__psql_version}/bin/psql + Name: netbox -Version: 3.5.4 +Version: 4.1.5 Release: 1 Summary: The premier source of truth powering network automation. @@ -11,7 +15,7 @@ Source: https://github.com/%{name}-community/%{name}/archive/refs/tags/v%{versio Source2: netbox.logrotate Source3: netbox.logfile -Requires: gcc libxml2-devel libxslt-devel libffi-devel libpq5-devel openssl-devel redhat-rpm-config rh-redis6-redis rh-python38 rh-python38-python-pip rh-python38-python-devel +Requires: gcc libxml2-devel libxslt-devel libffi-devel libpq5-devel openssl-devel postgresql%{__psql_version}-server redhat-rpm-config redis pwgen %{__python3} %{__python3}-pip %{__python3}-devel %description NetBox is the source of truth for everything on your network, from physical @@ -106,21 +110,20 @@ cp %{name}-%{version}/contrib/*.timer %{buildroot}%{_unitdir} %post if [ $1 -eq 1 ]; then - systemctl enable --now rh-redis6-redis + systemctl enable --now redis chown -R nobody /opt/netbox/netbox/{media,reports,scripts} - export pgsql_pw=$(pwgen 16 1) + export pgsql_pw=$(pwgen 32 1) export secret=$(pwgen 64 1) - sudo -Hiu postgres /usr/pgsql-13/bin/psql -c 'CREATE DATABASE netbox;' -c "CREATE USER netbox WITH PASSWORD '$pgsql_pw'; ALTER DATABASE netbox OWNER TO netbox;" - sudo -Hiu postgres /usr/pgsql-13/bin/psql netbox -c "GRANT CREATE ON SCHEMA public TO netbox;" + sudo -Hiu postgres %{__psql_binary} -c 'CREATE DATABASE netbox;' -c "CREATE USER netbox WITH PASSWORD '$pgsql_pw'; ALTER DATABASE netbox OWNER TO netbox;" + sudo -Hiu postgres %{__psql_binary} netbox -c "GRANT CREATE ON SCHEMA public TO netbox;" sed -e "s/'PASSWORD': '', # PostgreSQL password/'PASSWORD': '$pgsql_pw', # PostgreSQL password/" \ -e "s/^SECRET_KEY = ''$/SECRET_KEY = '$secret'/" \ -i /opt/netbox/netbox/netbox/configuration.py - source /opt/rh/rh-python38/enable - /opt/netbox/upgrade.sh + PYTHON=%{__python3_binary} /opt/netbox/upgrade.sh chmod -R o-rwx /var/log/netbox chown -R nobody:nobody /var/log/netbox @@ -131,5 +134,8 @@ if [ $1 -eq 1 ]; then fi %changelog +* Wed Oct 23 2024 Patrick Reichel - 4.1.5-1 +- Switch to version 4 + * Wed Sep 20 2023 Ole Ernst - 3.5.4-1 - Initial RPM release From 56fc864fb79c659a4f4a31993c3b5ed239081786 Mon Sep 17 00:00:00 2001 From: Patrick Reichel Date: Wed, 12 Mar 2025 13:52:02 +0100 Subject: [PATCH 2/3] Update to 4.1.11. --- SPECS/netbox.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/SPECS/netbox.spec b/SPECS/netbox.spec index 1094554..9c67516 100644 --- a/SPECS/netbox.spec +++ b/SPECS/netbox.spec @@ -4,7 +4,7 @@ %define __psql_binary /usr/pgsql-%{__psql_version}/bin/psql Name: netbox -Version: 4.1.5 +Version: 4.1.11 Release: 1 Summary: The premier source of truth powering network automation. @@ -134,8 +134,11 @@ if [ $1 -eq 1 ]; then fi %changelog +* Wed Mar 12 2025 Patrick Reichel - 4.1.11-1 +- Switch to version 4.1.11 + * Wed Oct 23 2024 Patrick Reichel - 4.1.5-1 -- Switch to version 4 +- Switch to version 4.1.5 * Wed Sep 20 2023 Ole Ernst - 3.5.4-1 - Initial RPM release From 6f526d93883b2ae46fc14625711ccb9bf1c1e2f3 Mon Sep 17 00:00:00 2001 From: Patrick Reichel Date: Wed, 18 Mar 2026 17:27:46 +0100 Subject: [PATCH 3/3] Allow autologin cookie in NMS Prime