diff --git a/src/main/java/ru/ulstu/configuration/ApplicationProperties.java b/src/main/java/ru/ulstu/configuration/ApplicationProperties.java index b89641a..8615cb2 100644 --- a/src/main/java/ru/ulstu/configuration/ApplicationProperties.java +++ b/src/main/java/ru/ulstu/configuration/ApplicationProperties.java @@ -15,6 +15,16 @@ public class ApplicationProperties { private String undeadUserLogin; private boolean devMode; + private boolean useHttps; + + public boolean isUseHttps() { + return useHttps; + } + + public void setUseHttps(boolean useHttps) { + this.useHttps = useHttps; + } + public String getBaseUrl() { return baseUrl; } diff --git a/src/main/java/ru/ulstu/configuration/SecurityConfiguration.java b/src/main/java/ru/ulstu/configuration/SecurityConfiguration.java index c0f34d6..da498fa 100644 --- a/src/main/java/ru/ulstu/configuration/SecurityConfiguration.java +++ b/src/main/java/ru/ulstu/configuration/SecurityConfiguration.java @@ -86,13 +86,16 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { .deleteCookies(Constants.COOKIES_NAME) .permitAll(); } - http.portMapper() - .http(httpPort) - .mapsTo(httpsPort) - .and() - .requiresChannel() - .anyRequest() - .requiresSecure(); + if (applicationProperties.isUseHttps()) { + http.portMapper() + .http(httpPort) + .mapsTo(httpsPort) + .and() + .requiresChannel() + .anyRequest() + .requiresSecure(); + } + } @Override diff --git a/src/main/java/ru/ulstu/strategy/api/StrategyEntityCreateExecutor.java b/src/main/java/ru/ulstu/strategy/api/StrategyEntityCreateExecutor.java index 97cd5ef..c3d4d95 100644 --- a/src/main/java/ru/ulstu/strategy/api/StrategyEntityCreateExecutor.java +++ b/src/main/java/ru/ulstu/strategy/api/StrategyEntityCreateExecutor.java @@ -18,8 +18,7 @@ public class StrategyEntityCreateExecutor { } - //@Scheduled(cron = "0 0 8 * * *") - @Scheduled(cron = "0 */5 * * * *") + @Scheduled(cron = "0 0 8 * * *") public void scheduleExecuteStrategies() { entityCreateStrategies.forEach(strategy -> strategy.createEntityIfNeed(userService.findAll())); } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 9544a7e..e696ccd 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -34,4 +34,5 @@ liquibase.change-log=classpath:db/changelog-master.xml # Application Settings ng-tracker.base-url=https://127.0.0.1:8443 ng-tracker.undead-user-login=admin -ng-tracker.dev-mode=true \ No newline at end of file +ng-tracker.dev-mode=true +ng-tracker.use-https=false \ No newline at end of file diff --git a/src/main/resources/db/changelog-20181108_000000-data.xml b/src/main/resources/db/changelog-20181108_000000-data.xml new file mode 100644 index 0000000..834bb58 --- /dev/null +++ b/src/main/resources/db/changelog-20181108_000000-data.xml @@ -0,0 +1,11 @@ + + + + + update users + set email = 'romanov73@gmail.com' where id = 1; + + + diff --git a/src/main/resources/db/changelog-master.xml b/src/main/resources/db/changelog-master.xml index bd52f71..fe8d7d6 100644 --- a/src/main/resources/db/changelog-master.xml +++ b/src/main/resources/db/changelog-master.xml @@ -13,4 +13,5 @@ + \ No newline at end of file