From 1696be423ea921caa71b72ea0fc78d17ae6b8518 Mon Sep 17 00:00:00 2001 From: Michael Skogberg Date: Sun, 17 Sep 2023 12:36:23 +0300 Subject: [PATCH] Tweak web --- musicmeta/frontend/webpack.base.config.js | 5 +---- musicpimp/app/controllers/musicpimp/Secured.scala | 2 +- pimpcloud/app/com/malliina/pimpcloud/CloudLoader.scala | 2 +- pimpcloud/frontend/webpack.base.config.js | 5 +---- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/musicmeta/frontend/webpack.base.config.js b/musicmeta/frontend/webpack.base.config.js index 4d30514f..0f60e8ba 100644 --- a/musicmeta/frontend/webpack.base.config.js +++ b/musicmeta/frontend/webpack.base.config.js @@ -8,15 +8,12 @@ const cssDir = path.resolve(rootDir, 'css'); const WebApp = Merge(ScalaJS, { entry: { styles: [path.resolve(cssDir, './musicmeta.js')] - // fonts: [path.resolve(cssDir, './fonts.js')] }, module: { rules: [ { test: /\.(png|woff|woff2|eot|ttf|svg)$/, - use: [ - { loader: 'url-loader', options: { limit: 8192 } } - ], + type: 'asset/inline' }, { test: /\.less$/, diff --git a/musicpimp/app/controllers/musicpimp/Secured.scala b/musicpimp/app/controllers/musicpimp/Secured.scala index 1c5b58b9..1e84019c 100644 --- a/musicpimp/app/controllers/musicpimp/Secured.scala +++ b/musicpimp/app/controllers/musicpimp/Secured.scala @@ -14,7 +14,7 @@ object Secured { def logUnauthorized(request: RequestHeader): Unit = { val remoteAddress = Proxies.realAddress(request) - log warn s"Unauthorized request '${request.path}' from '$remoteAddress'." + log.warn(s"Unauthorized request '${request.path}' from '$remoteAddress'.") } def redirecting(auth: Authenticator[AuthedRequest]): AuthBundle[AuthedRequest] = diff --git a/pimpcloud/app/com/malliina/pimpcloud/CloudLoader.scala b/pimpcloud/app/com/malliina/pimpcloud/CloudLoader.scala index b14d37ca..2b52304d 100644 --- a/pimpcloud/app/com/malliina/pimpcloud/CloudLoader.scala +++ b/pimpcloud/app/com/malliina/pimpcloud/CloudLoader.scala @@ -90,7 +90,7 @@ class CloudComponents(context: Context, conf: AppConf) val allowedEntry = allowedCsp.mkString(" ") val csp = - s"default-src 'self' 'unsafe-inline' 'unsafe-eval' $allowedEntry; connect-src *; img-src 'self' data:;" + s"default-src 'self' 'unsafe-inline' 'unsafe-eval' $allowedEntry data:; connect-src *; img-src 'self' data:;" override lazy val securityHeadersConfig = SecurityHeadersConfig( contentSecurityPolicy = Option(csp) ) diff --git a/pimpcloud/frontend/webpack.base.config.js b/pimpcloud/frontend/webpack.base.config.js index 2712fa49..ce1b3d45 100644 --- a/pimpcloud/frontend/webpack.base.config.js +++ b/pimpcloud/frontend/webpack.base.config.js @@ -8,15 +8,12 @@ const cssDir = path.resolve(rootDir, 'css'); const WebApp = Merge(ScalaJS, { entry: { styles: [path.resolve(cssDir, './pimpcloud.js')] - // fonts: [path.resolve(cssDir, './fonts.js')] }, module: { rules: [ { test: /\.(png|woff|woff2|eot|ttf|svg)$/, - use: [ - { loader: 'url-loader', options: { limit: 8192 } } - ], + type: 'asset/inline' }, { test: /\.less$/,