@@ -1,7 +1,7 @@
|
|||||||
FROM docker.io/library/maven:3.9.2-eclipse-temurin-17 AS build-hapi
|
FROM docker.io/library/maven:3.9.4-eclipse-temurin-17 AS build-hapi
|
||||||
WORKDIR /tmp/hapi-fhir-jpaserver-starter
|
WORKDIR /tmp/hapi-fhir-jpaserver-starter
|
||||||
|
|
||||||
ARG OPENTELEMETRY_JAVA_AGENT_VERSION=1.26.0
|
ARG OPENTELEMETRY_JAVA_AGENT_VERSION=1.31.0
|
||||||
RUN curl -LSsO https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v${OPENTELEMETRY_JAVA_AGENT_VERSION}/opentelemetry-javaagent.jar
|
RUN curl -LSsO https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v${OPENTELEMETRY_JAVA_AGENT_VERSION}/opentelemetry-javaagent.jar
|
||||||
|
|
||||||
COPY pom.xml .
|
COPY pom.xml .
|
||||||
@@ -12,7 +12,7 @@ COPY src/ /tmp/hapi-fhir-jpaserver-starter/src/
|
|||||||
RUN mvn clean install -DskipTests -Djdk.lang.Process.launchMechanism=vfork
|
RUN mvn clean install -DskipTests -Djdk.lang.Process.launchMechanism=vfork
|
||||||
|
|
||||||
FROM build-hapi AS build-distroless
|
FROM build-hapi AS build-distroless
|
||||||
RUN mvn package spring-boot:repackage -Pboot
|
RUN mvn package -DskipTests spring-boot:repackage -Pboot
|
||||||
RUN mkdir /app && cp /tmp/hapi-fhir-jpaserver-starter/target/ROOT.war /app/main.war
|
RUN mkdir /app && cp /tmp/hapi-fhir-jpaserver-starter/target/ROOT.war /app/main.war
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import ca.uhn.fhir.jpa.starter.AppProperties;
|
|||||||
import ca.uhn.fhir.jpa.starter.util.JpaHibernatePropertiesProvider;
|
import ca.uhn.fhir.jpa.starter.util.JpaHibernatePropertiesProvider;
|
||||||
import ca.uhn.fhir.jpa.subscription.match.deliver.email.EmailSenderImpl;
|
import ca.uhn.fhir.jpa.subscription.match.deliver.email.EmailSenderImpl;
|
||||||
import ca.uhn.fhir.jpa.subscription.match.deliver.email.IEmailSender;
|
import ca.uhn.fhir.jpa.subscription.match.deliver.email.IEmailSender;
|
||||||
import ca.uhn.fhir.rest.server.mail.IMailSvc;
|
|
||||||
import ca.uhn.fhir.rest.server.mail.MailConfig;
|
import ca.uhn.fhir.rest.server.mail.MailConfig;
|
||||||
import ca.uhn.fhir.rest.server.mail.MailSvc;
|
import ca.uhn.fhir.rest.server.mail.MailSvc;
|
||||||
import com.google.common.base.Strings;
|
import com.google.common.base.Strings;
|
||||||
@@ -221,21 +220,23 @@ public class FhirServerConfigCommon {
|
|||||||
@Bean
|
@Bean
|
||||||
public IEmailSender emailSender(AppProperties appProperties) {
|
public IEmailSender emailSender(AppProperties appProperties) {
|
||||||
if (appProperties.getSubscription() != null && appProperties.getSubscription().getEmail() != null) {
|
if (appProperties.getSubscription() != null && appProperties.getSubscription().getEmail() != null) {
|
||||||
MailConfig mailConfig = new MailConfig();
|
|
||||||
|
|
||||||
AppProperties.Subscription.Email email = appProperties.getSubscription().getEmail();
|
return buildEmailSender(appProperties.getSubscription().getEmail());
|
||||||
mailConfig.setSmtpHostname(email.getHost());
|
|
||||||
mailConfig.setSmtpPort(email.getPort());
|
|
||||||
mailConfig.setSmtpUsername(email.getUsername());
|
|
||||||
mailConfig.setSmtpPassword(email.getPassword());
|
|
||||||
mailConfig.setSmtpUseStartTLS(email.getStartTlsEnable());
|
|
||||||
|
|
||||||
IMailSvc mailSvc = new MailSvc(mailConfig);
|
|
||||||
IEmailSender emailSender = new EmailSenderImpl(mailSvc);
|
|
||||||
|
|
||||||
return emailSender;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
// Return a dummy anonymous function instead of null. Spring does not like null beans.
|
||||||
|
// TODO Get the signature of ca.uhn.fhir.jpa.subscription.channel.subscription.SubscriptionDeliveryHandlerFactory
|
||||||
|
// changed so it does not require an instance of an IEmailSender
|
||||||
|
return theDetails -> {};
|
||||||
|
}
|
||||||
|
|
||||||
|
private static IEmailSender buildEmailSender(AppProperties.Subscription.Email email) {
|
||||||
|
|
||||||
|
return new EmailSenderImpl(new MailSvc(new MailConfig()
|
||||||
|
.setSmtpHostname(email.getHost())
|
||||||
|
.setSmtpPort(email.getPort())
|
||||||
|
.setSmtpUsername(email.getUsername())
|
||||||
|
.setSmtpPassword(email.getPassword())
|
||||||
|
.setSmtpUseStartTLS(email.getStartTlsEnable())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user