Commit Graph

194 Commits

Author SHA1 Message Date
Dave Syer
68448a8c68 Use the ServerProperties to add prefixes to paths
when server.servletPath is set we need to add prefixes to
the security filter paths.

Fixes gh-945
2014-05-24 08:33:14 +01:00
Christian Dupuis
4648188782 Rework HealthEndpoint and HealthIndicator
With this commit the state of a component or subsystem becomes a first-class citizen in Boot's application health support. HealthIndicators now return a Health instance with status and some contextual details.

An aggregation strategy has been introduced to aggregate several Health instances into one final application Health instance. Out of the box OrderedHealthAggregator can be configured to allow different ordering or a custom HealthAggregator bean can be registered.
2014-05-22 12:27:03 +02:00
Andy Wilkinson
58b768b204 Merge branch '1.0.x' 2014-05-21 13:55:44 +01:00
Andy Wilkinson
6dafa15eef Remove mouldy start.groovy from the actuator sample
Fixes #900
2014-05-21 13:55:07 +01:00
Phillip Webb
8bcda1bcbe Polish 2014-05-20 18:26:56 +01:00
Dave Syer
58379e7593 Add hibernate-validator to spring-boot-starter-web
Fixes gh-616
2014-05-17 06:47:15 +01:00
Phillip Webb
01fcf61140 Polish 2014-05-15 09:51:16 +01:00
Dave Syer
5249f54c5a Integrate @ConfigurationProperties @Beans with DataSource configuration
We now have a much simpler DataSourceAutoConfiguration that binds to whatever
DataSource concrete type it finds at runtime. To be able to quickly switch between
Hikari and the other types of DataSource there's a minute shim for translating
the common properties (username, password, url, driverClassName), but actually
only url is different. The shim and also DataSource initialization is supported
through DataSourceProperties, but the other native properties get bound directly
through the concrete runtime type of the DataSource.

The /configprops endpoint works (and is exposed in the actuator sample).

Fixes gh-840, fixes gh-477, see also gh-808.
2014-05-13 16:46:04 +01:00
Dave Syer
5dd77a725c Enable access log explicitly in sample 2014-05-12 10:51:47 +01:00
Phillip Webb
61232395d8 Fixup versions 2014-05-10 23:47:31 +01:00
Christian Dupuis
c38f9bcdfa Add missing tests 2014-05-08 16:58:52 +02:00
Christian Dupuis
941c5560eb Remove duplicate hibernate-validator dependency from pom 2014-05-06 12:38:53 +02:00
Phillip Webb
decee8d871 Polish templates code 2014-04-30 21:36:09 +01:00
Dave Syer
2c087d4787 Update Boot version in gradle samples 2014-04-30 17:51:13 +01:00
Dave Syer
27580e726f Add generic error handling to BasicErrorController
Since Spring supports gobal error handling through
@ControllerAdvice, it is quite easy to set up more meta-data
about an exception for the BasicErrorController. You need
to be careful not to swallow Security exceptions, and probably
others (optionally) so this feature needs a bit more work.

See gh-538
2014-04-29 15:23:28 +01:00
Phillip Webb
64a835e91a Move master to 1.1.0.BUILD-SNAPSHOT 2014-04-24 12:45:20 +01:00
Spring Buildmaster
d3954a1703 Next development version 2014-04-24 02:24:28 -07:00
Phillip Webb
fad5ce45db Polish 2014-04-23 12:35:33 +01:00
Dave Syer
7b07fe8ce0 Convert remaining samples to use random port
Partial fix for gh-337. See also gh-607 which complements this, but might
conflict on a merge.
2014-04-17 20:29:04 -07:00
Dave Syer
f134e96053 Convert Actuator sample to dynamic ports 2014-04-17 17:36:09 -07:00
Spring Buildmaster
a5864ebcd0 Next development version 2014-04-06 22:43:18 -07:00
Dave Syer
72d7c286c0 Add Spring MVC-generated path suffixes to endpoint paths
Spring Security doesn't know that Spring MVC maps /foo, /foo.json
and /foo/ all to the same handler. This change explicitly adds
suffixes to the actuator endpoint matchers so they are properly
protected.
2014-04-03 14:03:09 +01:00
Spring Buildmaster
15e9dbe98b Next development version 2014-04-01 03:05:51 -07:00
Phillip Webb
1e68b7e0a9 Remove superfluous <packaging> tags from POMs 2014-04-01 02:07:43 -07:00
Phillip Webb
0af7f7e347 Add missing POM info 2014-04-01 02:07:42 -07:00
Phillip Webb
488b03387f Polish POM formatting 2014-04-01 02:07:36 -07:00
Phillip Webb
6f9bb233ad Revert "Next development version"
This reverts commit b67bb70ee3.
2014-04-01 00:38:48 -07:00
Spring Buildmaster
b67bb70ee3 Next development version 2014-03-31 22:38:42 -07:00
Phillip Webb
ac4cdd33c3 Revert "Next development version"
This reverts commit 1d0eea12eb.
Returning to 1.0.0.BUILD-SNAPSHOT for an updated release.
2014-03-31 17:14:30 -07:00
Spring Buildmaster
1d0eea12eb Next development version 2014-03-28 11:47:09 -07:00
Phillip Webb
aca67066bf Rename RestTemplates to TestRestTemplate
Rename the RestTemplates to TestRestTemplate to help indicate that it's
primarily intended for testing. Also now extend RestTemplate to allow
direct use, rather than via factory methods.

