Commit Graph

240 Commits

Author SHA1 Message Date
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