mirror of
https://git.freebsd.org/ports.git
synced 2025-04-28 09:36:41 -04:00
net-mgmt/librenms: Update to 24.12.0
re https://github.com/librenms/librenms/releases/tag/24.12.0 patched to fix URL validation issue - taken from this merge request: https://github.com/librenms/librenms/pull/16900
This commit is contained in:
parent
b2726e1055
commit
2782fc9899
3 changed files with 41 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
|||
PORTNAME= librenms
|
||||
PORTVERSION= 24.11.0
|
||||
PORTVERSION= 24.12.0
|
||||
PORTEPOCH= 1
|
||||
CATEGORIES= net-mgmt
|
||||
MASTER_SITES= LOCAL/dvl:vendor
|
||||
|
@ -128,7 +128,7 @@ _SCRIPT_FILES= daily.sh lnms
|
|||
# _RELEASE_TIMESTAMP is used for a patch inside the vendor code
|
||||
# it represents the release date via: git show --pretty='%H|%ct' -s 1.42.01
|
||||
# It sits here so you remember to update it with each release
|
||||
_RELEASE_TIMESTAMP= 1732114734
|
||||
_RELEASE_TIMESTAMP= 1734479713
|
||||
_ROOT_DIRS= LibreNMS app bootstrap config database doc html \
|
||||
includes lang licenses mibs misc resources routes \
|
||||
scripts tests
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
TIMESTAMP = 1732119849
|
||||
SHA256 (librenms-vendor-24.11.0.tar.gz) = 1014e59cd1a70a908307d72bd4ed54a6cb9a59bd37195199bd67e76290ec7fa6
|
||||
SIZE (librenms-vendor-24.11.0.tar.gz) = 28809754
|
||||
SHA256 (librenms-librenms-24.11.0_GH0.tar.gz) = de8f81f244852dabc82dc31a01509d5cc2a05486965007ba19d1dcf55e06e2c6
|
||||
SIZE (librenms-librenms-24.11.0_GH0.tar.gz) = 64503103
|
||||
TIMESTAMP = 1734480371
|
||||
SHA256 (librenms-vendor-24.12.0.tar.gz) = e7211b4b09793eaa46c08951c5b1c4535112144a5ad548e5b2ebafbbafb1712e
|
||||
SIZE (librenms-vendor-24.12.0.tar.gz) = 28817646
|
||||
SHA256 (librenms-librenms-24.12.0_GH0.tar.gz) = 16510909a7a5d8df82fb0c90d48efc93dff8065704d02230cdcb61744d2e64d4
|
||||
SIZE (librenms-librenms-24.12.0_GH0.tar.gz) = 65974321
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
--- LibreNMS/Validations/WebServer.php.orig 2024-12-17 23:55:13 UTC
|
||||
+++ LibreNMS/Validations/WebServer.php
|
||||
@@ -45,22 +45,28 @@ class WebServer extends BaseValidation
|
||||
{
|
||||
if (! app()->runningInConsole()) {
|
||||
$url = $this->removeStandardPorts(request()->url());
|
||||
- $expected = $this->removeStandardPorts(Str::finish(Config::get('base_url'), '/') . 'validate/results');
|
||||
+ $base_url = Config::get('base_url');
|
||||
+ $expected = $this->removeStandardPorts(Str::finish($base_url, '/') . 'validate/results');
|
||||
+ $correct_base = str_replace('/validate/results', '', $url);
|
||||
|
||||
if ($url !== $expected) {
|
||||
preg_match($this->host_regex, $url, $actual_host_match);
|
||||
preg_match($this->host_regex, $expected, $expected_host_match);
|
||||
$actual_host = $actual_host_match[1] ?? '';
|
||||
$expected_host = $expected_host_match[1] ?? "parse failure ($expected)";
|
||||
- if ($actual_host != $expected_host) {
|
||||
+
|
||||
+ if ($base_url == '/' && ! str_contains($actual_host, '/')) {
|
||||
+ $validator->warn('base_url could be more specific', "lnms config:set base_url $correct_base");
|
||||
+ } elseif ($actual_host != $expected_host) {
|
||||
$nginx = Str::startsWith(request()->server->get('SERVER_SOFTWARE'), 'nginx');
|
||||
$server_name = $nginx ? 'server_name' : 'ServerName';
|
||||
$fix = $nginx ? "server_name $actual_host;" : "ServerName $actual_host";
|
||||
$validator->fail("$server_name is set incorrectly for your webserver, update your webserver config. $actual_host $expected_host", $fix);
|
||||
} else {
|
||||
- $correct_base = str_replace('validate/results', '', $url);
|
||||
$validator->fail('base_url is not set correctly', "lnms config:set base_url $correct_base");
|
||||
}
|
||||
+ } elseif (preg_replace('#/$#', '', \config('app.url')) !== $correct_base) {
|
||||
+ $validator->fail("APP_URL is not set correctly. It should be set to $correct_base");
|
||||
}
|
||||
|
||||
if (request()->secure() && ! \config('session.secure')) {
|
Loading…
Add table
Reference in a new issue