mirror of https://github.com/halo-dev/halo
parent
4197ca33d8
commit
e7addd41f9
12
build.gradle
12
build.gradle
|
@ -40,14 +40,10 @@ configurations {
|
|||
}
|
||||
|
||||
|
||||
springBoot {
|
||||
buildInfo()
|
||||
}
|
||||
|
||||
// gradle 的 Property Expansion 的占位符 ${..} 与 springboot 的占位符 冲突, springboot 的需要转义 \${..}
|
||||
processResources {
|
||||
filesMatching("application.yaml") {
|
||||
expand(project.properties)
|
||||
bootJar {
|
||||
manifest {
|
||||
attributes("Implementation-Title": "Halo Application",
|
||||
"Implementation-Version": archiveVersion)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@ import lombok.extern.slf4j.Slf4j;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.boot.info.BuildProperties;
|
||||
import org.springframework.boot.web.client.RestTemplateBuilder;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
@ -17,10 +16,8 @@ import run.halo.app.cache.InMemoryCacheStore;
|
|||
import run.halo.app.cache.LevelCacheStore;
|
||||
import run.halo.app.cache.RedisCacheStore;
|
||||
import run.halo.app.config.properties.HaloProperties;
|
||||
import run.halo.app.model.support.HaloConst;
|
||||
import run.halo.app.utils.HttpClientUtils;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.security.KeyManagementException;
|
||||
import java.security.KeyStoreException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
@ -38,9 +35,6 @@ public class HaloConfiguration {
|
|||
@Autowired
|
||||
HaloProperties haloProperties;
|
||||
|
||||
@Autowired
|
||||
BuildProperties buildProperties;
|
||||
|
||||
@Bean
|
||||
public ObjectMapper objectMapper(Jackson2ObjectMapperBuilder builder) {
|
||||
builder.failOnEmptyBeans(false);
|
||||
|
@ -78,9 +72,4 @@ public class HaloConfiguration {
|
|||
return stringCacheStore;
|
||||
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
HaloConst.HALO_VERSION = buildProperties.getVersion();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -134,13 +134,19 @@ public class HaloConst {
|
|||
* Database product name.
|
||||
*/
|
||||
public static String DATABASE_PRODUCT_NAME = null;
|
||||
|
||||
/**
|
||||
* Version constant. (Available in production environment)
|
||||
*/
|
||||
public static final String HALO_VERSION;
|
||||
|
||||
/**
|
||||
* user_session
|
||||
*/
|
||||
public static String USER_SESSION_KEY = "user_session";
|
||||
|
||||
/**
|
||||
* Version constant.
|
||||
*/
|
||||
public static String HALO_VERSION = null;
|
||||
static {
|
||||
// Set version
|
||||
HALO_VERSION = HaloConst.class.getPackage().getImplementationVersion();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,9 +62,4 @@ halo:
|
|||
auth-enabled: true
|
||||
mode: demo
|
||||
workDir: ${user.home}/halo-demo/
|
||||
cache: level
|
||||
# use redis as cache to support halo deployment
|
||||
# cache: redis
|
||||
# cache-redis-nodes: ['127.0.0.1:6380', '127.0.0.1:6379']
|
||||
# cache-redis-password: 123456
|
||||
#
|
||||
cache: memory
|
||||
|
|
|
@ -32,6 +32,10 @@ halo:
|
|||
# Your admin client path is https://your-domain/{admin-path}
|
||||
admin-path: admin
|
||||
|
||||
# memory or level
|
||||
# memory, level, redis
|
||||
cache: memory
|
||||
|
||||
# if cache = redis, you need to set the following options
|
||||
# cache-redis-nodes: ['127.0.0.1:6380', '127.0.0.1:6379']
|
||||
# cache-redis-password: 123456
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ spring:
|
|||
multipart:
|
||||
max-file-size: 10240MB
|
||||
max-request-size: 10240MB
|
||||
location: \${java.io.tmpdir}
|
||||
location: ${java.io.tmpdir}
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
|
@ -48,10 +48,7 @@ logging:
|
|||
level:
|
||||
run.halo.app: INFO
|
||||
file:
|
||||
path: \${user.home}/.halo/logs
|
||||
path: ${user.home}/.halo/logs
|
||||
|
||||
halo:
|
||||
download-timeout: 5m
|
||||
|
||||
application:
|
||||
version: ${version}
|
||||
|
|
Loading…
Reference in New Issue