Fixes gh-599
2014-03-27 11:22:03 -07:00
Phillip Webb
d117a6b22b Polish 2014-03-27 11:21:51 -07:00
Dave Syer
71c2c69c92 Return actual status code not 200 to machine client
Machine clients are much more fussy than browsers and we
should take care to preserve the HTTP status for them.

Fixes gh-596
2014-03-27 17:23:47 +00:00
Dave Syer
8491f8eb07 Simplify build config for actuator sample 2014-03-27 08:59:03 +00:00
Phillip Webb
f70d6fb411 Declare all repositories in build samples
Update Gradle and Ant samples to consistently declare all repositories
(local, central, release, snapshot, milestone).

Fixes gh-426
2014-03-25 16:00:55 -07:00
Phillip Webb
d42bedf295 Rename @ConfigurationProperties attributes
Rename `name` to `prefix` and `path` to `locations`.
2014-03-24 11:44:52 -07:00
Phillip Webb
47eb8180b3 Rename spring-boot-starter-shell -> remote-shell
Fixes gh-462
2014-03-21 09:05:56 -07:00
Phillip Webb
632af6b1ab Polish gradle examples
Spaces -> Tabs, version number, whitespace.
2014-03-19 16:50:55 -07:00
Phillip Webb
4024450c5f Rename starter-shell-remote to starter-shell
Fixes gh-462
2014-03-19 16:28:36 -07:00
Andy Wilkinson
e90bc49988 Add dependency on spring-boot-starter-test
Fixes #530
2014-03-19 11:32:25 +00:00
Phillip Webb
c5ee3c7eba Remove duplicate documentation
Remove README files that have been since been migrated to the reference
documentation. Also updated remaining markdown files to asciidoctor to
save having a mix of different formats.

Fixed gh-503
2014-03-16 23:00:12 -07:00
Phillip Webb
80ac1fb0cd Polish 2014-03-15 13:02:01 -07:00
Dave Syer
7a285cf65d Convert all sample tests to @IntegrationTest where appropriate
Makes them a lot more readable IMO, and also enables @Autowiring
from the context into the test case (sweeet). I added @DirtiesContext
to all of them as well to be on the safe side, but possbly that can be
optimized in some way as well.
2014-03-11 13:54:30 +00:00
Dave Syer
6657e3ef84 More care taken with management.contextPath
The management.contextPath property should now be respected in a
secure application, whether or not the management.port is different.

Added some test cases in the sample to verify.

Fixes gh-469
2014-03-10 16:28:13 +00:00
Sebastien Deleuze
ab6c8dfee3 Use org.springframework.boot groupId in spring-boot-samples
Use org.springframework.boot instead of ${project.groupId}
groupId in order to make it easier to use spring-boot-samples
modules as a starting point for new projects.
2014-03-07 17:02:20 +00:00
Andy Wilkinson
326c12d1f5 Update Spring repository url in Gradle samples 2014-03-04 13:15:41 +00:00
Spring Buildmaster
b0d4e8ae69 Next development version 2014-03-03 22:46:12 -08:00
Spring Buildmaster
cb8668a151 Release version 1.0.0.RC4 2014-03-03 22:46:05 -08:00
Spring Buildmaster
1367d57e8c Next development version 2014-02-13 13:19:12 -08:00
Spring Buildmaster
eaff1677a7 Release version 1.0.0.RC3 2014-02-13 13:18:56 -08:00
Phillip Webb
c09ca17ca2 Update gradle example builds 2014-02-05 23:17:27 -08:00
Dave Syer
7a452d5bc0 Fix test that fails because of pretty printing 2014-01-31 16:38:09 +00:00
Christian Dupuis
b641a0d2a5 Enable json pretty print in actuator sample 2014-01-31 12:16:17 +01:00
Dave Syer
1f1820b161 Add Tld scanning exceptions to Tomcat startup
Addresses gh-263 to some extent.
2014-01-27 13:21:29 +00:00
Phillip Webb
0160760568 Apply latest eclipse cleanup rules 2014-01-21 16:28:26 -08:00
Phillip Webb
b12d728c06 Update ant example to 1.0.0.BUILD-SNAPSHOT 2014-01-21 10:22:42 -08:00
Phillip Webb
68293f34af Upgrade version to 1.0.0.BUILD-SNAPSHOT
Fixes fg-243
2014-01-21 00:43:54 -08:00
Dave Syer
559f907b54 Use explicit test dependencies in samples 2014-01-17 09:08:18 +00:00
Dave Syer
5592023f16 Add support for reloading resources in Gradle plugin
Usage:

