Commit Graph

693 Commits

Author SHA1 Message Date
eskyuu
7d950825a1
Make the service template controller re-evaluate dynamic membership when apply all button is pushed (#15214) 2023-08-21 18:27:54 -05:00
PipoCanaja
99cfbf1d63
Use full name for vendor_oui (#15234)
* Use full name for vendor_oui

* trimmed

* typo

* more spaces to remove

* don't set $short_vendor

* keep line return

---------

Co-authored-by: Tony Murray <murraytony@gmail.com>
2023-08-21 16:13:28 -05:00
Fehler12
cbe2ba55ce
Added empty string check (#15235)
* Added empty string check

* replaced tabs with spaces

replaced tabs with spaces

* Removed '(', ')' and enlarged if clause

* Added one space and removed an empty row

* removed is_null

Removed is_null check as static code analysis says that this variable cannot be null at this time

* compact form

* handle spaces

In case the sysName is " " (one space). Good to trim anyway.

---------

Co-authored-by: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com>
2023-08-21 00:17:25 +02:00
Jellyfrog
7c85763ff5
Make the installer use the schema dump (#15211) 2023-08-11 17:16:22 -05:00
Tony Murray
d1b7004fef
Severity Enum (#14620)
* Severity Enum
Replace old Alert constants

* Fix whitespace

* Additional uses

* style fixes

* Fix test too

* More missed locations

* More
2023-08-05 12:12:36 -05:00
eskyuu
6fb784a321
Apply service templates on a per-device basis (#15024)
* Created and use a function to apply service templates on a per-device basis

* formatting fix
2023-08-04 19:05:07 -05:00
Tony Murray
fe1b280a99
Fix timezone controller bad return (#15191)
was returning null when preferences.timezone was not set (not sure how to get to that case)
2023-08-03 19:31:28 -05:00
Tony Murray
12f8bb2040
MAC Vendor OUI use scheduler (#15187)
* MAC Vendor OUI use scheduler
Add command to update `lnms maintenance:fetch-ouis`
Show vendor column in tables if mac_oui.enabled is set to true
Improve scheduler validation handle non-standard install directories and systems without systemd
Add index to table to improve speed and improve mac->vendor lookup speed
Scheduled weekly with random wait to prevent stampeding herd issues for upstream
drop oui update from daily

* MAC Vendor OUI use scheduler
Add command to update `lnms maintenance:fetch-ouis`
Show vendor column in tables if mac_oui.enabled is set to true

* Lint fixes and better prefix detection

* update schema file
2023-08-03 19:29:30 -05:00
Tony Murray
e0a20fced0
Fix security fix breaking display (#15192)
Escaped a <br />
2023-08-03 11:02:55 -05:00
Tony Murray
77fc6a34df
Graylog API properly throw errors (#15188)
* Graylog API properly throw errors
remove unused legacy graylog code

* Add type casts
2023-08-02 19:59:53 -05:00
Tony Murray
3252ea37af
Fix some xss injection for sysLocation and some other fields (#15183)
Reported by [Zluudg](https://huntr.dev/users/zluudg/)
2023-08-02 09:51:31 -05:00
Tony Murray
1723f96b40
remove pingcheck debug statements (#15173) 2023-07-31 12:26:25 -05:00
Tony Murray
3908bddb49
Miscellaneous fixes (#15162) 2023-07-26 01:08:10 +02:00
Tony Murray
9b077df610
AlertLog model cast details (#15143)
* AlertLog model cast details

* Style fix
2023-07-24 17:01:07 +02:00
Andy Norwood
64c4650801
Add FDB table vendor search drop down (#15072)
* Add vendor search and related functions

* Add OUIDB cache for vendor lookup

* Add vendor drop down

* appy style CI changes

* Apply style CI and lint changes

* more styleCI changes

* update type hinting

* Edit mac_oui cache lock name and function

* Update MAC OUI message during daily

* Use DB for vendor lookup

* New vendor_oui table migration

* New MAC OUI to database function

* Update readbleOUI to use DB rather than cache

* Make StyleCI changes

* styleCI tweak

* Remove lock release to allow refresh timer

* change migration name to match table

* add schema dump

* update schema

* styleCI tweak
2023-07-21 11:30:13 -05:00
Neil Lathwood
798ad4dc57
Skip hostnames which are blank when generating the smokeping config (#15144) 2023-07-14 16:50:37 -05:00
Peter Childs
b655eb7feb
change chunk to chunkById (#15139) 2023-07-07 11:53:15 -05:00
Nick Peelman
e486ef4c22
Fix MPLS Tab Display for Nokia devices using LDP and not RSVP (#15128) 2023-07-03 13:08:58 +03:00
Albert Siersema
f4c739c179
Fixes #14975 (Widget part) (#15076) 2023-06-18 22:22:41 -05:00
Jellyfrog
b14e2d4609
Apply fixes from StyleCI (#15101)
Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-06-13 13:35:00 +02:00
Jellyfrog
2b3575a5e9
Laravel 10.x Shift (#14995)
* Apply code style

* Remove explicit call to register policies

* Shift core files

* Shift config files

* Default config files

In an effort to make upgrading the constantly changing config files
easier, Shift defaulted them and merged your true customizations -
where ENV variables may not be used.

* Bump Laravel dependencies

* Add type hints for Laravel 10

* Shift cleanup

* wip

* wip

* sync translation

* Sync back config

* Public Path Binding

* QueryException

* monolog

* db::raw

* monolog

* db::raw

* fix larastan collections

* fix phpstan bug looping forever

* larastan errors

* larastan: fix column type

* styleci

* initialize array

* fixes

* fixes

---------

Co-authored-by: Shift <shift@laravelshift.com>
2023-05-24 22:21:54 +02:00
Jellyfrog
153be4d583
Tests: Fix Dusk tests after 13626 (#15057) 2023-05-23 19:23:15 +02:00
Tony Murray
04bb75f5f3
Alert transport cleanup, no_proxy support and other proxy cleanups (#14763)
* Add no_proxy and other proxy related settings
Set user agent on all http client requests
Unify http client usage

* Style fixes

* Remove useless use statements

* Correct variable, good job phpstan

* Add tests
fix https_proxy bug
add tcp:// to the config settings format

* style and lint fixes

* Remove guzzle from the direct dependencies

* Use built in Laravel testing functionality

* update baseline
2023-05-23 09:25:17 -05:00
Etienne Wan
9af97a0395
Add a global setting for Ctrl-F focus (improve #14947) (#15023)
* Add a global setting for Ctrl-F focus (improve #14947)

* Move this new global setting to user setting (improve #14947)

* Update preferences.blade.php

Cleaner wording, and Copy & Paste bled through.

* Fix indents and @endif position in menu.blade.php

---------

Co-authored-by: Justin Lentz <monkeybrains7@gmail.com>
2023-05-14 20:34:37 -05:00
eskyuu
ce0734ff5d
Added support for user timezones and user browser timezone by default (incomplete) (#13626)
* Added support for user timezones and user browser timezone byt default

* Formatting fixes

* Use the timezone for alert log display

also added validation for the timezone because it's being used in SQL.

* Formatting fixes

* Added return type

* Formatting"

* Update the latency graphs to use the user timezone

* Simplify the web routes config

* Update phpstan to ignore type error

* Fixed up the phpstan config

* Reverse phpstan change

* Re-apply phpstan override

* Remove the option to unset the session timezone

* Formatting fix

* Update outge and event logs to use session timezone

* Fix route for the timezone control

* Made the timezone more dynamic

* Fix a logic error that was stopping the timezone from being set automatically on login

* Prevent getPref from being called twice

* again prevent getPref double call

* getPref double call

* Fixed typo made during merge

* Fixed merge error in phpstan-baseline.neon

* Change spaces to tabs in phpstan-baseline.neon

* Update error count

---------

Co-authored-by: Tony Murray <murraytony@gmail.com>
2023-05-09 10:24:48 -05:00
Tony Murray
5c25cece48
Convert the inventory page to Laravel (#15004)
* Convert the inventory page to Laravel
Fix several XSS issues (hopefully no new ones snuck in)
Small improvement to the SelectController to allow filtering by filterFields()

* style fixes

* Fix lint issues

* Fix part device filter
2023-04-28 07:51:41 -05:00
Tony Murray
8a630edb38
Fix language selector (#15003) 2023-04-25 23:10:37 -05:00
Jellyfrog
f271019f6c
Add a validation for checking if the scheduler is running (#14987) 2023-04-24 10:04:50 +02:00
Justin Lentz
53f66e0c2c
Allow device ignore to be set via API (#14985)
* Missing Fillables

* StyleCI

* Update Device.php
2023-04-21 15:38:58 -05:00
VoipTelCH
8733589f6a
Enabled disabling a device via api (#14983) 2023-04-19 09:50:42 -05:00
Jellyfrog
0a351b49fd
Laravel 9.x Shift (#14504)
* Move `resources/lang` folder

* Shift registered middleware

* Remove `fruitcake/laravel-cors` dependency

* Streamline `$commands` property

* Upgrade to Flysystem 3.0

* Shift core files

* Convert `optional()` to nullsafe operator

* Remove unnecessary `$model` property

* Convert route options to fluent methods

Laravel 8 adopts the tuple syntax for controller actions. Since the old options array is incompatible with this syntax, Shift converted them to use modern, fluent methods.

* Convert deprecated `$dates` property to `$casts`

* Shift config files

* Default config files

In an effort to make upgrading the constantly changing config files
easier, Shift defaulted them and merged your true customizations -
where ENV variables may not be used.

* Bump Laravel dependencies

* Use `<env>` tags for configuration

`<env>` tags have a lower precedence than system environment variables making it easier to overwrite PHPUnit configuration values in additional environments, such a CI.

Review this blog post for more details on configuration precedence when testing Laravel: https://jasonmccreary.me/articles/laravel-testing-configuration-precedence/

* Fix error provider

* Match new symfony syntax

* Match upstream syntax

* Fix route syntax

* generate composer.lock

* Sync back configs

* routes

* composer

* Fix more flare

* fix cors

* sync lang

* Apply fixes from StyleCI (#14517)

Co-authored-by: StyleCI Bot <bot@styleci.io>

* bump larastan

* update packages

* wip

* Temporarily lower phpstan level

* Update phpstan.neon

* wip

* wip

* wip

* Apply fixes from StyleCI (#14592)

Co-authored-by: StyleCI Bot <bot@styleci.io>

* test

* Update CiHelper.php

* Update test.yml

* Update CiHelper.php

* Update CiHelper.php

* Apply fixes from StyleCI (#14616)

Co-authored-by: StyleCI Bot <bot@styleci.io>

* test?

* fix phpstan problems

* dont run snmpsim on github ci

* Fix whitespace

* More whitespace

* More whitespace ???

* I think the space broke it

* fix the reset of the whitespace

* hard code auth guard

---------

Co-authored-by: Shift <shift@laravelshift.com>
Co-authored-by: StyleCI Bot <bot@styleci.io>
Co-authored-by: Tony Murray <murraytony@gmail.com>
2023-04-17 06:51:35 -05:00
Tony Murray
52f5f10231
Fix some lint issues (#14962) 2023-04-15 09:02:41 -05:00
Tony Murray
e9c08e21a5
Fix more divide by zero issues (#14954)
* Fix more divide by zero issues
fixes: 14932

* Round to the nearest integer, then cast

* Fix up dhcpatriot
2023-04-11 13:44:45 -05:00
Kevin Zink
cde4d6a09f
Add link to hosts mgmt (ipmi) interface (#14905)
* Add link to hosts mgmt (ipmi) interface

* Fix Style

* Fix style

* Fix Lint

* Update DeviceController.php

Mgmt > IPMI
2023-04-10 18:58:50 -05:00
maticomba
6c7fda9833
Solves error in discovering services module (#14939)
* Solves error discovering services module

* Removing trailing spaces

* Allow in device group scopes to accept an array

* Fix and optimize queries a little

---------

Co-authored-by: Tony Murray <murraytony@gmail.com>
2023-04-10 13:26:26 -05:00
Justin Lentz
df31be30c1
Cleanup enable bgp setting (#14931)
* remove logic in module

* remove enable_bgp logic

* remove enable_bgp logic

* remove enable_bgp logic

* remove enable_bgp logic

* remove enable_bgp definition

* remove enable_bgp logic

* Remove enable_bgp documentation

* StyleCI

* StyleCI

* StyleCI

* StyleCI

* StyleCI

* StyleCI

* StyleCI

* StyleCI

* StyleCI

* StyleCI
2023-04-06 21:01:21 -05:00
Skylark
473a7d360b
Allows GEO lookup with detailed internal Location information wrapped inside parentheses. (#14799)
* Ignore everyting inside () during GEO lookup

I location info is: "1100 Congress Ave, Austin, TX 78701 (3rd floor meeting room)" then the GEO locator will look up "1100 Congress Ave, Austin, TX 78701"

* update info

* small typo

* typo fix

* getting verify

* style fix

* commitment issues

* updating wiki

* tweaking the document format

* more tweaks

* Im starting to hate md

* cleanup
2023-03-18 22:07:52 -05:00
Jellyfrog
68e0b3df28
Apply fixes from StyleCI (#14899)
Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-03-13 22:32:22 +01:00
MANT5149
d86b9ce889
Update PingCheck.php to remove duplicate "Device status changed to ... from icmp check." event (#14785)
* Update PingCheck.php

Remove duplicate log entry per https://github.com/librenms/librenms/issues/14751

* Update PingCheck.php

Co-authored-by: Tony Murray <murraytony@gmail.com>
2023-01-21 07:17:43 -06:00
Skylark
02e78aab1d
Fix for RIPE NCC API Tools (#14757) 2022-12-24 22:36:26 +00:00
Tony Murray
1ab238a4d1
Fix port speed setting feedback (#14743) 2022-12-19 18:41:59 -06:00
Tony Murray
8ea3f5cd06
Offer opt in to usage and error reporting during install (#13906)
and on the about page
2022-12-15 19:52:22 -06:00
Tony Murray
88c86f2a19
Fix graph output base64 (#14701)
Mostly for people using unauth graphs instead of the api.
2022-12-15 15:58:56 -06:00
Tony Murray
1d3440b943
Unify time interval formatting (#14733)
* Unify time interval formatting
Use carbon for formatting, it supports locales.

* fix style

* remove baseline exceptions

* fixes found by lint
2022-12-15 15:52:53 -06:00
Gilles Depeyrot
ceb8a02a99
Search devices using display field as well (#14714) 2022-12-09 17:25:42 +01:00
Tony Murray
a6e1c11b0c
Remove ungrouped devices panel (#14664)
The panel destroyed the page performance on larger installs.
Now has a link to the devices list with new group=none filter.
2022-11-22 15:52:29 -06:00
Tony Murray
7635ace4fa
Split out lnms snmp convenience commands (#14603)
* Split out lnms snmp convenience commands

* Use SnmpQuery->valuesByIndex()

* Fix style
2022-11-19 22:10:25 -06:00
Tony Murray
b7b037bf4d
Fix Service Template XSS (#14659)
Reported via huntr.dev by @vautia
2022-11-19 21:51:35 -06:00
Tony Murray
00d5e2f477
Fix SNMP trap -> Eventlog XSS (#14657)
Reported via Huntr.dev by @stefan-schiller-sonarsource
2022-11-19 21:31:48 -06:00
Tony Murray
752bbc1531
Port search API search more than one fields (#14646)
* Fix port search columns

* Port search API search more than one fields
Fixup port APIs
Change validate_column_list api helper to throw a renderable exception on error and return the valid columns
DeviceCache::get() can handle a bigger range of input

* whitespace

* Refactor exceptions a bit

* change throws type to be more generic

* Lint fixes
2022-11-18 16:27:56 -06:00