From 6d1e79d97573218b51053d41af4f9328a1e6921f Mon Sep 17 00:00:00 2001 From: Alexander Alexeev Date: Wed, 30 Nov 2016 15:33:13 +0700 Subject: notification properties are added to example configuration --- .../configuration/NotificationsAppConfiguration.java | 12 ++++++------ juick-server/src/main/resources/juick.conf.example | 6 ++++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/juick-notifications/src/main/java/com/juick/components/configuration/NotificationsAppConfiguration.java b/juick-notifications/src/main/java/com/juick/components/configuration/NotificationsAppConfiguration.java index ff3a5a5a..67a551c4 100644 --- a/juick-notifications/src/main/java/com/juick/components/configuration/NotificationsAppConfiguration.java +++ b/juick-notifications/src/main/java/com/juick/components/configuration/NotificationsAppConfiguration.java @@ -1,12 +1,10 @@ package com.juick.components.configuration; import com.juick.components.Notifications; -import com.juick.configuration.DataConfiguration; import com.notnoop.apns.APNS; import com.notnoop.apns.ApnsService; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Import; import org.springframework.context.annotation.PropertySource; import org.springframework.core.env.Environment; import org.springframework.http.client.ClientHttpRequestInterceptor; @@ -30,10 +28,11 @@ public class NotificationsAppConfiguration { @Bean public RestTemplate rest() { RestTemplate rest = new RestTemplate(); - List interceptors = Collections - .singletonList( - new BasicAuthorizationInterceptor(env.getProperty("api_user", "juick"), - env.getProperty("api_password", "secret"))); + List interceptors = Collections.singletonList( + new BasicAuthorizationInterceptor( + env.getProperty("api_user", "juick"), + env.getProperty("api_password", "secret"))); + rest.setRequestFactory(new InterceptingClientHttpRequestFactory(rest.getRequestFactory(), interceptors)); return rest; } @@ -42,6 +41,7 @@ public class NotificationsAppConfiguration { public Notifications push() { return new Notifications(env, rest()); } + @Bean public ApnsService apns() { return APNS.newService().withCert(env.getProperty("ios_pkcs12_file"), env.getProperty("ios_pkcs12_password")) diff --git a/juick-server/src/main/resources/juick.conf.example b/juick-server/src/main/resources/juick.conf.example index e8ebf5d3..6a931ab5 100644 --- a/juick-server/src/main/resources/juick.conf.example +++ b/juick-server/src/main/resources/juick.conf.example @@ -43,6 +43,12 @@ template.showSponsors=false # Show Sape scripts template.showSape=true +api_user=juick +api_password=secret + +ios_pkcs12_file= +ios_pkcs12_password=secret + twitter_consumer_key= twitter_consumer_secret= -- cgit v1.2.3