Skip to content

Commit

Permalink
Tweak spring boot properties to allow access to management endpoints (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
labkey-tchad authored Jan 5, 2024
1 parent a22092c commit 89052b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions server/configs/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ mail.smtpUser=@@smtpUser@@

#useLocalBuild#spring.devtools.restart.additional-paths=@@pathToServer@@/build/deploy/modules,@@pathToServer@@/build/deploy/embedded/config

# Make management endpoints accessible with LabKey at ROOT context path
server.servlet.context-path=/actuator
management.endpoints.web.base-path=/
#Enable shutdown endpoint
management.endpoint.shutdown.enabled=true
# turn off other endpoints
Expand Down
5 changes: 4 additions & 1 deletion server/embedded/src/org/labkey/embedded/LabKeyServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.labkey.filters.ContentSecurityPolicyFilter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.ApplicationPidFileWriter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.embedded.tomcat.TomcatWebServer;
Expand Down Expand Up @@ -56,7 +57,9 @@ public static void main(String[] args)
System.setProperty(TERMINATE_ON_STARTUP_FAILURE, "true");
}

SpringApplication.run(LabKeyServer.class, args);
SpringApplication application = new SpringApplication(LabKeyServer.class);
application.addListeners(new ApplicationPidFileWriter("./labkey.pid"));
application.run(args);
}

@Bean
Expand Down

0 comments on commit 89052b4

Please sign in to comment.