$ gradle bootRun
...

Edit files in src/main/resources and see the changes live in a web app
(e.g. static resources in /static).

The old functionality of bootRun has been replaced (since it didn't add
a lot of value and also didn't expose any JMV argument setters of anything).
This new feature set is backed by any existing "run" task configuration.

In addition autodetects a main class if there is one in the project
sources, so no need for mainClassName = '...' in build.gradle.

Applies the 'application' plugin (so no need to declare that either).

Fixes gh-225
2014-01-15 11:26:33 +00:00
Dave Syer
f448e79f29 Remove long package names from samples
Long package names are really unnecessary in samples and they
just clutter things up. Also Spring Loaded doesn't work with
org.sfw packages, so to demo that technology you need a
different package name.
2013-12-31 08:40:26 +00:00
Dave Syer
aa2b020660 Refactor metrics to expose richer feature set
Main user-facing interface is still Counter/GaugeService but the
back end behind that has more options. The Default*Services write
metrics to a MetricWriter and there are some variants of that, and
also variants of MetricReader (basic read-only actions).

MetricRepository is now a combination of MetricReader, MetricWriter
and some more methods that make it a bit more repository like.

There is also a MultiMetricReader and a MultiMetricRepository for
the common case where metrics are stored in related (often open
ended) groups. Examples would be complex metrics like histograms
and "rich" metrics with averages and statistics attached (which
are both closed) and "field counters" which count the occurrences
of values of a particular named field or slot in an incoming message
(e.g. counting Twitter hastags, open ended).

In memory and redis implementations are provided for the repositories.
Generally speaking the in memory repository should be used as a
local buffer and then scheduled "exports" can be executed to copy
metric values accross to a remote repository for aggregation.
There is an Exporter interface to support this and a few implementations
dealing with different strategies for storing the results (singly or
grouped).

Codahale metrics are also supported through the MetricWriter interface.
Currently implemented through a naming convention (since Codahale has
a fixed object model this makes sense): metrics beginning with "histogram"
are Histograms, "timer" for Timers, "meter" for Meters etc.

Support for message driven metric consumption and production are provided
through a MetricWriterMessageHandler and a MessageChannelMetricWriter.

No support yet for pagination in the repositories, or for HATEOAS style
HTTP endpoints.
2013-12-30 10:32:42 +00:00
Dave Syer
f5ad4be2c1 Add basic build.xml to actuator sample
$ ant -lib ivy-2.2.jar

(substitute the location of your actual ivy jar)

    $ java -jar target/*.jar

Fixes gh-140
2013-12-23 14:50:58 +00:00
Phillip Webb
dbec81cabe Disable jmx by default
Change JmxAutoConfiguration so that by default JMX exposure is not
enabled. This matches the Javdoc text.
2013-12-18 22:32:39 -08:00
Dave Syer
ab4dec58ef Rename packages in samples 2013-12-18 20:05:33 -08:00
Dave Syer
60cb5fd35c Add log4j starter and some documentation
As discussed in gh-162
2013-12-16 17:26:53 +00:00
Dave Syer
e55e8f9863 Add build.gradle samples and rename runJar->bootRun 2013-12-10 11:10:04 +00:00
Dave Syer
bcae284dd9 Add a shim Endpoint if management context is child
When management endpoints are on a different port the HandlerMappings
are restricted to a single EndpointHandlerMapping, so the error
controller (which is a normal @Controller with @RequestMappings) does
not get mapped.

Fixed by addinga shim Endpoint on "/error" that delegates to the
ErrorController (which interface picks up an extra method).
2013-12-05 09:56:00 +00:00
Dave Syer
2f6f88e370 Fix actuator sample for new shutdown property 2013-11-27 13:53:12 +00:00
Dave Syer
bd26b28aa5 Extract actuator security into separate classes
So spring-security + a web app is secure by default
(you don't need the actuator).
2013-11-21 16:47:29 +00:00
Christian Dupuis
95e68bf1a2 Prepare actuator sample to show how to use the telnet connector 2013-11-20 17:15:45 +01:00
Phillip Webb
64f32893bb Source format and clean-up 2013-11-16 00:08:18 -08:00
Phillip Webb
883fd9162f Polish 2013-11-16 00:08:17 -08:00
Dave Syer
c678be49e3 Explicitly add servlet API to actuator sample 2013-11-06 13:02:27 +00:00
Dave Syer
6845c6b787 Remove tomcat dependencies from sample unless needed 2013-11-06 11:40:23 +00:00
Christian Dupuis
55b0e747b0 Rename spring-boot-starter-shell-crsh to spring-boot-starter-shell-remote 2013-11-06 12:12:40 +01:00
Christian Dupuis
6b599b8483 Add remote shell implementation based on crsh
This commit adds a new starter named spring-boot-starter-shell-crsh and auto configuration support to embed a system shell within Spring Boot applications.

The embedded shell allows clients to connect via ssh or telnet to the Boot app and execute commands. Commands can be implemented and embedded with app.

For sample usage see spring-boot-samples-actuator.
2013-11-04 17:22:02 +01:00
Dave Syer
63a2d06767 Explicitly disable security on management endpoints if requested
Previously the management endpoint filter was applied to all requests
if the user had disabled security.management.enabled, but since it
had no security applied it was letting all requests through.

The fix was to explicitly exclude the whole enclosing configuration
and carefully ignore the management endpoints in the normal security
chain.

Fixes gh-100.
2013-10-31 18:46:39 +00:00
Dave Syer
6c31854600 Refactor sample dependencies to use starters 2013-10-31 16:43:57 +00:00
Dave Syer
0498617411 Disable whitelabel view if Thymeleaf error.html detected 2013-10-23 10:48:14 -04:00
Dave Syer
f7fa63bcb4 Add status and error messages to /trace
[Fixes #57949108] [bs-323] Make sure /trace shows error responses
2013-10-01 14:48:07 -04:00
Phillip Webb
a33425920b Rework POMs to support automated CI release 2013-09-05 22:05:29 -07:00
Dave Syer
38e565e920 Back to SNAPSHOT for dev 2013-09-05 17:15:15 -07:00
Dave Syer
b634b3bde6 Update to 0.5.0.M2 2013-09-05 17:15:15 -07:00
Dave Syer
1e0e2e7102 Switch off CSRF filter
Might need to revisit later.
2013-09-05 17:14:12 -07:00
Dave Syer
43fc107437 Fix security config
The management endpoints were still all mixed up
with the user endpoints. Fixed that and extracted
user endpoints in to conditional block so not
protected if path explicitly set to empty string.

[#53029715]
2013-09-05 17:14:11 -07:00
Dave Syer
621116c9b8 ManagementServerConfiguration security
Management endpoints are still secure by default if
Spring Security is present, but now the default
user details have an ADMIN role, and a random password
(which is logged at INFO level if not overridden).

To override you add management.user.password (name, role)
to external properties.

[Fixes #53029715] [bs-203]
2013-09-05 17:14:10 -07:00
Dave Syer
f502098065 Fix logging depdendencies in samples 2013-08-06 13:40:39 +01:00
Phillip Webb
d86bf66645 Add parent relativePath
Update sample applications to correctly refer to parent relativePath.
2013-08-06 00:02:31 -07:00
Dave Syer
3922a7f526 Reinstate junit dependencies in starters 2013-08-05 12:43:24 +01:00
Dave Syer
4bb5de02e7 Switch back to SNAPSHOT for dev 2013-08-02 12:00:14 +01:00
Dave Syer
68e5a7e887 Bump version to 0.5.0.M1 2013-08-02 12:00:14 +01:00
Phillip Webb
5450af70e0 Ops -> Actuator 2013-07-31 13:20:26 -07:00
Phillip Webb
4c067a89fe Ops -> Actuator 2013-07-31 12:57:25 -07:00
Dave Syer
5995b7727a Ops -> Actuator 2013-07-31 09:46:34 +01:00