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