Commit Graph

384 Commits

Author SHA1 Message Date
Dave Syer
3bc37ddde0 Strip out most of websocket autoconfig
... leaving only the embedded Tomcat enabling feature (registering
the WsSci).

Fixes part of gh-65
2014-03-04 16:25:10 +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
Phillip Webb
468728a2c0 Polish 2014-03-03 17:50:19 -08:00
Dave Syer
8ff9e67714 Add actuator to method security sample 2014-03-03 15:03:08 +00:00
Dave Syer
9504f6e5a9 Add method security web sample
Useful sample for common use case where user adds custom Authentication,
a form login, *and* global method security all the the same application.
2014-03-03 14:24:08 +00:00
Dave Syer
b0b7bc0e7f Fix tests
Some assumptions were being made in tests, e.g. about
there being an AuthenticationManager @Bean, which were
false with the new Security 3.2.1 updates from Rob.

Also parent-child contexts with the actuator were
problematic because they didn't exclude the web configuration
for the management security in the parent context.

Fixes gh-244
2014-03-03 12:22:36 +00:00
Dave Syer
2845b101a1 Add spring-data-rest sample 2014-02-27 10:33:44 +00:00
Phillip Webb
cf23b519d2 Polish 2014-02-24 13:43:54 -08:00
Dave Syer
b2b487ee5f Add ServletRegistrationBean for DispatcherServlet
Mapping is exposed via server.servletPath.

Fixes gh-379
2014-02-20 09:49:24 +00:00
Phillip Webb
b69c659d8f Polish 2014-02-18 21:58:09 -08:00
Dave Syer
8778e82752 Add snakeyaml to spring-boot-starter
Fixes gh-366
2014-02-18 10:25:26 +00:00
Dave Syer
77bac876ce Add support for Spring Loaded in Maven and Gradle
Requires Loaded 1.1.5 (or better).

For Maven you can just add springloaded to the dependencies of the
spring-boot plugin (and also set MAVEN_OPTS=-noverify).

For Gradle add springloaded to the build dependencies (-noverify
can be added by the plugin).

In both cases there is also support for adding an arbitrary java agent
via configuration. Samples are provided in
spring-boot-sample-[simple,web-ui].

The ApplicationPlugin is only added if there is no JavaExec task
already present, and additionally it computes its own man class if
none is provided. So "gradle run" and "gradle bootRun" look
superficially similar, but "bootRun" has extra options, including
the agent and Loaded support.

Fixes gh-251, gh-183
2014-02-18 10:05:28 +00: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
4a58171b5c A few more package tweaks
Improve package structure and include package-info javadoc.
2014-02-12 13:50:37 -08:00
Phillip Webb
dd66f119d3 Revert Automatically detect 'development' profile
Revert commit a97bcfe3cd as adding
profiles automatically may be problematic.

Updates gh-296
2014-02-06 14:18:11 -08:00
Phillip Webb
c09ca17ca2 Update gradle example builds 2014-02-05 23:17:27 -08:00
Phillip Webb
ed9735361e Apply source cleanup and formatting 2014-02-05 22:53:28 -08:00
Phillip Webb
a97bcfe3cd Automatically detect 'development' profile
Detect when an application is running in development (by the presence
of a build file) and automatically add a 'development' profile.

Additional detectors can be developed by implementing the
`ProfileDetector` interface and registering with the `SpringApplication`

Fixes gh-296
2014-01-31 22:51:31 -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
3e9457ea8e Make @ConfigurationProperties available in @PostConstruct
Also means that persistence annotation processing can take advantage
of external properties bound in this way.
2014-01-30 10:14:35 +00:00
Dave Syer
99a2338323 Fix sample (Exception type changed in Mongo) 2014-01-30 10:06:35 +00:00
Dave Syer
4d608f20e9 Support for AuthenticationManagerBuilder injection into user code
Spring Boot provides a default AuthenticatiomManager for getting
started quickly with security and never exposing insecure
endpoints. To override that feature as users move to the next
stage in their project, they may have to do something slightly
different depending on whether it is a webapp or not.

In any app (web or not), providing a @Bean of type
AuthenticationManager always works, but you don't get the benefit of
the builder features.

In a webapp the user can also extend WebSecurityConfigurerAdapter
to provides a custom AuthenticationManager, and the preferred
way of doing that is via a void method that is autowired with an
AuthenticationManagerBuilder. The default AuthenticationManager is
built in a configurer with @Order(LOWEST_PRECEDENCE - 3) so
to override it the user's confugrer must have higher precedence
(lower @Order).

