Commit Graph

40 Commits

Author SHA1 Message Date
Tony Murray
f4a33c1a34
Prevent credentials from being leaked in backtrace in some instances (#9817)
* Prevent credentials from being leak in backtrace in some instances
Particularly before the user is authenticated

* fix test
2019-03-05 00:24:14 -06:00
Felicián Hoppál
942dc65122 Update to PHPMailer 6.0 (PHP 7.3 support) (#9818) 2019-02-15 00:53:41 -06:00
Tony Murray
63de34e295
php artisan serve and dusk testing (#9422)
* php artisan serve and dusk testing

* Fix style

* move if into, in case we need to have different configs

* fix travis yml

* Add missing folders files

* Try to fixup Travis-ci

* revert variable, change check

* skip browser tests for phpunit runs
set up env correctly

* maybe bg is needed

* attempt to fix env

* install Chrome

* Update tests
fix migrations

* Move pylint to python2

* use testing .env

* Running chrome on port 9515 conflicts with the instance started by the tests.  It is probably not needed.

* suppress some artisan serve output

* remove the unused updater
2019-02-14 09:06:10 -06:00
Tony Murray
ebb1569acb
Discard local changes to git based vendor packages (#9813)
Fixes an update issue with the recent dependencies update.
2019-02-13 09:01:05 -06:00
Tony Murray
e18f4522d5
Update to Laravel 5.7 (PHP 7.3 support) (#9800)
* Move assets to 5.7 location

* Add 5.7 SVGs

* add cache data dir

* update QUEUE_DRIVER -> QUEUE_CONNECTION

* Update trusted proxy config

* update composer.json

* 5.5 command loading

* @php and @endphp can't be inline

* Laravel 5.6 logging, Nice!

* Update blade directives

* improved redirects

* remove unneeded service providers

* Improved debugbar loading

* no need to emulate renderable exceptions anymore

* merge updated 5.7 files (WIP)

* Enable CSRF

* database_path() call causes issue in init.php

* fix old testcase name

* generic phpunit 7 fixes

* add missed file_get_contents
Keep migrations table content

* fix duplicate key

* Drop old php versions from travis-ci

* remove hhvm

* fix code climate message

* remove use of deprecated function assertInternalType

* Disable CSRF, we'll enable it separately.
All forms need to be updated to work.

* Update document references
2019-02-12 17:45:04 -06:00
Tony Murray
6e8e2eed0d add dbal so users can update the database 2019-01-16 09:52:56 -06:00
Tony Murray
d33d87931e
Update dependencies (#9657)
* Update dependencies
phpmailer/phpmailer (v5.2.26 => v5.2.27)
symfony/dotenv (v3.4.15 => v3.4.21)
amenadiel/jpgraph (3.6.20 => 3.6.21)
tecnickcom/tcpdf (6.2.22 => 6.2.26)
php-amqplib/php-amqplib (v2.0.2 => v2.8.1)
symfony/polyfill-ctype (v1.9.0 => v1.10.0)
symfony/yaml (v2.8.45 => v2.8.49)
vlucas/phpdotenv (v2.5.1 => v2.5.2)
symfony/css-selector (v3.4.15 => v4.2.2)
symfony/polyfill-mbstring (v1.9.0 => v1.10.0)
symfony/var-dumper (v3.4.15 => v3.4.21)
symfony/process (v3.4.15 => v3.4.21)
paragonie/random_compat (v2.0.17 => v2.0.18)
symfony/polyfill-php70 (v1.9.0 => v1.10.0)
symfony/http-foundation (v3.4.15 => v3.4.21)
symfony/contracts (v1.0.2)
symfony/event-dispatcher (v3.4.15 => v4.2.2)
psr/log (1.0.2 => 1.1.0)
symfony/debug (v3.4.15 => v3.4.21)
symfony/http-kernel (v3.4.15 => v3.4.21)
symfony/finder (v3.4.15 => v3.4.21)
symfony/console (v3.4.15 => v3.4.21)
nesbot/carbon (1.33.0 => 1.36.2)
monolog/monolog (1.23.0 => 1.24.0)
league/flysystem (1.0.47 => 1.0.49)
doctrine/inflector (v1.1.0 => v1.3.0)
ralouphie/getallheaders (2.0.5)
guzzlehttp/psr7 (1.4.2 => 1.5.2)
jakub-onderka/php-console-color (0.1 => v0.2)
nikic/php-parser (v3.1.5 => v4.1.1)
fico7489/laravel-pivot (2.3.7 => 3.0.0)
fideloper/proxy (4.0.0 => 4.1.0)
squizlabs/php_codesniffer (2.9.1 => 2.9.2)
barryvdh/reflection-docblock (v2.0.4 => v2.0.6)
symfony/class-loader (v3.4.15 => v3.4.21)
jakub-onderka/php-console-highlighter (v0.3.2 => v0.4)
psy/psysh (v0.9.8 => v0.9.9)
laravel/tinker (v1.0.7 => v1.0.8)
myclabs/deep-copy (1.7.0 => 1.8.1)
doctrine/instantiator (1.0.5 => 1.1.0)
webmozart/assert (1.3.0 => 1.4.0)
phpdocumentor/reflection-docblock (3.3.2 => 4.3.0)
phpunit/php-token-stream (1.4.12 => 2.0.2)

* limit laravel-pivot to <3.x because that requires laravel >= 5.5

* don't disable requirements

* update to master and exclude vendor database migrations and seeds

* a couple more updates
2019-01-15 17:34:05 -06:00
Paul Heinrichs
ebe2ecf524 Laravel migrations (#8868)
* Add migrations and seeds

* Fix spacing validation issues

* Fix linting

* Update tabs to spaces

* Update daily and install process

* Make build-base.php use the new migrations if empty or at dbschema 1000.
Seed 1000 into the database.
Temp fix for the route table index length (this table basically isn't used...)

* Fix typo in seed.
Hard code legacy schema checks to version 1000 (999 would have worked as is)

* Port association table no longer exists

* Make database validate again

* DB schema, remove as many DB::statement as possible

* update migrations
add librenms cli entry point (artisan)
update validate to check laravel migrations

* remove statements from users migration

* Fix up daily.sh and the 1000 migration

* Update migrations to current state
Take advantage of environment variables to set DB credentials.

* Fix style issues

* Update schema

* fix test db collation

* Fix migration table definition

* update db migrations

* Update migrations

* Update stats callback.  Just count the total migrations applied.

* Update 1000.sql.

* update migrations

* remove the graph type seeder, it is no longer needed

* update docs

* fix whitespace

* remove extra schema

* update tests

* fix sort

* add message

* dbSchema should actually be 1000

* add character set to db create

* Fix some artisan issues

* Update schema
2019-01-14 06:44:23 -06:00
Tony Murray
8bddfe7225 Fixed plugins using d_echo (#9498)
Move d_echo to helpers.php and include in autoload
Don't remove from common.php yet to be extra safe.
2018-12-08 13:16:49 +00:00
Tony Murray
46ca1fd45e
Revert "Attempt to make proxy sub-dir -> app no subdir work" (#9341)
* Revert "Attempt to make proxy sub-dir -> app no subdir work (#9317)"

This reverts commit df850a3ed9.
2018-10-18 09:15:48 -05:00
Tony Murray
df850a3ed9 Attempt to make proxy sub-dir -> app no subdir work (#9317)
Set APP_URL and APP_URL_SUFFIX in .env
2018-10-17 17:07:26 +01:00
Tony Murray
daec72f8a0 Move ext-mysqlnd to suggested for now (even though it is actually required) (#9229)
* Move ext-mysqlnd to suggested for now (even though it is actually required)
Remove extra dependency version locks, they are more trouble than they are worth.  I just run composer with php 5.6 when updating composer.lock.
Update dependencies.

* Trigger full build on composer updates

* Update composer.json
2018-09-20 00:05:10 +01:00
Tony Murray
79333c45f6
Allow trusted proxy via APP_TRUSTED_PROXIES (#9196)
* Allow trusted proxy via APP_TRUSTED_PROXIES
Set to '*' by default to emulate legacy behavior.
Set up doc describing environment variables

* Create helper to parse environment variables into arrays properly.

* Update doc blocks
2018-09-13 07:26:42 -05:00
Tony Murray
1e55601409 Update validate to check for mysqlnd (#9043)
Ran into some annoying bugs with the old mysql library driver and BIGINT.
2018-08-20 23:56:47 +01:00
TheGreatDoc
9940c884f5 Fixed snmptraps. (#8898)
* Fixed snmptraps.

* Fixed space

* Added bgp down/up and authentication failure

* Fixed typo

* Fixed some typos, arrays, astext and format_hostname

* Updated documentation

* Moved code to a function

* Some refactor

* Minor fixes

* Minor fixes 2

* More minor fixes

* Changes requested by Tony

* Minor fixes

* Moved include to snmptrap.php

* Refactor traps to use object oriented code.

Should trigger events too/instead, but we'll leave that.
Testing todo

* Add tests and fix things so they actually work
Not checking events yet.

* Fixed typo and severity level

* Update composer deps, I think the lock file wasn't right.
add json and mbstring extension deps while I'm at it.

* Fix several issues with phpunit fixtures
2018-08-11 16:37:44 -05:00
Tony Murray
9bc0c542a5 Allow ping checks to be ran separately from polling (#8821)
Allows ping checks at intervals not tied to the poller.  Pointless if you are not alerting on device status.
I updated the rrdstep.php script to treat ping-perf files separately and made it so it only converts if needed.

Docs here: https://docs.librenms.org/Extensions/Fast-Ping-Check/

DO NOT DELETE THIS TEXT

#### Please note

> Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting.

- [x] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/)

#### Testers

If you would like to test this pull request then please run: `./scripts/github-apply <pr_id>`, i.e `./scripts/github-apply 5926`
2018-07-30 22:58:38 +01:00
Daryl Peterson
67c585b7c0 PSR-4 Plugin Support (#8880)
Add phpdocblocks Plugins.php
Add psr-4 plugins path to composer.json

Changes to be committed:
	modified:   LibreNMS/Plugins.php
	modified:   composer.json
2018-07-17 07:46:49 -05:00
Tony Murray
310f7ca401 Downgrade phpdotenv dependency (#8902)
https://github.com/vlucas/phpdotenv/issues/276

Fixes values in .env starting with # being empty.

DO NOT DELETE THIS TEXT

#### Please note

> Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting.

- [x] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/)

#### Testers

If you would like to test this pull request then please run: `./scripts/github-apply <pr_id>`, i.e `./scripts/github-apply 5926`
2018-07-16 16:54:06 +01:00
Neil Lathwood
ad6ec7f72a
Refactor alert templates to use Laravel Blade templating engine (#8803)
* Initial start on new templating support

* further updates

* more updates

* More working version

* Last fixes

* Small updates

* modified test to look for dbname.

* Schema update

* Added fix for not being able to disable Philips Hue transport

* Updated sql file

* Updated db_schema

* Set myclabs/deep-copy to be 1.7.x version in composer

* Fixes from murrant

* Forced nikic/php-parser to version 3.1.x in composer

* Updated composer to use custom fork of string-blade-compiler + fixed transport use

* Updated to always use correct template

* Merged legacy and blade templating engines

* Removed template type + fixed test-alert.php

* Added more template placeholders

* Added ability to reference data in templates as $alert->X

* Updated docs for templates

* Updated db_schema.yaml

* Added $alert->builder

* Clarify the use of $alert->builder

* Fixed the use of $alert->transport

* renamed schema file

* Added template validation

* Small update to fix travis issue

* Add Docs text to title bar

* Updated amqp to new of version

* Consistency in alert rule and template title bars
2018-07-14 22:15:43 +01:00
Tony Murray
e736f5efec Updated YAML schema validation (#8808)
Changed some values to be explicitly boolean


DO NOT DELETE THIS TEXT

#### Please note

> Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting.

- [x] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/)

#### Testers

If you would like to test this pull request then please run: `./scripts/github-apply <pr_id>`, i.e `./scripts/github-apply 5926`
2018-06-15 09:45:20 +01:00
Tony Murray
1ad7f3138b
Add Laravel to LibreNMS (#8318)
* Add Laravel to LibreNMS.

* Try to set permissions during initial install and first composer update to Laravel.

* Fix composer.lock
Fix missing db config keys

* Start building v1 layout
Port ajax_setresolution, inject csrf into jquery ajax calls
Layout works, building menu
Partially done.

* Fix device group list
remove stupid count relationships

* Print messages for common boot errors.
Don't log to laravel.log file.
Log to error_log until booted, then librenms.log

* Fix up some issues with Config loading
Start of custom directives

* Custom blade directives: config, notconfig, admin

* Preflight checks
Only load config files once.

* Update the composer.lock for php 5.6

* Menu through routing

* Start of alert menu

* Better alert scopes

* reduce cruft in models

* Alerting menu more or less working :D

* Fix style

* Improved preflight

* Fix chicken-eggs!

* Remove examples

* Better alert_rule status queries
Debugbar

* fix app.env check

* User Menu

* Settings bar (dropped refresh)
Search JS

* Toastr messages

* Rename preflight

* Use hasAccess(User) on most models.
Add port counts

* Missed a Preflight -> Checks rename

* Fix some formatting

* Boot Eloquent outside of Laravel
Use Eloquent for Config and Plugins so we don't have to connect with dbFacile inside Laravel.
Move locate_binary() into Config class

* Config WIP

* Try to fix a lot of config loading issues.

* Improve menu for non-admins removing unneeded menus
url() for all in menu

* Only use eloquent if it exists

* Include APP_URL in initial .env settings

* Implement Legacy User Provider

* Helper class for using Eloquent outside of Laravel.
Allows access to DB style queries too and checking the connection status.

* Fix up tests

* Fix device groups query

* Checking Travis

* copy config.test.php earlier

* dbFacile check config before connecting
Don't use exception to check if eloquent is connected, it gets grabbed by the exception handler.
Ignore missing config.php error.

* Fix config load with database is not migrated yet.

* Remove Config::load() from early boot.

* Use laravel config settings to init db (this prefers .env settings)
Fix bgp vars not set in menu
add _ide_helper.php to .gitignore

* Restrict dependencies to versions that support php 5.6

* Update ConfigTest

* Fix a couple of installation issues

* Add unique NODE_ID to .env

* Correct handling of title image

* Fix database config not loading. Thanks @laf

* Don't prepend /

* add class_exists checks for development service providers

* Fix config value casting

* Don't use functions that may not exist

* Update dbFacile.php

* d_echo may not be defined when Config used called.

* Add SELinux configuration steps
More detailed permissions check.
Check all and give complete corrective commands in one step.

* Ignore node_modules directory

* Re-add accidetal removal
2018-05-09 08:05:17 -05:00
Tony Murray
7b6e4f95c0 Library update (#8311)
* Library update
amenadiel/jpgraph 3.6.12 > 3.6.14
ezyang/htmlpurifier 4.9.3 > 4.10.0
tecnickcom/tcpdf 6.2.13 > 6.2.17

Also, make composer.lock match our composer.json to avoid a warning.

* Remove php snmp extension, we don't actually use it.
2018-03-02 19:32:09 +00:00
Tony Murray
31bf122d4f Error for insufficient php version during install (#8292)
Remove platform from composer.json so users get an error if their php version isn't new enough.
Add extensions to composer.json too
2018-02-28 06:47:42 +00:00
Tony Murray
7a2e5f4e40
Update to phpunit 5 (#8217)
remove array_column it is no longer needed
2018-02-07 20:45:56 -06:00
Tony Murray
9b9fb121ab
Remove dependencies from the repository, update install docs (#6920)
After vendor is un-indexed restore the contents so things keep working.
2018-02-06 08:17:44 -06:00
Tony Murray
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
Tony Murray
37c3c5c88f fix composer GPL string (#8148)
Fixes an error from packagist:
License "GPL-3.0" is a deprecated SPDX license identifier, use "GPL-3.0-only" or "GPL-3.0-or-later" instead
2018-01-25 20:59:13 +00:00
Tony Murray
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
Tony Murray
d6db01abb5 refactor: Refactor fix php codesniffer 3.x issues (#7816)
We cannot use 3.x because it  requires php 5.4, so update to 2.9.1 or newer 2.x release.
2017-11-29 08:23:19 +00:00
Neil Lathwood
1be550826e api: Added ability to supports CORS for API (#7357)
* Update defaults.inc.php

* api: Added ability to supports CORS for API

* added acknowledge

* Update Configuration.md
2017-09-21 18:07:31 +01:00
Tony Murray
aeedf515c5 fix: Include state descriptions in eventlog (#6968)
* fix: include state descriptions in eventlog
Pull in array_column compat library for php < 5.5

* Add state descriptions to eventlog messages
2017-07-06 08:27:02 +01:00
Neil Lathwood
5f5dc2a854 feature: Peeringdb integration to show the Exchanges and peers for your AS' (#6178) 2017-03-22 10:17:13 +00:00
Tony Murray
e20a242785 refactor: use Composer to manage php dependencies (#5216) 2017-01-01 09:37:15 +00:00
Tony Murray
92ec339be6 Downgrade to php_codesniffer 2.6.* for now (#4325)
2.7.0 was released and has some indentation changes.  I'm not sure if these are bugs or should be corrected...
2016-09-02 12:30:28 -05:00
Neil Lathwood
31efe0129d Rebased 2016-08-28 22:02:02 +01:00
Tony Murray
b7d0b97c64 More pre-commit.php improvements (#4224)
* more pre-commit.php improvements
do not check influx-db on hhvm
Use parallel-lint to increase lint check speed and improve output
Add option to print out the commands that would be executed, makes it easier to modify them and run by hand
Fixed a couple of bugs

* Integrate the environment check
Flip it so we don't interfere with command line users
2016-08-28 21:44:36 +01:00
Neil Lathwood
4dea6fadbc Added docs + file changes to support creating new releases/changelog 2016-08-28 16:43:11 +01:00
Tony Murray
f042f9aa56 Use pre-commit.php in for travis-ci tests (#4212) 2016-08-26 10:30:43 +01:00
Neil Lathwood
9f1930a81e More more docs (#4197)
* Updated docs + some small code changes

* Added validating code doc for developers

* Doc updates

* Updates and improvements
2016-08-25 18:40:11 -05:00
Tony Murray
64399c833a Prep Travis.yml for codesniffer changes 2016-08-15 13:23:21 -05:00