add config parameter

This commit is contained in:
Anton Romanov 2018-11-08 20:08:26 +04:00
parent 1958e01d01
commit 4c43776528
6 changed files with 35 additions and 10 deletions

View File

@ -15,6 +15,16 @@ public class ApplicationProperties {
private String undeadUserLogin; private String undeadUserLogin;
private boolean devMode; private boolean devMode;
private boolean useHttps;
public boolean isUseHttps() {
return useHttps;
}
public void setUseHttps(boolean useHttps) {
this.useHttps = useHttps;
}
public String getBaseUrl() { public String getBaseUrl() {
return baseUrl; return baseUrl;
} }

View File

@ -86,6 +86,7 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
.deleteCookies(Constants.COOKIES_NAME) .deleteCookies(Constants.COOKIES_NAME)
.permitAll(); .permitAll();
} }
if (applicationProperties.isUseHttps()) {
http.portMapper() http.portMapper()
.http(httpPort) .http(httpPort)
.mapsTo(httpsPort) .mapsTo(httpsPort)
@ -95,6 +96,8 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
.requiresSecure(); .requiresSecure();
} }
}
@Override @Override
public void configure(WebSecurity web) { public void configure(WebSecurity web) {
web.ignoring() web.ignoring()

View File

@ -18,8 +18,7 @@ public class StrategyEntityCreateExecutor {
} }
//@Scheduled(cron = "0 0 8 * * *") @Scheduled(cron = "0 0 8 * * *")
@Scheduled(cron = "0 */5 * * * *")
public void scheduleExecuteStrategies() { public void scheduleExecuteStrategies() {
entityCreateStrategies.forEach(strategy -> strategy.createEntityIfNeed(userService.findAll())); entityCreateStrategies.forEach(strategy -> strategy.createEntityIfNeed(userService.findAll()));
} }

View File

@ -35,3 +35,4 @@ liquibase.change-log=classpath:db/changelog-master.xml
ng-tracker.base-url=https://127.0.0.1:8443 ng-tracker.base-url=https://127.0.0.1:8443
ng-tracker.undead-user-login=admin ng-tracker.undead-user-login=admin
ng-tracker.dev-mode=true ng-tracker.dev-mode=true
ng-tracker.use-https=false

View File

@ -0,0 +1,11 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">
<changeSet author="orion" id="20181108_000000-1">
<sql>
update users
set email = 'romanov73@gmail.com' where id = 1;
</sql>
</changeSet>
</databaseChangeLog>

View File

@ -13,4 +13,5 @@
<include file="db/changelog-20180505_000000-schema.xml"/> <include file="db/changelog-20180505_000000-schema.xml"/>
<include file="db/changelog-20181027_000000-schema.xml"/> <include file="db/changelog-20181027_000000-schema.xml"/>
<include file="db/changelog-20181030_000000-schema.xml"/> <include file="db/changelog-20181030_000000-schema.xml"/>
<include file="db/changelog-20181108_000000-data.xml"/>
</databaseChangeLog> </databaseChangeLog>