Merge pull request #139 from nicklewis/fix-ruby-source-docs

Correctly locate Ruby code in source docs
Fix tests for command-processing configuration to work on single-core systems

While a prior patchset fixes the main code for auto-configuring threads on a
single-core system, it didn't fix the test cases. So if you ran the tests on a
single core system, they'd fail.

This patchset abstracts out the code that determines the number of cores in a
host into a utility func, and test cases override that func during verification
of behavior.

Signed-off-by: Deepak Giridharagopal <deepak@puppetlabs.com>
Merge pull request #140 from grimradical/minimum-command-procs

Make command-proc tests work on single-core systems
Work around OpenJDK/OpenSSL PKCS11 TLSv1 issue

http://stackoverflow.com/questions/9586162/openjdk-and-php-ssl-connection-fails
https://bugs.launchpad.net/ubuntu/+source/openjdk-6/+bug/948875

This issue prevents clients using OpenSSL 1.0.1 from connecting to a
PuppetDB running on OpenJDK, with the PKCS11 security provider enabled.
So we disable the security provider, which isn't actually necessary
anyway.
Merge pull request #141 from nicklewis/disable-pkcs11

Work around OpenJDK/OpenSSL PKCS11 TLSv1 issue
Ensure config.ini and log4j config files are not world-readable

Prior to this commit, the files in /etc/puppetdb were world-readable.
This is bad since config files could have database passwords in them.
Fix permissions on config.ini and log4j config file

The permissions were adjusted incorrectly in that Rake's chmod method
requires 4-digit octal permission strings, rather than 3.
Bulk code reformatting

Signed-off-by: Deepak Giridharagopal <deepak@puppetlabs.com>
Disable default resource queries

If you don't supply a query parameter to the /resources/ REST endpoint, we
return *all* resoures with *all* parameters for *all* hosts. That, as you may
guess, is a horribly expensive operation.

This patch disables the default query, and mandates that a query is explicitly
supplied by the caller. Plus, that's actually the behavior that we documented
in our specs...so we now better deliver on our promises. :)

Signed-off-by: Deepak Giridharagopal <deepak@puppetlabs.com>
Merge pull request #144 from stahnma/secure_config_files

Ensure config.ini and log4j config files are not world-readable
Jetty should default to localhost for bind addresses

Previously, it would default to binding to all interfaces, which is a less
secure default.

Signed-off-by: Deepak Giridharagopal <deepak@puppetlabs.com>
Merge pull request #146 from stahnma/secure_config_files

Fix permissions on config.ini and log4j config file
Merge pull request #142 from grimradical/code-formatting

Bulk code reformatting
Merge pull request #143 from grimradical/disable-default-queries

Disable default queries
Merge pull request #145 from grimradical/default-jetty-bind-to-localhost

Default jetty bind to localhost
Support config.d-style configuration

Previously, you could only configure puppetdb by passing in a fully-realized
configuration file. This patchset allows you to pass in a directory instead,
and we'll parse-and-merge all configuration files contained therein.

This allows people to separate different logical bits of configuration into
their own files. For example, you can have your Jetty configuration in a
jetty.ini file. This, for example, makes it easier for puppet to manage subsets
of PuppetDB configuration.

Signed-off-by: Deepak Giridharagopal <deepak@puppetlabs.com>
Merge pull request #147 from grimradical/conf.d

Support config.d-style configuration
Delete resource query tests asserting SQL output

These have become laborious to maintain, as any changes to query
generation cause basically all of them to need to be changed. Given that
they will start failing on effectively *any* change to the code (correct
or not), they aren't providing any value in identifying regressions.
The end-to-end tests against a database which assert results are much
more useful.
Remove DISTINCT clauses from resource queries

These are unnecessary, and induce a lot of large sorts.
Don't join resource_params to catalog_resources

Expressing this as a subquery instead of a JOIN will hopefully be
faster.