Commit 5d38b5d 1 parent 2170db6 commit 5d38b5d Copy full SHA for 5d38b5d
File tree 6 files changed +33
-7
lines changed
kotlin/com/faforever/userservice/config
6 files changed +33
-7
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import javax.validation.constraints.NotBlank
9
9
@Validated
10
10
@ConstructorBinding
11
11
data class FafProperties (
12
+ val environment : String? ,
12
13
@NotBlank
13
14
val passwordResetUrl : String ,
14
15
@NotBlank
Original file line number Diff line number Diff line change
1
+ package com.faforever.userservice.config
2
+
3
+ import org.springframework.beans.factory.annotation.Autowired
4
+ import org.springframework.context.annotation.Bean
5
+ import org.springframework.context.annotation.Configuration
6
+ import org.thymeleaf.spring5.view.reactive.ThymeleafReactiveViewResolver
7
+
8
+ @Configuration
9
+ class ThymeleafConfig {
10
+ @Autowired
11
+ private lateinit var thymeleafViewResolver: ThymeleafReactiveViewResolver
12
+
13
+ @Autowired
14
+ private lateinit var fafProperties: FafProperties
15
+
16
+ @Bean
17
+ fun staticVariableProvider () {
18
+ val map = mutableMapOf<String , Any >()
19
+ map[" environment" ] = fafProperties.environment?.let { " [$it ] " } ? : " "
20
+ thymeleafViewResolver.staticVariables = map
21
+ }
22
+ }
Original file line number Diff line number Diff line change
1
+ faf :
2
+ environment : LOCAL
3
+
4
+ logging :
5
+ level :
6
+ org.springframework.security : INFO
7
+ com.faforever : INFO
8
+ org.thymeleaf : INFO
Original file line number Diff line number Diff line change @@ -22,11 +22,6 @@ hydra:
22
22
fakeTlsForwarding : ${HYDRA_FAKE_TLS_FORWARDING:false}
23
23
acceptUntrustedTlsCertificates : ${HYDRA_ACCEPT_UNTRUSTED_TLS_CERTIFICATES:true}
24
24
25
- logging :
26
- level :
27
- org.springframework.security : INFO
28
- com.faforever : INFO
29
-
30
25
spring :
31
26
r2dbc :
32
27
url : ${DB_R2DBC_URL:r2dbc:pool:mysql://localhost:3306/faf?ssl=false}
Original file line number Diff line number Diff line change 5
5
< body >
6
6
< div class ="background "> </ div >
7
7
< header >
8
- < h1 th:text ="${headerText} " layout:fragment ="header-title "> FAForever</ h1 >
8
+ < h1 th:text ="${environment} + ${ headerText} " layout:fragment ="header-title "> [ENV] FAForever</ h1 >
9
9
</ header >
10
10
< div layout:fragment ="content ">
11
11
< div class ="main-card ">
Original file line number Diff line number Diff line change 17
17
< div id ="leftheader ">
18
18
< a href ="https://www.faforever.com "> < img src ="https://faforever.com/images/faf-logo.png "
19
19
alt ="FAForever Logo "> </ a >
20
- < h1 th:text ="#{title} " layout:fragment ="header-title "> FAForever</ h1 >
20
+ < h1 th:text ="${environment} + #{title} " layout:fragment ="header-title "> [ENV] FAForever</ h1 >
21
21
</ div >
22
22
< div id ="rightheader ">
23
23
< p th:if ="${currentUser != null} " th:text ="#{header.loggedInAs(${currentUser.username})} "> You are logged in as [User]</ p >
You can’t perform that action at this time.
0 commit comments