├── .editorconfig ├── .gitattributes ├── .github └── ISSUE_TEMPLATE │ ├── spring-boot-admin-bug.md │ └── spring-boot-admin-enhancement.md ├── .gitignore ├── .gnupg.tar.enc ├── .mvn └── wrapper │ ├── MavenWrapperDownloader.java │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── .travis.yml ├── LICENSE.txt ├── README.md ├── deploy-settings.xml ├── images ├── logo-spring-boot-admin.png ├── screenshot-details.png ├── screenshot-environment.png ├── screenshot-jmx.png ├── screenshot-journal.png ├── screenshot-logfile.png ├── screenshot-logging.png ├── screenshot-metrics.png ├── screenshot-threads.png ├── screenshot-trace.png └── screenshot.png ├── lombok.config ├── mvnw ├── mvnw.cmd ├── pom.xml ├── spring-boot-admin-build └── pom.xml ├── spring-boot-admin-client ├── pom.xml └── src │ ├── main │ ├── java │ │ └── de │ │ │ └── codecentric │ │ │ └── boot │ │ │ └── admin │ │ │ └── client │ │ │ ├── config │ │ │ ├── ClientProperties.java │ │ │ ├── CloudFoundryApplicationProperties.java │ │ │ ├── InstanceProperties.java │ │ │ ├── SpringBootAdminClientAutoConfiguration.java │ │ │ ├── SpringBootAdminClientCloudFoundryAutoConfiguration.java │ │ │ └── SpringBootAdminClientEnabledCondition.java │ │ │ └── registration │ │ │ ├── Application.java │ │ │ ├── ApplicationFactory.java │ │ │ ├── ApplicationRegistrator.java │ │ │ ├── CloudFoundryApplicationFactory.java │ │ │ ├── DefaultApplicationFactory.java │ │ │ ├── RegistrationApplicationListener.java │ │ │ ├── ServletApplicationFactory.java │ │ │ └── metadata │ │ │ ├── CloudFoundryMetadataContributor.java │ │ │ ├── CompositeMetadataContributor.java │ │ │ ├── MetadataContributor.java │ │ │ └── StartupDateMetadataContributor.java │ └── resources │ │ └── META-INF │ │ ├── additional-spring-configuration-metadata.json │ │ └── spring.factories │ └── test │ └── java │ └── de │ └── codecentric │ └── boot │ └── admin │ └── client │ ├── AbstractClientApplicationTest.java │ ├── ClientReactiveApplicationTest.java │ ├── ClientServletApplicationTest.java │ ├── config │ ├── ClientPropertiesTest.java │ ├── CloudFoundryApplicationPropertiesTest.java │ ├── SpringBootAdminClientAutoConfigurationTest.java │ ├── SpringBootAdminClientCloudFoundryAutoConfigurationTest.java │ └── SpringBootAdminClientEnabledConditionTest.java │ └── registration │ ├── ApplicationRegistratorTest.java │ ├── ApplicationTest.java │ ├── CloudFoundryApplicationFactoryTest.java │ ├── DefaultApplicationFactoryTest.java │ ├── RegistrationApplicationListenerTest.java │ ├── ServletApplicationFactoryTest.java │ └── metadata │ ├── CloudFoundryMetadataContributorTest.java │ ├── CompositeMetadataContributorTest.java │ └── StartupDateMetadataContributorTest.java ├── spring-boot-admin-dependencies └── pom.xml ├── spring-boot-admin-docs ├── deploy-gh-pages.sh ├── pom.xml └── src │ └── main │ └── asciidoc │ ├── changes-2.x.adoc │ ├── client.adoc │ ├── customizing.adoc │ ├── faqs.adoc │ ├── getting-started.adoc │ ├── images │ └── mail-notification-sample.png │ ├── index.adoc │ ├── security.adoc │ ├── server-clustering.adoc │ ├── server-discovery.adoc │ ├── server-notifications.adoc │ └── server.adoc ├── spring-boot-admin-samples ├── pom.xml ├── spring-boot-admin-client-with-security │ ├── .gitattributes │ ├── .gitignore │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── de │ │ │ └── codecentric │ │ │ └── boot │ │ │ └── admin │ │ │ └── client │ │ │ └── SpringBootAdminClientApplication.java │ │ └── resources │ │ └── application.properties ├── spring-boot-admin-client-without-security │ ├── .gitattributes │ ├── .gitignore │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── de │ │ │ └── codecentric │ │ │ └── boot │ │ │ └── admin │ │ │ └── client │ │ │ └── SpringBootAdminClientApplication.java │ │ └── resources │ │ └── application.properties ├── spring-boot-admin-sample-consul │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── de │ │ │ │ └── codecentric │ │ │ │ └── boot │ │ │ │ └── admin │ │ │ │ └── SpringBootAdminApplication.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── de │ │ └── codecentric │ │ └── boot │ │ └── admin │ │ └── SpringBootAdminApplicationTest.java ├── spring-boot-admin-sample-custom-ui │ ├── .gitignore │ ├── README.md │ ├── babel.config.js │ ├── package-lock.json │ ├── package.json │ ├── pom.xml │ ├── src │ │ ├── custom-endpoint.vue │ │ ├── custom.vue │ │ └── index.js │ └── vue.config.js ├── spring-boot-admin-sample-eureka │ ├── docker-compose.yml │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── docker │ │ │ └── Dockerfile │ │ ├── java │ │ │ └── de │ │ │ │ └── codecentric │ │ │ │ └── boot │ │ │ │ └── admin │ │ │ │ └── SpringBootAdminApplication.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── de │ │ └── codecentric │ │ └── boot │ │ └── admin │ │ └── SpringBootAdminApplicationTest.java ├── spring-boot-admin-sample-hazelcast │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── de │ │ │ │ └── codecentric │ │ │ │ └── boot │ │ │ │ └── admin │ │ │ │ └── SpringBootAdminApplication.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── de │ │ └── codecentric │ │ └── boot │ │ └── admin │ │ └── SpringBootAdminApplicationTest.java ├── spring-boot-admin-sample-reactive │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── de │ │ │ │ └── codecentric │ │ │ │ └── boot │ │ │ │ └── admin │ │ │ │ └── SpringBootAdminApplication.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── de │ │ └── codecentric │ │ └── boot │ │ └── admin │ │ └── SpringBootAdminApplicationTest.java ├── spring-boot-admin-sample-servlet │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── de │ │ │ │ └── codecentric │ │ │ │ └── boot │ │ │ │ └── admin │ │ │ │ ├── CustomEndpoint.java │ │ │ │ ├── CustomNotifier.java │ │ │ │ └── SpringBootAdminApplication.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── de │ │ └── codecentric │ │ └── boot │ │ └── admin │ │ └── SpringBootAdminApplicationTest.java ├── spring-boot-admin-sample-war │ ├── .gitignore │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── de │ │ │ └── codecentric │ │ │ └── boot │ │ │ └── admin │ │ │ └── SpringBootAdminApplication.java │ │ └── resources │ │ └── application.yml ├── spring-boot-admin-sample-zookeeper │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── de │ │ │ │ └── codecentric │ │ │ │ └── boot │ │ │ │ └── admin │ │ │ │ └── SpringBootAdminApplication.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── de │ │ └── codecentric │ │ └── boot │ │ └── admin │ │ └── SpringBootAdminApplicationTest.java ├── spring-boot-admin-server-with-security │ ├── .gitattributes │ ├── .gitignore │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── de │ │ │ └── codecentric │ │ │ └── boot │ │ │ └── admin │ │ │ └── server │ │ │ └── SpringBootAdminServerApplication.java │ │ └── resources │ │ └── application.properties └── spring-boot-admin-server-without-security │ ├── .gitattributes │ ├── .gitignore │ ├── pom.xml │ └── src │ └── main │ ├── java │ └── de │ │ └── codecentric │ │ └── boot │ │ └── admin │ │ └── server │ │ └── SpringBootAdminServerApplication.java │ └── resources │ └── application.properties ├── spring-boot-admin-server-cloud ├── pom.xml └── src │ ├── main │ ├── java │ │ └── de │ │ │ └── codecentric │ │ │ └── boot │ │ │ └── admin │ │ │ └── server │ │ │ └── cloud │ │ │ ├── config │ │ │ └── AdminServerDiscoveryAutoConfiguration.java │ │ │ └── discovery │ │ │ ├── DefaultServiceInstanceConverter.java │ │ │ ├── EurekaServiceInstanceConverter.java │ │ │ ├── InstanceDiscoveryListener.java │ │ │ └── ServiceInstanceConverter.java │ └── resources │ │ └── META-INF │ │ ├── additional-spring-configuration-metadata.json │ │ └── spring.factories │ └── test │ └── java │ └── de │ └── codecentric │ └── boot │ └── admin │ └── server │ └── cloud │ ├── AdminApplicationDiscoveryTest.java │ ├── config │ └── AdminServerDiscoveryAutoConfigurationTest.java │ └── discovery │ ├── DefaultServiceInstanceConverterTest.java │ ├── EurekaServiceInstanceConverterTest.java │ └── InstanceDiscoveryListenerTest.java ├── spring-boot-admin-server-ui ├── .babelrc ├── .eslintignore ├── .eslintrc.js ├── .gitignore ├── README.md ├── package-lock.json ├── package.json ├── pom.xml ├── postcss.config.js ├── src │ ├── main │ │ ├── frontend │ │ │ ├── assets │ │ │ │ ├── css │ │ │ │ │ ├── _utilities.scss │ │ │ │ │ └── base.scss │ │ │ │ └── img │ │ │ │ │ ├── favicon-danger.png │ │ │ │ │ ├── favicon.png │ │ │ │ │ └── icon-spring-boot-admin.svg │ │ │ ├── components │ │ │ │ ├── __snapshots__ │ │ │ │ │ ├── sba-status.spec.js.snap │ │ │ │ │ └── sba-time-ago.spec.js.snap │ │ │ │ ├── font-awesome-icon.js │ │ │ │ ├── index.js │ │ │ │ ├── sba-confirm-button.vue │ │ │ │ ├── sba-formatted-obj.vue │ │ │ │ ├── sba-icon-button.vue │ │ │ │ ├── sba-panel.vue │ │ │ │ ├── sba-status.spec.js │ │ │ │ ├── sba-status.vue │ │ │ │ ├── sba-tags.vue │ │ │ │ ├── sba-time-ago.js │ │ │ │ └── sba-time-ago.spec.js │ │ │ ├── directives │ │ │ │ ├── on-resize.js │ │ │ │ ├── popper.js │ │ │ │ └── sticks-below.js │ │ │ ├── index.html │ │ │ ├── index.js │ │ │ ├── login.html │ │ │ ├── mixins │ │ │ │ └── subscribing.js │ │ │ ├── notifications.js │ │ │ ├── services │ │ │ │ ├── application.js │ │ │ │ ├── instance.js │ │ │ │ └── notification-filter.js │ │ │ ├── shell │ │ │ │ ├── index.vue │ │ │ │ └── navbar.vue │ │ │ ├── store.js │ │ │ ├── utils │ │ │ │ ├── autolink.js │ │ │ │ ├── autolink.spec.js │ │ │ │ ├── axios.js │ │ │ │ ├── axios.spec.js │ │ │ │ ├── collections.js │ │ │ │ ├── d3.js │ │ │ │ ├── eventsource-polyfill.js │ │ │ │ ├── logtail.js │ │ │ │ ├── objToString.js │ │ │ │ ├── objToString.spec.js │ │ │ │ ├── rxjs.js │ │ │ │ ├── rxjs.spec.js │ │ │ │ ├── uri.js │ │ │ │ └── uri.spec.js │ │ │ ├── viewRegistry.js │ │ │ └── views │ │ │ │ ├── about │ │ │ │ └── index.vue │ │ │ │ ├── applications │ │ │ │ ├── applications-list.vue │ │ │ │ ├── index.vue │ │ │ │ ├── label.vue │ │ │ │ └── notification-filter-settings.vue │ │ │ │ ├── index.js │ │ │ │ ├── instances │ │ │ │ ├── auditevents │ │ │ │ │ ├── auditevents-list.vue │ │ │ │ │ └── index.vue │ │ │ │ ├── details │ │ │ │ │ ├── cache-chart.vue │ │ │ │ │ ├── datasource-chart.vue │ │ │ │ │ ├── details-cache.vue │ │ │ │ │ ├── details-caches.vue │ │ │ │ │ ├── details-datasource.vue │ │ │ │ │ ├── details-datasources.vue │ │ │ │ │ ├── details-gc.vue │ │ │ │ │ ├── details-health.vue │ │ │ │ │ ├── details-info.vue │ │ │ │ │ ├── details-memory.vue │ │ │ │ │ ├── details-metadata.vue │ │ │ │ │ ├── details-process.vue │ │ │ │ │ ├── details-threads.vue │ │ │ │ │ ├── health-details.vue │ │ │ │ │ ├── index.vue │ │ │ │ │ ├── mem-chart.vue │ │ │ │ │ ├── process-uptime.js │ │ │ │ │ └── threads-chart.vue │ │ │ │ ├── env │ │ │ │ │ ├── env-manager.vue │ │ │ │ │ └── index.vue │ │ │ │ ├── flyway │ │ │ │ │ └── index.vue │ │ │ │ ├── heapdump │ │ │ │ │ └── index.vue │ │ │ │ ├── httptrace │ │ │ │ │ ├── index.vue │ │ │ │ │ ├── traces-chart.vue │ │ │ │ │ └── traces-list.vue │ │ │ │ ├── jolokia │ │ │ │ │ ├── index.vue │ │ │ │ │ ├── m-bean-attribute.vue │ │ │ │ │ ├── m-bean-attributes.vue │ │ │ │ │ ├── m-bean-operation-invocation.vue │ │ │ │ │ ├── m-bean-operation.vue │ │ │ │ │ └── m-bean-operations.vue │ │ │ │ ├── liquibase │ │ │ │ │ └── index.vue │ │ │ │ ├── logfile │ │ │ │ │ └── index.vue │ │ │ │ ├── loggers │ │ │ │ │ ├── index.vue │ │ │ │ │ └── logger-control.vue │ │ │ │ ├── mappings │ │ │ │ │ ├── DispatcherMappings.vue │ │ │ │ │ ├── ServletFilterMappings.vue │ │ │ │ │ ├── ServletMappings.vue │ │ │ │ │ └── index.vue │ │ │ │ ├── metrics │ │ │ │ │ ├── index.vue │ │ │ │ │ └── metric.vue │ │ │ │ ├── scheduledtasks │ │ │ │ │ └── index.vue │ │ │ │ ├── sessions │ │ │ │ │ ├── index.vue │ │ │ │ │ └── sessions-list.vue │ │ │ │ ├── shell │ │ │ │ │ ├── header.vue │ │ │ │ │ ├── index.vue │ │ │ │ │ └── tabs.vue │ │ │ │ └── threaddump │ │ │ │ │ ├── index.vue │ │ │ │ │ ├── thread-tag.vue │ │ │ │ │ └── threads-list.vue │ │ │ │ ├── journal │ │ │ │ └── index.vue │ │ │ │ └── wallboard │ │ │ │ ├── hex-mesh.spec.js │ │ │ │ ├── hex-mesh.vue │ │ │ │ └── index.vue │ │ ├── java │ │ │ └── de │ │ │ │ └── codecentric │ │ │ │ └── boot │ │ │ │ └── admin │ │ │ │ └── server │ │ │ │ └── ui │ │ │ │ ├── config │ │ │ │ ├── AdminServerUiAutoConfiguration.java │ │ │ │ └── AdminServerUiProperties.java │ │ │ │ ├── extensions │ │ │ │ ├── UiExtension.java │ │ │ │ └── UiExtensionsScanner.java │ │ │ │ └── web │ │ │ │ └── UiController.java │ │ └── resources │ │ │ └── META-INF │ │ │ ├── spring-boot-admin-server-ui │ │ │ └── extensions │ │ │ │ └── .gitignore │ │ │ └── spring.factories │ └── test │ │ └── frontend │ │ ├── __mocks__ │ │ ├── file-mock.js │ │ └── vue-mock-component.js │ │ └── globals.js └── webpack.config.js ├── spring-boot-admin-server ├── pom.xml └── src │ ├── main │ ├── java │ │ └── de │ │ │ └── codecentric │ │ │ └── boot │ │ │ └── admin │ │ │ └── server │ │ │ ├── config │ │ │ ├── AdminServerAutoConfiguration.java │ │ │ ├── AdminServerCloudFoundryAutoConfiguration.java │ │ │ ├── AdminServerHazelcastAutoConfiguration.java │ │ │ ├── AdminServerMarkerConfiguration.java │ │ │ ├── AdminServerNotifierAutoConfiguration.java │ │ │ ├── AdminServerProperties.java │ │ │ ├── AdminServerWebConfiguration.java │ │ │ └── EnableAdminServer.java │ │ │ ├── domain │ │ │ ├── entities │ │ │ │ ├── EventsourcingInstanceRepository.java │ │ │ │ ├── Instance.java │ │ │ │ ├── InstanceRepository.java │ │ │ │ └── SnapshottingInstanceRepository.java │ │ │ ├── events │ │ │ │ ├── InstanceDeregisteredEvent.java │ │ │ │ ├── InstanceEndpointsDetectedEvent.java │ │ │ │ ├── InstanceEvent.java │ │ │ │ ├── InstanceInfoChangedEvent.java │ │ │ │ ├── InstanceRegisteredEvent.java │ │ │ │ ├── InstanceRegistrationUpdatedEvent.java │ │ │ │ └── InstanceStatusChangedEvent.java │ │ │ └── values │ │ │ │ ├── BuildVersion.java │ │ │ │ ├── Endpoint.java │ │ │ │ ├── Endpoints.java │ │ │ │ ├── Info.java │ │ │ │ ├── InstanceId.java │ │ │ │ ├── Registration.java │ │ │ │ ├── StatusInfo.java │ │ │ │ └── Tags.java │ │ │ ├── eventstore │ │ │ ├── ConcurrentMapEventStore.java │ │ │ ├── HazelcastEventStore.java │ │ │ ├── InMemoryEventStore.java │ │ │ ├── InstanceEventPublisher.java │ │ │ ├── InstanceEventStore.java │ │ │ └── OptimisticLockingException.java │ │ │ ├── notify │ │ │ ├── AbstractEventNotifier.java │ │ │ ├── AbstractStatusChangeNotifier.java │ │ │ ├── CompositeNotifier.java │ │ │ ├── HipchatNotifier.java │ │ │ ├── LetsChatNotifier.java │ │ │ ├── LoggingNotifier.java │ │ │ ├── MailNotifier.java │ │ │ ├── MicrosoftTeamsNotifier.java │ │ │ ├── NotificationTrigger.java │ │ │ ├── Notifier.java │ │ │ ├── OpsGenieNotifier.java │ │ │ ├── PagerdutyNotifier.java │ │ │ ├── RemindingNotifier.java │ │ │ ├── SlackNotifier.java │ │ │ ├── TelegramNotifier.java │ │ │ └── filter │ │ │ │ ├── AbstractNotificationFilter.java │ │ │ │ ├── ApplicationNameNotificationFilter.java │ │ │ │ ├── ExpiringNotificationFilter.java │ │ │ │ ├── FilteringNotifier.java │ │ │ │ ├── InstanceIdNotificationFilter.java │ │ │ │ ├── NotificationFilter.java │ │ │ │ └── web │ │ │ │ └── NotificationFilterController.java │ │ │ ├── services │ │ │ ├── CloudFoundryInstanceIdGenerator.java │ │ │ ├── EndpointDetectionTrigger.java │ │ │ ├── EndpointDetector.java │ │ │ ├── HashingInstanceUrlIdGenerator.java │ │ │ ├── InfoUpdateTrigger.java │ │ │ ├── InfoUpdater.java │ │ │ ├── InstanceIdGenerator.java │ │ │ ├── InstanceRegistry.java │ │ │ ├── ResubscribingEventHandler.java │ │ │ ├── StatusUpdateTrigger.java │ │ │ ├── StatusUpdater.java │ │ │ └── endpoints │ │ │ │ ├── ChainingStrategy.java │ │ │ │ ├── EndpointDetectionStrategy.java │ │ │ │ ├── ProbeEndpointsStrategy.java │ │ │ │ └── QueryIndexEndpointStrategy.java │ │ │ ├── utils │ │ │ ├── MediaType.java │ │ │ └── jackson │ │ │ │ ├── RegistrationBeanSerializerModifier.java │ │ │ │ ├── RegistrationDeserializer.java │ │ │ │ └── SanitizingMapSerializer.java │ │ │ └── web │ │ │ ├── AbstractInstancesProxyController.java │ │ │ ├── AdminController.java │ │ │ ├── ApplicationsController.java │ │ │ ├── InstancesController.java │ │ │ ├── PathUtils.java │ │ │ ├── client │ │ │ ├── BasicAuthHttpHeaderProvider.java │ │ │ ├── CloudFoundryHttpHeaderProvider.java │ │ │ ├── CompositeHttpHeadersProvider.java │ │ │ ├── HttpHeadersProvider.java │ │ │ ├── InstanceExchangeFilterFunction.java │ │ │ ├── InstanceExchangeFilterFunctions.java │ │ │ ├── InstanceWebClient.java │ │ │ ├── LegacyEndpointConverter.java │ │ │ ├── LegacyEndpointConverters.java │ │ │ └── exception │ │ │ │ ├── InstanceWebClientException.java │ │ │ │ ├── ResolveEndpointException.java │ │ │ │ └── ResolveInstanceException.java │ │ │ ├── reactive │ │ │ ├── AdminControllerHandlerMapping.java │ │ │ └── InstancesProxyController.java │ │ │ └── servlet │ │ │ ├── AdminControllerHandlerMapping.java │ │ │ └── InstancesProxyController.java │ └── resources │ │ └── META-INF │ │ ├── additional-spring-configuration-metadata.json │ │ ├── spring-boot-admin-server │ │ └── mail │ │ │ └── status-changed.html │ │ └── spring.factories │ └── test │ ├── java │ └── de │ │ └── codecentric │ │ └── boot │ │ └── admin │ │ └── server │ │ ├── AbstractAdminApplicationTest.java │ │ ├── AdminApplicationHazelcastTest.java │ │ ├── AdminReactiveApplicationTest.java │ │ ├── AdminServletApplicationTest.java │ │ ├── config │ │ ├── AdminServerAutoConfigurationTest.java │ │ ├── AdminServerCloudFoundryAutoConfigurationTest.java │ │ └── AdminServerNotifierAutoConfigurationTest.java │ │ ├── domain │ │ ├── entities │ │ │ ├── AbstractInstanceRepositoryTest.java │ │ │ ├── EventsourcingInstanceRepositoryTest.java │ │ │ ├── InstanceTest.java │ │ │ └── SnapshottingInstanceRepositoryTest.java │ │ └── values │ │ │ ├── BuildVersionTest.java │ │ │ ├── EndpointTest.java │ │ │ ├── EndpointsTest.java │ │ │ ├── InfoTest.java │ │ │ ├── InstanceIdTest.java │ │ │ ├── RegistrationTest.java │ │ │ ├── StatusInfoTest.java │ │ │ └── TagsTest.java │ │ ├── eventstore │ │ ├── AbstractEventStoreTest.java │ │ ├── HazelcastEventStoreTest.java │ │ └── InMemoryEventStoreTest.java │ │ ├── notify │ │ ├── CompositeNotifierTest.java │ │ ├── HipchatNotifierTest.java │ │ ├── LetsChatNotifierTest.java │ │ ├── MailNotifierTest.java │ │ ├── MicrosoftTeamsNotifierTest.java │ │ ├── NotificationTriggerTest.java │ │ ├── OpsGenieNotifierTest.java │ │ ├── PagerdutyNotifierTest.java │ │ ├── RemindingNotifierTest.java │ │ ├── SlackNotifierTest.java │ │ ├── TelegramNotifierTest.java │ │ ├── TestNotifier.java │ │ └── filter │ │ │ ├── FilteringNotifierTest.java │ │ │ ├── InstanceIdNotificationFilterTest.java │ │ │ ├── InstanceNameNotificationFilterTest.java │ │ │ └── web │ │ │ └── NotificationFilterControllerTest.java │ │ ├── services │ │ ├── CloudFoundryInstanceIdGeneratorTest.java │ │ ├── EndpointDetectionTriggerTest.java │ │ ├── EndpointDetectorTest.java │ │ ├── InfoUpdateTriggerTest.java │ │ ├── InfoUpdaterTest.java │ │ ├── InstanceRegistryTest.java │ │ ├── ResubscribingEventHandlerTest.java │ │ ├── StatusUpdateTriggerTest.java │ │ ├── StatusUpdaterTest.java │ │ └── endpoints │ │ │ ├── ChainingStrategyTest.java │ │ │ ├── ProbeEndpointsStrategyTest.java │ │ │ └── QueryIndexEndpointStrategyTest.java │ │ ├── utils │ │ └── jackson │ │ │ └── RegistrationDeserializerTest.java │ │ └── web │ │ ├── AbstractInstancesProxyControllerIntegrationTest.java │ │ ├── InstancesControllerIntegrationTest.java │ │ ├── PathUtilsTest.java │ │ ├── client │ │ ├── BasicAuthHttpHeaderProviderTest.java │ │ ├── CloudFoundryHttpHeaderProviderTest.java │ │ ├── CompositeHttpHeadersProviderTest.java │ │ ├── InstanceExchangeFilterFunctionsTest.java │ │ ├── InstanceWebClientTest.java │ │ └── LegacyEndpointConvertersTest.java │ │ ├── reactive │ │ └── InstancesProxyControllerIntegrationTest.java │ │ └── servlet │ │ └── InstancesProxyControllerIntegrationTest.java │ └── resources │ ├── application.yml │ └── de │ └── codecentric │ └── boot │ └── admin │ └── server │ ├── notify │ ├── custom-mail.html │ ├── expected-custom-mail │ └── expected-default-mail │ └── web │ └── client │ ├── env-expected.json │ ├── env-legacy.json │ ├── flyway-expected.json │ ├── flyway-legacy.json │ ├── health-expected.json │ ├── health-legacy.json │ ├── httptrace-expected.json │ ├── httptrace-legacy.json │ ├── liquibase-expected.json │ ├── liquibase-legacy.json │ ├── threaddump-expected.json │ └── threaddump-legacy.json ├── spring-boot-admin-starter-client └── pom.xml ├── spring-boot-admin-starter-server └── pom.xml └── src └── checkstyle ├── checkstyle-header.txt └── checkstyle.xml /.editorconfig: -------------------------------------------------------------------------------- 1 | root=true 2 | 3 | [*] 4 | insert_final_newline = true 5 | trim_trailing_whitespace= true 6 | 7 | [*.{java,xml}] 8 | indent_style = space 9 | indent_size = 4 10 | 11 | [*.{js,vue}] 12 | indent_style = space 13 | indent_size = 2 14 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # All text files should have the "lf" (Unix) line endings 2 | * text eol=lf 3 | # windows cmd shoud have the "crlf" (Win32) line endings 4 | *.cmd eol=crlf 5 | 6 | # Explicitly declare text files you want to always be normalized and converted 7 | # to native line endings on checkout. 8 | *.java text 9 | *.js text 10 | *.css text 11 | *.html text 12 | *.properties text 13 | *.xml text 14 | *.yml text 15 | 16 | # Denote all files that are truly binary and should not be modified. 17 | *.png binary 18 | *.jpg binary 19 | *.jar binary 20 | *.ttf binary 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/spring-boot-admin-bug.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug 3 | about: Spring Boot Admin issue template for reporting bugs 4 | 5 | --- 6 | 7 | 20 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/spring-boot-admin-enhancement.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Enhancement / Feature Request 3 | about: Spring Boot Admin issue template for proposing Enhancements or making feature requests 4 | --- 5 | 6 | 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Maven 2 | target/ 3 | 4 | # Eclipse 5 | .settings/ 6 | .classpath 7 | .project 8 | .factorypath 9 | .apt_generated/ 10 | 11 | # Intellij 12 | .idea/ 13 | *.iml 14 | *.iws 15 | 16 | #vscode 17 | .vscode/ 18 | 19 | # gnupg keyring 20 | /.gnupg 21 | 22 | #nodejs 23 | node_modules/ 24 | 25 | #flattened POMs 26 | .flattened-pom.xml 27 | -------------------------------------------------------------------------------- /.gnupg.tar.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anandvarkeyphilips/spring-boot-admin/29c37c4e284511725f0dc3f642f336664f29b9d3/.gnupg.tar.enc -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anandvarkeyphilips/spring-boot-admin/29c37c4e284511725f0dc3f642f336664f29b9d3/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | sudo: false 3 | 4 | env: 5 | - TRAVIS_NODE_VERSION="lts/*" 6 | 7 | cache: 8 | directories: 9 | - $HOME/.m2 10 | - $HOME/.npm 11 | 12 | before_install: 13 | - 'if [[ -n "$DECRYPT_KEYPHRASE" ]]; then openssl aes-256-cbc -d -pass "env:DECRYPT_KEYPHRASE" -in .gnupg.tar.enc | tar xv; fi' 14 | - 'nvm install ${TRAVIS_NODE_VERSION} && nvm use ${TRAVIS_NODE_VERSION}' 15 | 16 | install: ./mvnw install -DskipTests=true -Dmaven.javadoc.skip=true -DskipNpmBuild=true -B -V 17 | 18 | script: ./mvnw verify ${TRAVIS_TAG:+-Drevision=${TRAVIS_TAG} -DdisableSpringSnapshots=true} 19 | 20 | after_success: 21 | - ./mvnw jacoco:report coveralls:report 22 | - "[[ ${TRAVIS_PULL_REQUEST} == 'false' ]] && [[ ${TRAVIS_TAG} == '' ]] && ./mvnw deploy -DreposityId=sonatype-nexus-snapshots -DskipTests --settings deploy-settings.xml" 23 | - "[[ ${TRAVIS_PULL_REQUEST} == 'false' ]] && [[ ${TRAVIS_TAG} != '' ]] && ./mvnw deploy -DreposityId=sonatype-nexus-staging -DskipTests -Drevision=${TRAVIS_TAG} -DdisableSpringSnapshots=true --settings deploy-settings.xml" 24 | -------------------------------------------------------------------------------- /deploy-settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | sonatype-nexus-snapshots 5 | ${env.OSSRH_USER} 6 | ${env.OSSRH_PASS} 7 | 8 | 9 | sonatype-nexus-staging 10 | ${env.OSSRH_USER} 11 | ${env.OSSRH_PASS} 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /images/logo-spring-boot-admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anandvarkeyphilips/spring-boot-admin/29c37c4e284511725f0dc3f642f336664f29b9d3/images/logo-spring-boot-admin.png -------------------------------------------------------------------------------- /images/screenshot-details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anandvarkeyphilips/spring-boot-admin/29c37c4e284511725f0dc3f642f336664f29b9d3/images/screenshot-details.png -------------------------------------------------------------------------------- /images/screenshot-environment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anandvarkeyphilips/spring-boot-admin/29c37c4e284511725f0dc3f642f336664f29b9d3/images/screenshot-environment.png -------------------------------------------------------------------------------- /images/screenshot-jmx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anandvarkeyphilips/spring-boot-admin/29c37c4e284511725f0dc3f642f336664f29b9d3/images/screenshot-jmx.png -------------------------------------------------------------------------------- /images/screenshot-journal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anandvarkeyphilips/spring-boot-admin/29c37c4e284511725f0dc3f642f336664f29b9d3/images/screenshot-journal.png -------------------------------------------------------------------------------- /images/screenshot-logfile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anandvarkeyphilips/spring-boot-admin/29c37c4e284511725f0dc3f642f336664f29b9d3/images/screenshot-logfile.png -------------------------------------------------------------------------------- /images/screenshot-logging.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anandvarkeyphilips/spring-boot-admin/29c37c4e284511725f0dc3f642f336664f29b9d3/images/screenshot-logging.png -------------------------------------------------------------------------------- /images/screenshot-metrics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anandvarkeyphilips/spring-boot-admin/29c37c4e284511725f0dc3f642f336664f29b9d3/images/screenshot-metrics.png -------------------------------------------------------------------------------- /images/screenshot-threads.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anandvarkeyphilips/spring-boot-admin/29c37c4e284511725f0dc3f642f336664f29b9d3/images/screenshot-threads.png -------------------------------------------------------------------------------- /images/screenshot-trace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anandvarkeyphilips/spring-boot-admin/29c37c4e284511725f0dc3f642f336664f29b9d3/images/screenshot-trace.png -------------------------------------------------------------------------------- /images/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anandvarkeyphilips/spring-boot-admin/29c37c4e284511725f0dc3f642f336664f29b9d3/images/screenshot.png -------------------------------------------------------------------------------- /lombok.config: -------------------------------------------------------------------------------- 1 | lombok.noArgsConstructor.extraPrivate = false 2 | -------------------------------------------------------------------------------- /spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/config/CloudFoundryApplicationProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.client.config; 18 | 19 | import java.util.ArrayList; 20 | import java.util.List; 21 | import org.springframework.boot.context.properties.ConfigurationProperties; 22 | 23 | @lombok.Data 24 | @ConfigurationProperties("vcap.application") 25 | public class CloudFoundryApplicationProperties { 26 | private String applicationId; 27 | private String instanceIndex; 28 | private List uris = new ArrayList<>(); 29 | } 30 | -------------------------------------------------------------------------------- /spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/registration/ApplicationFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.client.registration; 18 | 19 | /** 20 | * Classes implementing this interface are responsible for creating an {@link Application} class 21 | * which is used to register at the admin server. 22 | * 23 | * @author Johannes Edmeier 24 | */ 25 | public interface ApplicationFactory { 26 | /** 27 | * @return {@link Application} instance; 28 | */ 29 | Application createApplication(); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/registration/metadata/CloudFoundryMetadataContributor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.client.registration.metadata; 18 | 19 | import de.codecentric.boot.admin.client.config.CloudFoundryApplicationProperties; 20 | 21 | import java.util.Collections; 22 | import java.util.HashMap; 23 | import java.util.Map; 24 | import org.springframework.util.StringUtils; 25 | 26 | public class CloudFoundryMetadataContributor implements MetadataContributor { 27 | private final CloudFoundryApplicationProperties cfApplicationProperties; 28 | 29 | public CloudFoundryMetadataContributor(CloudFoundryApplicationProperties cfApplicationProperties) { 30 | this.cfApplicationProperties = cfApplicationProperties; 31 | } 32 | 33 | @Override 34 | public Map getMetadata() { 35 | if (StringUtils.hasText(this.cfApplicationProperties.getApplicationId()) && 36 | StringUtils.hasText(this.cfApplicationProperties.getInstanceIndex())) { 37 | Map map = new HashMap<>(); 38 | map.put("applicationId", this.cfApplicationProperties.getApplicationId()); 39 | map.put("instanceId", this.cfApplicationProperties.getInstanceIndex()); 40 | return map; 41 | } 42 | return Collections.emptyMap(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/registration/metadata/CompositeMetadataContributor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.client.registration.metadata; 18 | 19 | import java.util.LinkedHashMap; 20 | import java.util.List; 21 | import java.util.Map; 22 | 23 | public class CompositeMetadataContributor implements MetadataContributor { 24 | private final List delegates; 25 | 26 | public CompositeMetadataContributor(List delegates) { 27 | this.delegates = delegates; 28 | } 29 | 30 | @Override 31 | public Map getMetadata() { 32 | Map metadata = new LinkedHashMap<>(); 33 | delegates.forEach(delegate -> metadata.putAll(delegate.getMetadata())); 34 | return metadata; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/registration/metadata/MetadataContributor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.client.registration.metadata; 18 | 19 | import java.util.Map; 20 | 21 | @FunctionalInterface 22 | public interface MetadataContributor { 23 | 24 | Map getMetadata(); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/registration/metadata/StartupDateMetadataContributor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.client.registration.metadata; 18 | 19 | import java.time.OffsetDateTime; 20 | import java.time.format.DateTimeFormatter; 21 | import java.util.Map; 22 | 23 | import static java.util.Collections.singletonMap; 24 | 25 | public class StartupDateMetadataContributor implements MetadataContributor { 26 | private final OffsetDateTime timestamp = OffsetDateTime.now(); 27 | 28 | @Override 29 | public Map getMetadata() { 30 | return singletonMap("startup", this.timestamp.format(DateTimeFormatter.ISO_DATE_TIME)); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /spring-boot-admin-client/src/main/resources/META-INF/additional-spring-configuration-metadata.json: -------------------------------------------------------------------------------- 1 | {"groups": [ 2 | 3 | ],"properties": [ 4 | { 5 | "name": "spring.boot.admin.client.enabled", 6 | "type": "java.lang.Boolean", 7 | "description": "Enable Spring Admin Client.", 8 | "defaultValue": "true" 9 | } 10 | ]} 11 | -------------------------------------------------------------------------------- /spring-boot-admin-client/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ 2 | de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration,\ 3 | de.codecentric.boot.admin.client.config.SpringBootAdminClientCloudFoundryAutoConfiguration 4 | -------------------------------------------------------------------------------- /spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/metadata/CloudFoundryMetadataContributorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.client.registration.metadata; 18 | 19 | import de.codecentric.boot.admin.client.config.CloudFoundryApplicationProperties; 20 | 21 | import org.junit.Test; 22 | 23 | import static org.assertj.core.api.Assertions.assertThat; 24 | 25 | public class CloudFoundryMetadataContributorTest { 26 | 27 | @Test 28 | public void should_return_empty_metadata() { 29 | CloudFoundryMetadataContributor contributor = new CloudFoundryMetadataContributor( 30 | new CloudFoundryApplicationProperties()); 31 | assertThat(contributor.getMetadata()).isEmpty(); 32 | } 33 | 34 | @Test 35 | public void should_return_metadata() { 36 | CloudFoundryApplicationProperties cfApplicationProperties = new CloudFoundryApplicationProperties(); 37 | cfApplicationProperties.setApplicationId("appId"); 38 | cfApplicationProperties.setInstanceIndex("1"); 39 | CloudFoundryMetadataContributor contributor = new CloudFoundryMetadataContributor(cfApplicationProperties); 40 | assertThat(contributor.getMetadata()).containsEntry("applicationId", "appId").containsEntry("instanceId", "1"); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/metadata/CompositeMetadataContributorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.client.registration.metadata; 18 | 19 | import java.util.Map; 20 | import org.junit.Test; 21 | 22 | import static java.util.Arrays.asList; 23 | import static java.util.Collections.emptyList; 24 | import static java.util.Collections.singletonMap; 25 | import static org.assertj.core.api.Assertions.assertThat; 26 | import static org.assertj.core.api.Assertions.entry; 27 | 28 | public class CompositeMetadataContributorTest { 29 | 30 | @Test 31 | public void should_merge_metadata() { 32 | CompositeMetadataContributor contributor = new CompositeMetadataContributor( 33 | asList(() -> singletonMap("a", "first"), () -> singletonMap("b", "second"), 34 | () -> singletonMap("b", "second-new"))); 35 | 36 | Map metadata = contributor.getMetadata(); 37 | 38 | assertThat(metadata).containsExactly(entry("a", "first"), entry("b", "second-new")); 39 | } 40 | 41 | @Test 42 | public void should_return_empty_metadata() { 43 | CompositeMetadataContributor contributor = new CompositeMetadataContributor(emptyList()); 44 | 45 | Map metadata = contributor.getMetadata(); 46 | 47 | assertThat(metadata).isEmpty(); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/metadata/StartupDateMetadataContributorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.client.registration.metadata; 18 | 19 | import java.util.Map; 20 | import org.junit.Test; 21 | 22 | import static org.assertj.core.api.Assertions.assertThat; 23 | 24 | public class StartupDateMetadataContributorTest { 25 | 26 | @Test 27 | public void should_return_startupdate() { 28 | StartupDateMetadataContributor contributor = new StartupDateMetadataContributor(); 29 | 30 | Map metadata = contributor.getMetadata(); 31 | 32 | assertThat(metadata).hasSize(1).hasEntrySatisfying("startup", (value) -> assertThat(value).isNotEmpty()); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /spring-boot-admin-docs/deploy-gh-pages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ## 3 | # Makes a shallow clone for gh-pages branch, copies the new docs, adds, commits and pushes 'em. 4 | # 5 | # Requires the environment variable GH_TOKEN to be set to a valid GitHub-api-token. 6 | # 7 | # Usage: 8 | # ./deploy-gh-pages.sh 9 | # 10 | # project-version The version folder to use in gh-pages 11 | ## 12 | set -o errexit -o nounset 13 | 14 | GH_URL="https://${GH_TOKEN}@github.com/codecentric/spring-boot-admin.git" 15 | TEMPDIR="$(mktemp -d /tmp/gh-pages.XXX)" 16 | TARGET_DIR="${TRAVIS_BRANCH/master/current}" 17 | 18 | echo "Cloning gh-pages branch..." 19 | git clone --branch gh-pages --single-branch --depth 1 --config user.name="Johannes Edmeier" --config user.email="johannes.edmeier@codecentric.de" "$GH_URL" "$TEMPDIR" 20 | 21 | if [[ -d "$TEMPDIR"/"${TARGET_DIR}" ]]; then 22 | echo "Cleaning ${TARGET_DIR}..." 23 | rm -rf "$TEMPDIR"/"${TARGET_DIR}" 24 | fi 25 | 26 | echo "Copying new docs..." 27 | mkdir -p "$TEMPDIR"/"${TARGET_DIR}" 28 | cp -r target/generated-docs/* "$TEMPDIR"/"${TARGET_DIR}"/ 29 | 30 | pushd "$TEMPDIR" >/dev/null 31 | git add --all . 32 | 33 | if git diff-index --quiet HEAD; then 34 | echo "No changes detected." 35 | else 36 | echo "Commit changes..." 37 | git commit --message "Docs for ${TARGET_DIR}" 38 | echo "Pushing gh-pages..." 39 | git push origin gh-pages 40 | fi 41 | 42 | popd >/dev/null 43 | 44 | rm -rf "$TEMPDIR" 45 | exit 0 46 | -------------------------------------------------------------------------------- /spring-boot-admin-docs/src/main/asciidoc/faqs.adoc: -------------------------------------------------------------------------------- 1 | [[faqs]] 2 | == FAQs == 3 | [q-and-a] 4 | Can I include spring-boot-admin into my business application?:: 5 | *tl;dr* You can, but you shouldn't. + 6 | You can set `spring.boot.admin.context-path` to alter the path where the UI and REST-API is served, but depending on the complexity of your application you might get in trouble. On the other hand in my opinion it makes no sense for an application to monitor itself. In case your application goes down your monitoring tool also does. 7 | -------------------------------------------------------------------------------- /spring-boot-admin-docs/src/main/asciidoc/images/mail-notification-sample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anandvarkeyphilips/spring-boot-admin/29c37c4e284511725f0dc3f642f336664f29b9d3/spring-boot-admin-docs/src/main/asciidoc/images/mail-notification-sample.png -------------------------------------------------------------------------------- /spring-boot-admin-docs/src/main/asciidoc/index.adoc: -------------------------------------------------------------------------------- 1 | = Spring Boot Admin Reference Guide = 2 | Johannes Edmeier 3 | :revnumber: {project-version} 4 | :revdate: {commit-time} 5 | :toc: left 6 | :toclevels: 3 7 | :doctype: book 8 | :sectanchors: 9 | :sectlinks: 10 | :sectnums: 11 | :icons: font 12 | :hide-uri-scheme: 13 | :last-update-label!: 14 | :tabsize: 2 15 | 16 | == What is Spring Boot Admin? == 17 | 18 | codecentric's Spring Boot Admin is a community project to manage and monitor your http://projects.spring.io/spring-boot/[Spring Boot] ^(R)^ applications. 19 | The applications register with our Spring Boot Admin Client (via HTTP) or are discovered using Spring Cloud ^(R)^ (e.g. Eureka, Consul). 20 | The UI is just an AngularJs application on top of the Spring Boot Actuator endpoints. 21 | 22 | include::getting-started.adoc[] 23 | 24 | include::client.adoc[] 25 | 26 | include::server.adoc[] 27 | 28 | include::security.adoc[] 29 | 30 | include::customizing.adoc[] 31 | 32 | include::changes-2.x.adoc[] 33 | 34 | include::faqs.adoc[] 35 | -------------------------------------------------------------------------------- /spring-boot-admin-docs/src/main/asciidoc/server-clustering.adoc: -------------------------------------------------------------------------------- 1 | 2 | [[clustering-support]] 3 | === Clustering === 4 | Spring Boot Admin Server supports cluster replication via Hazelcast. It is automatically enabled when a `HazelcastConfig`- or `HazelcastInstance`-Bean is present. You can also configure the Hazelcast instance to be persistent, to keep the status over restarts. 5 | Also have a look at the http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#boot-features-hazelcast/[Spring Boot support for Hazelcast]. 6 | 7 | . Add Hazelcast to your dependencies: 8 | + 9 | [source,xml] 10 | .pom.xml 11 | ---- 12 | include::{samples-dir}/spring-boot-admin-sample-hazelcast/pom.xml[tags=dependency-hazelcast,indent=0] 13 | ---- 14 | 15 | . Instantiate a HazelcastConfig: 16 | + 17 | [source,java,indent=0] 18 | ---- 19 | include::{samples-dir}/spring-boot-admin-sample-hazelcast/src/main/java/de/codecentric/boot/admin/SpringBootAdminApplication.java[tags=application-hazelcast] 20 | ---- 21 | 22 | .Hazelcast configuration options 23 | |=== 24 | | Property name |Description |Default value 25 | 26 | | spring.boot.admin.hazelcast.enabled 27 | | Enables the Hazelcast support 28 | | `true` 29 | 30 | | spring.boot.admin.hazelcast.event-store 31 | | Name of the Hazelcast-map to store the events 32 | | `"spring-boot-admin-event-store"` 33 | |=== 34 | -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-client-with-security/.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-client-with-security/.gitignore: -------------------------------------------------------------------------------- 1 | # Eclipse 2 | .classpath 3 | .project 4 | .settings/ 5 | 6 | # Intellij 7 | .idea/ 8 | *.iml 9 | *.iws 10 | 11 | # Mac 12 | .DS_Store 13 | 14 | # Maven 15 | log/ 16 | target/ -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-client-with-security/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | de.codecentric 8 | spring-boot-admin-client-without-security 9 | 1.0-SNAPSHOT 10 | 11 | 12 | org.springframework.boot 13 | spring-boot-starter-parent 14 | 2.0.3.RELEASE 15 | 16 | 17 | 18 | de.codecentric 19 | spring-boot-admin-starter-client 20 | 2.0.2 21 | 22 | 23 | org.springframework.boot 24 | spring-boot-starter-web 25 | 26 | 27 | -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-client-with-security/src/main/java/de/codecentric/boot/admin/client/SpringBootAdminClientApplication.java: -------------------------------------------------------------------------------- 1 | package de.codecentric.boot.admin.client; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | /** 8 | * This is the entry point for spring boot admin client application. 9 | * There are lots of customizations available. 10 | * 11 | * @author Anand Varkey Philips 12 | * @version 2.0.2.RELEASE 13 | */ 14 | @Configuration 15 | @EnableAutoConfiguration 16 | public class SpringBootAdminClientApplication { 17 | 18 | public static void main(String[] args) { 19 | SpringApplication.run(SpringBootAdminClientApplication.class, args); 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-client-without-security/.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-client-without-security/.gitignore: -------------------------------------------------------------------------------- 1 | # Eclipse 2 | .classpath 3 | .project 4 | .settings/ 5 | 6 | # Intellij 7 | .idea/ 8 | *.iml 9 | *.iws 10 | 11 | # Mac 12 | .DS_Store 13 | 14 | # Maven 15 | log/ 16 | target/ -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-client-without-security/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | de.codecentric 8 | spring-boot-admin-client-without-security 9 | 1.0-SNAPSHOT 10 | 11 | 12 | org.springframework.boot 13 | spring-boot-starter-parent 14 | 2.0.3.RELEASE 15 | 16 | 17 | 18 | de.codecentric 19 | spring-boot-admin-starter-client 20 | 2.0.2 21 | 22 | 23 | org.springframework.boot 24 | spring-boot-starter-web 25 | 26 | 27 | -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-client-without-security/src/main/java/de/codecentric/boot/admin/client/SpringBootAdminClientApplication.java: -------------------------------------------------------------------------------- 1 | package de.codecentric.boot.admin.client; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | /** 8 | * This is the entry point for spring boot admin client application. 9 | * There are lots of customizations available. 10 | * 11 | * @author Anand Varkey Philips 12 | * @version 2.0.2.RELEASE 13 | */ 14 | @Configuration 15 | @EnableAutoConfiguration 16 | public class SpringBootAdminClientApplication { 17 | public static void main(String[] args) { 18 | SpringApplication.run(SpringBootAdminClientApplication.class, args); 19 | } 20 | } -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-sample-consul/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: consul-example 4 | cloud: 5 | config: 6 | enabled: false 7 | consul: 8 | host: localhost 9 | port: 8500 10 | discovery: 11 | tags: management.context-path=/foo, health.path=/ping, user.name=user, user.password=password 12 | profiles: 13 | active: 14 | - secure 15 | boot: 16 | admin: 17 | discovery: 18 | ignored-services: consul 19 | 20 | 21 | management: 22 | server: 23 | servlet: 24 | context-path: /foo 25 | endpoints: 26 | web: 27 | exposure: 28 | include: "*" 29 | path-mapping: 30 | health: /ping 31 | endpoint: 32 | health: 33 | show-details: ALWAYS 34 | 35 | --- 36 | spring: 37 | profiles: insecure 38 | 39 | --- 40 | spring: 41 | profiles: secure 42 | security: 43 | user: 44 | name: "user" 45 | password: "password" 46 | 47 | -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-sample-consul/src/test/java/de/codecentric/boot/admin/SpringBootAdminApplicationTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin; 18 | 19 | import org.junit.Test; 20 | import org.junit.runner.RunWith; 21 | import org.springframework.boot.test.context.SpringBootTest; 22 | import org.springframework.test.context.junit4.SpringRunner; 23 | 24 | @RunWith(SpringRunner.class) 25 | @SpringBootTest(classes = {SpringBootAdminApplication.class}, properties = {"spring.cloud.consul.enabled=false"}) 26 | public class SpringBootAdminApplicationTest { 27 | @Test 28 | public void contextLoads() { 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-sample-custom-ui/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw* 22 | -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-sample-custom-ui/README.md: -------------------------------------------------------------------------------- 1 | spring-boot-admin-sample-custom-ui 2 | ================================ 3 | 4 | ### Building this module 5 | The jar **can be build with Maven** with the maven-exec-plugin. To do this node.js and npm must be installed on your machine and be on your `$PATH`. 6 | If you don't want to use the maven exec run the following commands: 7 | 8 | ### Running Spring Boot Admin Server for development 9 | To develop the ui on an running server the best to do is 10 | 11 | 1. Running the ui build in watch mode so the resources get updated: 12 | ```shell 13 | npm run watch 14 | ``` 15 | 2. Run a Spring Boot Admin Server instances with the template-location and resource-location pointing to the build output and disable caching: 16 | ``` 17 | spring.boot.admin.ui.cache.no-cache: true 18 | spring.boot.admin.ui.extension-resource-locations: file:@project.basedir@/../spring-boot-admin-sample-custom-ui/target/dist/ 19 | spring.boot.admin.ui.cache-templates: false 20 | ``` 21 | Or just start the [spring-boot-admin-sample-servlet](../spring-boot-admin-sample-servlet) project using the `dev` profile. 22 | 23 | ### Build 24 | ```shell 25 | npm install 26 | npm run build 27 | ``` 28 | 29 | Repeated build with watching the files: 30 | ```shell 31 | npm run watch 32 | ``` 33 | -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-sample-custom-ui/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/app' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-sample-custom-ui/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "spring-boot-admin-sample-custom-ui", 3 | "private": true, 4 | "scripts": { 5 | "build": "vue-cli-service build", 6 | "watch": "vue-cli-service build --watch", 7 | "lint": "vue-cli-service lint" 8 | }, 9 | "peerDependencies": { 10 | "vue": "^2.5.16" 11 | }, 12 | "dependencies": {}, 13 | "devDependencies": { 14 | "@vue/cli-plugin-babel": "^3.0.1", 15 | "@vue/cli-plugin-eslint": "^3.0.1", 16 | "@vue/cli-service": "^3.0.1", 17 | "@vue/eslint-config-standard": "^3.0.1", 18 | "vue-template-compiler": "^2.5.17" 19 | }, 20 | "eslintConfig": { 21 | "root": true, 22 | "env": { 23 | "node": true 24 | }, 25 | "extends": [ 26 | "eslint:recommended", 27 | "plugin:vue/strongly-recommended" 28 | ], 29 | "rules": {}, 30 | "parserOptions": { 31 | "parser": "babel-eslint" 32 | } 33 | }, 34 | "postcss": { 35 | "plugins": { 36 | "autoprefixer": {} 37 | } 38 | }, 39 | "browserslist": [ 40 | "> 1%", 41 | "last 2 versions", 42 | "not ie <= 8" 43 | ] 44 | } 45 | -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-sample-custom-ui/src/custom-endpoint.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 23 | 24 | 41 | 42 | 48 | -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-sample-custom-ui/src/custom.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 20 | 21 | 34 | -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-sample-custom-ui/src/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /* global SBA */ 18 | import custom from './custom'; 19 | import customEndpoint from './custom-endpoint'; 20 | 21 | // tag::customization-ui-toplevel[] 22 | SBA.use({ 23 | install({viewRegistry}) { 24 | viewRegistry.addView({ 25 | name: 'custom', //<1> 26 | path: '/custom', //<2> 27 | component: custom, //<3> 28 | label: 'Custom', //<4> 29 | order: 1000, //<5> 30 | }); 31 | } 32 | }); 33 | // end::customization-ui-toplevel[] 34 | 35 | // tag::customization-ui-endpoint[] 36 | SBA.use({ 37 | install({viewRegistry}) { 38 | viewRegistry.addView({ 39 | name: 'instances/custom', 40 | parent: 'instances', // <1> 41 | path: 'custom', 42 | component: customEndpoint, 43 | label: 'Custom', 44 | order: 1000, 45 | isEnabled: ({instance}) => instance.hasEndpoint('custom') // <2> 46 | }); 47 | } 48 | }); 49 | // end::customization-ui-endpoint[] 50 | -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-sample-custom-ui/vue.config.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | module.exports = { 18 | outputDir: 'target/dist', 19 | chainWebpack: config => { 20 | config.entryPoints.delete('app'); 21 | config.entry('custom').add('./src/index.js'); 22 | config.externals({ 23 | vue: { 24 | commonjs: 'vue', 25 | commonjs2: 'vue', 26 | root: 'Vue' 27 | } 28 | }); 29 | config.output.libraryTarget('var'); 30 | config.optimization.splitChunks(false); 31 | config.module 32 | .rule('vue') 33 | .use('vue-loader') 34 | .loader('vue-loader') 35 | .tap(options => ({ 36 | ...options, 37 | hotReload: false 38 | })); 39 | config.plugins.delete('html'); 40 | config.plugins.delete('preload'); 41 | config.plugins.delete('prefetch'); 42 | } 43 | }; 44 | -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-sample-eureka/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:7 2 | VOLUME /tmp 3 | ADD target/spring-boot-admin-sample-eureka.jar /app.jar 4 | RUN bash -c 'touch /app.jar' 5 | EXPOSE 8080 6 | ENTRYPOINT ["java","-jar","/app.jar"] 7 | -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-sample-eureka/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: spring-boot-admin-sample-eureka 4 | profiles: 5 | active: 6 | - secure 7 | 8 | 9 | # tag::configuration-eureka[] 10 | eureka: #<1> 11 | instance: 12 | leaseRenewalIntervalInSeconds: 10 13 | health-check-url-path: /actuator/health 14 | client: 15 | registryFetchIntervalSeconds: 5 16 | serviceUrl: 17 | defaultZone: ${EUREKA_SERVICE_URL:http://localhost:8761}/eureka/ 18 | 19 | management: 20 | endpoints: 21 | web: 22 | exposure: 23 | include: "*" #<2> 24 | endpoint: 25 | health: 26 | show-details: ALWAYS 27 | # end::configuration-eureka[] 28 | 29 | --- 30 | spring: 31 | profiles: insecure 32 | 33 | --- 34 | spring: 35 | profiles: secure 36 | security: 37 | user: 38 | name: "user" 39 | password: "password" 40 | eureka: 41 | instance: 42 | metadata-map: 43 | user.name: "user" #These two are needed so that the server 44 | user.password: "password" #can access the protected client endpoints 45 | -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-sample-eureka/src/test/java/de/codecentric/boot/admin/SpringBootAdminApplicationTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin; 18 | 19 | import org.junit.Test; 20 | import org.junit.runner.RunWith; 21 | import org.springframework.boot.test.context.SpringBootTest; 22 | import org.springframework.test.context.junit4.SpringRunner; 23 | 24 | @RunWith(SpringRunner.class) 25 | @SpringBootTest(classes = {SpringBootAdminApplication.class}) 26 | public class SpringBootAdminApplicationTest { 27 | @Test 28 | public void contextLoads() { 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-sample-hazelcast/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | --- 2 | logging: 3 | file: "target/boot-admin-sample-hazelcast.log" 4 | 5 | management: 6 | endpoints: 7 | web: 8 | exposure: 9 | include: "*" 10 | endpoint: 11 | health: 12 | show-details: ALWAYS 13 | 14 | spring: 15 | application: 16 | name: spring-boot-admin-sample-hazelcast 17 | boot: 18 | admin: 19 | client: 20 | url: http://localhost:8080 21 | profiles: 22 | active: 23 | - secure 24 | 25 | --- 26 | spring: 27 | profiles: insecure 28 | 29 | --- 30 | spring: 31 | profiles: secure 32 | security: 33 | user: 34 | name: "user" 35 | password: "password" 36 | boot: 37 | admin: 38 | client: 39 | username: "user" #These two are needed so that the client 40 | password: "password" #can register at the protected server api 41 | instance: 42 | metadata: 43 | user.name: "user" #These two are needed so that the server 44 | user.password: "password" #can access the protected client endpoints 45 | 46 | 47 | -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-sample-hazelcast/src/test/java/de/codecentric/boot/admin/SpringBootAdminApplicationTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin; 18 | 19 | import org.junit.Test; 20 | import org.junit.runner.RunWith; 21 | import org.springframework.boot.test.context.SpringBootTest; 22 | import org.springframework.test.context.junit4.SpringRunner; 23 | 24 | @RunWith(SpringRunner.class) 25 | @SpringBootTest(classes = {SpringBootAdminApplication.class}) 26 | public class SpringBootAdminApplicationTest { 27 | @Test 28 | public void contextLoads() { 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-sample-reactive/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | --- 2 | info: 3 | scm-url: "@scm.url@" 4 | build-url: "https://travis-ci.org/codecentric/spring-boot-admin" 5 | 6 | logging: 7 | file: "target/boot-admin-sample-reactive.log" 8 | 9 | management: 10 | endpoints: 11 | web: 12 | exposure: 13 | include: "*" 14 | endpoint: 15 | health: 16 | show-details: ALWAYS 17 | 18 | spring: 19 | application: 20 | name: spring-boot-admin-sample-reactive 21 | boot: 22 | admin: 23 | client: 24 | url: http://localhost:8080 25 | profiles: 26 | active: 27 | - insecure 28 | 29 | --- 30 | spring: 31 | profiles: dev 32 | boot: 33 | admin: 34 | ui: 35 | cache: 36 | no-cache: true 37 | template-location: file://@project.basedir@/../../spring-boot-admin-server-ui/target/dist/ 38 | resource-locations: file://@project.basedir@/../../spring-boot-admin-server-ui/target/dist/ 39 | cache-templates: false 40 | 41 | --- 42 | spring: 43 | profiles: insecure 44 | 45 | --- 46 | spring: 47 | profiles: secure 48 | security: 49 | user: 50 | name: "user" 51 | password: "password" 52 | boot: 53 | admin: 54 | client: 55 | username: "user" #These two are needed so that the client 56 | password: "password" #can register at the protected server api 57 | instance: 58 | metadata: 59 | user.name: "user" #These two are needed so that the server 60 | user.password: "password" #can access the protected client endpoints 61 | 62 | 63 | -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-sample-reactive/src/test/java/de/codecentric/boot/admin/SpringBootAdminApplicationTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin; 18 | 19 | import org.junit.Test; 20 | import org.junit.runner.RunWith; 21 | import org.springframework.boot.test.context.SpringBootTest; 22 | import org.springframework.test.context.junit4.SpringRunner; 23 | 24 | @RunWith(SpringRunner.class) 25 | @SpringBootTest(classes = {SpringBootAdminApplication.class}) 26 | public class SpringBootAdminApplicationTest { 27 | @Test 28 | public void contextLoads() { 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-sample-servlet/src/main/java/de/codecentric/boot/admin/CustomEndpoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin; 18 | 19 | import org.springframework.boot.actuate.endpoint.annotation.Endpoint; 20 | import org.springframework.boot.actuate.endpoint.annotation.ReadOperation; 21 | 22 | @Endpoint(id = "custom") 23 | public class CustomEndpoint { 24 | 25 | @ReadOperation 26 | public String invoke() { 27 | return "Hello World!"; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-sample-servlet/src/test/java/de/codecentric/boot/admin/SpringBootAdminApplicationTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin; 18 | 19 | import org.junit.Test; 20 | import org.junit.runner.RunWith; 21 | import org.springframework.boot.test.context.SpringBootTest; 22 | import org.springframework.test.context.junit4.SpringRunner; 23 | 24 | @RunWith(SpringRunner.class) 25 | @SpringBootTest(classes = {SpringBootAdminApplication.class}) 26 | public class SpringBootAdminApplicationTest { 27 | @Test 28 | public void contextLoads() { 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-sample-war/.gitignore: -------------------------------------------------------------------------------- 1 | /.springBeans 2 | -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-sample-war/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: spring-boot-admin-sample-war 4 | boot: 5 | admin: 6 | client: 7 | url: http://localhost:8080 8 | instance: 9 | service-base-url: http://localhost:8080 10 | profiles: 11 | active: 12 | - secure 13 | 14 | management: 15 | endpoints: 16 | web: 17 | exposure: 18 | include: "*" 19 | endpoint: 20 | health: 21 | show-details: ALWAYS 22 | 23 | --- 24 | spring: 25 | profiles: insecure 26 | 27 | --- 28 | spring: 29 | profiles: secure 30 | security: 31 | user: 32 | name: "user" 33 | password: "password" 34 | boot: 35 | admin: 36 | client: 37 | username: "user" #These two are needed so that the client 38 | password: "password" #can register at the protected server api 39 | instance: 40 | metadata: 41 | user.name: "user" #These two are needed so that the server 42 | user.password: "password" #can access the protected client endpoints 43 | 44 | 45 | -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-sample-zookeeper/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: zookeeper-example 4 | cloud: 5 | config: 6 | enabled: false 7 | zookeeper: 8 | connect-string: localhost:2181 9 | discovery: 10 | metadata: 11 | management.context-path: /foo 12 | health.path: /ping 13 | user.name: user 14 | user.password: password 15 | profiles: 16 | active: 17 | - secure 18 | 19 | management: 20 | server: 21 | servlet: 22 | context-path: /foo 23 | endpoints: 24 | web: 25 | exposure: 26 | include: "*" 27 | path-mapping: 28 | health: /ping 29 | endpoint: 30 | health: 31 | show-details: ALWAYS 32 | 33 | --- 34 | spring: 35 | profiles: insecure 36 | 37 | --- 38 | spring: 39 | profiles: secure 40 | security: 41 | user: 42 | name: "user" 43 | password: "password" 44 | 45 | -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-sample-zookeeper/src/test/java/de/codecentric/boot/admin/SpringBootAdminApplicationTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin; 18 | 19 | import org.junit.Test; 20 | import org.junit.runner.RunWith; 21 | import org.springframework.boot.test.context.SpringBootTest; 22 | import org.springframework.test.context.junit4.SpringRunner; 23 | 24 | @RunWith(SpringRunner.class) 25 | @SpringBootTest(classes = {SpringBootAdminApplication.class}, properties = {"spring.cloud.zookeeper.enabled=false"}) 26 | public class SpringBootAdminApplicationTest { 27 | @Test 28 | public void contextLoads() { 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-server-with-security/.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-server-with-security/.gitignore: -------------------------------------------------------------------------------- 1 | # Eclipse 2 | .classpath 3 | .project 4 | .settings/ 5 | 6 | # Intellij 7 | .idea/ 8 | *.iml 9 | *.iws 10 | 11 | # Mac 12 | .DS_Store 13 | 14 | # Maven 15 | log/ 16 | target/ -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-server-with-security/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | de.codecentric 8 | spring-boot-admin-server-without-security 9 | 1.0-SNAPSHOT 10 | 11 | 12 | org.springframework.boot 13 | spring-boot-starter-parent 14 | 2.0.3.RELEASE 15 | 16 | 17 | 18 | de.codecentric 19 | spring-boot-admin-starter-server 20 | 2.0.2 21 | 22 | 23 | org.springframework.boot 24 | spring-boot-starter-web 25 | 26 | 27 | org.springframework.boot 28 | spring-boot-starter-security 29 | 30 | 31 | -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-server-with-security/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anandvarkeyphilips/spring-boot-admin/29c37c4e284511725f0dc3f642f336664f29b9d3/spring-boot-admin-samples/spring-boot-admin-server-with-security/src/main/resources/application.properties -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-server-without-security/.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-server-without-security/.gitignore: -------------------------------------------------------------------------------- 1 | # Eclipse 2 | .classpath 3 | .project 4 | .settings/ 5 | 6 | # Intellij 7 | .idea/ 8 | *.iml 9 | *.iws 10 | 11 | # Mac 12 | .DS_Store 13 | 14 | # Maven 15 | log/ 16 | target/ -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-server-without-security/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | de.codecentric 8 | spring-boot-admin-server-without-security 9 | 1.0-SNAPSHOT 10 | 11 | 12 | org.springframework.boot 13 | spring-boot-starter-parent 14 | 2.0.3.RELEASE 15 | 16 | 17 | 18 | de.codecentric 19 | spring-boot-admin-starter-server 20 | 2.0.2 21 | 22 | 23 | org.springframework.boot 24 | spring-boot-starter-web 25 | 26 | 27 | -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-server-without-security/src/main/java/de/codecentric/boot/admin/server/SpringBootAdminServerApplication.java: -------------------------------------------------------------------------------- 1 | package de.codecentric.boot.admin.server; 2 | 3 | import de.codecentric.boot.admin.server.config.EnableAdminServer; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 6 | import org.springframework.context.annotation.Configuration; 7 | 8 | /** 9 | * This is the entry point for spring boot admin server application. 10 | * There are lots of customizations available. 11 | * 12 | * @author Anand Varkey Philips 13 | * @version 2.0.2.RELEASE 14 | */ 15 | @Configuration 16 | @EnableAutoConfiguration 17 | @EnableAdminServer 18 | public class SpringBootAdminServerApplication { 19 | public static void main(String[] args) { 20 | SpringApplication.run(SpringBootAdminServerApplication.class, args); 21 | } 22 | } -------------------------------------------------------------------------------- /spring-boot-admin-samples/spring-boot-admin-server-without-security/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anandvarkeyphilips/spring-boot-admin/29c37c4e284511725f0dc3f642f336664f29b9d3/spring-boot-admin-samples/spring-boot-admin-server-without-security/src/main/resources/application.properties -------------------------------------------------------------------------------- /spring-boot-admin-server-cloud/src/main/java/de/codecentric/boot/admin/server/cloud/discovery/EurekaServiceInstanceConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.cloud.discovery; 18 | 19 | import de.codecentric.boot.admin.server.domain.entities.Instance; 20 | 21 | import java.net.URI; 22 | import org.springframework.cloud.client.ServiceInstance; 23 | import org.springframework.cloud.netflix.eureka.EurekaDiscoveryClient.EurekaServiceInstance; 24 | import org.springframework.util.Assert; 25 | import org.springframework.util.StringUtils; 26 | import com.netflix.appinfo.InstanceInfo; 27 | 28 | /** 29 | * Converts {@link EurekaServiceInstance}s to {@link Instance}s 30 | * 31 | * @author Johannes Edmeier 32 | */ 33 | public class EurekaServiceInstanceConverter extends DefaultServiceInstanceConverter { 34 | 35 | @Override 36 | protected URI getHealthUrl(ServiceInstance instance) { 37 | Assert.isInstanceOf(EurekaServiceInstance.class, instance, 38 | "serviceInstance must be of type EurekaServiceInstance"); 39 | 40 | InstanceInfo instanceInfo = ((EurekaServiceInstance) instance).getInstanceInfo(); 41 | String healthUrl = instanceInfo.getSecureHealthCheckUrl(); 42 | if (StringUtils.isEmpty(healthUrl)) { 43 | healthUrl = instanceInfo.getHealthCheckUrl(); 44 | } 45 | return URI.create(healthUrl); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /spring-boot-admin-server-cloud/src/main/java/de/codecentric/boot/admin/server/cloud/discovery/ServiceInstanceConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.cloud.discovery; 18 | 19 | 20 | import de.codecentric.boot.admin.server.domain.entities.Instance; 21 | import de.codecentric.boot.admin.server.domain.values.Registration; 22 | 23 | import org.springframework.cloud.client.ServiceInstance; 24 | 25 | /** 26 | * Converts {@link ServiceInstance}s to {@link Instance}s. 27 | * 28 | * @author Johannes Edmeier 29 | */ 30 | public interface ServiceInstanceConverter { 31 | 32 | /** 33 | * Converts a service instance to a application instance to be registered. 34 | * 35 | * @param instance the service instance. 36 | * @return Instance 37 | */ 38 | Registration convert(ServiceInstance instance); 39 | } 40 | -------------------------------------------------------------------------------- /spring-boot-admin-server-cloud/src/main/resources/META-INF/additional-spring-configuration-metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "groups": [ 3 | ], 4 | "properties": [ 5 | { 6 | "name": "spring.boot.admin.discovery.enabled", 7 | "type": "java.lang.Boolean", 8 | "description": "Enable Spring Cloud Discovery support.", 9 | "defaultValue": "true" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /spring-boot-admin-server-cloud/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ 2 | de.codecentric.boot.admin.server.cloud.config.AdminServerDiscoveryAutoConfiguration 3 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | "lodash" 4 | ], 5 | "presets": [ 6 | [ 7 | "env", 8 | { 9 | "modules": false 10 | } 11 | ], 12 | "stage-2" 13 | ], 14 | "env": { 15 | "test": { 16 | "presets": [ 17 | "env", 18 | "stage-2" 19 | ], 20 | "plugins": [ 21 | "babel-plugin-dynamic-import-node" 22 | ] 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/.eslintignore: -------------------------------------------------------------------------------- 1 | .eslintrc.js 2 | postcss.config.js 3 | webpack.config.js 4 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/.eslintrc.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // http://eslint.org/docs/user-guide/configuring 18 | 19 | module.exports = { 20 | root: true, 21 | parserOptions: { 22 | parser: 'babel-eslint', 23 | sourceType: 'module', 24 | ecmaVersion: '2017' 25 | }, 26 | env: { 27 | browser: true, 28 | }, 29 | extends: [ 30 | 'eslint:recommended', 31 | 'plugin:vue/strongly-recommended' 32 | ], 33 | rules: { 34 | 'quotes': ['error', 'single'], 35 | 'no-console': ['error', {allow: ['warn']}], 36 | 'vue/max-attributes-per-line': 'off' 37 | }, 38 | // required to lint *.vue files 39 | plugins: ['vue'] 40 | }; 41 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | dist/ 4 | npm-debug.log 5 | .idea 6 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/README.md: -------------------------------------------------------------------------------- 1 | spring-boot-admin-server-ui 2 | ================================ 3 | 4 | ### Building this module 5 | The jar **can be build with Maven** with the maven-exec-plugin. To do this node.js and npm must be installed on your machine and be on your `$PATH`. 6 | If you don't want to use the maven exec run the following commands: 7 | 8 | ### Running Spring Boot Admin Server for development 9 | To develop the ui on an running server the best to do is 10 | 11 | 1. Running the ui build in watch mode so the resources get updated: 12 | ```shell 13 | npm run watch 14 | ``` 15 | 2. Run a Spring Boot Admin Server instances with the template-location and resource-location pointing to the build output and disable caching: 16 | ``` 17 | spring.boot.admin.ui.cache.no-cache: true 18 | spring.boot.admin.ui.resource-locations: file://@project.basedir@/../../spring-boot-admin-server-ui/target/dist/ 19 | spring.boot.admin.ui.template-location: file://@project.basedir@/../../spring-boot-admin-server-ui/target/dist/ 20 | spring.boot.admin.ui.cache-templates: false 21 | ``` 22 | Or just start the [spring-boot-admin-sample-servlet](../spring-boot-admin-samples/spring-boot-admin-sample-servlet) project using the `dev` profile. 23 | 24 | ### Build 25 | ```shell 26 | npm install 27 | npm run build 28 | ``` 29 | 30 | Repeated build with watching the files: 31 | ```shell 32 | npm run watch 33 | ``` 34 | 35 | ## Run tests 36 | ```shell 37 | npm run test 38 | ``` 39 | 40 | Repeated tests with watching the files: 41 | ```shell 42 | npm run watch:test 43 | ``` 44 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: [ 3 | require('autoprefixer')() 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/main/frontend/assets/css/_utilities.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | // Import the initial variables 17 | @import "~bulma/sass/utilities/initial-variables"; 18 | @import "~bulma/sass/utilities/functions"; 19 | 20 | $turquoise: rgb(66, 211, 165); 21 | 22 | // overrides 23 | $primary: $turquoise; 24 | $primary-invert: $white; 25 | 26 | // Add new color variables to the color map. 27 | @import "~bulma/sass/utilities/derived-variables.sass"; 28 | 29 | $addColors: (); 30 | $colors: map-merge($colors, $addColors); 31 | 32 | $link: $primary; 33 | 34 | $modal-card-head-background-color: $white; 35 | $modal-content-width: calc(100vh - 40px); 36 | 37 | $navbar-background-color: $black-ter; 38 | $navbar-item-color: $grey; 39 | $navbar-item-hover-color: $white; 40 | $navbar-item-hover-background-color: $navbar-background-color; 41 | $navbar-item-active-color: $white; 42 | $navbar-item-active-background-color: $navbar-background-color; 43 | 44 | @import "~bulma/sass/utilities/mixins.sass"; 45 | 46 | // for calculations / originally rem 47 | $navbar-height-px: 52px; 48 | $tabs-height-px: 46px; 49 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/main/frontend/assets/img/favicon-danger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anandvarkeyphilips/spring-boot-admin/29c37c4e284511725f0dc3f642f336664f29b9d3/spring-boot-admin-server-ui/src/main/frontend/assets/img/favicon-danger.png -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/main/frontend/assets/img/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anandvarkeyphilips/spring-boot-admin/29c37c4e284511725f0dc3f642f336664f29b9d3/spring-boot-admin-server-ui/src/main/frontend/assets/img/favicon.png -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/main/frontend/assets/img/icon-spring-boot-admin.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 9 | 10 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/main/frontend/components/__snapshots__/sba-time-ago.spec.js.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`time-ago should match the snapshot 1`] = `14m`; 4 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/main/frontend/components/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | const components = []; 19 | 20 | /* global require */ 21 | const context = require.context('.', false, /^(?:(?!.*\.spec\.(js|vue)$).)*\.(js|vue)$/); 22 | context.keys().forEach(function (key) { 23 | const name = /^(.\/)+(.*)\.(vue|js)$/.exec(key)[2]; 24 | components.push({name, component: context(key).default}) 25 | }); 26 | 27 | export default { 28 | install(Vue) { 29 | components.forEach(component => Vue.component(component.name, component.component)); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/main/frontend/components/sba-confirm-button.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 23 | 24 | 49 | 50 | 51 | 58 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/main/frontend/components/sba-formatted-obj.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 20 | 21 | 44 | 45 | 50 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/main/frontend/components/sba-icon-button.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 22 | 23 | 45 | 46 | 78 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/main/frontend/components/sba-tags.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 27 | 28 | 43 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/main/frontend/components/sba-time-ago.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import moment from 'moment-shortformat'; 18 | 19 | export default { 20 | props: { 21 | date: { 22 | type: null, 23 | default: null 24 | } 25 | }, 26 | data: () => ({ 27 | now: moment.now(), 28 | timer: null, 29 | }), 30 | computed: { 31 | timeAgo() { 32 | return moment(this.date).short(true, this.now); 33 | } 34 | }, 35 | created() { 36 | this.timer = window.setInterval(() => { 37 | this.now = moment.now(); 38 | }, 1000); 39 | }, 40 | render() { 41 | return this._v(this.timeAgo); 42 | }, 43 | beforeDestroy() { 44 | if (this.timer) { 45 | window.clearInterval(this.timer); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/main/frontend/components/sba-time-ago.spec.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import {shallowMount} from '@vue/test-utils'; 18 | import moment from 'moment'; 19 | import sbaTimeAgo from './sba-time-ago.js'; 20 | 21 | moment.now = () => +new Date(1318781879406); 22 | 23 | describe('time-ago', () => { 24 | 25 | it('should match the snapshot', () => { 26 | const wrapper = shallowMount(sbaTimeAgo, { 27 | propsData: { 28 | date: moment(1318781000000) 29 | } 30 | }); 31 | expect(wrapper.vm.$el).toMatchSnapshot(); 32 | }); 33 | 34 | }); 35 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/main/frontend/directives/on-resize.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import ResizeObserver from 'resize-observer-polyfill'; 18 | 19 | const observers = new WeakMap(); 20 | 21 | const bind = (el, binding) => { 22 | unbind(el); 23 | const observer = new ResizeObserver(binding.value); 24 | observer.observe(el); 25 | observers.set(el, observer); 26 | 27 | }; 28 | 29 | const unbind = (el) => { 30 | const observer = observers.get(el); 31 | if (observer) { 32 | observer.disconnect(); 33 | observers.delete(el); 34 | } 35 | }; 36 | 37 | export default { 38 | bind, 39 | update(el, binding) { 40 | if (binding.value === binding.oldValue) { 41 | return 42 | } 43 | bind(el, binding) 44 | }, 45 | unbind 46 | } 47 | 48 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/main/frontend/directives/popper.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import Popper from 'popper.js'; 18 | 19 | const poppers = new WeakMap(); 20 | 21 | const bind = (el, binding) => { 22 | const reference = typeof binding.value === 'string' ? document.getElementById(binding.value) : binding.value; 23 | if (reference) { 24 | const popper = new Popper(reference, el); 25 | poppers.set(el, popper); 26 | } 27 | }; 28 | 29 | const unbind = (el) => { 30 | const popper = poppers.get(el); 31 | if (popper) { 32 | popper.destroy(el); 33 | } 34 | }; 35 | 36 | export default { 37 | bind, 38 | update(el, binding) { 39 | if (binding.value === binding.oldValue) { 40 | return 41 | } 42 | bind(el, binding) 43 | }, 44 | unbind 45 | } 46 | 47 | 48 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/main/frontend/directives/sticks-below.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | const bind = (el, binding) => { 18 | if (!binding.value) { 19 | return; 20 | } 21 | const top = binding.value.map(v => document.querySelector(v)) 22 | .filter(v => Boolean(v)) 23 | .map(v => v.getBoundingClientRect().height) 24 | .reduce((a, b) => a + b, 0); 25 | el.style.top = `${top}px`; 26 | el.style.position = 'sticky'; 27 | }; 28 | 29 | export default { 30 | bind, 31 | update(el, binding) { 32 | if (binding.value === binding.oldValue) { 33 | return 34 | } 35 | bind(el, binding) 36 | } 37 | } 38 | 39 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/main/frontend/mixins/subscribing.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | export default { 18 | created() { 19 | this.subscribe(); 20 | }, 21 | beforeDestroy() { 22 | this.unsubscribe(); 23 | }, 24 | methods: { 25 | async subscribe() { 26 | if (!this.subscription) { 27 | this.subscription = await this.createSubscription(); 28 | } 29 | }, 30 | unsubscribe() { 31 | if (this.subscription) { 32 | try { 33 | !this.subscription.closed && this.subscription.unsubscribe(); 34 | } finally { 35 | this.subscription = null; 36 | } 37 | } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/main/frontend/shell/index.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 23 | 24 | 57 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/main/frontend/utils/autolink.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import _Autolinker from 'autolinker'; 18 | 19 | export const defaults = { 20 | urls: { 21 | schemeMatches: true, 22 | wwwMatches: false, 23 | tldMatches: false 24 | }, 25 | email: false, 26 | phone: false, 27 | mention: false, 28 | hashtag: false, 29 | 30 | stripPrefix: false, 31 | stripTrailingSlash: false, 32 | newWindow: true, 33 | 34 | truncate: { 35 | length: 0, 36 | location: 'smart' 37 | }, 38 | 39 | className: '' 40 | }; 41 | const autolinker = new _Autolinker(defaults); 42 | 43 | export default s => autolinker.link(s); 44 | export function Autolink(cfg) { 45 | this.autolinker = new _Autolinker({...defaults, ...cfg}); 46 | return s => this.autolinker.link(s) 47 | } 48 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/main/frontend/utils/axios.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import axios from 'axios'; 18 | 19 | axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 20 | /* global SBA */ 21 | if (SBA && SBA.csrf && SBA.csrf.headerName) { 22 | axios.defaults.xsrfHeaderName = SBA.csrf.headerName; 23 | } 24 | 25 | export const redirectOn401 = (predicate = () => true) => error => { 26 | if (error.response && error.response.status === 401 && predicate(error)) { 27 | window.location.assign(`login?redirectTo=${encodeURIComponent(window.location.href)}`); 28 | } 29 | return Promise.reject(error); 30 | 31 | }; 32 | 33 | const instance = axios.create(); 34 | instance.interceptors.response.use(response => response, redirectOn401()); 35 | instance.create = axios.create; 36 | 37 | export default instance; 38 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/main/frontend/utils/collections.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | export const compareBy = mapper => (a, b) => { 19 | const valA = mapper(a); 20 | const valB = mapper(b); 21 | return valA > valB ? 1 : valA < valB ? -1 : 0; 22 | }; 23 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/main/frontend/utils/d3.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import * as array from 'd3-array'; 18 | import * as axis from 'd3-axis'; 19 | import * as brush from 'd3-brush'; 20 | import * as scale from 'd3-scale'; 21 | import * as selection from 'd3-selection'; 22 | import * as shape from 'd3-shape'; 23 | import * as time from 'd3-time'; 24 | 25 | export default { 26 | ...array, 27 | ...axis, 28 | ...brush, 29 | ...scale, 30 | ...selection, 31 | ...shape, 32 | ...time 33 | } 34 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/main/frontend/utils/eventsource-polyfill.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | export default async () => { 18 | if (typeof window.EventSource === 'undefined') { 19 | return import(/* webpackChunkName: "event-source-polyfill" */ 'event-source-polyfill'); 20 | } 21 | return Promise.resolve(); 22 | }; 23 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/main/frontend/utils/objToString.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import _ from 'lodash'; 17 | 18 | const nonEmptyComplexValue = value => (Array.isArray(value) || _.isObject(value)) && !_.isEmpty(value); 19 | 20 | const objToString = (obj, indent = '') => { 21 | if (Array.isArray(obj)) { 22 | if (_.isEmpty(obj)) { 23 | return indent + '[]'; 24 | } 25 | 26 | return obj.map(value => { 27 | if (nonEmptyComplexValue(value)) { 28 | return `${indent}-\n${objToString(value, indent + ' ')}`; 29 | } 30 | return `${indent}- ${objToString(value, '')}`; 31 | }).join('\n'); 32 | } 33 | 34 | if (_.isObject(obj)) { 35 | if (_.isEmpty(obj)) { 36 | return indent + '{}'; 37 | } 38 | 39 | return Object.entries(obj) 40 | .map(([key, value]) => { 41 | if (nonEmptyComplexValue(value)) { 42 | return `${indent}${key}:\n${objToString(value, indent + ' ')}`; 43 | } 44 | return `${indent}${key}: ${objToString(value, '')}`; 45 | }) 46 | .join('\n'); 47 | } 48 | 49 | if (obj === null) { 50 | return indent + 'null'; 51 | } 52 | 53 | if (typeof obj === 'undefined' || obj === '') { 54 | return ''; 55 | } 56 | 57 | return indent + obj; 58 | }; 59 | 60 | export default objToString; 61 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/main/frontend/utils/objToString.spec.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import objToString from './objToString' 18 | 19 | describe('objToString should', () => { 20 | 21 | it('return the input string for normal text', () => { 22 | const obj = { 23 | a: 'start', 24 | b: 1, 25 | c: true, 26 | d: [1, 2, [3, 4]], 27 | e: { 28 | f: '', 29 | g: 1, 30 | h: null, 31 | i: undefined, 32 | j: {}, 33 | k: [1], 34 | l: [{a:1, b:'foo'}, {b:2}] 35 | } 36 | }; 37 | const str = `a: start 38 | b: 1 39 | c: true 40 | d: 41 | - 1 42 | - 2 43 | - 44 | - 3 45 | - 4 46 | e: 47 | f: 48 | g: 1 49 | h: null 50 | i: 51 | j: {} 52 | k: 53 | - 1 54 | l: 55 | - 56 | a: 1 57 | b: foo 58 | - 59 | b: 2`; 60 | expect(objToString(obj)).toBe(str); 61 | }); 62 | 63 | }); 64 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/main/frontend/utils/uri.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | export default (strings, ...values) => { 18 | let result = strings[0]; 19 | for (let i = 0; i < values.length; ++i) { 20 | result += encodeURIComponent(values[i]) + strings[i + 1]; 21 | } 22 | return result; 23 | } 24 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/main/frontend/utils/uri.spec.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import uri from './uri'; 18 | 19 | describe('uri', () => { 20 | 21 | it('should escape uris properly', () => { 22 | expect(uri`http://app/${'foo/bar'}?q=${'???'}`).toBe('http://app/foo%2Fbar?q=%3F%3F%3F'); 23 | expect(uri`http://app/${'foo/bar'}?q=1`).toBe('http://app/foo%2Fbar?q=1'); 24 | expect(uri`http://app/${'foo/bar'}`).toBe('http://app/foo%2Fbar'); 25 | expect(uri`http://app/foo`).toBe('http://app/foo'); 26 | expect(uri``).toBe(''); 27 | }); 28 | 29 | 30 | }); 31 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/main/frontend/views/applications/label.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 27 | 28 | 64 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/main/frontend/views/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | const views = []; 18 | 19 | /* global require */ 20 | const context = require.context('.', true, /^\.\/.+\/index\.(js|vue)$/); 21 | context.keys().forEach(function (key) { 22 | const defaultExport = context(key).default; 23 | if (defaultExport && defaultExport.install) { 24 | views.push(defaultExport) 25 | } 26 | }); 27 | 28 | export default views; 29 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/main/frontend/views/instances/details/details-metadata.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 32 | 33 | 53 | 54 | 63 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/main/frontend/views/instances/details/process-uptime.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import subscribing from '@/mixins/subscribing'; 18 | import {timer} from '@/utils/rxjs'; 19 | import moment from 'moment'; 20 | 21 | export default { 22 | props: ['value'], 23 | mixins: [subscribing], 24 | data: () => ({ 25 | startTs: null, 26 | offset: null 27 | }), 28 | render() { 29 | return this._v(this.clock); 30 | }, 31 | computed: { 32 | clock() { 33 | if (!this.value) { 34 | return null; 35 | } 36 | const duration = moment.duration(this.value + this.offset); 37 | return `${Math.floor(duration.asDays())}d ${duration.hours()}h ${duration.minutes()}m ${duration.seconds()}s`; 38 | } 39 | }, 40 | watch: { 41 | value: 'subscribe' 42 | }, 43 | methods: { 44 | createSubscription() { 45 | if (this.value) { 46 | const vm = this; 47 | vm.startTs = moment.now(); 48 | vm.offset = 0; 49 | return timer(0, 1000).subscribe({ 50 | next: () => { 51 | vm.offset = moment.now().valueOf() - vm.startTs.valueOf(); 52 | } 53 | }) 54 | } 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/main/frontend/views/instances/jolokia/m-bean-operation.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 27 | 28 | 42 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/main/frontend/views/instances/mappings/ServletFilterMappings.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 49 | 59 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/main/frontend/views/instances/mappings/ServletMappings.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 42 | 52 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/main/frontend/views/wallboard/hex-mesh.spec.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import * as hm from './hex-mesh'; 18 | 19 | describe('calcLayout', () => { 20 | 21 | it('should calculate optimum layout for 12 in 1594x879', () => { 22 | const result = hm.calcLayout(12, 1594, 879); 23 | 24 | expect(result).toEqual({ 25 | rows: 3, 26 | cols: 5, 27 | sideLength: 175.8 28 | }); 29 | }); 30 | 31 | it('should calculate optimum layout for 1 in 100x100', () => { 32 | const result = hm.calcLayout(1, 100, 100); 33 | 34 | expect(result).toEqual({ 35 | rows: 1, 36 | cols: 1, 37 | sideLength: 50 38 | }); 39 | }); 40 | 41 | }); 42 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/main/java/de/codecentric/boot/admin/server/ui/extensions/UiExtension.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.ui.extensions; 18 | 19 | @lombok.Data 20 | public class UiExtension { 21 | private final String resourcePath; 22 | private final String resourceLocation; 23 | } 24 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/main/resources/META-INF/spring-boot-admin-server-ui/extensions/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anandvarkeyphilips/spring-boot-admin/29c37c4e284511725f0dc3f642f336664f29b9d3/spring-boot-admin-server-ui/src/main/resources/META-INF/spring-boot-admin-server-ui/extensions/.gitignore -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ 2 | de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/test/frontend/__mocks__/file-mock.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | module.exports = 'file-mock'; 18 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/test/frontend/__mocks__/vue-mock-component.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | const path = require('path'); 18 | 19 | module.exports = { 20 | process(_, filename, config) { 21 | const relative = path.relative(config.rootDir, filename); 22 | return ` 23 | module.exports = { 24 | render() { return this._v('${relative}'); } 25 | }; 26 | `; 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /spring-boot-admin-server-ui/src/test/frontend/globals.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | global.SBA = {}; 18 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/config/AdminServerMarkerConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.config; 18 | 19 | import org.springframework.context.annotation.Bean; 20 | import org.springframework.context.annotation.Configuration; 21 | 22 | @Configuration 23 | public class AdminServerMarkerConfiguration { 24 | @Bean 25 | public Marker adminServerMarker() { 26 | return new Marker(); 27 | } 28 | 29 | public static class Marker { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/config/EnableAdminServer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.config; 18 | 19 | import java.lang.annotation.Documented; 20 | import java.lang.annotation.ElementType; 21 | import java.lang.annotation.Retention; 22 | import java.lang.annotation.RetentionPolicy; 23 | import java.lang.annotation.Target; 24 | import org.springframework.context.annotation.Import; 25 | 26 | /** 27 | * @author Dennis Schulte 28 | */ 29 | @Target(ElementType.TYPE) 30 | @Retention(RetentionPolicy.RUNTIME) 31 | @Documented 32 | @Import(AdminServerMarkerConfiguration.class) 33 | public @interface EnableAdminServer { 34 | 35 | } 36 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/domain/events/InstanceDeregisteredEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.domain.events; 18 | 19 | import de.codecentric.boot.admin.server.domain.values.InstanceId; 20 | 21 | import java.time.Instant; 22 | 23 | /** 24 | * This event gets emitted when an instance is unregistered. 25 | * 26 | * @author Johannes Edmeier 27 | */ 28 | @lombok.Data 29 | @lombok.EqualsAndHashCode(callSuper = true) 30 | @lombok.ToString(callSuper = true) 31 | public class InstanceDeregisteredEvent extends InstanceEvent { 32 | private static final long serialVersionUID = 1L; 33 | 34 | public InstanceDeregisteredEvent(InstanceId instance, long version) { 35 | this(instance, version, Instant.now()); 36 | } 37 | 38 | public InstanceDeregisteredEvent(InstanceId instance, long version, Instant timestamp) { 39 | super(instance, version, "DEREGISTERED", timestamp); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/domain/events/InstanceEndpointsDetectedEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.domain.events; 18 | 19 | import de.codecentric.boot.admin.server.domain.values.Endpoints; 20 | import de.codecentric.boot.admin.server.domain.values.InstanceId; 21 | 22 | import java.time.Instant; 23 | 24 | /** 25 | * This event gets emitted when all instance's endpoints are discovered. 26 | * 27 | * @author Johannes Edmeier 28 | */ 29 | @lombok.Data 30 | @lombok.EqualsAndHashCode(callSuper = true) 31 | @lombok.ToString(callSuper = true) 32 | public class InstanceEndpointsDetectedEvent extends InstanceEvent { 33 | private static final long serialVersionUID = 1L; 34 | private final Endpoints endpoints; 35 | 36 | public InstanceEndpointsDetectedEvent(InstanceId instance, long version, Endpoints endpoints) { 37 | this(instance, version, Instant.now(), endpoints); 38 | } 39 | 40 | public InstanceEndpointsDetectedEvent(InstanceId instance, long version, Instant timestamp, Endpoints endpoints) { 41 | super(instance, version, "ENDPOINTS_DETECTED", timestamp); 42 | this.endpoints = endpoints; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/domain/events/InstanceEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.domain.events; 18 | 19 | import de.codecentric.boot.admin.server.domain.values.InstanceId; 20 | 21 | import java.io.Serializable; 22 | import java.time.Instant; 23 | import org.springframework.util.Assert; 24 | 25 | /** 26 | * Abstract Event regarding registered instances 27 | * 28 | * @author Johannes Edmeier 29 | */ 30 | @lombok.Data 31 | public abstract class InstanceEvent implements Serializable { 32 | private static final long serialVersionUID = 1L; 33 | private final InstanceId instance; 34 | private final long version; 35 | private final Instant timestamp; 36 | private final String type; 37 | 38 | protected InstanceEvent(InstanceId instance, long version, String type, Instant timestamp) { 39 | Assert.notNull(instance, "'instance' must not be null"); 40 | Assert.notNull(timestamp, "'timestamp' must not be null"); 41 | Assert.hasText(type, "'type' must not be empty"); 42 | this.instance = instance; 43 | this.version = version; 44 | this.timestamp = timestamp; 45 | this.type = type; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/domain/events/InstanceInfoChangedEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.domain.events; 18 | 19 | import de.codecentric.boot.admin.server.domain.values.Info; 20 | import de.codecentric.boot.admin.server.domain.values.InstanceId; 21 | 22 | import java.time.Instant; 23 | 24 | /** 25 | * This event gets emitted when an instance information changes. 26 | * 27 | * @author Johannes Edmeier 28 | */ 29 | @lombok.Data 30 | @lombok.EqualsAndHashCode(callSuper = true) 31 | @lombok.ToString(callSuper = true) 32 | public class InstanceInfoChangedEvent extends InstanceEvent { 33 | private static final long serialVersionUID = 1L; 34 | private final Info info; 35 | 36 | public InstanceInfoChangedEvent(InstanceId instance, long version, Info info) { 37 | this(instance, version, Instant.now(), info); 38 | } 39 | 40 | public InstanceInfoChangedEvent(InstanceId instance, long version, Instant timestamp, Info info) { 41 | super(instance, version, "INFO_CHANGED", timestamp); 42 | this.info = info; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/domain/events/InstanceRegisteredEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.domain.events; 18 | 19 | import de.codecentric.boot.admin.server.domain.values.InstanceId; 20 | import de.codecentric.boot.admin.server.domain.values.Registration; 21 | 22 | import java.time.Instant; 23 | 24 | /** 25 | * This event gets emitted when an instance is registered. 26 | * 27 | * @author Johannes Edmeier 28 | */ 29 | @lombok.Data 30 | @lombok.EqualsAndHashCode(callSuper = true) 31 | @lombok.ToString(callSuper = true) 32 | public class InstanceRegisteredEvent extends InstanceEvent { 33 | private static final long serialVersionUID = 1L; 34 | private final Registration registration; 35 | 36 | public InstanceRegisteredEvent(InstanceId instance, long version, Registration registration) { 37 | this(instance, version, Instant.now(), registration); 38 | } 39 | 40 | public InstanceRegisteredEvent(InstanceId instance, long version, Instant timestamp, Registration registration) { 41 | super(instance, version, "REGISTERED", timestamp); 42 | this.registration = registration; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/domain/events/InstanceRegistrationUpdatedEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.domain.events; 18 | 19 | import de.codecentric.boot.admin.server.domain.values.InstanceId; 20 | import de.codecentric.boot.admin.server.domain.values.Registration; 21 | 22 | import java.time.Instant; 23 | 24 | /** 25 | * This event gets emitted when an instance updates it's registration. 26 | * 27 | * @author Johannes Edmeier 28 | */ 29 | @lombok.Data 30 | @lombok.EqualsAndHashCode(callSuper = true) 31 | @lombok.ToString(callSuper = true) 32 | public class InstanceRegistrationUpdatedEvent extends InstanceEvent { 33 | private static final long serialVersionUID = 1L; 34 | private final Registration registration; 35 | 36 | public InstanceRegistrationUpdatedEvent(InstanceId instance, long version, Registration registration) { 37 | this(instance, version, Instant.now(), registration); 38 | } 39 | 40 | public InstanceRegistrationUpdatedEvent(InstanceId instance, long version, Instant timestamp, Registration registration) { 41 | super(instance, version, "REGISTRATION_UPDATED", timestamp); 42 | this.registration = registration; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/domain/events/InstanceStatusChangedEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.domain.events; 18 | 19 | import de.codecentric.boot.admin.server.domain.values.InstanceId; 20 | import de.codecentric.boot.admin.server.domain.values.StatusInfo; 21 | 22 | import java.time.Instant; 23 | 24 | /** 25 | * This event gets emitted when an instance changes its status. 26 | * 27 | * @author Johannes Edmeier 28 | */ 29 | @lombok.Data 30 | @lombok.EqualsAndHashCode(callSuper = true) 31 | @lombok.ToString(callSuper = true) 32 | public class InstanceStatusChangedEvent extends InstanceEvent { 33 | private static final long serialVersionUID = 1L; 34 | private final StatusInfo statusInfo; 35 | 36 | public InstanceStatusChangedEvent(InstanceId instance, long version, StatusInfo statusInfo) { 37 | this(instance, version, Instant.now(), statusInfo); 38 | } 39 | 40 | public InstanceStatusChangedEvent(InstanceId instance, long version, Instant timestamp, StatusInfo statusInfo) { 41 | super(instance, version, "STATUS_CHANGED", timestamp); 42 | this.statusInfo = statusInfo; 43 | } 44 | 45 | public StatusInfo getStatusInfo() { 46 | return statusInfo; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/domain/values/Endpoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.domain.values; 18 | 19 | import java.io.Serializable; 20 | import org.springframework.util.Assert; 21 | 22 | @lombok.Data 23 | public class Endpoint implements Serializable { 24 | public static final String INFO = "info"; 25 | public static final String HEALTH = "health"; 26 | public static final String LOGFILE = "logfile"; 27 | public static final String ENV = "env"; 28 | public static final String HTTPTRACE = "httptrace"; 29 | public static final String THREADDUMP = "threaddump"; 30 | public static final String LIQUIBASE = "liquibase"; 31 | public static final String FLYWAY = "flyway"; 32 | private final String id; 33 | private final String url; 34 | 35 | private Endpoint(String id, String url) { 36 | Assert.hasText(id, "'id' must not be empty."); 37 | Assert.hasText(url, "'url' must not be empty."); 38 | this.id = id; 39 | this.url = url; 40 | } 41 | 42 | public static Endpoint of(String id, String url) { 43 | return new Endpoint(id, url); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/domain/values/Info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.domain.values; 18 | 19 | import java.io.Serializable; 20 | import java.util.Collections; 21 | import java.util.LinkedHashMap; 22 | import java.util.Map; 23 | import com.fasterxml.jackson.annotation.JsonAnyGetter; 24 | 25 | /** 26 | * Represents the info fetched from the info actuator endpoint 27 | * 28 | * @author Johannes Edmeier 29 | */ 30 | @lombok.Data 31 | public class Info implements Serializable { 32 | private static final Info EMPTY = new Info(Collections.emptyMap()); 33 | 34 | private final Map values; 35 | 36 | private Info(Map values) { 37 | if (values.isEmpty()) { 38 | this.values = Collections.emptyMap(); 39 | } else { 40 | this.values = Collections.unmodifiableMap(new LinkedHashMap<>(values)); 41 | } 42 | } 43 | 44 | public static Info from(Map values) { 45 | if (values == null || values.isEmpty()) { 46 | return empty(); 47 | } 48 | return new Info(values); 49 | } 50 | 51 | public static Info empty() { 52 | return EMPTY; 53 | } 54 | 55 | @JsonAnyGetter 56 | public Map getValues() { 57 | return this.values; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/domain/values/InstanceId.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.domain.values; 18 | 19 | import java.io.Serializable; 20 | import org.springframework.util.Assert; 21 | import com.fasterxml.jackson.annotation.JsonCreator; 22 | import com.fasterxml.jackson.annotation.JsonValue; 23 | 24 | /** 25 | * Value type for the instance identifier 26 | */ 27 | @lombok.Data 28 | public final class InstanceId implements Serializable, Comparable { 29 | private final String value; 30 | 31 | private InstanceId(String value) { 32 | Assert.hasText(value, "'value' must have text"); 33 | this.value = value; 34 | } 35 | 36 | @JsonCreator 37 | public static InstanceId of(String value) { 38 | return new InstanceId(value); 39 | } 40 | 41 | @JsonValue 42 | @Override 43 | public String toString() { 44 | return value; 45 | } 46 | 47 | @Override 48 | public int compareTo(InstanceId that) { 49 | return this.value.compareTo(that.value); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/eventstore/InMemoryEventStore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.eventstore; 18 | 19 | import de.codecentric.boot.admin.server.domain.events.InstanceEvent; 20 | import reactor.core.publisher.Mono; 21 | 22 | import java.util.List; 23 | import java.util.concurrent.ConcurrentHashMap; 24 | 25 | /** 26 | * Event-Store backed by a ConcurrentHashMap. 27 | * 28 | * @author Johannes Edmeier 29 | */ 30 | public class InMemoryEventStore extends ConcurrentMapEventStore { 31 | public InMemoryEventStore() { 32 | this(100); 33 | } 34 | 35 | public InMemoryEventStore(int maxLogSizePerAggregate) { 36 | super(maxLogSizePerAggregate, new ConcurrentHashMap<>()); 37 | } 38 | 39 | @Override 40 | public Mono append(List events) { 41 | return super.append(events).then(Mono.fromRunnable(() -> this.publish(events))); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/eventstore/InstanceEventStore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.eventstore; 18 | 19 | import de.codecentric.boot.admin.server.domain.events.InstanceEvent; 20 | import de.codecentric.boot.admin.server.domain.values.InstanceId; 21 | import reactor.core.publisher.Flux; 22 | import reactor.core.publisher.Mono; 23 | 24 | import java.util.List; 25 | import org.reactivestreams.Publisher; 26 | 27 | /** 28 | * Interface for storing all instance related Events 29 | * 30 | * @author Johannes Edmeier 31 | */ 32 | public interface InstanceEventStore extends Publisher { 33 | Flux findAll(); 34 | 35 | Flux find(InstanceId id); 36 | 37 | Mono append(List events); 38 | } 39 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/eventstore/OptimisticLockingException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.eventstore; 18 | 19 | public class OptimisticLockingException extends RuntimeException { 20 | 21 | public OptimisticLockingException(String message) { 22 | super(message); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/CompositeNotifier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.notify; 18 | 19 | import de.codecentric.boot.admin.server.domain.events.InstanceEvent; 20 | import reactor.core.publisher.Flux; 21 | import reactor.core.publisher.Mono; 22 | 23 | import org.springframework.util.Assert; 24 | 25 | /** 26 | * A notifier delegating notifications to all specified notifiers. 27 | * 28 | * @author Sebastian Meiser 29 | */ 30 | public class CompositeNotifier implements Notifier { 31 | private final Iterable delegates; 32 | 33 | public CompositeNotifier(Iterable delegates) { 34 | Assert.notNull(delegates, "'delegates' must not be null!"); 35 | this.delegates = delegates; 36 | } 37 | 38 | @Override 39 | public Mono notify(InstanceEvent event) { 40 | return Flux.fromIterable(delegates).flatMap(d -> d.notify(event)).then(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/NotificationTrigger.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.notify; 18 | 19 | import de.codecentric.boot.admin.server.domain.events.InstanceEvent; 20 | import de.codecentric.boot.admin.server.services.ResubscribingEventHandler; 21 | import reactor.core.publisher.Flux; 22 | import reactor.core.publisher.Mono; 23 | import reactor.core.scheduler.Schedulers; 24 | 25 | import org.reactivestreams.Publisher; 26 | 27 | public class NotificationTrigger extends ResubscribingEventHandler { 28 | private final Notifier notifier; 29 | 30 | public NotificationTrigger(Notifier notifier, Publisher publisher) { 31 | super(publisher, InstanceEvent.class); 32 | this.notifier = notifier; 33 | } 34 | 35 | @Override 36 | protected Publisher handle(Flux publisher) { 37 | return publisher.subscribeOn(Schedulers.newSingle("notifications")).flatMap(this::sendNotifications); 38 | } 39 | 40 | protected Mono sendNotifications(InstanceEvent event) { 41 | return notifier.notify(event); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/Notifier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.notify; 18 | 19 | import de.codecentric.boot.admin.server.domain.events.InstanceEvent; 20 | import reactor.core.publisher.Mono; 21 | 22 | /** 23 | * Interface for components which emits notifications upon status changes in clients 24 | * 25 | * @author Johannes Edmeier 26 | */ 27 | public interface Notifier { 28 | 29 | Mono notify(InstanceEvent event); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/filter/AbstractNotificationFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.notify.filter; 18 | 19 | import java.util.concurrent.atomic.AtomicLong; 20 | 21 | public abstract class AbstractNotificationFilter implements NotificationFilter { 22 | private static AtomicLong instanceCounter = new AtomicLong(0L); 23 | private final String id; 24 | 25 | public AbstractNotificationFilter() { 26 | this.id = "F-" + instanceCounter.getAndIncrement(); 27 | } 28 | 29 | @Override 30 | public String getId() { 31 | return id; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/filter/ApplicationNameNotificationFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.notify.filter; 18 | 19 | import de.codecentric.boot.admin.server.domain.entities.Instance; 20 | import de.codecentric.boot.admin.server.domain.events.InstanceEvent; 21 | 22 | import java.time.Instant; 23 | 24 | public class ApplicationNameNotificationFilter extends ExpiringNotificationFilter { 25 | private final String applicationName; 26 | 27 | public ApplicationNameNotificationFilter(String applicationName, Instant expiry) { 28 | super(expiry); 29 | this.applicationName = applicationName; 30 | } 31 | 32 | @Override 33 | protected boolean doFilter(InstanceEvent event, Instance instance) { 34 | return applicationName.equals(instance.getRegistration().getName()); 35 | } 36 | 37 | public String getApplicationName() { 38 | return applicationName; 39 | } 40 | 41 | @Override 42 | public String toString() { 43 | return "NotificationFilter [applicationName=" + applicationName + ", expiry=" + getExpiry() + "]"; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/filter/ExpiringNotificationFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.notify.filter; 18 | 19 | import de.codecentric.boot.admin.server.domain.entities.Instance; 20 | import de.codecentric.boot.admin.server.domain.events.InstanceEvent; 21 | 22 | import java.time.Instant; 23 | 24 | public abstract class ExpiringNotificationFilter extends AbstractNotificationFilter { 25 | private final Instant expiry; 26 | 27 | public ExpiringNotificationFilter(Instant expiry) { 28 | this.expiry = expiry; 29 | } 30 | 31 | public boolean isExpired() { 32 | return expiry != null && expiry.isBefore(Instant.now()); 33 | } 34 | 35 | @Override 36 | public boolean filter(InstanceEvent event, Instance instance) { 37 | return !isExpired() && doFilter(event, instance); 38 | } 39 | 40 | protected abstract boolean doFilter(InstanceEvent event, Instance instance); 41 | 42 | public Instant getExpiry() { 43 | return expiry; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/filter/InstanceIdNotificationFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.notify.filter; 18 | 19 | import de.codecentric.boot.admin.server.domain.entities.Instance; 20 | import de.codecentric.boot.admin.server.domain.events.InstanceEvent; 21 | import de.codecentric.boot.admin.server.domain.values.InstanceId; 22 | 23 | import java.time.Instant; 24 | 25 | public class InstanceIdNotificationFilter extends ExpiringNotificationFilter { 26 | private final InstanceId instanceId; 27 | 28 | public InstanceIdNotificationFilter(InstanceId instanceId, Instant expiry) { 29 | super(expiry); 30 | this.instanceId = instanceId; 31 | } 32 | 33 | @Override 34 | protected boolean doFilter(InstanceEvent event, Instance instance) { 35 | return instanceId.equals(event.getInstance()); 36 | } 37 | 38 | public InstanceId getInstanceId() { 39 | return instanceId; 40 | } 41 | 42 | @Override 43 | public String toString() { 44 | return "NotificationFilter [instanceId=" + instanceId + ", expiry=" + getExpiry() + "]"; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/filter/NotificationFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.notify.filter; 18 | 19 | import de.codecentric.boot.admin.server.domain.entities.Instance; 20 | import de.codecentric.boot.admin.server.domain.events.InstanceEvent; 21 | 22 | public interface NotificationFilter { 23 | String getId(); 24 | boolean filter(InstanceEvent event, Instance instance); 25 | } 26 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/services/CloudFoundryInstanceIdGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.services; 18 | 19 | import de.codecentric.boot.admin.server.domain.values.InstanceId; 20 | import de.codecentric.boot.admin.server.domain.values.Registration; 21 | 22 | import org.springframework.util.StringUtils; 23 | 24 | /** 25 | * Generates CF instance uniqueId "applicationId:instanceId" for CloudFoundry instance. 26 | * Uses a fallback InstanceIdGenerator when the metadata isn't present. 27 | * 28 | * @author Tetsushi Awano 29 | */ 30 | public class CloudFoundryInstanceIdGenerator implements InstanceIdGenerator { 31 | private final InstanceIdGenerator fallbackIdGenerator; 32 | 33 | public CloudFoundryInstanceIdGenerator(InstanceIdGenerator fallbackIdGenerator) { 34 | this.fallbackIdGenerator = fallbackIdGenerator; 35 | } 36 | 37 | @Override 38 | public InstanceId generateId(Registration registration) { 39 | String applicationId = registration.getMetadata().get("applicationId"); 40 | String instanceId = registration.getMetadata().get("instanceId"); 41 | 42 | if (StringUtils.hasText(applicationId) && StringUtils.hasText(instanceId)) { 43 | return InstanceId.of(String.format("%s:%s", applicationId, instanceId)); 44 | } 45 | return fallbackIdGenerator.generateId(registration); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/services/InstanceIdGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.services; 18 | 19 | import de.codecentric.boot.admin.server.domain.values.InstanceId; 20 | import de.codecentric.boot.admin.server.domain.values.Registration; 21 | 22 | public interface InstanceIdGenerator { 23 | 24 | /** 25 | * Generate an id based on the given Instance 26 | * 27 | * @param registration the registration the id is computed for. 28 | * @return the instance id 29 | */ 30 | InstanceId generateId(Registration registration); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/services/endpoints/ChainingStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.services.endpoints; 18 | 19 | import de.codecentric.boot.admin.server.domain.entities.Instance; 20 | import de.codecentric.boot.admin.server.domain.values.Endpoints; 21 | import reactor.core.publisher.Mono; 22 | 23 | import org.springframework.util.Assert; 24 | 25 | public class ChainingStrategy implements EndpointDetectionStrategy { 26 | private EndpointDetectionStrategy[] delegates; 27 | 28 | public ChainingStrategy(EndpointDetectionStrategy... delegates) { 29 | Assert.notNull(delegates, "'delegates' must not be null."); 30 | Assert.noNullElements(delegates, "'delegates' must not contain null."); 31 | this.delegates = delegates; 32 | } 33 | 34 | @Override 35 | public Mono detectEndpoints(Instance instance) { 36 | Mono result = Mono.empty(); 37 | for (EndpointDetectionStrategy delegate : delegates) { 38 | result = result.switchIfEmpty(delegate.detectEndpoints(instance)); 39 | } 40 | return result.switchIfEmpty(Mono.just(Endpoints.empty())); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/services/endpoints/EndpointDetectionStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.services.endpoints; 18 | 19 | import de.codecentric.boot.admin.server.domain.entities.Instance; 20 | import de.codecentric.boot.admin.server.domain.values.Endpoints; 21 | import reactor.core.publisher.Mono; 22 | 23 | public interface EndpointDetectionStrategy { 24 | Mono detectEndpoints(Instance instance); 25 | } 26 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/utils/MediaType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.utils; 18 | 19 | import org.springframework.boot.actuate.endpoint.http.ActuatorMediaType; 20 | 21 | public final class MediaType { 22 | public static final org.springframework.http.MediaType ACTUATOR_V1_MEDIATYPE = org.springframework.http.MediaType.parseMediaType( 23 | ActuatorMediaType.V1_JSON); 24 | public static final org.springframework.http.MediaType ACTUATOR_V2_MEDIATYPE = org.springframework.http.MediaType.parseMediaType( 25 | ActuatorMediaType.V2_JSON); 26 | 27 | private MediaType() { 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/web/AdminController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.web; 18 | 19 | import java.lang.annotation.Documented; 20 | import java.lang.annotation.ElementType; 21 | import java.lang.annotation.Retention; 22 | import java.lang.annotation.RetentionPolicy; 23 | import java.lang.annotation.Target; 24 | 25 | /** 26 | * Indicates that the annotated class is a mvn controller used whithin spring boot admin. 27 | * 28 | * @author Johannes Edmeier 29 | */ 30 | @Target({ElementType.TYPE}) 31 | @Retention(RetentionPolicy.RUNTIME) 32 | @Documented 33 | public @interface AdminController { 34 | } 35 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/web/PathUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.web; 18 | 19 | import org.springframework.util.StringUtils; 20 | 21 | public final class PathUtils { 22 | private PathUtils() { 23 | } 24 | 25 | 26 | public static String normalizePath(String path) { 27 | if (!StringUtils.hasText(path)) { 28 | return path; 29 | } 30 | String normalizedPath = path; 31 | if (!normalizedPath.startsWith("/")) { 32 | normalizedPath = "/" + normalizedPath; 33 | } 34 | if (normalizedPath.endsWith("/")) { 35 | normalizedPath = normalizedPath.substring(0, normalizedPath.length() - 1); 36 | } 37 | return normalizedPath; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/web/client/CloudFoundryHttpHeaderProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.web.client; 18 | 19 | import de.codecentric.boot.admin.server.domain.entities.Instance; 20 | 21 | import org.springframework.http.HttpHeaders; 22 | import org.springframework.util.StringUtils; 23 | 24 | /** 25 | * Provides CloudFoundry related X-CF-APP-INSTANCE header for the {@link Instance} using the metadata for 26 | * "applicationId" and "instanceId". 27 | * 28 | * @author Tetsushi Awano 29 | */ 30 | public class CloudFoundryHttpHeaderProvider implements HttpHeadersProvider { 31 | 32 | @Override 33 | public HttpHeaders getHeaders(Instance instance) { 34 | String applicationId = instance.getRegistration().getMetadata().get("applicationId"); 35 | String instanceId = instance.getRegistration().getMetadata().get("instanceId"); 36 | 37 | if (StringUtils.hasText(applicationId) && StringUtils.hasText(instanceId)) { 38 | HttpHeaders headers = new HttpHeaders(); 39 | headers.set("X-CF-APP-INSTANCE", applicationId + ":" + instanceId); 40 | return headers; 41 | } 42 | 43 | return HttpHeaders.EMPTY; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/web/client/CompositeHttpHeadersProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.web.client; 18 | 19 | import de.codecentric.boot.admin.server.domain.entities.Instance; 20 | 21 | import java.util.Collection; 22 | import org.springframework.http.HttpHeaders; 23 | 24 | public class CompositeHttpHeadersProvider implements HttpHeadersProvider { 25 | 26 | private final Collection delegates; 27 | 28 | public CompositeHttpHeadersProvider(Collection delegates) { 29 | this.delegates = delegates; 30 | } 31 | 32 | @Override 33 | public HttpHeaders getHeaders(Instance instance) { 34 | HttpHeaders headers = new HttpHeaders(); 35 | delegates.forEach(delegate -> headers.addAll(delegate.getHeaders(instance))); 36 | return headers; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/web/client/HttpHeadersProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.web.client; 18 | 19 | import de.codecentric.boot.admin.server.domain.entities.Instance; 20 | 21 | import org.springframework.http.HttpHeaders; 22 | 23 | /** 24 | * Is responsible to provide the {@link HttpHeaders} used to interact with the given 25 | * {@link Instance}. 26 | * 27 | * @author Johannes Edmeier 28 | */ 29 | public interface HttpHeadersProvider { 30 | 31 | HttpHeaders getHeaders(Instance instance); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/web/client/InstanceExchangeFilterFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.web.client; 18 | 19 | import de.codecentric.boot.admin.server.domain.entities.Instance; 20 | import reactor.core.publisher.Mono; 21 | 22 | import org.springframework.web.reactive.function.client.ClientRequest; 23 | import org.springframework.web.reactive.function.client.ClientResponse; 24 | import org.springframework.web.reactive.function.client.ExchangeFunction; 25 | 26 | @FunctionalInterface 27 | public interface InstanceExchangeFilterFunction { 28 | Mono exchange(Instance instance, ClientRequest request, ExchangeFunction next); 29 | } 30 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/web/client/LegacyEndpointConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.web.client; 18 | 19 | import reactor.core.publisher.Flux; 20 | 21 | import java.util.function.Function; 22 | import org.springframework.core.io.buffer.DataBuffer; 23 | 24 | /** 25 | * @author Johannes Edmeier 26 | */ 27 | public class LegacyEndpointConverter { 28 | private final String endpointId; 29 | private final Function, Flux> converterFn; 30 | 31 | protected LegacyEndpointConverter(String endpointId, Function, Flux> converterFn) { 32 | this.endpointId = endpointId; 33 | this.converterFn = converterFn; 34 | } 35 | 36 | public boolean canConvert(Object endpointId) { 37 | return this.endpointId.equals(endpointId); 38 | } 39 | 40 | public Flux convert(Flux body) { 41 | return converterFn.apply(body); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/web/client/exception/InstanceWebClientException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.web.client.exception; 18 | 19 | public class InstanceWebClientException extends RuntimeException { 20 | public InstanceWebClientException(String message) { 21 | super(message); 22 | } 23 | 24 | public InstanceWebClientException(String message, Throwable cause) { 25 | super(message, cause); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/web/client/exception/ResolveEndpointException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.web.client.exception; 18 | 19 | public class ResolveEndpointException extends InstanceWebClientException { 20 | public ResolveEndpointException(String message) { 21 | super(message); 22 | } 23 | 24 | public ResolveEndpointException(String message, Throwable cause) { 25 | super(message, cause); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/web/client/exception/ResolveInstanceException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.web.client.exception; 18 | 19 | public class ResolveInstanceException extends InstanceWebClientException { 20 | 21 | public ResolveInstanceException(String message) { 22 | super(message); 23 | } 24 | 25 | public ResolveInstanceException(String message, Throwable cause) { 26 | super(message, cause); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/resources/META-INF/additional-spring-configuration-metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "groups": [ 3 | ], 4 | "properties": [ 5 | { 6 | "name": "spring.boot.admin.hazelcast.enabled", 7 | "type": "java.lang.Boolean", 8 | "description": "Enable Hazelcast support.", 9 | "defaultValue": "true" 10 | }, 11 | { 12 | "name": "spring.boot.admin.hazelcast.event-store", 13 | "type": "java.lang.String", 14 | "description": "Name of backing Hazelcast-Map for storing the instance events", 15 | "defaultValue": "spring-boot-admin-application-store" 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ 2 | de.codecentric.boot.admin.server.config.AdminServerAutoConfiguration,\ 3 | de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration,\ 4 | de.codecentric.boot.admin.server.config.AdminServerHazelcastAutoConfiguration,\ 5 | de.codecentric.boot.admin.server.config.AdminServerCloudFoundryAutoConfiguration 6 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/entities/EventsourcingInstanceRepositoryTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.domain.entities; 18 | 19 | import de.codecentric.boot.admin.server.eventstore.InMemoryEventStore; 20 | 21 | public class EventsourcingInstanceRepositoryTest extends AbstractInstanceRepositoryTest { 22 | 23 | public EventsourcingInstanceRepositoryTest() { 24 | super(new EventsourcingInstanceRepository(new InMemoryEventStore())); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/entities/SnapshottingInstanceRepositoryTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.domain.entities; 18 | 19 | import de.codecentric.boot.admin.server.eventstore.InMemoryEventStore; 20 | 21 | import org.junit.After; 22 | import org.junit.Before; 23 | 24 | public class SnapshottingInstanceRepositoryTest extends AbstractInstanceRepositoryTest { 25 | 26 | public SnapshottingInstanceRepositoryTest() { 27 | super(new SnapshottingInstanceRepository(new InMemoryEventStore())); 28 | } 29 | 30 | @Before 31 | public void setUp() { 32 | ((SnapshottingInstanceRepository) repository).start(); 33 | } 34 | 35 | @After 36 | public void tearDown() { 37 | ((SnapshottingInstanceRepository) repository).stop(); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/values/EndpointTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.domain.values; 18 | 19 | import org.junit.Test; 20 | 21 | import static org.assertj.core.api.Assertions.assertThatThrownBy; 22 | 23 | public class EndpointTest { 24 | 25 | @Test 26 | public void invariants() { 27 | assertThatThrownBy(() -> Endpoint.of("", "")).isInstanceOf(IllegalArgumentException.class) 28 | .hasMessage("'id' must not be empty."); 29 | assertThatThrownBy(() -> Endpoint.of("id", "")).isInstanceOf(IllegalArgumentException.class) 30 | .hasMessage("'url' must not be empty."); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/values/EndpointsTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.domain.values; 18 | 19 | 20 | import java.util.Collections; 21 | import org.junit.Test; 22 | 23 | import static org.assertj.core.api.Assertions.assertThat; 24 | import static org.assertj.core.api.Assertions.assertThatThrownBy; 25 | 26 | public class EndpointsTest { 27 | @Test 28 | public void should_return_endpoint_or_empty() { 29 | Endpoints endpoints = Endpoints.single("id", "path"); 30 | assertThat(endpoints.isPresent("id")).isTrue(); 31 | assertThat(endpoints.get("id")).contains(Endpoint.of("id", "path")); 32 | assertThat(endpoints.get("none!")).isEmpty(); 33 | } 34 | 35 | @Test 36 | public void factory_methods() { 37 | assertThat(Endpoints.empty()).isEqualTo(Endpoints.of(Collections.emptyList())).isEqualTo(Endpoints.of(null)); 38 | assertThat(Endpoints.of(Collections.singletonList(Endpoint.of("id", "path")))).isEqualTo( 39 | Endpoints.empty().withEndpoint("id", "path")).isEqualTo(Endpoints.single("id", "path")); 40 | } 41 | 42 | @Test 43 | public void should_throw_on_iterator_modificiation() { 44 | Endpoints endpoints = Endpoints.single("id", "path"); 45 | assertThatThrownBy(() -> endpoints.iterator().remove()).isInstanceOf(UnsupportedOperationException.class); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/values/InstanceIdTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.domain.values; 18 | 19 | 20 | import org.junit.Test; 21 | import com.fasterxml.jackson.core.JsonProcessingException; 22 | import com.fasterxml.jackson.databind.ObjectMapper; 23 | 24 | import static org.assertj.core.api.Assertions.assertThat; 25 | import static org.assertj.core.api.Assertions.assertThatThrownBy; 26 | 27 | public class InstanceIdTest { 28 | @Test 29 | public void invariants() { 30 | assertThatThrownBy(() -> InstanceId.of(null)).isInstanceOf(IllegalArgumentException.class) 31 | .hasMessage("'value' must have text"); 32 | assertThatThrownBy(() -> InstanceId.of("")).isInstanceOf(IllegalArgumentException.class) 33 | .hasMessage("'value' must have text"); 34 | } 35 | 36 | @Test 37 | public void json() throws JsonProcessingException { 38 | assertThat(new ObjectMapper().writeValueAsString(InstanceId.of("abc"))).isEqualTo("\"abc\""); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/eventstore/HazelcastEventStoreTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.eventstore; 18 | 19 | import com.hazelcast.core.HazelcastInstance; 20 | import com.hazelcast.test.TestHazelcastInstanceFactory; 21 | 22 | public class HazelcastEventStoreTest extends AbstractEventStoreTest { 23 | 24 | @Override 25 | protected InstanceEventStore createStore(int maxLogSizePerAggregate) { 26 | HazelcastInstance hazelcast = new TestHazelcastInstanceFactory(1).newHazelcastInstance(); 27 | return new HazelcastEventStore(maxLogSizePerAggregate, hazelcast.getMap("testList")); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/eventstore/InMemoryEventStoreTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.eventstore; 18 | 19 | public class InMemoryEventStoreTest extends AbstractEventStoreTest { 20 | 21 | @Override 22 | protected InstanceEventStore createStore(int maxLogSizePerAggregate) { 23 | return new InMemoryEventStore(maxLogSizePerAggregate); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/TestNotifier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.notify; 18 | 19 | import de.codecentric.boot.admin.server.domain.events.InstanceEvent; 20 | import reactor.core.publisher.Mono; 21 | 22 | import java.util.ArrayList; 23 | import java.util.List; 24 | 25 | public class TestNotifier implements Notifier { 26 | private List events = new ArrayList<>(); 27 | 28 | @Override 29 | public Mono notify(InstanceEvent event) { 30 | this.events.add(event); 31 | return Mono.empty(); 32 | } 33 | 34 | public List getEvents() { 35 | return events; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/PathUtilsTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.codecentric.boot.admin.server.web; 18 | 19 | import org.junit.Test; 20 | 21 | import static org.assertj.core.api.Assertions.assertThat; 22 | 23 | public class PathUtilsTest { 24 | 25 | @Test 26 | public void normalizePath() { 27 | assertThat(PathUtils.normalizePath(null)).isEqualTo(null); 28 | assertThat(PathUtils.normalizePath("")).isEqualTo(""); 29 | assertThat(PathUtils.normalizePath("/")).isEqualTo(""); 30 | assertThat(PathUtils.normalizePath("admin")).isEqualTo("/admin"); 31 | assertThat(PathUtils.normalizePath("/admin")).isEqualTo("/admin"); 32 | assertThat(PathUtils.normalizePath("/admin/")).isEqualTo("/admin"); 33 | assertThat(PathUtils.normalizePath("admin/")).isEqualTo("/admin"); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/test/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8080 3 | spring: 4 | instance: 5 | name: spring-boot-admin-server-test 6 | jmx: 7 | enabled: false 8 | logging: 9 | level: 10 | de.codecentric: DEBUG 11 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/test/resources/de/codecentric/boot/admin/server/notify/custom-mail.html: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | [[${instance.registration.name}]] ([[(${instance.id})]]) is [[${event.statusInfo.status}]] 26 | 27 | 28 | 29 |

