577 Commits

Author SHA1 Message Date
41ddce6377 XSS fix, cont. again (#13778)
* XSS in alert template creation

* XSS in alert rule name

* XSS in service name & desc

* style

* strip_tags in alert_notes

* strip_tags in create_alert_item

* strip_tags in addsrv page
2022-02-13 20:23:07 +01:00
0029e9f161 [refactor] Eloquent for includes/html/pages/device/health.inc.php (#13777)
* [rewrite] includes/html/pages/device/health.inc.php
* translate sensor names
* ci
2022-02-13 19:20:47 +01:00
4f86915866 XSS fix, cont. (#13776)
https://huntr.dev/bounties/13951f51-deed-4a3d-8275-52306cc5a87d/
2022-02-13 19:07:37 +01:00
135717a9a0 security - XSS Fix 01
fixing https://huntr.dev/bounties/114ba055-a2f0-4db9-aafb-95df944ba177/ (#13775)
2022-02-13 11:00:56 +01:00
7d2ade71f1 [WebUI] Show selected selection option on graphs page (#13765) 2022-02-11 11:06:41 +01:00
b9e55bc462 Upgrade to font awesome 5 (#13754)
* Upgrade to font awesome 5

* Update memory icon
2022-02-09 00:49:07 +01:00
58c88a6db3 [WebUI] Removing colon symbol from multiple dialogs (#13742)
* [WebUI] Removing the colon symbol from dialogs

In order to make multiple pages more visually consistent with other pages in the system, removed the colon simbol ":" to the very right of each control description, where present.

Regards
GG

* Update new_alert_rule.inc.php

* Update alert_schedule.inc.php

* Update alert_template.inc.php
2022-02-03 15:51:51 +01:00
b93a892feb [WebUI] Added the word Actions in the header of the oxidized-nodes table (#13741) 2022-02-02 02:07:35 +01:00
29bd6789cb Stp module rewrite (#13570)
* STP module rewrite WIP

* Finish rewrite

* Ignore disabled and log root/topology changes

* Remove interfaces for now

* fix style

* Lint fixes

* Document ResolvesPortIds and hide map functions

* whitespace fixes

* Revert to stpInstances in case someone writes mstp support

* missed one

* phpstan fixes

* Handle table and oids separately

* forgot to register observer

* Test data and correct non-table handling in SnmpResponse->table()

* update test

* test data

* revert aos7 silly things

* minimal polling

* Update test data

* order ports_ntp and rename new field to port_index

* forgot the db_schema

* revert ciena-sds port things

* MSTP support, maybe

* Adding test data

* Filter bad lines instead of discarding the entire snmp response
and capture fixes and test data

* fresh data

* add os data

* update data, ignore unfound ports, obviously bad device implementation.

* fixes

* Ignore context files in os detection test

* Remove empty table data

* add ciena-sds vlan

* designatedCost column is too small

* Update stp webui

* Refactor code to interfaces, to allow vendor mibs

* update schema

* fix issues added by abstraction

* STP fixes

* Default to no context for vlan 1

* never store vlan 1

* Update test data

* remove eltex brokenness

* fix style

* fix stan

* Fix Rewrite MAC to Hex padding with floats

* fix sqlite migration
2022-01-30 16:28:18 -06:00
b6a8b602b8 Oxidized update and Device remove (#13730)
* Oxidized + Device remove
Was just working on oxidized, but then to properly update nodes after delete, updated delete_device()

* revert dumb style changes

* baseline update and no DI there...

* Fix OS first load and device deletion missing tables
2022-01-29 21:09:05 -06:00
d2d07b8c88 Place a more consistent Fontawesome icon for the Export to PDF (#13713)
In Alerts >> Alert History

1 - reword "Export to pdf" to "Export to PDF"
2 - replace the Fontawesome Heartbeat icon with the Fontawesome File to PDF icon.

Regards
GG
2022-01-26 22:43:22 +01:00
1debe5e166 Use built in method to render a string with Blade (#13688) 2022-01-26 07:10:06 -06:00
20495d648c [WebUI] 2/2 Services - Removing the colon symbol to the right of a control label (#13705)
In order to make the Services Add or Edit pages while adding a Service more visually consistent with other pages in the system, removed the colon simbol ":" to the very right of each control description, where present.

Regards
GG
2022-01-24 22:20:14 +01:00
aaf8e37c09 [WebUI] 1/2 Services - Removing the colon symbol to the right of a control label (#13704)
In order to make the Services Add or Edit pages while adding a Service more visually consistent with other pages in the system, removed the colon simbol ":" to the very right of each control description, where present.

Regards
GG
2022-01-24 22:20:05 +01:00
f1e436a55e Removing the colon symbol to the right of a control label (#13698)
In order to make the "Device setting" tab while Editing a device more consistent with other pages in the system, removed the colon simbol ":" to the very right of each control description, where present.
This because in no other HTML pages we find that the label with the control description is followed by a colon symbol.

Regards
GG
2022-01-22 13:28:37 +01:00
0fc2f9e4c9 Add API-routes for listing MPLS SAPs and services (#13561)
* add apis for mpsl services and saps

* updated docs

* removed dbFetch, orm instead

* changed queries

* Removed unused variables

* Update api_functions.inc.php

* Update api_functions.inc.php

* Update api_functions.inc.php

* Update api_functions.inc.php

Co-authored-by: laf <gh+n@laf.io>
2022-01-20 08:15:23 -06:00
df288edbe3 remove unneccessary Section Description (#13677) 2022-01-15 09:59:56 -06:00
8f8872520a Add supervisord application (#13673) 2022-01-13 18:19:27 +01:00
42d84da24a Device tracepath using wrong variables to check for traceroute output (#13674) 2022-01-13 17:34:36 +01:00
7453ca65ae Allow filter by display name in device list (#13665)
* Corrected filtering of devices under maintenance

* Fix display of device sysname in alert history stats widget

* Merge LibreNMS master

* Enable searching for devices using display name

* Enable searching for devices using display name
2022-01-11 12:55:43 -06:00
107736697c Add Sla jitter packet loss percent graph (#13600)
* Add sla packet loss percent rrd graph

* Add packet loss percent div

* Add OID for NumPackets

* Fixed CDEF typo

* Rename graph file to include .inc

* Flipped axis for Src and Dst to match key

* Create new rrd file for loss percent

* Remove duplicate rrd data and rename rrd to reflect

* Amend to use second rrd file for NumPackets

* Removed spaces

* dbFetchRow be gone

* insert if statement check

* white space cleanup

* New line at end of file

Co-authored-by: Tony Murray <murraytony@gmail.com>
2022-01-09 18:57:16 -06:00
fa3367f5c6 Timos sap dot1q graphing fix (#13654)
* Added wireless MSE

* dot1q sap graph fix

* Fix removed files

* fix

* Fixed style

* Fixed style

* Fixed style

* Removed vscode workspace file

* Clarification
2022-01-09 10:33:32 +01:00
2d57e49caf Teleste Luminato ports & qam/asi output sensors & yaml (#13616)
* Luminato: bitrate sensor

* bitrate sensor Eloquent

* luminato ports

* luminato ports styleci

* luminato QAM/ASI sensor

* luminato QAM/ASI sensor styleci

* YAML & test

* drop debug $ver from sensor type

* mess with Teleste ifExtPhysInterface/ifExtLogiInterface

* styleci

* test data

* mistake in port discovery

* left out Graphs->Health->Overview->Bitrate label

* fixed Bitrate graph, copy/paste errors
2022-01-08 18:17:08 +01:00
4b64d33d13 API detect if new location should be fixed by default (#13637) 2021-12-27 17:32:50 -06:00
VTS
1ac60e3b1d set fixed_coordinates via api (#13593)
* set fixed_coordinates via api

* update api doc

* fix style problem

* Update Locations.md

* Update api_functions.inc.php

* Update api_functions.inc.php

Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-12-23 15:32:02 -06:00
e24862545d Fix the displayed unit for frequency and distance in the wireless section (#13614)
* Fix the displayed unit for frequency and distance in the wireless menu

* Small style fix
2021-12-13 08:30:57 -06:00
a95efd6d2a Global search: search device display (#13583)
* Global search: search device display
Add display field to search (also port_desc_descr, portName, and bgpPeerDescr)
Rewrite backend
update typeahead bundle
update devices and ports indexes
reduce some port field sizes so we can index them

* Style fixes

* remove nonsense
2021-12-06 16:12:24 +01:00
12a262744e Fix nototal graph option (#13589) 2021-11-30 19:21:09 -06:00
99fbdeef02 Do not show location in device overview if location is not found (#13572) 2021-11-26 18:54:29 +01:00
6bf97c6ac9 API 'list_parents_of_host' - mostly doco, but one small code enhancement (#13567)
* Allow 'list_devices' to query by exact device-id

* Remove 'http://' prefix from --dev-addr in doco for 'mkdocs serve'

* Document 'list_parents_of_host' API call by reference to 'list_devices' call

* Remove possibility of SQL injection attacks

* Remove possibility of SQL injection attacks
2021-11-25 22:38:50 +01:00
35a6905092 Fix security vuls (#13554)
* Fix XSS vulnerabilities

* fix XSS vulnerabilities in alerts.inc.php

* fix XSS vulnerability in poller-groups.inc.php

* small fix for the integration

* another fix for the inegration

* another fix for the inegration

* change the sanitizer at sources instead of json_encode sinks

* another change sanitizer at sources instead of json_encode sinks

* another change sanitizer at sources instead of common_output and current_config sinks

* fix path manipulation vulnerability
2021-11-24 10:00:25 -06:00
790c4b3402 Configurable device display name (#13528)
* Configurable device display name
You can just set the display name in device settings.

It also accepts simple template format with  the variables: hostname, sysName, sysName_fallback, ip

Default controlled by device_display_default, (set from old force_hostname_to_sysname and force_ip_to_sysname settings

* remove second argument to format_hostname()

* Style fixes

* Update schema

* update phpstan baseline

* Improved settings strings (and add for translation)
2021-11-18 15:46:22 -06:00
b6240254b4 Billing fix a couple divide by zero errors (#13517)
* Billing fix a couple divide by zero errors
In probably an ocean.

* add missing space
2021-11-15 10:31:52 +01:00
97340c5fd5 add missing graph definition for pf_matches (pfSense firewall) (#13507)
* add missing graph definition for pf_matches (pfSense firewall)

* update unit_text
2021-11-12 10:35:54 -06:00
19217e8dfc Fix maintenance mode button in Firefox (#13500) 2021-11-12 08:22:57 -06:00
0862496e26 Fix api transport mult-line parsing (#13469)
* API transport fix parsing
parse templates after parsing user options, not before

* API transport tests

* fix style and lint

* remove accidental item

* fix more type issues
2021-11-03 13:37:57 -05:00
5900edbf16 PHP-Flasher for toast messages (#13401)
* PHP-Flasher for toast messages
Allows customized template
removes dependency on unmaintained package using dev stability
no solution for javascript toasts yet

Use DI in places it makes sense

allow html in flashes

Use "template.librenms" as a default notification style

merge toast containers
toastr needs to be second because it will find the containr made by flasher, but the inverse is not true

upgrade php-flasher to add custom options and persistent notifications

Add dark theme

* update composer.lock
2021-10-29 09:13:56 -05:00
38773598e0 Fix syslog widget priority filtering (#13411)
* Fix widget filtering
syslog stores priority as a string
filter strings, not numbers

* Add enums for SyslogSeverity and CheckStatus
2021-10-29 10:32:36 +02:00
b0e0d65c86 Fixes for misc unset variables in polling (#13421)
Remove $attribs global
2021-10-25 21:35:18 +02:00
bc8efedc83 Show single quotes correcting for device configs (#13360)
* Added ENT_HTML5 decoding for device configs
Previously single quote/apostrophes weren't being decoded correctly from &apos;, leading to configs being misrepresented in LibreNMS. ENT_HTML5 allows for proper decoding.

* Change to less risky flag

* Update showconfig.inc.php

Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-10-20 23:20:57 -05:00
98ed6bb9dc New plugin system based on Laravel Package Development (#12998)
* use Blade view and Eloquent models for plugins

* move views

* fix style

* fix style

* revert mistake

* Update Plugin.php

delete test property "name"

* rename plugin function to settings

* last but not least - rename in Test.php

* Rename Test to Example

* fix typo

* fix style

* fix style

* fix style

* fix style - I hate tabs...

* Extract view calls

* fix method calls and style

* Move Models the the abstract class

* fix style

* Convert to traits

* Change the Example description

* Fix style

* Fix style

* Fix style

* Convert plugin function to Model static methods and delete .inc.php

* fix style

* fix style

* Use scope

* final methods blows up legacy code

* Config > \LibreNMS\Config

* convert the static string to a static method

* Correct placement in the page

* fix tabs

* fix style

* Rename from tait to hook

to make it easier to understand and be complient

* rename file

* Typo

* Started to change the docu

* change to a more usefully Device_Overview example

* and activate of course

* PluginManager

* fix .gitignore

* only php files in the root folder

* corrected .gitignore with all files :)

* Rename the Hooks and ExampleClass for better readability

* Fix style

* Fix style

* Exception handling (especially if DB is not present)

* Fix style and update schema

* fix indentation

* actually correct indent

* fix migration collation check include utf8mb4_bin

* stop phpstan whining

* A view lines documentation

* add typeHints

* Allow return null on handle

* lint

* fix return types

* fix logic of column collation check

* Fix MenuEntryHook

* switch to longtext instead of json type for now :D

* try phpstan on PHP 7.3

* set phpstan target version to 7.3

* all the typehints

* optional

* more

* Use namespace to prevent view collisions
disambiguate plugin and hook
no magic guessing of names in PluginManager, bad assumptions
remove unused plugins from the DB

* cleanup plugin menu

* cleanup on shutdown and ignore but log query error on cleanup

* instanceof must be called against an instance

* Allow multiple hooks per plugin

* Port plugin ui code to Laravel

* page instead of settings for v1 plugins

* actually working settings pages
a little url cleanup plugin/admin -> plugin/settings

* fix style

* Add page hook

* PHPstan

* Try to fix Illuminate\Http\RedirectResponse

* typehint

* Rewrite the doc

* Fix style

Co-authored-by: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com>
Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-10-19 06:53:28 -05:00
d3726e6bdc Update alertlog-widget to allow filtering by device group (#13380)
* Add group filter to alertlog widget

* Remove extra characters from settings

* Apply fixes from StyleCI

Co-authored-by: ottorei <ottorei@users.noreply.github.com>
2021-10-19 06:18:29 +03:00
fb7d89c4c3 Add get_ports_by_group API function (#13361)
* implement api route get_ports_by_group

* Update API docs for new get_ports_by_group

* Fix misspelling of function names and routes
2021-10-18 20:47:37 -05:00
16584d8090 Added conditional check for rules parameter on add_device_group API function (#13353) 2021-10-11 21:08:16 -05:00
0b8b97bb68 Push Notifications (Mobile and PC) (#13277)
* Update manifest and add service worker
cleanup icons a bit

* Push notifications WIP

* navigate working

* cleanup

* acknowledge wired up

* Set VAPID keys on composer install

* Component to control notification permissions.

* Allow all user option to validate

* Enable on browser load if transport exists.

* Check for transport before showing user permissions
translations

* Documentation

* style fixes

* access via the attribute model

* fix alerting test

* update schema

* cleanup subscription on disable

* non-configurable db and table for webpush subscriptions (respect system connection)

* revert AlertTransport change
hopefully phpstan can figure it out

* phpstan fixes

* Support custom details display

* Match transport names to brand's preferred display

* less duplicate id errors

* Tests are done in Laravel code now so
remove legacy function usage... could be better, but ok

* Style fixes

* Style fixes 2

* Fix alert test

* Doc updates requires HTTPS and GMP

* unregister subscription when permission is set to denied

* cleanup after user deletion

* delete the right thing

* fix whitespace

* update install docs to include php-gmp

* suggest ext-gmp

* update javascript

* Update functions.php

Co-authored-by: Jellyfrog <Jellyfrog@users.noreply.github.com>
2021-10-06 07:29:47 -05:00
6288cb6edf alert detail fix (#13335) 2021-10-05 14:35:51 -05:00
8e1b9e2989 Show Detail by default Option on Alert Widget (#13309)
* Show Detail by default on Alert Widget

* .

* change to row count length limitation

* .

* .
2021-10-03 01:12:18 +02:00
fafb5a62c2 Fix port links (#13296)
yes is not a valid boolean
2021-09-30 09:41:12 +02:00
66dddbaa66 SNMP Capabilities (#13289)
* SNMP Capabilities
Allow all available auth algorithms to be set in global settings
cleanup other usages

* fix style
2021-09-28 18:35:59 -05:00
708d1ebb87 API Call to set instant Maintenance mode (#13237)
* API Call to set instance Maintenance mode

* .

* remove unused code

* update query

* Use recent code

* remove accidental line return

* fix duration in success string

* style fix

* Try to fix bad code merge

Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-09-28 21:54:52 +02:00