Skip to content
Snippets Groups Projects
Commit b7cac7a0 authored by 천 진강's avatar 천 진강
Browse files

refactor: 개방 포트 변경

parent 37b5c9d3
No related tags found
No related merge requests found
......@@ -19,5 +19,5 @@ RUN chmod +x /usr/local/bin/lego
WORKDIR /app
COPY --from=build /home/gradle/project/build/libs/*.jar app.jar
EXPOSE 8080
EXPOSE 8888
ENTRYPOINT ["java", "-jar", "app.jar"]
......@@ -129,7 +129,7 @@ public class ForwardingService {
}
/* nginx test */
String url = "http://nginx:8081/nginx-api/test";
String url = "http://localhost:8081/nginx-api/test";
try {
restTemplate.getForEntity(url, String.class);
} catch (HttpServerErrorException.InternalServerError e) {
......@@ -146,7 +146,7 @@ public class ForwardingService {
}
/* nginx reload */
url = "http://nginx:8081/nginx-api/reload";
url = "http://localhost:8081/nginx-api/reload";
try {
restTemplate.getForEntity(url, String.class);
} catch (HttpServerErrorException.InternalServerError e) {
......@@ -186,6 +186,9 @@ public class ForwardingService {
throw new CustomException(ErrorCode.DUPLICATED_INSTANCE_INFO);
}
if (!(dto.getInstanceIp() == null) && !dto.getInstanceIp().startsWith("10.16."))
throw new CustomException(ErrorCode.INVALID_CONF_INPUT, "허용되지 않은 IP대역입니다");
/* 파일 수정 */
forwarding.edit(dto);
String content = forwardingTemplate.getPortForwardingWithTCP(forwarding.getServerPort(),
......@@ -213,7 +216,7 @@ public class ForwardingService {
}
/* nginx test */
String url = "http://nginx:8081/nginx-api/test";
String url = "http://localhost:8081/nginx-api/test";
try {
restTemplate.getForEntity(url, String.class);
} catch (RuntimeException e) {
......@@ -229,7 +232,7 @@ public class ForwardingService {
}
/* nginx reload */
url = "http://nginx:8081/nginx-api/reload";
url = "http://localhost:8081/nginx-api/reload";
try {
restTemplate.getForEntity(url, String.class);
} catch (RuntimeException e) {
......@@ -265,7 +268,7 @@ public class ForwardingService {
}
/* nginx test */
String url = "http://nginx:8081/nginx-api/test";
String url = "http://localhost:8081/nginx-api/test";
try {
restTemplate.getForEntity(url, String.class);
} catch (Exception e) {
......@@ -278,7 +281,7 @@ public class ForwardingService {
}
/* nginx reload */
url = "http://nginx:8081/nginx-api/reload";
url = "http://localhost:8081/nginx-api/reload";
try {
restTemplate.getForEntity(url, String.class);
} catch (Exception e) {
......@@ -303,5 +306,8 @@ public class ForwardingService {
throw new CustomException(ErrorCode.INVALID_CONF_INPUT, violation.getMessage());
}
if (!dto.getInstanceIp().startsWith("10.16."))
throw new CustomException(ErrorCode.INVALID_CONF_INPUT, "허용되지 않은 IP대역입니다");
}
}
......@@ -137,7 +137,7 @@ public class RoutingService {
}
/* nginx test */
String url = "http://nginx:8081/nginx-api/test";
String url = "http://localhost:8081/nginx-api/test";
try {
restTemplate.getForEntity(url, String.class);
......@@ -160,7 +160,7 @@ public class RoutingService {
}
/* nginx reload */
url = "http://nginx:8081/nginx-api/reload";
url = "http://localhost:8081/nginx-api/reload";
try {
restTemplate.getForEntity(url, String.class);
} catch (Exception e) {
......@@ -186,6 +186,9 @@ public class RoutingService {
throw new CustomException(ErrorCode.DUPLICATED_DOMAIN_NAME);
}
if ((dto.getIp() != null) && !dto.getIp().startsWith("10.16."))
throw new CustomException(ErrorCode.INVALID_CONF_INPUT, "허용되지 않은 IP대역입니다");
/* SSL 인증서 조회 */
Certificate certificate;
if (dto.getCertificateId() == null) {
......@@ -224,7 +227,7 @@ public class RoutingService {
}
/* nginx test */
String url = "http://nginx:8081/nginx-api/test";
String url = "http://localhost:8081/nginx-api/test";
try {
restTemplate.getForEntity(url, String.class);
} catch (HttpClientErrorException | HttpServerErrorException e) {
......@@ -249,7 +252,7 @@ public class RoutingService {
}
/* nginx reload */
url = "http://nginx:8081/nginx-api/reload";
url = "http://localhost:8081/nginx-api/reload";
try {
restTemplate.getForEntity(url, String.class);
} catch (RuntimeException e) {
......@@ -285,7 +288,7 @@ public class RoutingService {
}
/* nginx test */
String url = "http://nginx:8081/nginx-api/test";
String url = "http://localhost:8081/nginx-api/test";
try {
restTemplate.getForEntity(url, String.class);
} catch (Exception e) {
......@@ -298,7 +301,7 @@ public class RoutingService {
}
/* nginx reload */
url = "http://nginx:8081/nginx-api/reload";
url = "http://localhost:8081/nginx-api/reload";
try {
restTemplate.getForEntity(url, String.class);
} catch (Exception e) {
......@@ -321,5 +324,8 @@ public class RoutingService {
throw new CustomException(ErrorCode.INVALID_CONF_INPUT, violation.getMessage());
}
if (!dto.getIp().startsWith("10.16."))
throw new CustomException(ErrorCode.INVALID_CONF_INPUT, "허용되지 않은 IP대역입니다");
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment