From 711181751f0a5ee183b74514a621e4aaa6da3dd7 Mon Sep 17 00:00:00 2001 From: André Oliveira <37463445+SpecialAro@users.noreply.github.com> Date: Fri, 26 Jan 2024 02:06:35 +0000 Subject: feat: self signed certificates bypass (#1545) * feat: self signed certificates bypass * fix lint and vscode setting * Fix some mistakes and comments * forgot this one [skip ci] --- .../settings/settings/EditSettingsForm.tsx | 61 +++++++++++++++++++++- 1 file changed, 59 insertions(+), 2 deletions(-) (limited to 'src/components') diff --git a/src/components/settings/settings/EditSettingsForm.tsx b/src/components/settings/settings/EditSettingsForm.tsx index 70887af0f..226dbac76 100644 --- a/src/components/settings/settings/EditSettingsForm.tsx +++ b/src/components/settings/settings/EditSettingsForm.tsx @@ -15,6 +15,7 @@ import Infobox from '../../ui/Infobox'; import { H1, H2, H3, H5 } from '../../ui/headline'; import { ferdiumVersion, + userDataCertsPath, userDataPath, userDataRecipesPath, } from '../../../environment-remote'; @@ -262,6 +263,20 @@ const messages = defineMessages({ id: 'settings.app.form.splitColumns', defaultMessage: 'Number of columns', }, + warningSelfSignedCertificates: { + id: 'settings.app.warningSelfSignedCertificates', + defaultMessage: + 'WARNING: Only enable this feature if you know what you are doing. Enabling this is a security risk and should only be used for testing purposes.', + }, + infoOpenCertificatesFolder: { + id: 'settings.app.infoOpenCertificatesFolder', + defaultMessage: + 'To install a certificate, click the button below to open the certificates folder and copy it into the folder. After that you can refresh the service (CTRL/CMD + R). To remove/uninstall, simply delete the certificate file and restart Ferdium.', + }, + buttonOpenFerdiumCertsFolder: { + id: 'settings.app.buttonOpenFerdiumCertsFolder', + defaultMessage: 'Open certificates folder', + }, }); const Hr = (): ReactElement => ( @@ -387,8 +402,12 @@ class EditSettingsForm extends Component { updateButtonLabelMessage = messages.updateStatusAvailable; } - const { lockingFeatureEnabled, scheduledDNDEnabled, reloadAfterResume } = - window['ferdium'].stores.settings.all.app; + const { + lockingFeatureEnabled, + scheduledDNDEnabled, + reloadAfterResume, + useSelfSignedCertificates, + } = window['ferdium'].stores.settings.all.app; let cacheSize; let notCleared; @@ -411,6 +430,7 @@ class EditSettingsForm extends Component { const profileFolder = userDataPath(); const recipeFolder = userDataRecipesPath(); + const certsFolder = userDataCertsPath(); return (
@@ -947,6 +967,43 @@ class EditSettingsForm extends Component { {intl.formatMessage(messages.appRestartRequired)}

+ + + {useSelfSignedCertificates && ( +
+

+ {intl.formatMessage(messages.infoOpenCertificatesFolder)} +

+
+
+
+ )} + +

+ {intl.formatMessage(messages.warningSelfSignedCertificates)} +

+