@EnableGlobalMethodSecurity can also be used in a non-webapp, and
Spring Boot will still provide a default AuthenticationManager.
To override it the user has to either extend
GlobalMethodSecurityConfiguration or provide a @Bean of type
AuthenticationManager (there's no other way to
capture the AuthenticationManagerBuilder that doesn't happen too late
in the beans lifecyle).

Fixes gh-244
2014-01-29 15:47:46 +00:00
Dave Syer
216bd16b7a Remove unneeded explicit versions in sample 2014-01-28 15:19:24 +00: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
Dave Syer
607b371706 Add thymeleaf starter
Fixes gh-264
2014-01-24 09:28:45 +00:00
Dave Syer
d23dab3bd0 Change package name in sample 2014-01-22 09:34:56 +00:00
Phillip Webb
43e54d38f7 Make fields private where possible 2014-01-21 16:29:07 -08:00
Phillip Webb
0160760568 Apply latest eclipse cleanup rules 2014-01-21 16:28:26 -08:00
Phillip Webb
ac54d7fe3c Final polish before 1.0.0.RC1 2014-01-21 16:28:17 -08:00
Phillip Webb
cdda330acd Update copyright header for files changed in 2014 2014-01-21 10:27:10 -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
5627caa724 Move spring-boot tests utilities to main spring-boot.jar
Fixes gh-233
2014-01-17 18:31:08 +00:00
Dave Syer
d53a52cf1a Fix test 2014-01-17 17:40:01 +00:00
Dave Syer
d01bc59d7e Update to bootstrap 3.0.3 2014-01-17 10:15:16 +00:00
Dave Syer
aded7435b5 Swicth to webjars for static sample 2014-01-17 09:59:13 +00:00
Dave Syer
559f907b54 Use explicit test dependencies in samples 2014-01-17 09:08:18 +00:00
Phillip Webb
312535bcd5 Add SpringNamingStrategy to improve FK names
Add a new `SpringNamingStrategy` hibernate `NamingStrategy` that
extends `ImprovedNamingStrategy` to improve the name of foreign
key columns.

Fixes gh-213
2014-01-16 10:38:56 -08: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
Phillip Webb
e3b352e0b5 Support 'headless' applications
Update SpringApplication to run by default in 'headless' mode. This
prevents the AWT system from creating a Java icon (for example in the
OSX dock).

Also update builds to run tests in 'headless' mode.
2014-01-13 22:43:37 -08:00
Phillip Webb
ffe8bf5419 Remove unused .gitignore files 2014-01-13 21:53:24 -08:00
Phillip Webb
47da8a817a Polish 2014-01-10 13:06:54 -08:00
Dave Syer
5bbb01c071 Move properties file to correct location 2014-01-10 08:10:22 +00:00
Dave Syer
d6b2ade8df Ensure logging initializer listens to the right event
This should make a difference to gh-196. It might even fix it
(depending on what snapshot the user had there).
2014-01-09 18:01:13 +00:00
Dave Syer
b1db714c23 Allow @EnableGlobalMethodSecurity in a non webapp
Fixes gh-202
2014-01-09 17:13:59 +00:00
Dave Syer
f5f41fef5e Check that WAR apps work in a container 2014-01-06 11:38:00 +00:00
Phillip Webb
1bcd3de7b5 Polish 2014-01-02 12:10:37 -08:00
Phillip Webb
0029e8200c Fix copyright dates 2014-01-02 10:55:04 -08:00
Phillip Webb
7623c291a2 Attempt to fix failing CI build 2014-01-02 10:23:58 -08: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
Dave Syer
6c4ee0b05d Add PoolConfig to Redis 2013-12-23 12:28:24 +00:00
Dave Syer
fa507005cd Use ServletWrappingController for jolokia instead of Servlet
We get more control over the handling and in particular the registration
of the endpoint this way. It was practically impossible to disable the
AgentServlet bean when in a parent context of the management server
because of lifecyce issues - you don't know that the user wants a
separate management server until too late.

