diff --git a/src/main/kotlin/dev/fyloz/colorrecipesexplorer/model/Configuration.kt b/src/main/kotlin/dev/fyloz/colorrecipesexplorer/model/Configuration.kt index 5284285..77ed627 100644 --- a/src/main/kotlin/dev/fyloz/colorrecipesexplorer/model/Configuration.kt +++ b/src/main/kotlin/dev/fyloz/colorrecipesexplorer/model/Configuration.kt @@ -90,7 +90,8 @@ enum class ConfigurationType( TOUCH_UP_KIT_EXPIRATION("touchupkit.expiration"), EMERGENCY_MODE_ENABLED("env.emergency", computed = true, public = true), - VERSION("env.version", computed = true), + BUILD_VERSION("env.build.version", computed = true), + BUILD_TIME("env.build.time", computed = true), JAVA_VERSION("env.java.version", computed = true), OPERATING_SYSTEM("env.os", computed = true) ; diff --git a/src/main/kotlin/dev/fyloz/colorrecipesexplorer/service/ConfigurationService.kt b/src/main/kotlin/dev/fyloz/colorrecipesexplorer/service/ConfigurationService.kt index 0dd69e0..7855597 100644 --- a/src/main/kotlin/dev/fyloz/colorrecipesexplorer/service/ConfigurationService.kt +++ b/src/main/kotlin/dev/fyloz/colorrecipesexplorer/service/ConfigurationService.kt @@ -11,7 +11,9 @@ import org.springframework.boot.info.BuildProperties import org.springframework.context.annotation.Lazy import org.springframework.data.repository.findByIdOrNull import org.springframework.stereotype.Service +import java.time.LocalDate import java.time.Period +import java.time.ZoneId import javax.annotation.PostConstruct interface ConfigurationService { @@ -138,7 +140,8 @@ class ConfigurationServiceImpl( private fun getComputedConfiguration(key: ConfigurationType) = configuration( key, when (key) { ConfigurationType.EMERGENCY_MODE_ENABLED -> emergencyMode - ConfigurationType.VERSION -> buildInfo.version + ConfigurationType.BUILD_VERSION -> buildInfo.version + ConfigurationType.BUILD_TIME -> LocalDate.ofInstant(buildInfo.time, ZoneId.systemDefault()).toString() ConfigurationType.DATABASE_SUPPORTED_VERSION -> SUPPORTED_DATABASE_VERSION ConfigurationType.JAVA_VERSION -> Runtime.version() ConfigurationType.OPERATING_SYSTEM -> "${System.getProperty("os.name")} ${System.getProperty("os.version")} ${