mirror of https://github.com/halo-dev/halo
Initialize work directory when starting up
parent
26c0192517
commit
0134924052
|
@ -124,7 +124,7 @@ public class HaloConfiguration {
|
||||||
adminAuthenticationFilter.addExcludeUrlPatterns(
|
adminAuthenticationFilter.addExcludeUrlPatterns(
|
||||||
"/api/admin/login",
|
"/api/admin/login",
|
||||||
"/api/admin/installations",
|
"/api/admin/installations",
|
||||||
"/api/admin/recoveries/migration/*"
|
"/api/admin/recoveries/migrations/*"
|
||||||
);
|
);
|
||||||
adminAuthenticationFilter.addTryAuthUrlMethodPattern("/api/admin/comments", HttpMethod.POST.name());
|
adminAuthenticationFilter.addTryAuthUrlMethodPattern("/api/admin/comments", HttpMethod.POST.name());
|
||||||
adminAuthenticationFilter.addTryAuthUrlMethodPattern("/api/comments", HttpMethod.POST.name());
|
adminAuthenticationFilter.addTryAuthUrlMethodPattern("/api/comments", HttpMethod.POST.name());
|
||||||
|
|
|
@ -1,8 +1,12 @@
|
||||||
package run.halo.app.config.properties;
|
package run.halo.app.config.properties;
|
||||||
|
|
||||||
import run.halo.app.model.support.HaloConst;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import run.halo.app.model.support.HaloConst;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Halo configuration properties.
|
* Halo configuration properties.
|
||||||
|
@ -31,5 +35,9 @@ public class HaloProperties {
|
||||||
/**
|
/**
|
||||||
* Work directory.
|
* Work directory.
|
||||||
*/
|
*/
|
||||||
private String workDir = HaloConst.USER_HOME + "/halo/";
|
private String workDir = HaloConst.USER_HOME + "/.halo/";
|
||||||
|
|
||||||
|
public HaloProperties() throws IOException {
|
||||||
|
Files.createDirectories(Paths.get(workDir));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ spring:
|
||||||
|
|
||||||
# H2database 配置
|
# H2database 配置
|
||||||
driver-class-name: org.h2.Driver
|
driver-class-name: org.h2.Driver
|
||||||
url: jdbc:h2:file:~/halo/db/halo
|
url: jdbc:h2:file:~/.halo/db/halo
|
||||||
username: admin
|
username: admin
|
||||||
password: 123456
|
password: 123456
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue