2022-03-04 07:04:11 +00:00
|
|
|
plugins {
|
2023-03-06 06:18:12 +00:00
|
|
|
id 'org.springframework.boot' version '3.0.4'
|
2022-10-25 02:56:11 +00:00
|
|
|
id 'io.spring.dependency-management' version '1.1.0'
|
Provide system config endpoint (#3182)
#### What type of PR is this?
/kind feature
/area core
/milestone 2.2.x
#### What this PR does / why we need it:
Provide `globalconfig` actuator endpoint to let console and theme know how to do according various system configuration. The endpoint allows anonymous users to access, but other actuator endpoints can be accessed by admin users.
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3055
#### Special notes for your reviewer:
Try to request <http://localhost:8090/actuator/globalinfo> and see the result.
```json
{
"externalUrl":"http://localhost:8090",
"timeZone":"Asia/Shanghai",
"locale":"en_US",
"allowComments":true,
"allowRegistration":false
}
```
You can request <http://localhost:8090/actuator/info> to see more detail as well.
```json
{
"git": {
"branch": "feat/system-info",
"commit": {
"id": "ca4e93d",
"time": "2023-01-19T08:56:15Z"
}
},
"build": {
"artifact": "halo",
"name": "halo",
"time": "2023-01-29T15:04:42.151Z",
"version": "2.2.0-SNAPSHOT",
"group": "run.halo.app"
},
"java": {
"version": "17.0.6",
"vendor": {
"name": "Amazon.com Inc.",
"version": "Corretto-17.0.6.10.1"
},
"runtime": {
"name": "OpenJDK Runtime Environment",
"version": "17.0.6+10-LTS"
},
"jvm": {
"name": "OpenJDK 64-Bit Server VM",
"vendor": "Amazon.com Inc.",
"version": "17.0.6+10-LTS"
}
},
"os": {
"name": "Windows 11",
"version": "10.0",
"arch": "amd64"
}
}
```
#### Does this PR introduce a user-facing change?
```release-note
提供系统配置详情端口
```
2023-01-30 07:20:11 +00:00
|
|
|
id "com.gorylenko.gradle-git-properties" version "2.3.2"
|
2022-03-04 07:04:11 +00:00
|
|
|
id "checkstyle"
|
|
|
|
id 'java'
|
|
|
|
}
|
|
|
|
|
|
|
|
group = "run.halo.app"
|
|
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
|
|
|
|
|
|
checkstyle {
|
|
|
|
toolVersion = "9.3"
|
|
|
|
showViolations = false
|
|
|
|
ignoreFailures = false
|
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
2022-06-07 02:20:12 +00:00
|
|
|
|
2022-10-25 02:56:11 +00:00
|
|
|
maven { url 'https://repo.spring.io/milestone' }
|
2022-03-04 07:04:11 +00:00
|
|
|
}
|
|
|
|
|
2022-06-07 02:20:12 +00:00
|
|
|
|
2022-03-04 07:04:11 +00:00
|
|
|
configurations {
|
|
|
|
compileOnly {
|
|
|
|
extendsFrom annotationProcessor
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-01-13 02:50:12 +00:00
|
|
|
springBoot {
|
|
|
|
buildInfo()
|
|
|
|
}
|
|
|
|
|
2022-03-04 07:04:11 +00:00
|
|
|
bootJar {
|
|
|
|
manifest {
|
|
|
|
attributes "Implementation-Title": "Halo Application",
|
|
|
|
"Implementation-Version": archiveVersion
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-04-13 11:38:34 +00:00
|
|
|
ext {
|
|
|
|
commonsLang3 = "3.12.0"
|
2022-05-27 06:26:37 +00:00
|
|
|
base62 = "0.1.3"
|
2023-01-31 06:10:10 +00:00
|
|
|
pf4j = '3.9.0'
|
2022-08-22 07:32:11 +00:00
|
|
|
javaDiffUtils = "4.12"
|
|
|
|
guava = "31.1-jre"
|
2022-09-25 11:22:14 +00:00
|
|
|
jsoup = '1.15.3'
|
2022-09-21 04:06:10 +00:00
|
|
|
jsonPatch = "1.13"
|
2023-01-31 03:04:09 +00:00
|
|
|
springDocOpenAPI = "2.0.2"
|
2023-01-31 07:14:09 +00:00
|
|
|
lucene = "9.5.0"
|
2022-04-13 11:38:34 +00:00
|
|
|
}
|
2022-03-04 07:04:11 +00:00
|
|
|
|
|
|
|
dependencies {
|
|
|
|
implementation 'org.springframework.boot:spring-boot-starter-actuator'
|
|
|
|
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
|
|
|
|
implementation 'org.springframework.boot:spring-boot-starter-mail'
|
2022-06-07 02:20:12 +00:00
|
|
|
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
|
|
|
|
implementation 'org.springframework.boot:spring-boot-starter-webflux'
|
|
|
|
implementation 'org.springframework.boot:spring-boot-starter-validation'
|
2022-08-17 02:56:11 +00:00
|
|
|
implementation 'org.springframework.boot:spring-boot-starter-data-r2dbc'
|
2022-06-07 02:20:12 +00:00
|
|
|
|
|
|
|
// Spring Security
|
2022-03-04 07:04:11 +00:00
|
|
|
implementation 'org.springframework.boot:spring-boot-starter-security'
|
2022-04-13 09:08:34 +00:00
|
|
|
implementation 'org.springframework.security:spring-security-oauth2-jose'
|
2022-06-07 02:20:12 +00:00
|
|
|
implementation 'org.springframework.security:spring-security-oauth2-resource-server'
|
2022-05-11 08:06:11 +00:00
|
|
|
|
2022-11-25 02:31:07 +00:00
|
|
|
implementation "org.springdoc:springdoc-openapi-starter-webflux-ui:$springDocOpenAPI"
|
2022-08-03 03:34:14 +00:00
|
|
|
implementation 'org.openapi4j:openapi-schema-validator:1.0.7'
|
2022-07-22 03:13:50 +00:00
|
|
|
implementation "net.bytebuddy:byte-buddy"
|
2022-04-13 11:38:34 +00:00
|
|
|
|
2022-11-11 16:12:13 +00:00
|
|
|
// Apache Lucene
|
2023-01-31 07:14:09 +00:00
|
|
|
implementation "org.apache.lucene:lucene-core:$lucene"
|
|
|
|
implementation "org.apache.lucene:lucene-queryparser:$lucene"
|
|
|
|
implementation "org.apache.lucene:lucene-highlighter:$lucene"
|
|
|
|
implementation "org.apache.lucene:lucene-backward-codecs:$lucene"
|
2022-11-11 16:12:13 +00:00
|
|
|
implementation 'cn.shenyanchao.ik-analyzer:ik-analyzer:9.0.0'
|
|
|
|
|
2022-04-13 11:38:34 +00:00
|
|
|
implementation "org.apache.commons:commons-lang3:$commonsLang3"
|
2022-05-27 06:26:37 +00:00
|
|
|
implementation "io.seruco.encoding:base62:$base62"
|
2022-05-31 04:06:10 +00:00
|
|
|
implementation "org.pf4j:pf4j:$pf4j"
|
2022-08-22 07:32:11 +00:00
|
|
|
implementation "com.google.guava:guava:$guava"
|
|
|
|
implementation "org.jsoup:jsoup:$jsoup"
|
|
|
|
implementation "io.github.java-diff-utils:java-diff-utils:$javaDiffUtils"
|
2022-09-15 06:52:13 +00:00
|
|
|
implementation "org.springframework.integration:spring-integration-core"
|
2022-09-21 04:06:10 +00:00
|
|
|
implementation "com.github.java-json-tools:json-patch:$jsonPatch"
|
2022-11-23 03:00:19 +00:00
|
|
|
implementation "org.thymeleaf.extras:thymeleaf-extras-springsecurity6"
|
2022-08-03 03:34:14 +00:00
|
|
|
|
2022-03-04 07:04:11 +00:00
|
|
|
compileOnly 'org.projectlombok:lombok'
|
2022-07-29 05:22:14 +00:00
|
|
|
testCompileOnly 'org.projectlombok:lombok'
|
2022-03-04 07:04:11 +00:00
|
|
|
|
2022-04-13 09:08:34 +00:00
|
|
|
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
|
2023-01-31 02:58:09 +00:00
|
|
|
annotationProcessor "org.springframework:spring-context-indexer:6.0.4"
|
2022-04-13 09:08:34 +00:00
|
|
|
|
2022-03-04 07:04:11 +00:00
|
|
|
developmentOnly 'org.springframework.boot:spring-boot-devtools'
|
|
|
|
|
2022-08-17 02:56:11 +00:00
|
|
|
// R2DBC
|
|
|
|
// Currently, official doesn't support mssql and mariadb yet until drivers are available.
|
|
|
|
// See https://github.com/spring-projects/spring-data-relational/commit/ee6c2c89b5c433748b22a79cf40dc8e01142caa3
|
|
|
|
// for more.
|
|
|
|
runtimeOnly 'io.r2dbc:r2dbc-h2'
|
2023-01-31 05:54:09 +00:00
|
|
|
runtimeOnly 'com.github.jasync-sql:jasync-r2dbc-mysql:2.1.23'
|
2022-12-26 04:02:31 +00:00
|
|
|
runtimeOnly 'org.mariadb:r2dbc-mariadb:1.1.3'
|
2022-03-04 07:04:11 +00:00
|
|
|
runtimeOnly 'org.postgresql:postgresql'
|
2022-08-17 02:56:11 +00:00
|
|
|
runtimeOnly 'org.postgresql:r2dbc-postgresql'
|
2022-03-04 07:04:11 +00:00
|
|
|
|
|
|
|
annotationProcessor 'org.projectlombok:lombok'
|
2022-07-29 05:22:14 +00:00
|
|
|
testAnnotationProcessor 'org.projectlombok:lombok'
|
2022-03-04 07:04:11 +00:00
|
|
|
|
|
|
|
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
|
|
|
testImplementation 'org.springframework.security:spring-security-test'
|
2022-06-07 02:20:12 +00:00
|
|
|
testImplementation 'io.projectreactor:reactor-test'
|
2022-03-04 07:04:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
tasks.named('test') {
|
|
|
|
useJUnitPlatform()
|
|
|
|
}
|