From 310271c10fdf3d8a0e39f2d841d67c0cf54a3891 Mon Sep 17 00:00:00 2001 From: HrBingR Date: Mon, 8 Aug 2022 00:37:17 +0200 Subject: [PATCH 1/2] Added new environment variables for custom css, custom title, and custom description. Fully tested using the Dockerfile, example can be found on https://fileshare.thenextweb.co.za --- server/config.js | 17 ++++++++++++++++- server/layout.js | 5 +++++ server/state.js | 8 ++++---- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/server/config.js b/server/config.js index 77f4b989..bc1404a6 100644 --- a/server/config.js +++ b/server/config.js @@ -168,6 +168,16 @@ const conf = convict({ default: 'https://send.firefox.com', env: 'BASE_URL' }, + custom_title: { + format: String, + default: 'Send', + env: 'CUSTOM_TITLE' + }, + custom_description: { + format: String, + default: 'Encrypt and send files with a link that automatically expires to ensure your important documents don’t stay online forever.', + env: 'CUSTOM_DESCRIPTION' + }, detect_base_url: { format: Boolean, default: false, @@ -303,7 +313,12 @@ const conf = convict({ format: String, default: '', env: 'UI_CUSTOM_ASSETS_WORDMARK' - } + }, + custom_css: { + format: String, + default: '', + env: 'UI_CUSTOM_CSS' + } } }); diff --git a/server/layout.js b/server/layout.js index 9c8aa65d..916a6228 100644 --- a/server/layout.js +++ b/server/layout.js @@ -40,6 +40,11 @@ module.exports = function(state, body = '') { type="text/css" href="${assets.get('app.css')}" /> + { if (config.ui_custom_assets[index] !== '') @@ -47,9 +48,8 @@ module.exports = async function(req) { locale, capabilities: { account: false }, translate: getTranslator(locale), - title: 'Send', - description: - 'Encrypt and send files with a link that automatically expires to ensure your important documents don’t stay online forever.', + title: config.custom_title, + description: config.custom_description, baseUrl, ui: { colors: { From bce861bcaf435cd42cb47317cfbce914b4bb30b0 Mon Sep 17 00:00:00 2001 From: HrBingR Date: Wed, 10 Aug 2022 22:55:51 +0200 Subject: [PATCH 2/2] Added if check to see if user is using custom CSS --- server/layout.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/server/layout.js b/server/layout.js index 916a6228..0aceade7 100644 --- a/server/layout.js +++ b/server/layout.js @@ -40,11 +40,16 @@ module.exports = function(state, body = '') { type="text/css" href="${assets.get('app.css')}" /> - +