Skip to content
Permalink
Browse files

优化配置

  • Loading branch information...
zhou-hao committed Jan 22, 2019
1 parent 0efe06b commit 22139567759d546a0aa00d98df859457da31db99
@@ -16,7 +16,7 @@ services:
volumes:
- "user-database:/var/lib/mysql"
ports:
- 3306
- "3306:3306"
restart: always
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --sql-mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
environment:
@@ -34,10 +34,10 @@
<!--<scope>provided</scope>-->
</dependency>

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<!--<dependency>-->
<!--<groupId>org.springframework.cloud</groupId>-->
<!--<artifactId>spring-cloud-starter-config</artifactId>-->
<!--</dependency>-->

<dependency>
<groupId>org.springframework.boot</groupId>
@@ -48,7 +48,10 @@ hsweb:
iot-cloud-user: offlineOther #异地登录模式,踢出其他地方登录的用户
socket:
max-text-message-buffer-size: 10485760

users:
gateway-user:
username: gateway-server
password: admin
eureka:
client:
service-url:
@@ -182,7 +182,7 @@ menus.forEach(function (menu) {
autz_menu.push({
id: org.hswebframework.web.id.IDGenerator.MD5.generate(),
parentId: "-1",
menid: menu.id,
menId: menu.id,
status: 1,
"settingId": autz_setting[0].id,
"path": "-"
@@ -1,5 +1,6 @@
package org.hswebframework.iot.interaction.vertx;

import com.netflix.discovery.EurekaClient;
import io.vertx.core.DeploymentOptions;
import io.vertx.core.Vertx;
import io.vertx.core.VertxOptions;
@@ -19,6 +20,7 @@
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -48,12 +50,6 @@ public VertxOptions vertxOptions() {
return new VertxOptions();
}

@Bean
@ConfigurationProperties(prefix = "vertx.mqtt")
public MqttServerOptions mqttServerOptions() {
return new MqttServerOptions();
}

@Bean
@ConfigurationProperties(prefix = "vertx.mqtt.pfx")
public MqttSslProperties mqttSslProperties() {
@@ -73,13 +69,16 @@ public MqttServerOptions mqttServerOptions(MqttSslProperties sslProperties) {
MqttServerOptions serverOptions = new MqttServerOptions();
PfxOptions pfxOptions = new PfxOptions();
pfxOptions.setPassword(sslProperties.getPassword());
serverOptions.setSsl(true).setPfxKeyCertOptions(pfxOptions);
if (StringUtils.hasText(sslProperties.valueBase64)) {
pfxOptions.setValue(Buffer.buffer(Base64.decodeBase64(sslProperties.valueBase64)));
} else {
} else if (StringUtils.hasText(sslProperties.path)) {
pfxOptions.setPath(sslProperties.path);
} else {
serverOptions.setSsl(false);
}
serverOptions.setSsl(true)
.setPfxKeyCertOptions(pfxOptions);


return serverOptions;
}

@@ -148,7 +147,7 @@ public void run(String... args) throws Exception {
if (!e.succeeded()) {
log.error("deploy verticle :{} error", suplier, e.succeeded(), e.cause());
} else {
log.debug("deploy verticle :{} success",suplier);
log.debug("deploy verticle :{} success", suplier);
}
});
}
@@ -159,11 +158,11 @@ public void run(String... args) throws Exception {
@Setter
public static class MqttSslProperties {

private String path = "mqtt.pfx";
private String path;

private String valueBase64;

private String password = "";
private String password;

}
}

0 comments on commit 2213956

Please sign in to comment.
You can’t perform that action at this time.