mirror of https://github.com/halo-dev/halo
Add spring.config.additional-location default config
parent
847828cd14
commit
89a3d76160
|
@ -27,6 +27,8 @@ public class Application {
|
||||||
private final static Logger LOG = Logger.getLogger(Application.class);
|
private final static Logger LOG = Logger.getLogger(Application.class);
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
System.setProperty("spring.config.additional-location", "file:${user.home}/halo/");
|
||||||
|
|
||||||
// Run application
|
// Run application
|
||||||
SpringApplication.run(Application.class, args);
|
SpringApplication.run(Application.class, args);
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,9 +86,10 @@ public class StartedListener implements ApplicationListener<ApplicationStartedEv
|
||||||
}
|
}
|
||||||
|
|
||||||
private void printStartInfo() {
|
private void printStartInfo() {
|
||||||
String blogUrl = getBlogUrl();
|
String blogUrl = getBaseUrl();
|
||||||
|
|
||||||
log.info("Halo started at {}", blogUrl);
|
log.info("Halo started at {}", blogUrl);
|
||||||
|
// TODO admin may be changeable
|
||||||
log.info("Halo admin is at {}/admin", blogUrl);
|
log.info("Halo admin is at {}/admin", blogUrl);
|
||||||
if (!haloProperties.getDocDisabled()) {
|
if (!haloProperties.getDocDisabled()) {
|
||||||
log.debug("Halo doc enable at {}/swagger-ui.html", blogUrl);
|
log.debug("Halo doc enable at {}/swagger-ui.html", blogUrl);
|
||||||
|
@ -100,7 +101,7 @@ public class StartedListener implements ApplicationListener<ApplicationStartedEv
|
||||||
*
|
*
|
||||||
* @return blog url (If blog url isn't present, current machine IP address will be default)
|
* @return blog url (If blog url isn't present, current machine IP address will be default)
|
||||||
*/
|
*/
|
||||||
private String getBlogUrl() {
|
private String getBaseUrl() {
|
||||||
// Get server port
|
// Get server port
|
||||||
String serverPort = applicationContext.getEnvironment().getProperty("server.port", "8080");
|
String serverPort = applicationContext.getEnvironment().getProperty("server.port", "8080");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue