* Show composer status in web validate.
Don't duplicate in validate.php
* Create variable to check if a group has been completed.
No longer skips database checks.
Extract a base class.
Fix locate_binary and find_executable issues (mostly exposed by lack of db)
* Update Validator.php
* Restore vendor contents even if composer is not available
Leave the code in both places for safety.
* Instruct users to use the wrapper instead of straight up composer...
* Prep for composer changes
* Update composer.json, composer.lock and a small update to phpmailer and Yaml
* Prevent accidental `composer update` runs
* Add --no-interaction to daily.sh
* refactor: AD Auth defer connection until it is needed
Nice error if php-ldap is missing instead of http 500.
* Add the same error when ldap is missing to other auth methods.
Not as graceful looking in the authorizers since they do not defer connection.
* Refactored authorizers to classes
* Merge changes for #7335
* ! fix php 5.3 incompatibility
* Update ADAuthorizationAuthorizer.php
* Fix get_user -> getUser
* Rename AuthorizerFactory to Auth, fix interface missing functions
* Add phpdocs to all interface methods and normalize the names a bit.
* Re-work auth_test.php AD bind tests to work properly with the new class.
Reflection is not the nicest tool, but I think it is appropriate here.
Handle exceptions more nicely in auth_test.php
* Restore AD getUseList fix
Not sure how it got removed
* fix auth_test.php style
* fix: devices detected as ibmtl
Guess at the sysObjectID, please report if you have devices that should be ibmtl and are no longer detected.
Add output of os in discovery.
* Always load all os for discovery. Should be cached most of the time.
This PR fixes the following error that showed up after upgrading to 1.31.
```
Array ( [0] => 1 [1] => Uncaught Error: Call to undefined function init_auth() in /srv/deployment/librenms/librenms-cache/revs/8c9da11850ecbf2a949b9317d1fce75301bfd13b/includes/init.php:152 Stack trace: #0 /srv/deployment/librenms/librenms-cache/revs/8c9da11850ecbf2a949b9317d1fce75301bfd13b/html/index.php(59): require() #1 {main} thrown [2] => /srv/deployment/librenms/librenms-cache/revs/8c9da11850ecbf2a949b9317d1fce75301bfd13b/includes/init.php [3] => 152 )
```
it's most likeley related to the fact that we use a symlink, and $config['install_dir'] is the symlink, and $install_dir is the real folder.
* Refactor remove use of pear Net_IPv4 and Net_IPv6
Caution, I added tests to test the functionality of the new functions, but I'm not 100% certain the replaced usages match 100%. Please test.
Left usage in generate-iplist.php because I'm not sure the use of that script, so I didn't want to implement additional functionality to support it.
Add support for ipv6 fo ipInNetwork() function
Add phpdocs to functions
Remove accidental inclusion
Use binary operations instead of string for networKFromIp()
Tidy up binary operations in ipInNetwork()
tidy parsing cidr network
Change to a class based implementation.
Update phpdocs.
Fully catch exceptions for hex parsing.
Fix mistake.
support older phpunit versions
Fix php shifting to negative with php 5
* Fix graph authorization. Uncaught exception and checking an ipv4 against an ipv6 network == fail.
* Also remove colons from hex strings.
* Fix typo in bgp polling
Two passes of removing invalid characters from hex strings. (That way we don't mangle valid IPs)
Always output header (may be missing mysql data)
Improve version display, now looks like '1.28-129-g74e6c3edf' <tag>-<commits since tag>-<shortag>
Add mysqli to the list of required extensions, check extensions before init
Add dbIsConnected() function, used to check if we have db in version_info()
Do not die on IPv4 and IPv6 so validate can print errors.
Move git checks so they are output together
fix rrdtool 1.7.0 reports version as 1.7.01.7.0
* fix: minimize session open time
page/graphs speedup part 2
Write close the session as soon as we no longer need to write to it. Prevents the session from blocking other requests.
Do not run through full authentication functions if the session is already authenticated.
Removes password from the session as well as some items to prevent session fixation from #4608.
WARNING: This will cause issues for ad/ldap users who do not have a bind user configured!
* Do no erase username when using cookie auth.
Properly close the session in ajax_setresolution.php
* write close the session as soon as possible in ajax_setresolution.php
* Remove session regeneration. It is not compatible with the current code and would require more changes.
* Totally refactor authentication. Extract code to functions for re-use and improved readability
* Use exceptions for authentication and error logging
Tested: mysql, ad_auth with and without bind user
* fix a couple scrutinizer issues
* fix reauthenticate in radius
* fix: page/graph load speed: part 1
Speed up load_all_os() by caching the full $config['os'] array
Function time goes from 1.13648s -> 0.00073s
The cache is updated during discovery, but only if it is >22hrs old.
Additionally, the cache is not used and a full yaml load is forced if the cache is >24hrs old.
The cache time is controlled by $config['os_def_cache_time'], I don't see any reason anyone would change that time.
* Delete Session.php
* Include the cache directory.
* Update database tests to prepare for more
Add test_db_name, test_db_user, test_db_pass to allow developers to have a dedicated testing database.
Extract DBTestCase to include common functionality for database based tests. Use transactions to isolate tests.
Enable STRICT_TRANS_TABLE, test for it's existence (only when we have a user that can set it)
Move the database cleanup to register_shutdown_function, this makes it happen every time at the end of tests.
If the was not empty, only truncate the tables (that aren't prepopulated) instead of drop the database.
Use our schema functions for schema tests.
Fix some missing array indexes so it doesn't clutter test output.
* Fix style
* Add support for custom MySQL unix-socket
* NULL must be lowercase!
* Naive edit of html/install.php
* fixup
* Refactor dbConnect
Use it everywhere
* $config needs to be global
Don't need to set $database_link
* small cleanups
* Initial support for graphite
* Enable graphite include
* fixed typos.
* Fixed port naming to graphite metric names
* Added documentation for Graphite
* added documentation for graphite
* fixed style
* replace / with _ in interface names for graphite
* sets default graphite port
* adds rrd-name tags to the metric, otherwise metrics get lost
* add suggested storage schema for graphite
* add whitespace
* Updated to show some output
* bad english
* initial work to standardise collation
* more updates
* final bits for collation update (famous last words)
* Rename 165.sql to 166.sql
* Update schema version inside 166.sql
* moved schema file 166->171