WASMX live setting

pull/4696/head
Thibault Duplessis 2018-11-09 14:49:41 +01:00
parent 6af2362098
commit b09ee504f2
4 changed files with 13 additions and 2 deletions

View File

@ -17,7 +17,8 @@ object Dev extends LilaController {
Env.irwin.irwinModeSetting,
Env.explorer.indexFlowSetting,
Env.report.scoreThresholdSetting,
Env.api.cspEnabledSetting
Env.api.cspEnabledSetting,
Env.api.wasmxEnabledSetting
)
def settings = Secure(_.Settings) { implicit ctx => me =>

View File

@ -56,6 +56,8 @@ object Environment
def cspEnabled = apiEnv.cspEnabledSetting.get _
def wasmxEnabled = apiEnv.wasmxEnabledSetting.get _
def isChatPanicEnabled =
lila.chat.Env.current.panic.enabled

View File

@ -25,7 +25,9 @@ csp: Option[lila.common.ContentSecurityPolicy] = None)(body: Html)(implicit ctx:
<meta http-equiv="Content-Security-Policy" content="@csp.getOrElse(defaultCsp)">
}
@if(isProd) {
<!-- <meta http-equiv="origin-trial" data-feature="WebAssembly Threads" data-expires="2018-12-12" content="AvQS5g8cLXUfw7Vu3lmQ6B55HURS0KMuY6blwOUmAPYX3Jph8GXMSO4/jTx3el3BxG8SyJRlQTbsRRsjOHwiCAMAAABXeyJvcmlnaW4iOiJodHRwczovL2xpY2hlc3Mub3JnOjQ0MyIsImZlYXR1cmUiOiJXZWJBc3NlbWJseVRocmVhZHMiLCJleHBpcnkiOjE1NDQ2MzY2MzN9"> -->
@if(wasmxEnabled()) {
<meta http-equiv="origin-trial" data-feature="WebAssembly Threads" data-expires="2018-12-12" content="AvQS5g8cLXUfw7Vu3lmQ6B55HURS0KMuY6blwOUmAPYX3Jph8GXMSO4/jTx3el3BxG8SyJRlQTbsRRsjOHwiCAMAAABXeyJvcmlnaW4iOiJodHRwczovL2xpY2hlc3Mub3JnOjQ0MyIsImZlYXR1cmUiOiJXZWJBc3NlbWJseVRocmVhZHMiLCJleHBpcnkiOjE1NDQ2MzY2MzN9">
}
<title>@fullTitle.getOrElse{@title • lichess.org}</title>
<link href="https://fonts.googleapis.com/css?family=Noto+Sans:400,700|Roboto:300" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono:500&text=0123456789:." rel="stylesheet">

View File

@ -64,6 +64,12 @@ final class Env(
text = "Enable CSP for everyone.".some
)
val wasmxEnabledSetting = settingStore[Boolean](
"wasmxEnabled",
default = false,
text = "Enable WASMX for everyone.".some
)
object Accessibility {
val blindCookieName = config getString "accessibility.blind.cookie.name"
val blindCookieMaxAge = config getInt "accessibility.blind.cookie.max_age"