Commit Graph

818 Commits

Author SHA1 Message Date
Tony Murray
d8c372bbf4
Refactor MAC utilities into a single class (#15379)
* Refactor MAC utils to a new utility class

* Apply fixes from StyleCI

* Inline functions
Add tests
Handle bridgeid format

* Apply fixes from StyleCI

* Dedicated code path for stp bridge parsing, and improve STP output a bit

* Correctly parse dot1dBaseBridgeAddress and don't store int in bool field

* trim any unexpected character from bridge addresses, add extra test data.

* better comment

* barsBridge can handle dot1dBaseBridgeAddress correctly now

* parseBridge, check for properly formatted mac first.

* update test data, empty data = empty mac

* Fix new usage after rebase

* import

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-10-06 07:34:14 -05:00
AdamB
91bc3bf479
Show which host marked a device as down. (#15209)
* Show which host marked a device as down.
One of my pollers can't reach a device, it'd be nice to know which one is causing the issue.

* Only show the actor in a distributed setup

* Use distributed poller name as its now ensured

* Use node_id

* Change to avoid extra dns lookups

* Update DeviceObserver.php

* Update DeviceObserver.php

---------

Co-authored-by: Tony Murray <murraytony@gmail.com>
2023-10-05 19:53:38 -05:00
Tony Murray
087d588102
Vmware vminfo modernize (#15008)
* Vmware vminfo
Remove legacy file and migrate to OS discovery

* tighter

* ios_stp-vlans working correctly now

* Make vmwVmGuestOS nullable

* Discover os info too

* VM Info module

* Apply fixes from StyleCI

* Fix log severity

* Fix log severity (more)

* VM Info module

* Poll with ESXi too because it is lightweight
add test data

* poller data now too

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-10-05 19:49:26 -05:00
Tony Murray
bec7a9f449
Throttle error reporting (#15391)
* Throttle error reporting
Sets how frequently errors can be reported (across all pollers)
Also has the side effect of at most 1 error reported per run
To disable, set reporting.throttle to 0 (for development and testing purposes)

* Don't crash if Cache provider is unavailable, refactor
2023-10-05 17:24:28 -05:00
Tony Murray
9fca01830c
Update Tnmsne table backend (#15384)
remove ridiculous sql injection vulnerability
2023-10-05 10:32:21 +02:00
Tony Murray
e0444bffcf
Deprecate poller.php (#15370)
* Deprecate poller.php

* Apply fixes from StyleCI

* Remove references to poller.php
Leave wrapper...

* fix python style

* update wraper to call lnms device:poll

* Quiet output too

* make pb happy

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-10-04 16:32:02 -05:00
Tony Murray
c1258320f8
Availability module fixes (#15369)
* Refactor poller to allow modules to run even if the device is down
Include core in config (but not webui) to avoid silly shenanigans
Inject datastore into polling

* Needed to split datastore interface

* Cleanup some data_udpate() references

* Apply fixes from StyleCI

* Fix legacy poller :D

* Output to the correct stream

* Fix lint issues

* Apply fixes from StyleCI

* Fix discovery not including core and submodule handling

* Use whereRaw

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-10-04 10:32:59 -05:00
Tony Murray
6f329a7595
Fix alerting find owner contacts on old SQL server versions (#15355)
* Fix alerting find owner contacts on old SQL server versions
Older SQL server versions had a bug where they didn't accept parenthesis around the first query of a union statement.
It was difficult to remove these parenthesis, so use whereHas instead.

* Fix style
2023-09-28 09:49:29 -05:00
Tony Murray
c8041b6699
FDB Tables improve performance (#15333)
* FDB Tables improve performance
Reduce unnecessary sql queries, by using a relationship
Cache vendor oui lookups

* Oui already "clean"

* Fix typo
2023-09-25 19:49:22 -05:00
SourceDoctor
c0a233700c
show never polled information (#15341) 2023-09-24 18:10:11 +02:00
Tony Murray
35406b4b32
Fix some issues with admin self settings (#15332)
Don't require old password when not settings password
Show old password field for user's own user
2023-09-18 14:35:12 -05:00
Tony Murray
c4852a01e9
Fix device display name in top interfaces widget (#15319)
fixes: #15317
2023-09-14 08:15:29 -05:00
Tony Murray
4dc2ae9d44
Timezone, fix user set no timezone (#15296)
fixes #15277
2023-09-08 07:48:16 -05:00
Zane C. Bowers-Hadley
2618a99be5
Application Soft Delete (#15270)
* add the softdeletes migrations for applications

* add working migration file

* add deleted_at to db schema.yaml for applications

* update includes/html/forms/application-update.inc.php to work with softdeletes

* update includes/html/pages/device/edit/apps.inc.php for softdelete

* update includes/discovery/applications.inc.php to work with softdelete

* minor updates to application-update.inc.php for disabling

* style cleanup

* set discovered when running discovery

* update application tests to include deleted_at

* add deleted_at to a missed test

* a few more tweaks for opensips

* add a missing deleted_at for linux_suricata_extract-v1

* fix fillable for Application model

* massive cleanup of the application update widget thingy

* improve the code for discovery and using Laravel

* add a missing line to app/Models/Application

* add a missing include to app/Models/Application.php

* record includes for Application model

* remove apps from the applications table when a device is deleted

* revert to using upcert and where for discovery to fix CI

* make discovered fillable and set it when running discovery... convert back to firstOrNew

* clean up application discovery a bit and use observer

* style fix

* spelling fix... disablaed -> disabled

* rever removal to just use where

* cleanup app removal on delete

* add restored to ModuleModelObserver

* delete -> forcedelete fix

* apply the suggested changes

* use murrants other suggestion

* style fix
2023-09-06 16:34:39 -05:00
SourceDoctor
013096c092
readd missing key (#15291)
* readd missing key

* .
2023-09-06 16:08:07 -05:00
SourceDoctor
d991a4b505
fix missing keys for new status (#15284) 2023-09-05 16:08:15 -05:00
SourceDoctor
35ff23b39f
show ignored device up when up (#15283)
* show ignored device up when up

* change status string
2023-09-05 11:04:16 -05:00
Wheel
a6ccb596df
Custom ssh,telnet port with oxidized (#15255)
* Custom ssh,telnet,http port with oxidized

* Lint fixes

* copy paste minors
2023-09-03 20:15:51 -05:00
PipoCanaja
8eeb83928f
Add global NAC page and refactor the per-device one (#15228)
* Adding a NAC global port page

* style

* filter_menu_entry

* typo

* ->when()

* device_id always returned

* use request

* laravel conversion, let see how it goes

* styleci

* ->with('device') to avoid 1 query per item processed

* and rewrote on @murrant advice

* any -> get

Suggested by @murrant

Co-authored-by: Tony Murray <murraytony@gmail.com>

* @push('scripts')

* style

* @endpush

---------

Co-authored-by: Tony Murray <murraytony@gmail.com>
2023-08-31 20:25:24 -05:00
Tony Murray
bbe835b5f9
Radius update roles correctly (#15261)
Needs a re-write so semantics line up with Laravel auth better, but this is the quick/safe fix.
2023-08-28 23:38:09 -05:00
Tony Murray
f622a96c70
Fix mysql auth removing roles upon login (#15258) 2023-08-28 11:00:18 -05:00
Tony Murray
c737788727
Roles user add fix (#15257)
* Fix user add command doesn't allow roles

* update baseline
2023-08-28 10:27:56 -05:00
Tony Murray
2cd207028a
Implement RBAC (only built in roles) (#15212)
* Install bouncer

* Seeder and level migration

* Display and edit roles

* remove unused deluser page

* Update Radius and SSO to assign roles

* update AlertUtil direct level check to use roles instead

* rewrite ircbot auth handling

* Remove legacy auth getUserlist and getUserlevel methods, add getRoles
Set roles in LegacyUserProvider

* Small cleanups

* centralize role sync code
show roles on user preferences page

* VueSelect component WIP and a little docs

* WIP

* SelectControllers id and text fields.

* LibrenmsSelect component extracted from SettingSelectDynamic

* Handle multiple selections

* allow type coercion

* full width settings

* final style adjustments

* Final compiled assets update

* Style fixes

* Fix SSO tests

* Lint cleanups

* small style fix

* don't use json yet

* Update baseline for usptream package issues

* Change schema, not 100% sure it is correct
not sure why xor doesn't work
2023-08-28 00:13:40 -05:00
Hans Erasmus
4fc27d98e9
Another OR statement in GrayLog API (#15246)
* Another OR statement in GL-api

* try again to fix linting issue

* yet more linting issues

* Cannot fix me being an idiot
2023-08-25 07:56:29 -05:00
Tony Murray
cfc9aca6a4
Revert "Added empty string check (#15235)" (#15249)
This reverts commit cbe2ba55ce.
2023-08-24 10:09:50 -05:00
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
Tony Murray
63988a4615
fix snmp_disable type (#14650) 2022-11-18 17:30:16 +01:00
pertruccio
c9d617823d
added disable_notify and location_id (#14619) 2022-11-16 08:12:37 -06:00
Jellyfrog
f411c1a6a7
Fix GeocodingHelper type-hinting (#14604)
* Fix GeocodingHelper type-hinting

* Update GeocodingHelper.php
2022-11-09 10:10:04 -06:00
geg347
96c7e7166e
Adding device's field in get_alert_rule and list-alert-rules API function (new) (#14481)
* Adding device's field in get_alert_rule and lis-alert-rules API function

* Converting SQL request for list/get_alert_rules to Eloquent (thanks a lot to Murrant)

* Manually added #14500 to pass pipeline

* Fixing StyleCI error + trying to fix PHPStan errors

* Trying to fix PHPStan errors (part 2)
2022-11-09 08:21:41 -06:00
Jellyfrog
71d740770b
Remove Log::event (#14526)
* Remove Log::event

Use the Eventlog class directly instead

* wip

* wip

* wip

* Apply fixes from StyleCI

* Update Eventlog.php
2022-11-09 09:47:19 +01:00
Tony Murray
0e9bb04071
API restore ability to update purpose and override_sysLocation (#14596)
fixes #14538
2022-11-08 18:22:37 +01:00
Tony Murray
0801af7a81
Consolidate and improve snmptranslate usage (#14567)
* Consolidate and improve snmptranslate usage

* Fix style

* lint fixes

* fix typo

* allow multiple mib directories

* Only add mib if it is not already set

* oid first, in case we have key length issues

* if there is a full oid, don't add other mibs

* debug in ci

* more debug in ci

* better debug in ci

* remove debug

* Use numeric index

* revert dlink change

* Don't add -On twice

* unit tests and hopefully better heuristics

* remove dump and add one more set of tests

* style fixes

* handle bad input in old functions

* shortcut whole snmp_translate function
2022-11-07 12:00:47 -06:00
Jellyfrog
009d69a48d
Use Collection instead of collect() (#14527)
* Use Collection instead of collect()

* wip
2022-11-05 10:04:36 +01:00
Tony Murray
0c365d08e3
SnmpQuery numeric accept a boolean (#14565) 2022-11-02 18:50:46 -05:00
Tony Murray
e938458cde
Fix BaseApi uninitialized (#14557) 2022-11-02 09:02:52 -05:00
Félix Bouynot
3a61955658
Fix Type error (#14555)
Fix production.ERROR: Typed property App\ApiClients\BaseApi::$client must not be accessed before initialization
cf. https://stackoverflow.com/a/59265626/3236342
2022-11-02 14:40:05 +01:00
Félix Bouynot
b59cf980ca
Type API methods and properties (#14476)
* Type properties

* Comment method

* Update base_uri child property

* Update BingApi.php

* Update GoogleMapsApi.php

* Update MapquestApi.php

* Update NominatimApi.php

* Update RipeApi.php

* Update phpstan-baseline.neon

* Update phpstan-baseline.neon

* Fix indent

* Fix escaping

* Update phpstan-baseline.neon

* Update phpstan-baseline.neon

* Update phpstan-baseline.neon

* Update phpstan-baseline.neon

* Update phpstan-baseline.neon

* Update phpstan-baseline.neon

* Update phpstan-baseline.neon

* Update phpstan-baseline.neon

* StyleCI indent

* Update phpstan-baseline.neon

* Make possible for $client to be null

* Remove comments

* Remove comments

* Remove comments

* Update MapquestApi.php

* Update NominatimApi.php

* Remove comments

* Remove comments

* $base_uri not nullable

* $base_uri not nullable

* $base_uri not nullable

* $base_uri not nullable

* $base_uri not nullable

* $base_uri not nullable

* Type method and properties

* Type method and properties

* Type method and properties

* Type method and properties

* Type method and properties

* Type method and properties

* Type $client

* Type method and properties

* Remove errors not matched anymore

* Fix type errors in graylogapi

* Mixed can't be ORed

* uri never null

* Update app/ApiClients/GraylogApi.php

* Fix getAdresses Type

* Collection changed its folder?

* Fix directory, there was just a backslash missing

Co-authored-by: Tony Murray <murraytony@gmail.com>
2022-11-02 01:06:15 +01:00
Tony Murray
4b65dc41d2
Graphing cleanup (#14492)
* WIP

* Fixes and cleanups

* Move parseAtTime to Time util class

* lint fixes, explicitly define variables

* Style fixes
2022-10-28 08:06:29 -05:00
Jellyfrog
44578b2935
Convert string references to ::class (#14508)
PHP 5.5.9 adds the new static `class` property which provides the fully qualified class name. This is preferred over using strings for class names since the `class` property references are checked by PHP.

Co-authored-by: Shift <shift@laravelshift.com>
2022-10-25 08:31:46 -05:00
Tony Murray
bfc9c5f846
Fix v2 plugins (#14506)
inverted check caused all v2 plugins to not be shown.
2022-10-24 21:48:13 -05:00
Tony Murray
62aa77c0a0
Fix AlertRule relationships (#14500) 2022-10-24 09:54:59 -05:00
rhinoau
6372041d39
Fix update_device hostname handling #14435 (#14448)
* Fix device_update hostname handling #14435

* Use Eloquent

* Update Device.php

Co-authored-by: Tony Murray <murraytony@gmail.com>
2022-10-22 15:45:47 -05:00
Tony Murray
4b97abe225
Add --forgot-key to key:rotate command (#14495)
Destroys all encrypted data
2022-10-22 11:45:58 +02:00
Tony Murray
da8befca06
Add instance id to error reports (#14444)
* Add instance id to error reports

Alternative to #14261

* lint fix
2022-10-19 18:45:27 -05:00
Tony Murray
7dd3a224fa
Block disabled user session auth (#14473)
Do not allow users that are disabled to be logged in via cookie.
Allow all auth methods to disable users
2022-10-17 12:39:15 -05:00
Tony Murray
722791d086
Fix XSS when deleting device and port groups (#14472) 2022-10-17 12:38:16 -05:00
Tony Murray
09a2977adb
Fix authentication mass assignment vulnerability (#14468)
Users were able to submit changes to fields they should not have access to change by bypassing the frontend validation.  Correct backend validation to prevent that.
2022-10-17 12:11:14 -05:00
PipoCanaja
1fd915c8a3
Fix VRP duplicate BGP Peers (#14431)
* fix VRP not cleaning BGP peers properly

* fix missing field in BgpPeer model

* Update includes/discovery/bgp-peers/vrp.inc.php

Co-authored-by: Tony Murray <murraytony@gmail.com>
2022-10-11 20:26:56 +02:00
Jellyfrog
071173ffb9
Remove tabs from yaml (#14437)
* Remove tabs from yaml

* Remove tabs from random files
2022-10-10 18:13:10 +02:00
Jellyfrog
b31b992020
Rework socialite integration (#14367)
* Rework socialite integration

Prevents unnecessary work each boot

* Update SocialiteController.php

* Gen 2
2022-10-07 20:52:55 +02:00
PipoCanaja
daa8c757f6
Fix a few Db* to Eloquent requests (#14278)
* Eloquent for 2 requests

* Eloquent for 1 request

* a few in Dell

* Model

* and more with timos

* and more with timos

* and firebrick

* firebrick

* one query instead of many

* Should use collection get

* Update timos.inc.php

* Update dell-os10.inc.php

* avoid changing timos as it breaks something

* new try with timos

* deps for BGP

* revert deps for BGP

* style

* style

* deps for BGP, 2nd try

* typo

* revert aos7

* fix create

* firebricktests

* firebrick

* firebrick

* cipsec-fix

* cipsec

* timos fix 100th time :)

* ./scripts/save-test-data.php -m os,ports,processors,mempools,vrf,sensors,bgp-peers,mpls,ospf  -o timos -v 7705

* remove timos from this PR

Co-authored-by: Tony Murray <murraytony@gmail.com>
2022-10-02 16:04:08 +02:00
Tony Murray
e4451714e2
version and git helper improvements (#14412)
* Fix up version and git helpers
Improve method names
Move all git calls into the git helper
Allow runtime and external cache of results where appropriate
Consolidate version headers for discovery, poller, and validate

* Style fixes

* improve consistency in git calls

* fix style

* don't send name inconsistently

* Improve database versions

* No need to cache Version it is not used more than once currently.
2022-10-02 00:41:56 -05:00
Tony Murray
f60b6788d3
Cache version data (#14404)
* Cache version data
Calling cli commands can be expensive, cache the results.

* style fixes

* Fix pre-laravel usage

* fix lint
2022-09-28 23:23:32 -05:00
Tony Murray
e990dfcb35
Disable plugins that have errors (#14383)
* Disable plugins that have errors
Disable plugin if a hook throws an error and set a notification
Move notification code to class, so we can access it
Clear notification when plugin is attempted to be enabled again

* fix style and lint fixes

* another lint fix and handle if property is missing
2022-09-25 22:47:58 -05:00
Félix Bouynot
333ba7c2cd
Fix oxidized web requests unclosed connections or responding fast enough (#14370)
* Fix oxidized web requests not closing connections or responding fast enough

* Update showconfig.inc.php

* Add method to get the text content of an oxidized page

* Use Oxidized getContent method instead of file_get_content

* Too much brackets with copy paste

* Fix carriage return errors because of copy paste

* Fix copy paste error again

* Fix indent

* PHPStan is waiting for a return even outside of the if loop

* Single quotes

* Variabilize timeout in baseapi

* Set Oxidized Api class timeout var to 90 because oxidized is slow and to be sure not to break half the installs here

* fix typo

* Variabilize timeout

* Variabilize timeout

* Variabilize timeout

* Variabilize timeout

* Variabilize timeout

* Spacing

* Remove timeout type because of this error

Unexpected 'int' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in app/ApiClients/BaseApi.php on line 34

* Lint needs type finally

* Use contruct instead of setting variable

* Type hinting instead for php7.3

* Type hinting fix

* Set property value instead of calling parent constructor

* Typo

* Remove unneededconstructors

* Remove unneeded constructors

* Remove unneeded constructors

* Remove unneeded constructors

* Remove unneeded constructors

* Remove unneeded constructors

* Typing not casting

* Typing not casting

* Cannot type variables outside of a class

Co-authored-by: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com>
2022-09-24 14:24:11 -05:00
sembeek
4e1f958e16
Fix ping.php skipped results (#14368)
* Update PingCheck.php

* Update PingCheck.php

* Update phpstan-baseline.neon

* Update PingCheck.php

Co-authored-by: Tony Murray <murraytony@gmail.com>
2022-09-19 15:10:26 -05:00
Jellyfrog
27a19039dc
Defer loading cli option defaults (#14363)
* Defer loading cli option defaults

Also allows passing args to functions

* Update DynamicInputOption.php
2022-09-19 16:03:55 +02:00
Jellyfrog
be4f39a2b4
Remove call to Config from artisan (#14362)
Defers the loading of Config a bit
2022-09-17 23:44:45 -05:00
Tony Murray
0805002086
Fix scheduled maintenance xss (#14360)
Fix for fields title, notes, and maybe recurring_day. Other fields can't store html.

https://huntr.dev/bounties/bcb6ee68-1452-4fdb-932a-f1031d10984f/
2022-09-16 11:59:48 -05:00
Tony Murray
67ad0726b0
Defer loading cli option values (#14354)
* Defer loading option values
Otherwise it causes a cli command to be run every single application boot.

* style and lint

* Just return whatever we have it isn't callable
2022-09-16 11:58:22 +02:00
Félix Bouynot
9cff8acb29
Match displayname source for graylog (#14339)
* Match displayname source for graylog

* Update GraylogApi.php

* Reorder addresses
2022-09-13 07:44:19 -05:00
Jellyfrog
a22be00c66
Ignore CommandNotFoundException from reporting (#14342)
Prevents user typos from bubbling up to error reports
2022-09-13 07:24:01 -05:00
Tony Murray
ad8580d694
Cleanup and optimize the availability widget (#14329)
* Cleanup and optimize the availability widget
Default sort is display name
Sort applies to services too (services always last)
May need to refresh the page to get new css

* style

* We don't need request (lint fix)

* Wrong service field name
2022-09-09 18:22:58 +02:00
Jellyfrog
152497a098
PHPStan: Enable more checks (#14318)
* PHPStan: Enable more checks

* Fixes

* Fixes

* Deprecation fixes
2022-09-09 07:08:06 -05:00
Marek Wobst
22f84ef3d8
Add additional sorting options for Availability Map (#14073)
* Fix IPv6 in service check host (#13939)

* Add hostName cleaning to Clean

* Apply RFC 5952 formatting to Clean::hostName output

* Use more liberal cleaning for hostnames

* Remove unwanted whitespace

* Apply Clean::hostName() to all relevant fields

* Fix docstring

* Use IP::isValid inline

* Update Clean.php

* Update services.inc.php

Co-authored-by: Tony Murray <murraytony@gmail.com>

* Add sorting support for additional columns + dual column

Additional columns are Display Name (display) and System Name (sysName)

Dual column means that first is sorted after status, then within
each status group another sort is done (every columns from single column
sorting is possible).

* Change code for styleCI

* Expand availability map sorting menu

Also change sysName to System Name – there is no real reason for
that short form.

* Add german translation for avail. map sorting/display options

* Adjust sorting behaviour in Availability Map

The dropdown now presents two options:

- Display Text: Sort by the selected value of the dropdown 'Display Text'
- Status: Sort by status, then by selected value of dropdown 'Display Text'

As the field 'display' (The display name) may contain template functions
etc., sorting is not done by SQL means; instead custom sorting is done
within the controller.

* Apply fix for styleCI

* Apply fix for styleCI, part 2

* Update availability-map.blade.php

* Update availability-map.blade.php

* Update availability-map.blade.php

* Update de.json

* Update AvailabilityMapController.php

* Update AvailabilityMapController.php

* Update availability-map.blade.php

* Update de.json

Co-authored-by: Sander Steffann <sander@steffann.nl>
Co-authored-by: Tony Murray <murraytony@gmail.com>
2022-09-07 20:02:00 -05:00
PipoCanaja
53bfb24ef9
Migrate xDSL code to module, and add support for VDSL2 MIB (#14207)
* use component to discover if xDSL polling is needed

use component to discover if xDSL polling is needed

* Components OK, Polling in correct files, no DB for VDSL

* GUI

GUI_suite

* per port as well

* rename

* interface listing

* draytek_snmpsim

* fix arraymerge

fix names and max value

* schema

schema

style

* remove one dbFetchRows

remove 2x dbFetchCell

style

style

remove Legacy dbFetchRow

tests

tests

eloquent

more eloquent

more eloquent

one more gone

* fix properties access

eloquent_insert_update

style

tests

tests

tests

tests

* tests

tests

tests

* adslLineCoding

* Models

* fix not nullable cols in DB from code

default values

typo

rename

typo

schema

fix

fix

vdsl fix now

typo

typo

fix size

fix size

* Power values for VDSL

Power values for VDSL

Power values for VDSL

DB

* cleanup

* Rrd::checkRrdExists

* always enable DSL discovery

style

* xdsl module

* cleanup and move to Module

cleanup and move to Module

cleanup and move to Module

cleanup and move to Module

* Fix display

* fix polling and tenth

* remove legacy poller

* Style and Cosmetics

Cosmetics

Cleanup

* Translations

Translations

* exists

exists

* add test support for xdsl

* remove last component call

unused

* translations

* remove non standard onclick event on xdsl line

* Update Discovery Support.md

Update Poller Support.md

toner_gone

* Notification for removal of lnms config:set enable_ports_adsl true

* enable on devices with potential DSL interfaces

* tests are working now

fix teldat tests

* os_schema

* teldat

* move to new module structure

* move to new module structure

* wrong dump function

* wrong dump function

* laravel_through_key hidden

* Update notifications.rss

* Update notifications.rss

Co-authored-by: Tony Murray <murraytony@gmail.com>
2022-09-07 19:29:17 -05:00
Tony Murray
dc050711ec
2fa not all routes have names (#14311) 2022-09-07 09:06:24 +02:00
Tony Murray
9fdc213f25
Return GraphImage to include more metadata (#14307)
* Return GraphImage to include more metadata
Allows things like including title.
Implements __toString for backwards compatability
getImageData to allow controlling the output through flags

* Style and Lint
2022-09-06 07:33:57 -05:00
Tony Murray
302a989d4e
Email Transport: embed graphs by default (#14270)
* Email embed graphs

* Allow attachment for non-html
Add setting to webui
Correct $auth setting

* Cleanups, throw RrdGraphException instead of returning an error image.
Generate the error image later, giving more control.
Reduce code duplication a little

* Style and lint fixes
Change to flags

* Add baseline for lint errors I don't know how to resolve

* oopsie, changed the code after generating the baseline

* Tiny cleanups.  Make set DeviceCache primary, it is free.

* Docs.

* email_html note

* Allow control of graph embed at the email transport level to override the global config.

* Allow control of graph embed at the email transport level to override the global config.

* Add INLINE_BASE64 to make it easier to create inline image tags
2022-09-05 20:41:55 -05:00
Tony Murray
ec8629fb63
Discord ability to attach graph images (#14276)
* Discord ability to attach graph images
Must use @signedGraphTag()
Needs more work on the graph side of things still: issues with CORs and other.

* Fixes

* alert data is an array for transports

* No need to decode, that was a bug before
2022-09-05 16:20:10 -05:00
Jellyfrog
214ee9588c
Check correct class (#14297) 2022-09-05 11:13:47 -05:00
Tony Murray
c03954cfc3
Error Reporting (#14291)
Don't try to enable Ignition and Flare when the user has too old of flare-client-php
2022-09-05 09:02:53 +02:00
Tony Murray
c592811477
Error Reporting, strict check (#14293)
Strict check to reduce chances for accidental enabling.
2022-09-05 09:00:12 +02:00
Tony Murray
ad9868b8b3
Fix issue causing error reporting to be incorrectly enabled (#14292)
for some reason, the reporting.error.dump merged with reporting.error to store an array instead of a bool.
2022-09-04 23:05:36 -05:00
Tony Murray
04b7b1cb03
Fix rounding null in mempools module (#14290) 2022-09-04 21:26:02 +02:00
Tony Murray
2e42326e34
Remove reference to unused variable (#14280) 2022-09-03 23:45:12 -05:00
Tony Murray
152bf6e8de
Allow dumping of errors and warnings (#14275)
`lnms config:set reporting.error.dump true`
2022-09-03 20:57:26 -05:00
Tony Murray
5c76890373
Add @signedGraphTag() and @signedGraphUrl() blade directives (#14269)
* More secure external graph access
Add @signedGraphTag() and @signedGraphUrl() blade directives
Takes either an array of graph variables or a url to a graph
Uses a signed url that is accessible without user login, embeds signature in url to authenticate access
See Laravel Signed Url for more details.
Adds Laravel route to graphs (does not change links to use it yet)
@graphImage requires the other PR
Also APP_URL is required in .env

* missing files from rebase

* Fix url parsing with a get string

* allow width and height to be omitted

* Documentation

* Add to, otherwise it will always be now

* Doc note for to and from relative security

* fix vars.inc.php (Laravel has a dummy url here)
2022-09-03 12:48:43 -05:00
Tony Murray
6f5cf7727a
Misc webui code cleanups (#14242)
* Misc webui cleanups

* Style

* More

* graphing fixes

* More graph cleanups

* more fixes, graphs and device pages

* style
2022-08-30 12:55:37 -05:00
Tony Murray
673ad552a1
Device settings: attempt to open related tab (#14250)
* Device settings: attempt to open related tab

* remove baseline
2022-08-28 21:45:52 -05:00
Tony Murray
323f0ea8b5
Fix removing all port groups (#14253)
* Fix removing all port groups

* Make backend work in the situation where this endpoint is used for more than just this setting change
change event is called multiple times when select2 is cleared (once for each item)
prevent duplicate backend calls
Remove no default Port Group item
2022-08-28 20:57:16 -05:00
Tony Murray
a0b8b09f97
lnms dev:simulate check simulated device exists (#14243) 2022-08-25 09:58:40 +02:00
Jellyfrog
1dbab5ac7e
Error reporting (#14190)
* Error reporting

* Move code to ErrorReportingProvider
Enable reporting of error (and warning) messages.
report module exceptions

* Restore flare key
Not needed to set late anymore.  We set up filtering before it is initialized.

* Remove unnecessary and maybe double Flare report

* lint

* Cannot use typed properties yet, use phpdoc

* fix handleError return type

* Filter both exceptions and reports (so we don't miss any)
Consolidate the check if reporting should be enabled

* Cache reportingEnabled check for the runtime

* Split out middleware to improve readability
Logging of why reporting is disabled
Fix reportingEnabled cache

* Style

* Return some user data

* Change to class based middleware, it looks nicer

* Fix error page error id report, add url.

* also rewrite intended url

* remove link

* Move ignition to production and update flare-client

Co-authored-by: Tony Murray <murraytony@gmail.com>
2022-08-24 00:33:28 +02:00
Nash Kaminski
2741612eb6
Correct logic for recurring alert rules that span UTC days (#14145)
* Correct logic for recurring alert rules that span UTC days. Evaluate the day of week in local time.

* Enable previously broken test cases

* Update TestScheduledMaintenance.php

Co-authored-by: Tony Murray <murraytony@gmail.com>
2022-08-18 20:20:25 -05:00
electrocret
478d800384
View Ports in Portgroups (#14141)
* Add group case

Add group case for portgroup URL query

* Add PortGroups to MenuComposer

* Add PortGroups to Menu blade

Adds to menu blade, using a similar behavior as Locations.

* Make PortCount into link

Make port count into like similar to DeviceGroups device count.

* Update MenuComposer.php

Make StyleCI happy

* Update MenuComposer.php

Make StyleCI happy

* Update ports.inc.php

Make StyleCI happy

* Update menu.blade.php

Menu fix.

* Update Menu so Manage Groups always displays.

* Adding Group function

* Add group to filterFields

* Trying suggested change

* Subquery

Co-authored-by: Tony Murray <murraytony@gmail.com>
2022-08-07 14:49:57 -05:00
Tony Murray
e9211d93c0
Fix ports display (#14183)
* Fix ports with deleted device breaking all ports display

* Only filter callable based filters when required
2022-08-05 09:01:15 -05:00
electrocret
1d1b2b1c8b
Ports by device group (#14175)
* Add devicegroup filterFields

* add Devicegroup to post function

* StyleCI

* Add GUI Element

* Less wordy

Dropped "View" from the link. Made it too wordy for such a small GUI insertion.

* Moved DeviceGroup Ports link to a separate column

I realized how it could be confusing to have links to two different items in the same column, so I separated the Ports out.
2022-08-04 18:09:21 -05:00
Tony Murray
1c2e446326
New Poller validations (#14148)
* New Poller validations
Seperated poller and distributed poller validations to make poller validations generally available
One auto fixer added
Translatable strings

* lint and style fixes

* and style

* and style

* Update LibreNMS/Validations/Poller/CheckLocking.php

Co-authored-by: Jellyfrog <Jellyfrog@users.noreply.github.com>

* Update CheckPythonWrapper.php

* Try to check if cron is even installed before warning about not being able to read the cron files.
Likely most systems they won't be readable, but also, it is very unlikely we hit the cron check and it is meaningfully different than the first Poller::exists() check.

* Work on poller validation
Remove errors/warnings when at least one poller of the other type is active.

* style fixes

Co-authored-by: Jellyfrog <Jellyfrog@users.noreply.github.com>
2022-08-02 16:02:37 -05:00
Tony Murray
7b868982d5
New lnms command to enable and disable plugins (#14147)
* New lnms command to enable and disable plugins
lnms plugin:disable
lnms plugin:enable

* cleanup

* appease the lint gods

* and style

* Restore accidental file removal
2022-07-29 11:36:49 -05:00
Jellyfrog
670f964e98
Validate: use "database version" instead of "mysql version" (#14158)
* Validate: use "database version" instead of "mysql version"

* wip

* wip
2022-07-29 11:36:18 -05:00
Tony Murray
799c03df29
lnms device:poll better feedback (#14130)
* lnms device:poll better feedback
Feedback when 0 devices are found to poll or 0 devices are polled.
Make devices polled summary string translatable.

* additional note on what the wildcard is

* Fix style
2022-07-22 16:31:27 -05:00
Zane C. Bowers-Hadley
0bbcde1227
add the ability for storing app data to prevent spamming of the event log via via component usage (#14087)
* initial work on add the ability to save/fetch app data

* update to use get_app_data for ZFS

* update the poller for the new app_data stuff

* ZFS now logs changes to pools

* add schema update for app_data stuff

* small formatting fix

* add a missing \

* now adds a column

* sql-schema is no longer used, so remove the file that was added here

* misc cleanups

* rename the method in database/migrations/2022_07_03_1947_add_app_data.php

* hopefully fix the migration bit

* add the column to misc/db_schema.yaml

* more misc small DB fixes

* update the test as the json column uses collat of utf8mb4_bin

* revert the last change and try manually setting it to what is expected

* remove a extra ;

* update suricata as well

* correct the instance -> instances in one location to prevent the old instance list from being stomped

* remove a extra ;

* update fail2ban to use it as well

* remove two unused functions as suricata and fail2ban no longer use components

* style cleanup

* postgres poller updated to use it

* update html side of the postgres bits

* chronyd now uses app data bits now as well

* portactivity now uses it as well

* style fix

* sort the returned arrays from app_data

* correct log message for port activity

* collocation change

* try re-ordering it

* add in the new data column to the tests

* remove a extra ,

* hmm... ->collate('utf8mb4_unicode_ci') is not usable as apparently collate does not exist

* change the column type from json to longtext

* mv chronyd stuff while I sort out the rest of the tests... damn thing is always buggy

* hmm... fix a missing line then likely move stuff back

* style fix

* add fillable

* add the expexcted data for fail2ban json

* escape a " I missed

* add data for portactivity

* add suricata app data

* add app data to zfs legacy test

* put the moved tests back into place and update zfs-v1 test

* add app data for chronyd test

* add app data for fail2ban legacy test

* update zfs v1 app data

* add some notes on application dev work

* add Developing/Application-Notes.md to mkdocs.yml

* add data column to it

* added various suggestions from bennet-esyoil

* convert from isset to sizeof

* type fix

* fully remove the old save app data function and move it into a helper function... the other still needs cleaned up prior to removal

* update docs

* get_app_data is fully removed now as well

* a few style fixes

* add $casts

* update chronyd test

* attempt to fix the data

* more doc cleanup and try changing the cast

* style fix

* revert the changes to the chronyd test

* apply a few of murrant's suggestions

* document working with ->data as json and non-josn

* remove two no-longer used in this PR exceptions

* ->data now operates transparently

* style fix

* update data tests

* fix json

* test fix

* update the app notes to reflect how app data now works

* app test fix

* app data fix for linux_lsi

* json fix

* minor doc cleanup

* remove duplicate querty and use json_decode instead

* style fix

* modelize the app poller

* use a anon func instead of foreach

* test update

* style cleanup

* style cleanup

* another test cleanup

* more test cleanup

* reverse the test changes and add in some more glue code

* revert one of the test changes

* another small test fix

* Make things use models
Left some array access, but those will still work just fine.

* missed chronyd and portactivity

* rename poll to avoid make it any confusion

* Remove extra save and fix timestamp

* save any changes made to app->data

* nope, that was not it

* What are magic methods and how do they work?

* fix two typos

* update linux_lsi test

* change quote type

Co-authored-by: Tony Murray <murraytony@gmail.com>
2022-07-22 16:01:55 -05:00
Tony Murray
9320e6cd06
Prevent duplicate plugin table entries (#14120)
* Prevent duplicate plugin table entries
Some sort of race condition.
Add a unique index, this will cause the create query to fail when it tries to add a new entry for an existing plugin.

* Add index
2022-07-20 15:25:45 +02:00
Tony Murray
4536ccbcab
Fix device filtering false values (#14103)
now disabled=0 and ignore=0 filters should work
2022-07-11 14:56:52 -05:00
Tony Murray
9d28ee9200
Reset the opcache after install (#14098)
* Reset the opcache after install
Follow up to #14097

* clear the config, will be cached again on daily anyway
2022-07-09 02:57:09 -05:00
Tony Murray
25c40301d1
Update config cache on install finalize step (#14097)
This make sure the user doesn't get stuck in a loop.
2022-07-09 00:36:45 -05:00
Tony Murray
2b67dde6dd
Remove mib poller module remnants (#14077)
fixes #14075
2022-07-01 06:54:50 -05:00
Tony Murray
9f749ae778
Update Larastan (#14031)
* Update Larastan

* fix as many as I can

* update baseline for the remaining

* fix style

* Update Log::event phpdoc
2022-06-13 08:57:21 +02:00
Tony Murray
7a0d604cdd
Automatic fixes for validation failures (#13930)
* Automatic fixes for validations

* webui

* lint fixes

* Fix an install issue with ConfigSeeder requesting cli input in web page.

* Do not use c_echo in validate.php print_fail()
2022-06-10 16:25:33 -05:00
Tony Murray
32f1ce494e
Dashboard code cleanup (#13996)
* Dashboard Cleanup
Remove static widgets table, list of available widgets should not be in the database.
Remove legacy ajax scripts
Cleanup and reorganize controllers

* reorganize code to put all dashboard things into it's controller
better url scheme while supporting the original

* lint clean ups

* properly formatted language file

* style fixes

* update schema
2022-05-31 08:08:40 -05:00