30 | () 31 | status changed from to 32 |
33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/test/resources/de/codecentric/boot/admin/server/notify/expected-custom-mail: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 |

HELLO WORLD!

23 | application-name (cafebabe) 24 | status changed from UNKNOWN to DOWN 25 |
26 | http://localhost:8081/actuator/health 27 | 28 | 29 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/test/resources/de/codecentric/boot/admin/server/web/client/env-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "activeProfiles": [ 3 | "one" 4 | ], 5 | "propertySources": [ 6 | { 7 | "name": "server.ports", 8 | "properties": { 9 | "local.server.port": { 10 | "value": 9000 11 | } 12 | } 13 | }, 14 | { 15 | "name": "servletContextInitParams", 16 | "properties": {} 17 | }, 18 | { 19 | "name": "systemProperties", 20 | "properties": { 21 | "java.runtime.name": { 22 | "value": "OpenJDK Runtime Environment" 23 | }, 24 | "java.protocol.handler.pkgs": { 25 | "value": "org.springframework.boot.loader" 26 | }, 27 | "sun.boot.library.path": { 28 | "value": "/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64/jre/lib/amd64" 29 | } 30 | } 31 | }, 32 | { 33 | "name": "class path resource [spring-boot-starter-batch-web.properties]", 34 | "properties": { 35 | "spring.batch.job.enabled": { 36 | "value": "false" 37 | } 38 | } 39 | } 40 | ] 41 | } -------------------------------------------------------------------------------- /spring-boot-admin-server/src/test/resources/de/codecentric/boot/admin/server/web/client/env-legacy.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": [ 3 | "one" 4 | ], 5 | "server.ports": { 6 | "local.server.port": 9000 7 | }, 8 | "servletContextInitParams": {}, 9 | "systemProperties": { 10 | "java.runtime.name": "OpenJDK Runtime Environment", 11 | "java.protocol.handler.pkgs": "org.springframework.boot.loader", 12 | "sun.boot.library.path": "/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64/jre/lib/amd64" 13 | }, 14 | "class path resource [spring-boot-starter-batch-web.properties]": { 15 | "spring.batch.job.enabled": "false" 16 | } 17 | } -------------------------------------------------------------------------------- /spring-boot-admin-server/src/test/resources/de/codecentric/boot/admin/server/web/client/flyway-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "contexts": { 3 | "application": { 4 | "flywayBeans": { 5 | "flyway": { 6 | "migrations": [ 7 | { 8 | "type": "SQL", 9 | "checksum": 710039845, 10 | "version": "1", 11 | "description": "init", 12 | "script": "V1__init.sql", 13 | "state": "SUCCESS", 14 | "installedOn": "2017-12-30T11:12:18.544+0000", 15 | "executionTime": 10 16 | } 17 | ] 18 | }, 19 | "secondary": { 20 | "migrations": [ 21 | { 22 | "type": "SQL", 23 | "checksum": 710039845, 24 | "version": "1", 25 | "description": "init", 26 | "script": "V1__init.sql", 27 | "state": "SUCCESS", 28 | "installedOn": "2017-12-30T11:12:18.544+0000", 29 | "executionTime": 10 30 | } 31 | ] 32 | } 33 | } 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/test/resources/de/codecentric/boot/admin/server/web/client/flyway-legacy.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "flyway", 4 | "migrations": [ 5 | { 6 | "type": "SQL", 7 | "checksum": 710039845, 8 | "version": "1", 9 | "description": "init", 10 | "script": "V1__init.sql", 11 | "state": "SUCCESS", 12 | "installedOn": 1514632338544, 13 | "executionTime": 10 14 | } 15 | ] 16 | }, 17 | { 18 | "name": "secondary", 19 | "migrations": [ 20 | { 21 | "type": "SQL", 22 | "checksum": 710039845, 23 | "version": "1", 24 | "description": "init", 25 | "script": "V1__init.sql", 26 | "state": "SUCCESS", 27 | "installedOn": 1514632338544, 28 | "executionTime": 10 29 | } 30 | ] 31 | } 32 | ] -------------------------------------------------------------------------------- /spring-boot-admin-server/src/test/resources/de/codecentric/boot/admin/server/web/client/health-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "status": "DOWN", 3 | "details": { 4 | "info": "Hello", 5 | "sub-1": { 6 | "status": "DOWN", 7 | "details": { 8 | "info-1": false, 9 | "sub-1-1": { 10 | "status": "UP" 11 | }, 12 | "sub-1-2": { 13 | "status": "DOWN", 14 | "details": { 15 | "info-1-2": "World" 16 | } 17 | } 18 | } 19 | }, 20 | "sub-2": { 21 | "status": "UP", 22 | "details": { 23 | "info-2": 1 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /spring-boot-admin-server/src/test/resources/de/codecentric/boot/admin/server/web/client/health-legacy.json: -------------------------------------------------------------------------------- 1 | { 2 | "status": "DOWN", 3 | "info": "Hello", 4 | "sub-1": { 5 | "status": "DOWN", 6 | "info-1": false, 7 | "sub-1-1": { 8 | "status": "UP" 9 | }, 10 | "sub-1-2": { 11 | "status": "DOWN", 12 | "info-1-2": "World" 13 | } 14 | }, 15 | "sub-2": { 16 | "status": "UP", 17 | "info-2": 1 18 | } 19 | } -------------------------------------------------------------------------------- /spring-boot-admin-server/src/test/resources/de/codecentric/boot/admin/server/web/client/httptrace-legacy.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "timestamp": 1517781533427, 4 | "info": { 5 | "method": "HEAD", 6 | "path": "/actuator/liquibase", 7 | "headers": { 8 | "request": { 9 | "pragma": "no-cache", 10 | "cache-control": "no-cache", 11 | "accept": "application/json, text/plain, */*", 12 | "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36", 13 | "accept-language": "de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7", 14 | "accept-encoding": "gzip", 15 | "host": "172.17.0.17:8080", 16 | "connection": "Keep-Alive" 17 | }, 18 | "response": { 19 | "X-Application-Context": "spring-application", 20 | "status": "404" 21 | } 22 | }, 23 | "timeTaken": "2" 24 | } 25 | }, 26 | { 27 | "timestamp": "2018-02-19T17:34:51.207+0000", 28 | "info": { 29 | "method": "GET", 30 | "path": "", 31 | "headers": { 32 | "request": { 33 | "accept": "application/json, text/plain, */*", 34 | "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36", 35 | "accept-language": "de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7", 36 | "accept-encoding": "gzip, deflate, br", 37 | "x-requested-with": "XMLHttpRequest" 38 | }, 39 | "response": { 40 | "X-Application-Context": "spring-application", 41 | "Content-Type": "application/json;charset=UTF-8", 42 | "Transfer-Encoding": "chunked", 43 | "Date": "Sun, 04 Feb 2018 21:58:44 GMT", 44 | "status": "200" 45 | } 46 | } 47 | } 48 | } 49 | ] 50 | -------------------------------------------------------------------------------- /spring-boot-admin-server/src/test/resources/de/codecentric/boot/admin/server/web/client/liquibase-legacy.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "liquibase", 4 | "changeLogs": [ 5 | { 6 | "ID": "1", 7 | "AUTHOR": "marceloverdijk", 8 | "FILENAME": "classpath:/db/changelog/db.changelog-master.yaml", 9 | "DATEEXECUTED": 1514588735890, 10 | "ORDEREXECUTED": 1, 11 | "EXECTYPE": "EXECUTED", 12 | "MD5SUM": "7:b8f2ae9c88deabd32666dff9bc5d7f5d", 13 | "DESCRIPTION": "createTable tableName=person", 14 | "COMMENTS": "", 15 | "TAG": null, 16 | "LIQUIBASE": "3.5.3", 17 | "CONTEXTS": null, 18 | "LABELS": null, 19 | "DEPLOYMENT_ID": "4588735849" 20 | }, 21 | { 22 | "ID": "2", 23 | "AUTHOR": "marceloverdijk", 24 | "FILENAME": "classpath:/db/changelog/db.changelog-master.yaml", 25 | "DATEEXECUTED": 1514588735899, 26 | "ORDEREXECUTED": 2, 27 | "EXECTYPE": "EXECUTED", 28 | "MD5SUM": "7:a8006415097ebb8b3334a23347847322", 29 | "DESCRIPTION": "insert tableName=person", 30 | "COMMENTS": "", 31 | "TAG": null, 32 | "LIQUIBASE": "3.5.3", 33 | "CONTEXTS": "dev,db2", 34 | "LABELS": "hard,core", 35 | "DEPLOYMENT_ID": "4588735849" 36 | } 37 | ] 38 | }, 39 | { 40 | "name": "secondary", 41 | "changeLogs": [ 42 | { 43 | "ID": "1", 44 | "AUTHOR": "marceloverdijk", 45 | "FILENAME": "classpath:/db/changelog/db.changelog-master.yaml", 46 | "DATEEXECUTED": 1514588735890, 47 | "ORDEREXECUTED": 1, 48 | "EXECTYPE": "EXECUTED", 49 | "MD5SUM": "7:b8f2ae9c88deabd32666dff9bc5d7f5d", 50 | "DESCRIPTION": "createTable tableName=person", 51 | "COMMENTS": "", 52 | "TAG": null, 53 | "LIQUIBASE": "3.5.3", 54 | "CONTEXTS": null, 55 | "LABELS": null, 56 | "DEPLOYMENT_ID": "4588735849" 57 | } 58 | ] 59 | } 60 | ] -------------------------------------------------------------------------------- /spring-boot-admin-server/src/test/resources/de/codecentric/boot/admin/server/web/client/threaddump-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "threads": [ 3 | { 4 | "threadId": "1", 5 | "threadName": "foo" 6 | }, 7 | { 8 | "threadId": "2", 9 | "threadName": "bar" 10 | } 11 | ] 12 | } -------------------------------------------------------------------------------- /spring-boot-admin-server/src/test/resources/de/codecentric/boot/admin/server/web/client/threaddump-legacy.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "threadId": "1", 4 | "threadName": "foo" 5 | }, 6 | { 7 | "threadId": "2", 8 | "threadName": "bar" 9 | } 10 | ] -------------------------------------------------------------------------------- /spring-boot-admin-starter-client/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 4.0.0 20 | spring-boot-admin-starter-client 21 | Spring Boot Admin Client Starter 22 | Spring Boot Admin Client Starter 23 | 24 | de.codecentric 25 | spring-boot-admin-build 26 | ${revision} 27 | ../spring-boot-admin-build 28 | 29 | 30 | 31 | de.codecentric 32 | spring-boot-admin-client 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/checkstyle/checkstyle-header.txt: -------------------------------------------------------------------------------- 1 | ^\Q/*\E$ 2 | ^\Q * Copyright \E2014-20\d\d\Q the original author or authors.\E$ 3 | ^\Q *\E$ 4 | ^\Q * Licensed under the Apache License, Version 2.0 (the "License");\E$ 5 | ^\Q * you may not use this file except in compliance with the License.\E$ 6 | ^\Q * You may obtain a copy of the License at\E$ 7 | ^\Q *\E$ 8 | ^\Q * http://www.apache.org/licenses/LICENSE-2.0\E$ 9 | ^\Q *\E$ 10 | ^\Q * Unless required by applicable law or agreed to in writing, software\E$ 11 | ^\Q * distributed under the License is distributed on an "AS IS" BASIS,\E$ 12 | ^\Q * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\E$ 13 | ^\Q * See the License for the specific language governing permissions and\E$ 14 | ^\Q * limitations under the License.\E$ 15 | ^\Q */\E$ 16 | ^$ 17 | ^.*$ --------------------------------------------------------------------------------