42 Commits

Author SHA1 Message Date
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
258505ed44 Apply fixes from StyleCI (#13224) 2021-09-10 20:09:53 +02:00
d74bb37971 Show port speed on port graphs, optionally set scale (#11858)
* Show ifSpeed on Graph
Drop ifHighSpeed, we really don't want to store that value.

* safer truth check

* Allow global setting and per-graph variable

* match surrounding case

* Style fixes

* Remove old function usage

* update schema

* remove some old usages

* cleanup more ifHighSpeed references

* update test data to remove ifHighSpeed

* fix down migration

* Add button on graph page
Change default
tweak wording
2021-08-23 06:47:44 -05:00
450463f7b1 filter out NULL lat/lng values from Geographical Map display queries (#12985)
* filter out null lat/long values from map display queries

* removed space

* and the 2nd one

Co-authored-by: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com>
2021-06-25 01:33:20 +02:00
3d62be5003 Jquery upgrade (#12802)
* WIP js upgrades

* trying 3.0

* Event handler changes

* fix alert rule collection loading

* blur fix

* jQuery 3.5
homescreen no warnings

* actually 3.6 include js

* Update bootstrap to 3.4.1

* missed file

* Update and test install process

* cleanup

* attempt to version js files that were updated.
2021-05-11 08:08:06 -05:00
edb36fd69d More cleanups (#12715)
* PHPDoc

* Replace Auth > Illuminate\Support\Facades\Auth

* Return inside when()

* use str_replace correct

* Misc

* dead code

* use int $port

* styleci
2021-04-08 08:14:49 -05:00
1c379dcd05 Remove legacy function calls (#12651)
* massive inlines

* fix style and wtf

* remove rrdtool.inc.php include

* fix CommonFunctions namespace issues

* looking for missing class space, fix undefined class issues

* style fixes
2021-03-29 00:25:30 +02:00
800ae95b90 Cleanup (#12641) 2021-03-23 08:47:38 -05:00
0712b5299e Update availability-map.inc.php (#12632)
fix services url in availability maps as currently generates a 404
2021-03-18 16:27:49 -05:00
c5178cf550 webui: Add button to show verbose alert details in the alert, alert-log webui (#12484)
* Show verbose alert details in the alert, alert-log webui

update file permissions

* Make global admin permission required to use alert details ui

* StyleCI patch

Co-authored-by: root <root@usopsl-libre001.corp.blizzard.net>
2021-03-06 21:57:06 +01:00
20b4215204 Swich links to https (#12511)
* Switch librenms links to https

* Convert librenms links in comments

* Switch gnu.org url to https

* switch php urls to https
2021-02-09 00:29:04 +01:00
bef67751a3 Add PHP CS Fixer (#12128)
* Add PHP CS Fixer

Based on https://gist.github.com/laravel-shift/cab527923ed2a109dda047b97d53c200

* Apply PHP CS
2020-09-21 19:52:01 -05:00
29f45ca352 Apply fixes from StyleCI (#12124) 2020-09-21 15:59:34 +02:00
0d56bbd946 Apply fixes from StyleCI (#12123) 2020-09-21 15:51:53 +02:00
82f43cb98d Apply fixes from StyleCI (#12120) 2020-09-21 15:40:17 +02:00
a4d1f5e1c8 Show Device Outages as Log List (#12011) 2020-08-18 20:02:56 +02:00
dcab027c1f Enhance AlertLog Table View (#11936) 2020-07-18 00:26:17 +02:00
80aca5eec9 Fix availability map downtime (#11638)
* fix

* fix widget

* fix widget

* fix widget

* fix

* last_polled fix

* factorize down / up time device

* factorize down / up time device

* factorize down / up time device

* factorize down / up time device

* factorize down / up time device
2020-06-15 23:53:48 +02:00
e469d15493 check if lat/long exist for each device with link (#11366) 2020-04-02 10:49:28 +02:00
daf451cef7 Convert overview page to laravel (#10757)
* Convert overview page to laravel

* Convert more pages

* More fixes
2020-03-31 23:03:02 -05:00
e320fdf1cc Better map link scaling algorithm (#11329) 2020-03-23 11:42:18 +01:00
1cf7e206e5 Geographical map: Show network links between locations (#11269)
* Geographical map: Show links between locations

* Fix manifest after merge conflict
2020-03-13 11:22:32 +01:00
c07678d55f Mark Devices in Maintenance Mode (#11092)
* Mark Devices in Maintenance Mode

* code climate fix
2020-02-02 08:33:01 -06:00
692247ddf3 only show uptime seperator '-' if uptime present (#11069) 2020-01-26 08:04:52 -06:00
e3156cbef6 Support of "disable alerting" in availability map and device summary widget (#11022)
* Hide disabled alerting device from avaibility map

* Hide disabled alerting device from avaibility map

* Hide disabled alerting device from avaibility map

* Hide disabled alerting device from avaibility map

* Hide disabled alerting device from avaibility map

* Hide disabled alerting device from avaibility map

* Hide disabled alerting device from avaibility map

* Hide disabled alerting device from avaibility map

* Hide disabled alerting device from avaibility map

* merge for last release

* Hide disabled alerting device from avaibility map

* Hide disabled alerting device from avaibility map

* Hide disabled alerting device from avaibility map

* Hide disabled alerting device from avaibility map

* Widget device summary

* Widget device summary

* Widget device summary

* Widget device summary

* Widget device summary

* Widget device summary

* fix color in widget device summary

* fix color in widget device summary

* Commit to restart travis CI

* Commit to restart travis CI
2020-01-15 11:32:29 -06:00
ee8297df19 Extend FS switches support, handle lowerLayerDown ifOperStatus (#10904)
* extend FS switches support

* MIB compilation

* HW and Ver

* sensors and CPU

* tests

* correct version

* try to handle properly "down" as not up, for OperStat like lowerLayerDown

* try to handle properly "down" as not up, for OperStat like lowerLayerDown

* try to handle properly "down" as not up, for OperStat like lowerLayerDown

* try to replace "down" with "not up" :)

* fix other ifOperStatus checks
2020-01-15 08:28:36 -06:00
b361710148 Device group based access (#10568)
* Device group based access

* Use Permissions class to resolve permissions

Also give port access based on device access

* Convert more pages to use Permissions class

* shorten config setting name
use Eloquent relationships in several places
alphabetize config_definitions.json

* Change Models and Permissions

* Clean up ajax_search LIMIT sql

* Convert more pages to use Permissions class

Co-authored-by: Tony Murray <murraytony@gmail.com>
2019-12-30 12:11:26 +01:00
82bad5f701 Add alert history in device section (#10972)
* Alert log in device
2019-12-24 17:11:25 +01:00
e6423852ef Remove $_SESSION usage, except install (#10745)
* Remove $_SESSION usage, except install
Fixes issue with device debug capture
Removes secure_cookies setting, use the .env variable SESSION_SECURE_COOKIE instead.  Reminder secure cookies requires cookies are transported over https, if everything is already transported via https, the setting won't make a difference.

* Fix availability map controls
2019-10-26 00:29:12 +00:00
52f1bc9e8c geographical map sql query fix for normal user (#10590) 2019-09-09 12:26:44 +02:00
3cb971e33f Added Graylog to device overview and log level filter mechanism (#10509)
* Added Recent Graylog Entries to Device Overview (WIP)

* Improved "Recent Graylog" entries on device overview (WIP)
Added $config['graylog']['device-page']['rowCount'] to set maximum rows shown in "Recent Graylog" on device overview (Default: 10)
Added $config['graylog']['device-page']['maxLevel'] to set the maximum message level shown in "Recent Graylog" on device overview (Default: 7, validates value to be >= 0 and <= 7)

* Fixed code styling issue

* Added Log Level filter to Graylog widget
Added Log Level filter to Graylog pages (device pages and graylog overview)

* Added documentation for new configuration options

* Removed unneccesary (and already commented) using
Renamed "maxLevel" to "loglevel" as suggested by a colleague

* Added doc for $config['graylog']['loglevel']

* Removed includes/html/print-graylog.inc.php and inlined it in includes/html/pages/device/overview/graylog.inc.php
Removed comma in json object in resources/views/widgets/graylog.blade.php
Replaced translation strings in resources/views/widgets/settings/graylog.blade.php with existing translation strings

* log level -> minimum log level

* Use Config::get() default functionality

* Oops
2019-08-27 12:44:27 -05:00
e99f421511 Remove legacy auth usage of $_SESSION (#10491)
* Remove auth use of $_SESSION

Will break plugins that depend on $_SESSION, Weathermap was already fixed.
Port them to use Auth::check()/Auth::user()/Auth:id()

* revert accidental replacement
2019-08-05 14:16:05 -05:00
6394c35ce6 Graylog entry matching device if source is not hostname or primary ip (#10458)
* Added findByHostnameOrIp($hostnameOrIp) for devices.
    Returns Device or null
Fixed Graylog device links, "device" parameter in URL was IP or Hostname instead of device id before
Added Severity number to name conversion. Can be activated by setting $config['graylog']['severity-names'] = "true" in config
Added Facility number to name conversion. Can be activated by setting $config['graylog']['facility-names'] = "true" in config

* Added $config['graylog']['match-any-address']. To enable matching Graylog entries by any interface address set to "true"
Added code to match Graylog entries by any interface address instead of only hostname or primary address

* Fixed missing quotation marks in <script> block in includes/html/common/graylog.inc.php:46, causing graylog page only load header with empty table. Introduced in https://github.com/librenms/librenms/pull/10447

* Modified code to reduce complexity as mentioned by codeclimate

* Changed findByHostnameOrIp($hostnameOrIp) as mentioned by https://github.com/murrant

* Added Language File "syslog.php" for Syslog Severity and Facility
Merged functions "levelName($level)" and "facilityName($facility)" to "syslogPrioParser($type, $value)" where $type should be "facility" or "severity" and $value the numeric or text facility or severity. Returns "NUMBER (NAME)" if possible, otherwhise returns $value

* Shortened findByHostnameOrIp($hostnameOrIp) as mentioned by https://github.com/murrant

* Add shortcut ipv4 and ipv6 device relationships
Better code for adding source addresses
Only translate level and facility if they are numeric
Allow level and facility to be sortable
No need for device link if we know it won't work.  Before the code was punting to save sql queries.

* Cache devices
Took queries from 69 to 6 in my quick test.

* Added Documentation for $config['graylog']['match-any-address']

* Fixed missing quotation marks in app/ApiClients/GraylogApi.php:125
2019-07-26 15:13:35 -05:00
fd42ea6e83 Add more detail to webgui alerts (#10388)
* alert sysname

* use existing config option

* add location to alert table

* made location a link

* fix formating

* Update alerts.inc.php
2019-07-18 23:24:24 -05:00
36a5da00ca Fix missed alert function renames (#10452) 2019-07-18 11:05:43 -05:00
3ead462549 Enable CSRF protection (#10447)
* Enable CSRF protection

* fix style issues
2019-07-17 07:20:26 -05:00
f3ba8947f7 Use Config helper (#10339)
remove usage of global variable
2019-06-23 00:29:12 -05:00
1a60c44eb0 Device groups rewrite (#10346)
* Device Groups rewrite
Updated web ui
Static or dynamic groups allowed
Alert rule query builder
Translation support
Permissions support

* cleanup, make relationship save, and validate it

* builder WIP

* rules builder and rules saving/loading

* Parse query builder to Laravel Fluent query

* Upgrade existing groups when editing.
Properly update only dynamic groups when polling.

* remove unused old code
Update API and other places to use Eloquent

* debug output in poller restored

* Fix up some things
creating static
improved validation
fix js error on creation
Fix static groups in polling

* hide pattern for static group

* Implement authorization
Use in the menu too

* update schema

* fix rollback

* Don't abort on invalid queries

* fixes to query builder

* add test data, looks like macros aren't handled (omitted them because groups don't use them generally)

* Add macro support for QueryBuilderFluentParser

* add test for macro that accepts value

* More space in forms
Retain rules when converted to static
no duplicate names allowed

* Better error feedback
Update related devices on save

* Add button icon

* format

* update docs

* fix tests

* Fix some QueryBuilderFluentParser issues with OR
updated/more test data

* Show device groups runtime
fix querybuilder.json format

* Store table joins in the rules to minimize polling time
Update group joins in daily.sh (and when they are saved)

* Update daily.php

* Add units to time
2019-06-19 16:01:53 -05:00
c2b09b8f80 Revert "Rewritten device groups (including static) (#10295)" (#10340)
This reverts commit cfc51d51f5714519536931bc331ed981639a9d87.
2019-06-16 21:52:57 -05:00
cfc51d51f5 Rewritten device groups (including static) (#10295)
* Device Groups rewrite
Updated web ui
Static or dynamic groups allowed
Alert rule query builder
Translation support
Permissions support

* cleanup, make relationship save, and validate it

* builder WIP

* rules builder and rules saving/loading

* Parse query builder to Laravel Fluent query

* Upgrade existing groups when editing.
Properly update only dynamic groups when polling.

* remove unused old code
Update API and other places to use Eloquent

* debug output in poller restored

* Fix up some things
creating static
improved validation
fix js error on creation
Fix static groups in polling

* hide pattern for static group

* Implement authorization
Use in the menu too

* update schema

* fix rollback

* Don't abort on invalid queries

* fixes to query builder

* add test data, looks like macros aren't handled (omitted them because groups don't use them generally)

* Add macro support for QueryBuilderFluentParser

* add test for macro that accepts value

* More space in forms
Retain rules when converted to static
no duplicate names allowed

* Better error feedback
Update related devices on save

* Add button icon

* format

* update docs

* fix tests
2019-06-16 08:27:22 -05:00
e9ae08d5db Use Laravel url helpers to improve functionality without dns name (#10227)
* Use Laravel url helpers to improve functionality without dns name
Not exhaustive...

* Fix Url generated urls

* Bump js version
2019-05-20 11:47:34 -05:00
36431dd296 Security fix: unauthorized access (#10091)
* Security fix: unauthorized access
Affects nginx users:
Moved php files outside of public html directory (Apache was protected by .htaccess)

Affects all users:
Some files did not check for authentication and could disclose some info.
Better checks before including files from user input

* git mv html/includes/ includes/html
git mv html/pages/ includes/html/
2019-04-11 23:26:42 -05:00