Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Fix missing default avatar

Chocobozzz6bafac54bf37
diff --git a/client/config/webpack.common.js b/client/config/webpack.common.js
index acf22dab19..c37516271f 100644
--- a/client/config/webpack.common.js
+++ b/client/config/webpack.common.js
@@ -13,6 +13,7 @@ const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin')
const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin')
const InlineManifestWebpackPlugin = require('inline-manifest-webpack-plugin')
const ngcWebpack = require('ngc-webpack')
+const CopyWebpackPlugin = require('copy-webpack-plugin')
const WebpackNotifierPlugin = require('webpack-notifier')
@@ -267,6 +268,17 @@ module.exports = function (options) {
inject: 'body'
}),
+ new CopyWebpackPlugin([
+ {
+ from: helpers.root('src/assets/images/favicon.png'),
+ to: 'assets/images/favicon.png'
+ },
+ {
+ from: helpers.root('src/assets/images/default-avatar.png'),
+ to: 'assets/images/default-avatar.png'
+ }
+ ]),
+
/*
* Plugin: ScriptExtHtmlWebpackPlugin
* Description: Enhances html-webpack-plugin functionality
diff --git a/client/src/app/shared/users/user.model.ts b/client/src/app/shared/users/user.model.ts
index 220362ef02..9364ae721b 100644
--- a/client/src/app/shared/users/user.model.ts
+++ b/client/src/app/shared/users/user.model.ts
@@ -54,6 +54,6 @@ export class User implements UserServerModel {
getAvatarPath () {
if (this.account && this.account.avatar) return this.account.avatar.path
- return '/assets/images/default-avatar.png'
+ return '/client/assets/images/default-avatar.png'
}
}
diff --git a/client/src/assets/images/favicon.png b/client/src/assets/images/favicon.png
index bb57ee6b02..cef0f0d2e2 100644
Binary files a/client/src/assets/images/favicon.png and b/client/src/assets/images/favicon.png differ
diff --git a/client/src/index.html b/client/src/index.html
index 8e94b903d5..4af6b12f6f 100644
--- a/client/src/index.html
+++ b/client/src/index.html
@@ -11,7 +11,7 @@
<!-- open graph and oembed tags -->
<!-- Do not remove it! -->
- <link rel="icon" type="image/png" href="/client/assets/favicon.png" />
+ <link rel="icon" type="image/png" href="/client/assets/images/favicon.png" />
<!-- base url -->
<base href="<%= htmlWebpackPlugin.options.metadata.baseUrl %>">
diff --git a/server/controllers/client.ts b/server/controllers/client.ts
index 64e5829caa..f474c42820 100644
--- a/server/controllers/client.ts
+++ b/server/controllers/client.ts
@@ -18,6 +18,7 @@ import { VideoInstance } from '../models'
const clientsRouter = express.Router()
const distPath = join(root(), 'client', 'dist')
+const assetsImagesPath = join(root(), 'client', 'dist', 'assets', 'images')
const embedPath = join(distPath, 'standalone', 'videos', 'embed.html')
const indexPath = join(distPath, 'index.html')
@@ -33,6 +34,7 @@ clientsRouter.use('/videos/embed', (req: express.Request, res: express.Response,
// Static HTML/CSS/JS client files
clientsRouter.use('/client', express.static(distPath, { maxAge: STATIC_MAX_AGE }))
+clientsRouter.use('/client/assets/images', express.static(assetsImagesPath, { maxAge: STATIC_MAX_AGE }))
// 404 for static files not found
clientsRouter.use('/client/*', (req: express.Request, res: express.Response, next: express.NextFunction) => {