Commit Graph

64 Commits

Author SHA1 Message Date
Tony Murray
d841625f12 refactor: Refactor database and config init (#8527)
* Refactor database and config init
Connect to the database without loading full config
Load config completely so post-processing is always done consistently.
Erase existing $config when loading, fixes issues in case we load the config twice.
If the database is not connected, don't try to load database settings. (Fixes some db errors on install)
Attempt to remove $config access/modification before init.php
Remove usage of db_name, that might not match the connected database.
Centralize db config loading, so we consistently apply db_test database settings.
Many of these changes are influenced by Laravel port.

* Some safety so we don't assign strings to numeric port field
Smooth out phpunit bootstrap

* Fix a couple of scrutinizer warnings.
2018-04-11 16:15:13 +01:00
Tony Murray
496575ea99 docs: Add composer back to the CentOS install docs (#8224)
* Add composer back to the centos install docs
This is for CentOS 7, not CentOS 6...

* In tree composer requires php 7.2

* Rename socket file to match

* Clean up the initial config.php a bit
Add clearer releasing info in that config.php
Update the manual update instructions
2018-02-08 21:46:55 +00:00
Tony Murray
38bde97fc4 mcrypt is optional, update for PHP 7.2 (#7859) 2017-12-06 08:24:20 +00: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
mcq8
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
Tony Murray
b79d106c56 fix: Errors with missing posix extension (#7666)
* fix: errors with missing posix extension
It should be an optional dependency

* add php71w-process to the CentOS 7 install docs
2017-11-10 15:20:47 +00:00
François LASSERRE
e33392a812 Fix librenms install go to stage 0 to 6. (#7571) 2017-10-28 10:48:28 +01:00
Tony Murray
51ba934e11 feature: Added web validation (#7474)
* refactor: convert validations to modules to prep for gui integration

* accidentally dropped, schema update

* fix accidental output to webui

* mention discovery-wrapper.py and re-arrange.

* refine some fix statements

* rename the Config validation group to Configuration.

* fix some scrutinizer issues
remove as many local functions from validator.php as possible
move extensions from pre-check
remove duplicate timezone check
looks like there is some db schema differences between mariadb 10.1 and 10.2, investigating

* mariadb version diff take2

* Check schema version first for database.
Remove stop to go back to command line for install docs.
Add helpful link when there is no devices added to /addhost

* fix incorrect validation for empty string defaults

* Fix style

* Add additional file permissions checks

* catch exception and fail for invalid timezone
Change visuals a bit.

* add php version warning

* fix space
2017-10-26 07:56:09 +01:00
Neil Lathwood
1205f12f10 security: Stop accepting other variables in install that we do not use (#7511) 2017-10-18 13:19:16 +01:00
ZedTheYeti
ee5c223669 Supply MySQL database hostname when using Unix sockets to connect (#7471)
* Supply MySQL database hostname when using Unix sockets to connect

* Pass unix_socket parameter when db_socket is set

* Set db_host to localhost when db_socket is set
2017-10-17 21:55:41 -05:00
Neil Lathwood
f1b50737bb Docs refactor (#7389)
* docs: Refactored docs for new layout

* some more changes

* more doc updates

* More doc updates

* small update

* small update
2017-10-02 21:36:22 +01:00
Tony Murray
a410e34115 fix: If session save path is "", php will use /tmp (#7359) 2017-09-18 19:22:24 +01:00
Tony Murray
8bacb053c9 fix: slower hardware can hit the schema update response timeout (#7296)
Update the timeout from 40s to 90s.
2017-09-07 09:28:03 +01:00
Tony Murray
96cc9bfaa0 feature: Improve install process (#7223)
Fix incorrectly updating session with build-ok before start of schema update
Set a timeout for progress on the schema build 40s (lock wait time is 30s, so must be more than that).  Allow the user to restart the process if this timeout is reached.
Animate the progress bar while waiting for the schema update. Stop animation on failure or success.
Properly destroy the session after install.  This allows the user to restart if they need to without any tricks.
Move next step buttons to the right.
2017-08-26 19:35:13 +01:00
Daniel Preussker
d3094fa657 security: Security Patch to deal with reported vulnerabilties (#7164)
* WIP: Security Patch

* Update install.php

Styling fix

* Update install.php

* Update dbFacile.php

* Fix whitespace
2017-08-18 21:29:12 +01:00
Tony Murray
1098529c62 fix: Check session directory is writable before install.php (#7103)
Drop pear check.
A few html/bootstrap cleanups too.
2017-08-08 20:26:03 +01:00
Tony Murray
f02b551145 feature: Improved install experience (#6915)
always check that the base sql has been imported.
async db building
After this merge, we could move install.php to the end of the install documentation.  Makes a more natural flow.
2017-07-01 21:28:29 +01:00
Tony Murray
5f8729b1a0 refactor: update the default config generated by install.php (#6914) 2017-06-29 07:09:22 +01:00
Neil Lathwood
41e7689c77 refactor: DB Updates will now file level lock to stop duplicate updates (#6469)
* refactor: DB Updates will now file level lock to stop duplicate updates

* scrut fixes

* renamed function from clear_lock() to release_lock()
2017-05-03 14:48:23 +01:00
Tony Murray
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
Neil Lathwood
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
David Bell
5dd030f438 refactor: Added config option for database port (#5517) 2017-01-27 23:16:04 +00:00
Tony Murray
9a33464c52 refactor: Centralize includes and initialization (#4991) 2016-11-21 20:12:59 +00:00
Neil Lathwood
cc01969b06 refactor: Default to only using mysqli (#4915)
* refactor: Default to only using mysqli

* Remove includes/dbFacile.mysql.php

* updated mres() function to remove $config global
2016-11-10 19:40:53 -06:00
Neil Lathwood
d6d28564ae fix: Removed suggestion in install.php on installing php modules (#4377) 2016-09-09 10:26:52 -05: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
8c639aa5a4 PSR2 Cleanup: /html edition
Travis tests for code conformance. Ignore warnings for now.
Fixed all errors, left most warnings.
2016-08-18 21:29:30 -05:00
laf
2cf3fe160d Added a message to tell users that install.php is not the final step 2016-08-05 19:52:22 +01:00
Tony Murray
4210d35658 Use the correct closing tag in install.php 2016-08-03 10:06:33 -05:00
laf
c4ffa423a1 Added suggestion to contribute to stats 2016-01-11 21:03:12 +00:00
Arjit Chaudhary
815a3e72e6 Fixes #2724 -- Added mysqli to install.php if PHP 7 2016-01-10 03:23:34 +05:30
nguillaumin
ceb2d15b9d Fixes #2725: Wrong suggestion to install PEAR 2016-01-09 22:50:47 +11:00
f0o
5806850bce Soft-Fail if PEAR doesnt exist 2015-10-01 15:20:46 +00:00
Daniel Preussker
939218865b Merge pull request #1956 from laf/user-validation
Add config option for librenms user + validate.php support
2015-09-22 18:09:28 +00:00
laf
4cc9482dbe Added support for specifying user in config and then validating install 2015-09-21 21:06:57 +00:00
laf
8980bbc4e3 Changed config db options from double quotes to single 2015-09-21 13:23:09 +00:00
f0o
9ca926b9c6 SQLs are performed up to an execution time of 45s, then a page reload is induced to avoid fcgi/cgi/modphp timeouts. 2015-09-02 15:30:51 +01:00
f0o
501cf5a6ef Present all output+errors at the end 2015-09-02 15:30:21 +01:00
f0o
574e4c5290 Typo 2015-09-02 15:29:11 +01:00
f0o
ca0f9ea2f9 Avoid useless I/O 2015-09-02 15:29:07 +01:00
f0o
2fd423f9fc Revert build.sql
Make update.php responsive
2015-09-02 15:29:06 +01:00
f0o
19059412da Make installer more responsive
Update each schema in update.php after applying
Packaged new build.sql bundling all updates up to 067
2015-09-02 15:29:02 +01:00
f0o
87677eabeb Use the persistent MySQL connections in install and build-base
Share mysql-connection from install to build-base
2015-09-02 15:28:54 +01:00
laf
a8f0d91aae Fixed the connection settings being incorrect 2015-08-15 17:33:41 +00:00
Neil Lathwood
0737722cb8 Merge pull request #1667 from miken32/master
changes needed to run under a web server subdirectory
2015-08-14 15:05:29 +01:00
Daniel Preussker
409b2efd17 Merge pull request #1647 from laf/issue-12-new
Added mysqli support
2015-08-12 22:06:09 +02:00
Michael Newton
f77c712bfc changes needed to run under web server subdirectory 2015-08-11 14:54:05 -07:00
Neil Lathwood
945ca7f2ea Revert "changes needed to run under web server subdirectory" 2015-08-11 21:25:23 +01:00
Neil Lathwood
1b6b57b593 Merge pull request #1645 from miken32/master
changes needed to run under web server subdirectory
2015-08-11 18:32:53 +01:00
Paul Gear
5d3701e3a6 Update install.php
spelling
2015-08-11 08:39:14 +10:00