mirror of
https://github.com/laurent22/joplin.git
synced 2025-02-07 19:30:04 +02:00
Linux: Move keychain support behind an off-by-default feature flag (#11227)
This commit is contained in:
parent
2c40cec639
commit
41b251d67a
@ -1576,6 +1576,20 @@ const builtInMetadata = (Setting: typeof SettingType) => {
|
|||||||
isGlobal: true,
|
isGlobal: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
'featureFlag.linuxKeychain': {
|
||||||
|
value: false,
|
||||||
|
type: SettingItemType.Bool,
|
||||||
|
public: true,
|
||||||
|
storage: SettingStorage.File,
|
||||||
|
appTypes: [AppType.Desktop],
|
||||||
|
label: () => 'Enable keychain support',
|
||||||
|
description: () => 'This is an experimental setting to enable keychain support on Linux',
|
||||||
|
show: () => shim.isLinux(),
|
||||||
|
section: 'general',
|
||||||
|
isGlobal: true,
|
||||||
|
advanced: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
// 'featureFlag.syncAccurateTimestamps': {
|
// 'featureFlag.syncAccurateTimestamps': {
|
||||||
// value: false,
|
// value: false,
|
||||||
|
@ -34,6 +34,13 @@ export async function loadKeychainServiceAndSettings(keychainServiceDrivers: Key
|
|||||||
Setting.setKeychainService(KeychainService.instance());
|
Setting.setKeychainService(KeychainService.instance());
|
||||||
await Setting.load();
|
await Setting.load();
|
||||||
|
|
||||||
|
// Using Linux with the keychain has been observed to cause all secure settings to be lost
|
||||||
|
// on Fedora 40 + GNOME. (This may have been related to running multiple Joplin instances).
|
||||||
|
// For now, make saving to the keychain opt-in until more feedback is received.
|
||||||
|
if (shim.isLinux() && !Setting.value('featureFlag.linuxKeychain')) {
|
||||||
|
KeychainService.instance().readOnly = true;
|
||||||
|
}
|
||||||
|
|
||||||
// This is part of the migration to the new sync target info. It needs to be
|
// This is part of the migration to the new sync target info. It needs to be
|
||||||
// set as early as possible since it's used to tell if E2EE is enabled, it
|
// set as early as possible since it's used to tell if E2EE is enabled, it
|
||||||
// contains the master keys, etc. Once it has been set, it becomes a noop
|
// contains the master keys, etc. Once it has been set, it becomes a noop
|
||||||
|
@ -1,9 +1,13 @@
|
|||||||
|
import Logger from '@joplin/utils/Logger';
|
||||||
import { _ } from './locale';
|
import { _ } from './locale';
|
||||||
import Setting from './models/Setting';
|
import Setting from './models/Setting';
|
||||||
import { reg } from './registry';
|
import { reg } from './registry';
|
||||||
|
import KeychainService from './services/keychain/KeychainService';
|
||||||
import { Plugins } from './services/plugins/PluginService';
|
import { Plugins } from './services/plugins/PluginService';
|
||||||
import shim from './shim';
|
import shim from './shim';
|
||||||
|
|
||||||
|
const logger = Logger.create('versionInfo');
|
||||||
|
|
||||||
export interface PackageInfo {
|
export interface PackageInfo {
|
||||||
name: string;
|
name: string;
|
||||||
version: string;
|
version: string;
|
||||||
@ -70,15 +74,21 @@ export default function versionInfo(packageInfo: PackageInfo, plugins: Plugins)
|
|||||||
copyrightText.replace('YYYY', `${now.getFullYear()}`),
|
copyrightText.replace('YYYY', `${now.getFullYear()}`),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
let keychainSupported = false;
|
||||||
|
try {
|
||||||
|
// To allow old keys to be read, certain apps allow read-only keychain access:
|
||||||
|
keychainSupported = Setting.value('keychain.supported') >= 1 && !KeychainService.instance().readOnly;
|
||||||
|
} catch (error) {
|
||||||
|
logger.error('Failed to determine if keychain is supported', error);
|
||||||
|
}
|
||||||
|
|
||||||
const body = [
|
const body = [
|
||||||
_('%s %s (%s, %s)', p.name, p.version, Setting.value('env'), shim.platformName()),
|
_('%s %s (%s, %s)', p.name, p.version, Setting.value('env'), shim.platformName()),
|
||||||
'',
|
'',
|
||||||
_('Client ID: %s', Setting.value('clientId')),
|
_('Client ID: %s', Setting.value('clientId')),
|
||||||
_('Sync Version: %s', Setting.value('syncVersion')),
|
_('Sync Version: %s', Setting.value('syncVersion')),
|
||||||
_('Profile Version: %s', reg.db().version()),
|
_('Profile Version: %s', reg.db().version()),
|
||||||
// The portable app temporarily supports read-only keychain access (but disallows
|
_('Keychain Supported: %s', keychainSupported ? _('Yes') : _('No')),
|
||||||
// write).
|
|
||||||
_('Keychain Supported: %s', (Setting.value('keychain.supported') >= 1 && !shim.isPortable()) ? _('Yes') : _('No')),
|
|
||||||
];
|
];
|
||||||
|
|
||||||
if (gitInfo) {
|
if (gitInfo) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user