fix: wrong base url for staging env (#28)
* fix: wrong base url for staging env * fix: wrong var changed domain
This commit is contained in:
@@ -2,11 +2,19 @@
|
||||
"image": "mcr.microsoft.com/devcontainers/java:25-trixie",
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/java:1": {
|
||||
"installMaven": true,
|
||||
"version": "latest",
|
||||
"jdkDistro": "tem",
|
||||
"installMaven": true,
|
||||
"gradleVersion": "latest",
|
||||
"mavenVersion": "latest",
|
||||
"installGradle": "false"
|
||||
"antVersion": "latest",
|
||||
"groovyVersion": "latest"
|
||||
},
|
||||
"ghcr.io/devcontainers/features/node:1": {
|
||||
"installYarnUsingApt": true,
|
||||
"version": "lts",
|
||||
"pnpmVersion": "latest",
|
||||
"nvmVersion": "latest"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@
|
||||
<surefire.version>3.5.5</surefire.version>
|
||||
<jacoco.version>0.8.14</jacoco.version>
|
||||
<checkstyle.version>3.6.0</checkstyle.version>
|
||||
<springboot.version>4.0.3</springboot.version>
|
||||
<springboot.version>4.0.5</springboot.version>
|
||||
<jjwt.version>0.12.6</jjwt.version>
|
||||
</properties>
|
||||
|
||||
|
||||
@@ -29,10 +29,10 @@ import org.springframework.web.client.RestTemplate;
|
||||
@Service
|
||||
public class MailgunEmailService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(MailgunEmailService.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(MailgunEmailService.class.getName());
|
||||
private final RestTemplate restTemplate;
|
||||
private final String targetEnv;
|
||||
private String domain;
|
||||
private final String domain;
|
||||
private String senderEmail;
|
||||
|
||||
/**
|
||||
@@ -73,6 +73,8 @@ public class MailgunEmailService {
|
||||
String subject = "TaskNote App confirmation email";
|
||||
String link = getBaseUrl() + "/email-confirmation?identification=%s";
|
||||
|
||||
logger.info("New user link: {}", link);
|
||||
|
||||
MailgunTemplateSignUp signUpTemplate = new MailgunTemplateSignUp();
|
||||
signUpTemplate.setConfirmationLink(String.format(link, user.getEmailUuid().toString()));
|
||||
|
||||
@@ -91,6 +93,8 @@ public class MailgunEmailService {
|
||||
String subject = "TaskNote App password reset";
|
||||
String link = getBaseUrl() + "/finish-reset-password?token=%s";
|
||||
|
||||
logger.info("Password reset link: {}", link);
|
||||
|
||||
MailgunTemplateResetPwd resetTemplate = new MailgunTemplateResetPwd();
|
||||
resetTemplate.setResetLink(String.format(link, user.getResetToken()));
|
||||
|
||||
@@ -184,7 +188,10 @@ public class MailgunEmailService {
|
||||
if ("development".equals(targetEnv) || Objects.isNull(targetEnv)) {
|
||||
return "http://localhost:5000";
|
||||
}
|
||||
String stage = targetEnv.equals("stage") ? "stage." : "";
|
||||
return String.format("https://%s%s", stage, domain);
|
||||
String baseUrl = domain;
|
||||
if (targetEnv.equals("staging")) {
|
||||
baseUrl = "tasknote-stg" + domain.substring(8);
|
||||
}
|
||||
return String.format("https://%s", baseUrl);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -257,7 +257,7 @@ resource "kubernetes_deployment_v1" "tasknote_stg_backend" {
|
||||
}
|
||||
env {
|
||||
name = "TARGET_ENV"
|
||||
value = "production"
|
||||
value = "staging"
|
||||
}
|
||||
env {
|
||||
name = "MAILGUN_APIKEY"
|
||||
|
||||
Reference in New Issue
Block a user