Added CLOUD_RPC_PORT and CLOUD_RPC_SSL_ENABLED to the instructions docker-compose file
This commit is contained in:
parent
b87b74a27e
commit
fd03d333bd
@ -46,6 +46,8 @@ services:
|
||||
CLOUD_ROUTING_KEY: ${CLOUD_ROUTING_KEY}
|
||||
CLOUD_ROUTING_SECRET: ${CLOUD_ROUTING_SECRET}
|
||||
CLOUD_RPC_HOST: ${BASE_URL}
|
||||
CLOUD_RPC_PORT: ${CLOUD_RPC_PORT}
|
||||
CLOUD_RPC_SSL_ENABLED: ${CLOUD_RPC_SSL_ENABLED}
|
||||
volumes:
|
||||
- ~/.mytb-edge-data:/data
|
||||
- ~/.mytb-edge-logs:/var/log/tb-edge
|
||||
|
||||
@ -17,6 +17,7 @@ package org.thingsboard.server.service.edge.instructions;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.thingsboard.server.common.data.edge.Edge;
|
||||
@ -45,6 +46,12 @@ public class DefaultEdgeInstallService implements EdgeInstallService {
|
||||
|
||||
private final InstallScripts installScripts;
|
||||
|
||||
@Value("${edges.rpc.port}")
|
||||
private int rpcPort;
|
||||
|
||||
@Value("${edges.rpc.ssl.enabled}")
|
||||
private boolean sslEnabled;
|
||||
|
||||
@Override
|
||||
public EdgeInstallInstructions getDockerInstallInstructions(TenantId tenantId, Edge edge, HttpServletRequest request) {
|
||||
String dockerInstallInstructions = readFile(resolveFile("docker", "instructions.md"));
|
||||
@ -59,6 +66,8 @@ public class DefaultEdgeInstallService implements EdgeInstallService {
|
||||
}
|
||||
dockerInstallInstructions = dockerInstallInstructions.replace("${CLOUD_ROUTING_KEY}", edge.getRoutingKey());
|
||||
dockerInstallInstructions = dockerInstallInstructions.replace("${CLOUD_ROUTING_SECRET}", edge.getSecret());
|
||||
dockerInstallInstructions = dockerInstallInstructions.replace("${CLOUD_RPC_PORT}", Integer.toString(rpcPort));
|
||||
dockerInstallInstructions = dockerInstallInstructions.replace("${CLOUD_RPC_SSL_ENABLED}", Boolean.toString(sslEnabled));
|
||||
return new EdgeInstallInstructions(dockerInstallInstructions);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user