This approach also makes it possible to test with spring-test MVC
support.
2013-12-20 19:49:48 +00:00
Dave Syer
e2c962ac28 Switch to thymeleaf-spring4 2013-12-19 13:40:24 +00:00
Dave Syer
d9e326a3d3 Add @Value injection to JSP (WAR) sample 2013-12-19 08:28:06 +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
6443800038 Add actuator-noweb sample 2013-12-18 20:05:33 -08:00
Dave Syer
ab4dec58ef Rename packages in samples 2013-12-18 20:05:33 -08:00
Dave Syer
997b015d10 Split SecurityAutoConfiguration
Spring Security 3.2 has a new annotation @EnableWebMvcSecurity that we
should use if MVC is being used.
2013-12-17 17:17:05 +00:00
Phillip Webb
513c6a1de2 Polish 2013-12-16 14:38:52 -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
b72002142d Split MessageConverters auto config out into separate class 2013-12-16 16:13:39 +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
25d9ac6535 Remove FIXME from JPA sample 2013-12-05 09:38:10 +00:00
Phillip Webb
f7f53e4e64 Fix for upstream Spring 4.0 changes 2013-12-03 11:51:51 -08:00
Dave Syer
19fa5b9af6 Updated howtos 2013-11-29 07:39:24 +00:00
Dave Syer
9db55a3b71 Add explicit test for config file and SpringApplication 2013-11-28 16:46:21 +00:00
Dave Syer
3e6c1b435f Add @SpringApplicationConfiguration (for integration testing)
Example:

    @RunWith(SpringJUnit4ClassRunner.class)
    @SpringApplicationConfiguration(classes = SampleDataJpaApplication.class)
    public class CityRepositoryIntegrationTests {

    	@Autowired
    	CityRepository repository;

Fixes gh-66.
2013-11-28 14:35:36 +00:00
Dave Syer
2f6f88e370 Fix actuator sample for new shutdown property 2013-11-27 13:53:12 +00:00
Dave Syer
756b5e1b60 Convert JSP sample to deployable (executable) WAR 2013-11-27 10:17:04 +00:00
Dave Syer
3f1cfbf241 Add JSTL to JSP sample 2013-11-26 10:00:50 +00:00
Phillip Webb
f4f668a52b Polish 2013-11-25 17:12:56 -08:00
Dave Syer
aed0e0f217 Add provided scope for tomcat 2013-11-25 17:22:14 +00:00
Dave Syer
d6593fbee6 Add extra test for partial overrides 2013-11-22 08:51:02 +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
Dave Syer
63f8b63f7e Upgrade Tomcat to 7.0.47 2013-11-20 12:21:21 +00: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
811bd32ce2 More sensible signature for servlet initializer 2013-11-07 14:03:58 +00: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
Dave Syer
c144cae600 Comment out security condition pending SPR-11069 2013-11-05 14:20:51 +00:00
Dave Syer
e43dcd3061 Upgrade reactor and tomcat (for websocket) 2013-11-05 11:56:32 +00:00
Dave Syer
7006f222ab Use @Transactional where appropriate 2013-11-05 11:28:24 +00:00
Dave Syer
0c79c8913f Ensure AutoConfigurationReport is always present 2013-11-04 17:07:04 +00:00
Greg Turnquist
b63016d8fc Create a report based on Boot's autoconfiguration decisions
- Gather autoconfiguration conditional decisiions (true and false)
- Provide an actuator endpoint as one means to read the report
- Define @EnableAutConfigurationReport annotation to turn this feature on
- Tidy up autoconfig report a bit and log it if --debug=true
2013-11-04 17:07:04 +00: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
a2db6a911f Add new sample to reactor build 2013-11-02 15:49:36 +00:00
Dave Syer
c5cfe54c80 Add spring-boot tests to test starter 2013-11-01 14:39:03 +00:00
Dave Syer
e53dad879d Add sample with form login 2013-11-01 11:28:53 +00: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
Phillip Webb
af0d08c998 Polish 2013-10-08 21:17:39 -07:00
Phillip Webb
b772f7c2e4 Polish
Minor formatting and consistent copyright header.
2013-10-08 20:30:45 -07:00
Phillip Webb
1a9ce42da9 Apply source formatting to samples 2013-10-08 20:25:10 -07:00
Ulrich von Poblotzki
f306eda703 Implemented the error handling in case of commucation failures 2013-10-08 17:38:43 -04:00
Ulrich von Poblotzki
386bb73169 Added simple error hangling to 'SnakeTimer#broadcast'
In some cases the websocket communication fails and Snake#sendMessage throws an exception.
In that case the send loop is interrupted and later clients are not update.
2013-10-08 17:38:42 -04:00
Dave Syer
4655eb3a94 Expose SpringApplicationBuilder in SpringBootServletInitializer 2013-10-08 11:04:45 -04:00
Ulrich von Poblotzki
4ddae32de9 Updated Tomcat version updated to 8.0.0-RC3
The RC1 version had some websocket issues, that prevented propper websocket communication.
In some cases the SocketJS communication was downgraded to 'xhr_streaming'.
2013-10-07 17:52:26 -04:00
Dave Syer
3b2abe9c17 Use create_drop JPA as default if in-memory
[Fixes #55277582] [bs-288]
2013-10-07 17:38:08 -04:00
Dave Syer
1a59698f8b Tweak AMQP sample slightly 2013-10-07 11:22:33 -04:00
Eberhard Wolff
1096ed6d1f Added AMQP starter and sample 2013-10-07 11:02:21 -04:00
Dave Syer
5fe9ef69c7 Add SpringApplicationContextLoader 2013-10-02 15:07:04 -04:00
Dave Syer
345c0fc5a4 Add SpringApplicationBuilder
Builder for SpringApplication and ApplicationContext instances with
convenient fluent API and context hierarchy support. Simple example
of a context hierarchy:

   new SpringApplicationBuilder(ParentConfig.class)
               .child(ChildConfig.class).run(args);

Another common use case is setting default arguments, e.g.
active Spring profiles, to set up the environment for an application:

     new SpringApplicationBuilder(Application.class).profiles("server")
 		.defaultArgs("--transport=local").run(args);

If your needs are simpler, consider using the static convenience
methods in SpringApplication instead.

[#49703716] [bs-116] Parent context for some beans maybe?
2013-10-02 07:06:12 -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
1bdb2ce1c2 Polish 2013-09-30 09:50:38 -07:00
Dave Syer
923f286ae2 Add spring.view.{prefix,suffix} properties
Fixes #62
2013-09-27 09:34:10 -04:00
Phillip Webb
e16a0278ae Support single config from ServletInitializer
Update SpringBootServletInitializer with separate getConfigClass() and
getAdditionalConfigClasses() methods. This change makes it easier to
use the SpringBootServletInitializer with the common use case of a
single config class.
2013-09-25 20:58:27 -07:00
Phillip Webb
c544921eaa Polish whitespace 2013-09-24 15:42:45 -07:00
Dave Syer
abb1420486 Fixes #55: stop() connector to unbind socket
The `Tomcat.start()` has to happen to initialize the `ServletContext`
but we can immediately stop the connector and then restart it when
the context is finished refreshing. Seems to make curl fail quickly
if an app is slow to start.
2013-09-20 18:16:03 +01:00
Phillip Webb
9a529b41c1 Polish 2013-09-18 12:50:47 -07:00
Phillip Webb
b857a9001d Cleanup trailing whitespace 2013-09-18 12:17:56 -07:00
Dave Syer
2b5a67ba3c mongo->mongodb sample 2013-09-13 08:13:24 -07:00
Dave Syer
1026e349c4 Prevent Mongo sample tests from failing in CI 2013-09-12 08:41:02 -07:00
Dave Syer
191894a16a Add Mongo auto configuration
Spring Data Mongo is the only dependency so it doesn't
really need a new starter. Added a sample though.
2013-09-11 09:53:36 -07:00
Dave Syer
d06d202fd0 Add AopAutoConfiguration (also starter and sample)
A side effect is that spring-boot-starter-data-jpa needs
to include an aspectjweaver depdendency. Hope that doesn't
hurt anything else.

[Fixes #56780004]
2013-09-11 06:18:34 -07:00
Phillip Webb
a33425920b Rework POMs to support automated CI release 2013-09-05 22:05:29 -07:00
Phillip Webb
16cf2faa1b Remove sample gradle builds
Remove sample gradle builds since they are not run during the regular
build and would need to be manually updated after a release.
2013-09-05 22:04:24 -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
5755b07e6c Switch roles of snake and echo
Snake is stateful so it should be one per connection. Echo is the
opposite.
2013-09-05 17:15:14 -07:00
Phillip Webb
f7ce153ff0 Fix JSP EL support with Tomcat
Fix TomcatEmbeddedServletContainerFactory to set a MERGED_WEB_XML
attribute when JSPs are used. This is required for EL support with
JSPs since Jasper checks the version number in the web.xml. Without
any web.xml Jasper default to disabling EL.

Issue: #55752948
2013-09-05 17:14:13 -07:00
Phillip Webb
a95494fe61 Remove '/resources/**' mapping and default servlet
Remove '/resources/**' mapping since it can cause problems with the
'/**' when the developer defines their own 'resources' sub-folder.

Also remove default servlet config since the resources mapping renders
it redundant.

Issue: #55494446
2013-09-05 17:14:13 -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
Phillip Webb
2b54b6286f Rework database auto-configure
Rework several aspects of database auto-configuration:

- Use RelaxedPropertyResolver to obtain property values
- Extract EmbeddedDatabaseConnection from EmbeddedDatabaseConfiguration
- Rename several configuration classes for consistency

Issue: #53028397
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
3c44fda782 Switch off ws sample tests 2013-09-05 17:14:10 -07:00
Dave Syer
5ead60a7e1 Comment out websocket sample (fails in CI) 2013-09-05 17:14:10 -07:00
Dave Syer
767aa43e31 Add WebSocketAutoConfiguration
Opinionated defaults for WebSockets:

* If spring-websocket is on the classpath and so is
the Tomcat WSci initializer then it is added to the context
* A DefaultSockJsService is added if none is present
* User has only to define @Beans of type WebSocketHandler with
name starting "/"
* Each one is converted to a SockJsHttpRequestHandler and
mapped to "/<beanName>/**"
2013-09-05 17:14:10 -07:00
Dave Syer
6e8cbbde3b Use reflection hack for error page in Tocmat 8 2013-09-05 17:14:10 -07:00
Biju Kunjummen
fa3b593568 Removed spring-boot related version from dependencies of samples 2013-09-05 17:14:09 -07:00
Phillip Webb
d4fe320254 Update trace logging to include Hibernate SQL 2013-09-05 17:14:09 -07:00
Dave Syer
d205d9404a Add additional ViewResolver configuration
The DispatcherServlet adds a default InternalViewResolver
which was used by some apps, but when the actuator was
available it added an "/error" bean and effectively
switched off the default view resolver. The net fix was
to add an InternalViewResolver at the same time as
adding any other ViewResolvers.

[Fixes #55357516] [bs-290] Actuator UI app cannot serve static index.html
2013-09-05 17:14:08 -07:00
Phillip Webb
878ff13620 Documentation updates 2013-08-09 15:34:04 -07:00
Phillip Webb
cf655945aa Polish 2013-08-09 12:28:54 -07:00
Dave Syer
7bea9dd973 Massage MVC test a bit
* Use *Tests as classname
* Fixed broken test in suite where ID is not always "1"
2013-08-09 16:41:58 +01:00
Biju Kunjummen
31af68a915 Added a Spring MVC test for the Sample MessageController 2013-08-09 16:31:11 +01:00
Dave Syer
42bb793155 Add ServletContextListener to embedded web app
* User can add @Bean of type EventListener (e.g.
ServletContextListener)

[Fixes #54112999] [bs-254]
2013-08-08 11:27:07 +01:00
Phillip Webb
f5bae04714 Ignore websocket sample for now 2013-08-07 23:09:08 -07:00
Phillip Webb
b5e81ff42d Fix broken test dependencies 2013-08-07 22:52:26 -07:00
Phillip Webb
eb69732fbb Reinstate integration tests 2013-08-07 22:34:09 -07:00
Dave Syer
521174754e Add default /error view for HTML clients
* Add integration tests for /error view
* Add "error" @Bean as default view for HTML

Users may see side effects because now there will be
a ContentNegotiatingViewResolver by default for the
first time in a vanilla Actuator app. Should be
interesting.

[Fixes #54597932] [bs-273] Circular view reference for /error
2013-08-07 10:55:30 +01:00
Dave Syer
f502098065 Fix logging depdendencies in samples 2013-08-06 13:40:39 +01:00
Dave Syer
12f0d4d95e Rename ops package to actuate 2013-08-06 13:15:02 +01:00
Dave Syer
d2419a36fd Add server.tomcat.access_valve_enabled flag
Also introduced new strategy for customizing Tomcat Context
(TomcatContextCustomizer) - any that are added to the factory
will be applied before any other customizations in postProcessContext()

[Fixes #54670052] [bs-275] Make Tomcat access valve logs more accessible
2013-08-06 10:21:17 +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
Phillip Webb
4e11ae1671 Documentation
Various updates to README.md files.
2013-08-05 22:36:22 -07:00
Phillip Webb
4038b39496 Add OutputCapture test class 2013-08-05 13:48:14 -07:00
Dave Syer
c2c8144117 Add websocket sample 2013-08-05 21:40:33 +01:00
Dave Syer
bfb843e1a0 Add logging initializer to tests 2013-08-05 17:32:18 +01:00
Dave Syer
3922a7f526 Reinstate junit dependencies in starters 2013-08-05 12:43:24 +01:00
Oliver Gierke
d2def68602 Cleanups Spring Data JPA example.
Various cleanups to the Spring Data JPA example, including:

* Move repositories into service package and make them package private
  thus only expose the service interfaces to clients.
* Merge HotelRepository and HotelSummaryRepository and make service
  implementations package protected.
* Introduce integration test base class to bootstrap the app as
  SpringAppliation.run would.
* Refactor central test case to rather use Spring MVC integration
  testing framework.
* Add integration tests for repositories to execute query methods.
2013-08-02 22:29:07 -07:00
Phillip Webb
1db22aca5c Rework POM structure
Rework main build POM to be an aggregator pom that does not inherit
from any parent. Introduce new spring-boot-dependencies module to
act as a parent for both spring-boot-starter-parent and
spring-boot-parent.
2013-08-02 21:58:24 -07:00
Dave Syer
4bb5de02e7 Switch back to SNAPSHOT for dev 2013-08-02 12:00:14 +01:00
Dave Syer
638a31f5e3 Fix poms for a milestone release 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
e1c6860a41 Documentation 2013-08-02 00:34:53 -07: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
39425c81d6 Servlet context document root not found when running as exploded WAR
* Added additional search in
AbstractEmbeddedServletContainerFactory.getValidDocumentRoot() to
detect a /WEB-INF/ directory in the code archive
* If the code archive is in /WEB-INF/** then we assume it is
safe to serve content from / (exposes the loader classes
but nothing sensitive from the app)

[Fixes #54345578]
2013-07-31 10:30:03 +01:00
Dave Syer
5995b7727a Ops -> Actuator 2013-07-31 09:46:34 +01:00
Phillip Webb
3bb79db579 Renamed spring-boot-ups -> spring-boot-starter 2013-07-31 01:11:10 -07:00
Dave Syer
2f0a96c986 Remove unused @ComponentScan 2013-07-30 22:02:08 +01:00
Dave Syer
6d76467a66 Add responsive features to static sample 2013-07-30 10:31:37 +01:00
Phillip Webb
0fee00f0d7 Add gradle example builds
Add gradle example builds to spring-boot-sample-tomcat and
spring-boot-sample-traditional.

Issue: #53129653
2013-07-30 00:06:35 -07:00
Phillip Webb
6fd6d3a73e Rename maven 'package' goal to 'repackage' 2013-07-29 14:52:30 -07:00
Phillip Webb
36c3ceab97 Include servlet support for index.html resources
Issue: #54228642
2013-07-29 13:03:42 -07:00
Phillip Webb
728829ba81 Revert welcome file defaults
Revert welcome file default that break existing tests.

Issue: #54228642
2013-07-29 12:42:37 -07:00
Dave Syer
fe90df3afc Remove WARN log in Tomcat startup 2013-07-29 17:09:31 +01:00
Dave Syer
4c359e1a4d Two choices are available to users for welcome page
* For a jar deployment add classpath:static/index.html
(works via Spring MVC mapping)
* For a war the same thing works, but so does adding
index.html to src/main/webapp (works via container
default servlet)

[Fixes #54092261] [bs-252]
2013-07-29 11:57:44 +01:00
Dave Syer
7ea433dce2 Fix broken logback.xml 2013-07-27 12:08:17 +01:00
Phillip Webb
b665a2bb1d Renamed packages
Issue: #54095231
2013-07-26 14:11:04 -07:00
Phillip Webb
3f2bb03fb8 Renamed some projects and polish POMs
Issue: #54095231
2013-07-26 12:31:37 -07:00
Dave Syer
2098e23fca Change package names zero->boot
* actuator -> boot-ops
* cli -> boot-cli
* launcher -> boot-load
* autoconfig -> boot-config
* bootstrap -> boot-strap
* starters -> boot-up

[#54095231] [bs-253] Refactor Zero->Boot
2013-07-26 14:13:41 +01:00