* Convert Config to a singleton
Continuation of #14364 by @Jellyfrog
This time, make the old class a shim for the facade. Will update references in a separate PR.
* Remove logging config call
* Apply fixes from StyleCI
* Fix bad Git constructor call
* Fail on config table does not exist instead of throw exception
* Inline LibrenmsConfig::isRegistered()
* Debug call in case there are more issues,
remove before merge.
* Fix up config tests
* Allow config cache controlled by CONFIG_CACHE_TTL (disabled by default for now)
* Enable config cache for tests
* Remove debug statement and deprecation phpdoc
* Apply fixes from StyleCI
---------
Co-authored-by: Tony Murray <murrant@users.noreply.github.com>
* SnmpTrap Handler for Cisco IOS LDP Session UP and DOWN
* Indentation correction
* Indentation correction 2
* Indentation correction 3
* MIB correction in snmptraps.php
* Added test file and mib
* Added test file and mib - v2
* Added test file and mib - v3
* Added test file and mib - v4
* Added test file and mib - v5
* Added test file and mib - v6
* Added test file and mib - v7
* Added test file and mib - v8
* Added test file and mib - v9
* Added test file and mib - v10
* Added test file and mib - v11
* Added test file and mib - v12
* Added test file and mib - v13
* Added test file and mib - v14
* Added test file and mib - v15
* Added test file and mib - v16
* Added test file and mib - v17
* Added test file and mib - v18
* Added test file and mib - v19
* Added test file and mib - v20
* Added test file and mib - v21
* Added test file and mib - v22
* Added test file and mib - v23
* Added test file and mib - v24
* Add ifAlias in logs messages and change type to interface for message
* Add ifAlias in logs messages and change type to interface for message
* Add ifAlias in logs messages and change type to interface for message
* Add ifAlias in logs messages and change type to interface for message
* Add ifAlias in logs messages and change type to interface for message
* Add ifAlias in logs messages and change type to interface for message
* Remove flasher
Just use a bit of custom code to interface with toastr js
This is able to retain our custom theme and work properly
* Fix style issues
* Missed reference rename
* Remove test code :)
* Fix a missed rename
* Fix one more missed reference
* Fix typo
* Iterate in javascript and separate processing
* Widget refresh/destroy events
* Remove old dom and unbind events
* fix whitespace
* Fix up bootgrid tables, they inserted a div before the first div breaking event propagation
switch to regular js function to scope variables instead of jquery
* Handle settings the same way as the normal widget
* Use standard init_map and add layer control
* May need L.Control.Locate now
* Set maxZoom for marker cluster
* Try setMaxZoom
* worldmap size 100 and resize on refresh/widget resize
* Add resize event (and throttle it a bit)
* Further worldmap cleanup
* Move most javascript to common js, will cause js errors until page is reloaded, but better in the long run
* Fixed mysql connection to include additional options for SSL Cert and Key. This allows for TLS client communication.
* Modified config options for mysql database to make SSL/TLS settings optional.
SSL/TLS CA, CERT, and KEY are optional. If they are not provided the array_filter() will remove them.
MYSQL_ATTR_SSL_VERIFY_SERVER_CERT is outside array_filter() because the function will remove the option if it is falsey; however there are times when that variable must be set to false.
* fix style
---------
Co-authored-by: Tony Murray <murraytony@gmail.com>
* 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
* 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>
* Adds API call to update port notes on devices.
* Adds Cisco IETF-DHCP Server MIB and Trap Handlers.
* Updates local permissions changed.
* Linting cleanup.
* Moves test to a single file. Updates the args to match the status.
* Fixes tests failing for Cisco DHCP server SNMP traps.
* 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.
* 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)
* 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>
* Allow configuration of the SSL/TLS operating mode when connecting to a mysql database
* Support SSL/TLS DB connections in the dispatcher service as well
* Apply black formatting standards to Python files
* Suppress pylint errors as redis module is not installed when linting
* More pylint fixes
* Correct typo in logging output
* Refactor SSL/TLS changes into DBConfig class instead of ServiceConfig
* Define DB config variables as class vars instead of instance vars
* Break circular import
* 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()
* Move Config loading to a service provider
That way other service providers can depend on it
Move various random listener registrations into the EventServiceProvider
Various startup cleanup
* Config::persist Set live variable before persisting incase db update fail
* Disable strict mode for legacy code (init.php)
* Disable debug after os test data is gathered
* remove Eloquent::boot it is never used
* remove Eloquent::version
* lint fixes
* style fixes
* there is no c_echo here
* Add Cisco Err Disable Mib
* Add new trap handler class
* Add ErrDisabled event handler
* Add ErrDisalbed event test
* remove unused line
* no ifindex message change
* Update unknown ifIndex message
* Add bad IfIndex test
* update description text
* style fixes
* change param to True for toString
* Add return type to test function
* style fix
* remove toString() and explode()
* remove unused line
* OspfTxRetransmit class
* Message tidyup
* Initial test class
* add ospftxretransmit class
* add empty line
* chnage int to string in traptext
* new block to catch non lsupdates trap
* Add second test
* lint fail changes
* extra space removed
* Secure MAC Violation event
* Add Cisco Port Sec Mib
* Add CiscoMacViolation class
* removed $ifIndex and $port reference
* change ifDescr for ifName
* New test
* style fix
* Implement OAuth and SAML2 support via Socialite
* Add socialite docs
* fixes
* Additional information added
* wip
* 22.3.0 targeted version
* Allow mysql auth as long as there is a password saved
Co-authored-by: laf <gh+n@laf.io>
Co-authored-by: Tony Murray <murraytony@gmail.com>
* push apc trap handlers
* added unit test
* removed CR and fixed test
* switch cr for lf
* fixing ci complaints
* fixing another ci error
* fixed unit test
* annotating test
* Veeam fix and extend part 1
* Veeam SNMP traps
* StyleCI
* StyleCI
* Fix typo
* Lint
* Fix tests
* Fix tests :fingerscrossed:
* Think i get it now
* This is it?
* gotta be it
* Final
* Again
* core WIP
* try to finish up
* trim space too
and a couple of cleanups
* update test data
* put escapes back
* another net-snmp difference
* correct copy paste error
* WIP
* Use new code YAY
* a tiny bit more
* Kind of working
* Handle manual modules correctly
* convert core to modern module
* Only save metrics if modules is not overridden
* correct module exists check
* database error handling
* debug handling
* restore bad changes
* Introduce Actions
RunAlertRulesAction
UpdateDeviceGroupsAction
* tweaks to output
* Fix some issues in outside code
* Style fixes
* fixes to module status checks
* typehints!
* Use logger only and DI
* OS module not named correctly
* Work on quiet output a bit more
* generically don't change output when disabling debug if the driver is already stack
* Fix missing $device variable for legacy os polling
Fix missing dbFacile functions when no legacy modules polled in RunAlertRulesAction
* restore legacy os module shim
* use the new poller code for tests
* PollingDevice event
* Fix some issues and enable/disable error reporting around legacy modules
* typehints
* fully update baseline
* Use Process for version commands so we don't leak debug output.
* don't detect rrdtool version in ci every time
* style fixes
* Warning fixes
* more fixes
* re-update baseline
* remove diff noise
* fix up alerts
* Catch exceptions in device ip lookup
* Revert accidental snmp.inc.php poller target change
(should have been ?: not ??)
* core WIP
* try to finish up
* trim space too
and a couple of cleanups
* update test data
* put escapes back
* another net-snmp difference
* correct copy paste error
* WIP
* Use new code YAY
* a tiny bit more
* Kind of working
* Handle manual modules correctly
* convert core to modern module
* Only save metrics if modules is not overridden
* correct module exists check
* database error handling
* debug handling
* restore bad changes
* Introduce Actions
RunAlertRulesAction
UpdateDeviceGroupsAction
* tweaks to output
* Fix some issues in outside code
* Style fixes
* fixes to module status checks
* typehints!
* Use logger only and DI
* OS module not named correctly
* Work on quiet output a bit more
* generically don't change output when disabling debug if the driver is already stack
* Fix missing $device variable for legacy os polling
Fix missing dbFacile functions when no legacy modules polled in RunAlertRulesAction
* restore legacy os module shim
* use the new poller code for tests
* PollingDevice event
* Fix some issues and enable/disable error reporting around legacy modules
* typehints
* fully update baseline
* Use Process for version commands so we don't leak debug output.
* don't detect rrdtool version in ci every time
* style fixes
* Warning fixes
* more fixes
* re-update baseline
* remove diff noise
* fix up alerts
Because we know authenticate cookies, remember me is tied to the session lifetime now in addition to the cookie lifetime. Increase the lifetime to one month instead of two hours.
* 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
* 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>
* Rename NetSnmp to SnmpQuery
Always resolve a new instance. It was not expected to be a singleton, set options persisted.
This means numeric() works properly now
* fix snmpfetch call and style
* Ability to set device from device array
* 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>
* SNMP WIP
* cleanup, more types
* Include my snmp:fetch command
* Fix Facade name conflict
* Command WIP
remove mib
* Ignore exit code
cleanups
* Doc blocks and style fixes
* forgot to use parseOid
* Hopefully final fixes
* missed on (:
* small changes
deviates from existing code, hopefully doesn't re-add too many corner cases.
* add some simple tests, will make it easier to add more in the future when we find corner cases.
* test numeric
* API refinements, try to avoid setting textual net-snmp options directly
* change numeric to a toggle makes for nicer usage
* make ci happy
* Some errors happen only in stderr, pass that to SnmpResponse for parsing.
Add error message access
* More consistent naming
* Infer character encoding for ifAlias and sysLocation
Tries to convert character encoding for non-UTF-8 encoded strings.
This will only work for snmp strings that are type-hinted, not ones forced to ASCII with -Oa or similar
Only works for your default charset or Windows-1251 or LATIN1.
You can set your character encoding in .env with CHARSET
Please save us all and just use UTF-8
* style fixes
* less Yoda
* ensure return type
* fall back to passed string
* don't convert strings with any unprintable characters (such as line return)
* Update LibreNMS/Util/StringHelpers.php
Co-authored-by: Jellyfrog <Jellyfrog@users.noreply.github.com>
* Fix CP850
* fix space
Co-authored-by: Jellyfrog <Jellyfrog@users.noreply.github.com>