40 Commits

Author SHA1 Message Date
3c3fbd3731 feature: Show composer status in web validate. (#8181)
* 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
2018-02-27 15:57:20 +00:00
de56dccc8a refactor: Move config loading into the Config class. (#8100)
Self contain dbFacile too.
Update rrdtool default setting to be similar to others.
Move silly cisco-entities.php into entity-physical.inc.php
2018-02-10 20:38:25 +00:00
f43e23e15a Restore vendor contents even if composer is not available (#8223)
* 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...
2018-02-07 20:45:18 -06:00
609676a9f8 Move InfluxDB to vendor and update dependencies. (#8184)
Update all dependencies

Updated event-dispatcher too far
2018-02-02 22:57:31 -06:00
6878df8c12 Prep for composer changes (#8075)
* 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
2018-01-22 08:16:37 -06:00
c22c879983 fix: Remove faulty memcached code (not related to distributed polling) (#7881) 2017-12-10 20:40:45 +00:00
6b5dccc169 refactor: AD Auth defer connection until it is needed (#7768)
* 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.
2017-11-28 09:19:34 -06:00
c9728a1f71 refactor: Refactored authorizers to classes (#7497)
* 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
2017-11-18 10:33:03 +00:00
8e61c6394a feature: Added support for setting php memory_limit in config.php (#7704) 2017-11-14 08:17:01 -06:00
54b476c769 fix: devices detected as ibmtl or generic (#7618)
* 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.
2017-11-03 16:10:24 -05:00
33c8d38e57 Use $install_dir var for auth_mechanism require_once
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.
2017-08-28 12:07:00 -07:00
1d777693e1 feature: New IP parsing classes. Removes usage of Pear Net_IPv4 and Net_IPv6. (#7106)
* 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)
2017-08-08 14:14:58 -05:00
08d3a267ad fix: Stop loading all oses when we have no db connection (#7003)
* fix: Stop loading all oses when we have no db connection

* updated to use load_all_os() correctly
2017-07-21 12:42:16 -05:00
1e77d4b3ea refactor: validate.php improvements (#6973)
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
2017-07-17 19:02:28 +01:00
294ec4d73d feature: Added support for sending metrics to OpenTSDB (#7022)
* Create OpenTSDB.md

* Send collected data to OpenTSDB

* Send collected data to OpenTSDB

* Update build.sql

* Send collected data to OpenTSDB

* Delete 200.sql

* Update db_schema.yaml

* Update datastore.inc.php

* Update OpenTSDB.md

* Added OpenTSDB to mkdocs.yaml
2017-07-15 10:28:27 +01:00
dcca74dcc4 fix: Show fatal config.php errors on the web page. (#7023) 2017-07-13 18:01:01 +01:00
20b08cf595 refactor: finish logic and definition separation (#6883)
Clean up rewrites to only have function definitions
Move authentication initialization into a function
2017-07-03 15:38:58 -05:00
683a10e723 fix: Improve authentication load time and security (#6615)
* 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
2017-05-15 22:18:23 -05:00
b6e18db766 fix: page/graph load speed: part 1 (#6611)
* 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.
2017-05-10 08:57:10 +01:00
1b1907a09f Update database tests to prepare for more (#6500)
* 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
2017-04-26 07:56:00 -05:00
b1a414e785 feature: support non-standard unix socket (#5724)
* 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
2017-04-06 22:02:37 +01:00
cf509f138b fix: Fixed the dbTest units so they work (#6293)
* fix: Fixed the dbTest units so they work

* fix schema, should now pass
2017-03-29 16:13:30 -05:00
affe5090f4 feature: Send collected data to graphite server (#6201)
* 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
2017-03-22 10:35:44 -05:00
296360b204 fix: Update OSTicket transport to use the from email address #5739 (#5927) 2017-03-03 18:22:33 +00:00
24a5f6bd37 Db collation standardisation (#5932)
* 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
2017-02-27 18:28:01 +00:00
200b762478 feature: Added phpunit db setup tests (#5594) 2017-02-07 15:08:52 +00:00
5dd030f438 refactor: Added config option for database port (#5517) 2017-01-27 23:16:04 +00:00
afe887d85e webui: New LibreNMS logo assets (#5629) 2017-01-27 18:02:49 +00:00
2f1095cb8d fix: html purify init wasn't done always when it was used (#5626) 2017-01-26 19:23:03 +00:00
59706194bf refactor: move HTMLPurifier init to init.php so we only create one object. (#5601) 2017-01-25 20:56:59 +00:00
e552bb4a95 fix: dark/mono logo was incorrect (#5342) 2017-01-08 15:08:12 +02:00
e20a242785 refactor: use Composer to manage php dependencies (#5216) 2017-01-01 09:37:15 +00:00
c06cceeeb5 fix: Fixed passing of data to load_all_os() function (#5235) 2016-12-24 18:53:50 +00:00
f5a16be0e3 refactor: Move OS definitions into yaml files (#5189) 2016-12-23 17:53:19 +00:00
fc941bc14e feature: enable override of $config values set in includes/definitions.inc.php (#5096) 2016-12-09 18:38:21 +00:00
78f5c26cd6 fix: Allow html but not script, head and html tags in notes widget #4898 (#5006) 2016-11-26 20:54:49 +00:00
58582c82c1 fix: Fixed loaded modules for ajax search (#5043)
* fix: Fixed loaded modules for ajax search

* fixed eventlog widget
2016-11-22 09:46:41 +00:00
ccb76a7de9 fix: init php 5.3 (#5042)
This will require a git pull.
2016-11-22 02:14:19 -06:00
d9bcd53eda fix: always include rewrites.php (#5040) 2016-11-21 19:18:18 -06:00
9a33464c52 refactor: Centralize includes and initialization (#4991) 2016-11-21 20:12:59 +00:00