Skip to content

Commit 3fa3ac8

Browse files
committed
Change encryption option name to "encrypt_tabs"
Also adds a note about encryption to the documentation.
1 parent f1571bd commit 3fa3ac8

File tree

10 files changed

+51
-37
lines changed

10 files changed

+51
-37
lines changed

docs/backup.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,19 @@ configuration and commands within the application.
6666

6767
.. warning::
6868

69-
Tabs are always exported **unencrypted** and if a tab is
70-
synchronized with directory on disk the files themselves won't be
71-
exported.
69+
Tabs are exported **without any encryption** by default (you would need
70+
CopyQ 14.0.0 and above) and if a tab is synchronized with directory on disk
71+
the files themselves will not be exported.
7272

73-
To export the data click "Export..." in "File" menu and select what to
74-
export, confirm with OK button and select file to save the stuff to.
73+
To export the data click "Export..." in "File" menu, select what to
74+
export, confirm with OK button and select target file to save.
7575

7676
To restore the data click "Import..." in "File" menu, select file to
7777
import and select what to import.
7878

7979
.. note::
8080

81-
Import won't overwrite existing tabs and commands but create new ones.
81+
Import will not overwrite existing tabs and commands but create new ones.
8282

8383
Alternatively you can use command line for export and import everything
8484
(selection dialogs won't be opened).

docs/faq.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,14 @@ Alternatively, run the following command::
448448
Why does encryption ask for password so often?
449449
----------------------------------------------
450450

451-
Encryption plugin uses ``gpg2`` to decrypt tabs and items. The password usually
452-
needs to be entered only once every few minutes.
451+
CopyQ 14.0.0 and above has a built-in encryption support, which requires
452+
password only at start (and when changing encryption password). Even that can
453+
be avoided if "Use external key store" option is enabled and the system
454+
supports it (Windows Credential Store, macOS Keychain, GNOME Keyring, KWallet).
455+
456+
In older versions, there is an Encryption plugin which uses ``gpg2`` utility to
457+
decrypt tabs and items. The password usually needs to be entered once every few
458+
minutes.
453459

454460
If the password prompt is showing up too often, either increase tab unloading
455461
interval ("Unload tab after an interval" option in "History" tab in

docs/password-protection.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ Password Protection
66
This page describes how to encrypt and protect selected tabs and single
77
items with a password.
88

9+
.. note::
10+
11+
CopyQ 14.0.0 and above will support encrypting all data using a custom
12+
Password. This can be enabled with "Encrypt Tabs" option in Preferences. As
13+
An alternative, available in older versions, the below describes using
14+
Encryption plugin to encrypt specific tabs or single items (this requires a
15+
GnuPG utility to be installed).
16+
917
Installation
1018
------------
1119

docs/security.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ copied from windows with matching window titles.
1818
- :ref:`faq-ignore-password-manager`
1919

2020
The data from all tabs are stored in the configuration directory unencrypted
21-
(unless the Encryption plugin is enabled for a tab).
21+
(unless the Encryption is enabled).
2222

2323
.. seealso::
2424

src/common/appconfig.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ struct item_data_threshold : Config<int> {
4848
}
4949
};
5050

51-
struct tab_encryption_enabled : Config<bool> {
52-
static QString name() { return QStringLiteral("tab_encryption_enabled"); }
51+
struct encrypt_tabs : Config<bool> {
52+
static QString name() { return QStringLiteral("encrypt_tabs"); }
5353
static Value defaultValue() { return false; }
5454
};
5555

src/gui/configurationmanager.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,11 @@ void ConfigurationManager::updateOptionsVisibility()
228228
platform->canPreventScreenCapture() );
229229

230230
#ifdef WITH_QCA_ENCRYPTION
231-
m_tabGeneral->checkBoxTabEncryption->setVisible(true);
231+
m_tabGeneral->checkBoxEncryptTabs->setVisible(true);
232232
const bool passwordWasSet = m_sharedData && !Encryption::loadPasswordHash().isEmpty();
233233
m_tabGeneral->pushButtonChangeEncryptionPassword->setVisible(passwordWasSet);
234234
#else
235-
m_tabGeneral->checkBoxTabEncryption->setVisible(false);
235+
m_tabGeneral->checkBoxEncryptTabs->setVisible(false);
236236
m_tabGeneral->pushButtonChangeEncryptionPassword->setVisible(false);
237237
#endif
238238

@@ -254,7 +254,7 @@ void ConfigurationManager::initOptions()
254254
/* general options */
255255
bind<Config::autostart>(m_tabGeneral->checkBoxAutostart);
256256
bind<Config::prevent_screen_capture>(m_tabGeneral->checkBoxPreventScreenCapture);
257-
bind<Config::tab_encryption_enabled>(m_tabGeneral->checkBoxTabEncryption);
257+
bind<Config::encrypt_tabs>(m_tabGeneral->checkBoxEncryptTabs);
258258
bind<Config::use_key_store>(m_tabGeneral->checkBoxUseKeychain);
259259
bind<Config::clipboard_tab>(m_tabHistory->comboBoxClipboardTab->lineEdit());
260260
bind<Config::maxitems>(m_tabHistory->spinBoxItems);

src/gui/mainwindow.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ MainWindow::MainWindow(const ClipboardBrowserSharedPtr &sharedData, QWidget *par
757757
, m_tray(nullptr)
758758
, m_toolBar(new ToolBar(this))
759759
, m_sharedData(sharedData)
760-
, m_wasEncrypted(AppConfig().option<Config::tab_encryption_enabled>())
760+
, m_wasEncrypted(AppConfig().option<Config::encrypt_tabs>())
761761
, m_menu( new TrayMenu(this) )
762762
, m_menuMaxItemCount(-1)
763763
, m_commandDialog(nullptr)
@@ -3705,7 +3705,7 @@ void MainWindow::promptForEncryptionPasswordIfNeeded(AppConfig *appConfig)
37053705
if (!useKeyStore)
37063706
removePasswordFromKeychain();
37073707

3708-
if ( !appConfig->option<Config::tab_encryption_enabled>() ) {
3708+
if ( !appConfig->option<Config::encrypt_tabs>() ) {
37093709
m_sharedData->encryptionKey.clear();
37103710
} else if ( !m_sharedData->encryptionKey.isValid() ) {
37113711
const auto prompt = useKeyStore
@@ -3727,7 +3727,7 @@ void MainWindow::reencryptTabsIfNeeded(const QStringList &tabNames, AppConfig *a
37273727

37283728
void MainWindow::reencryptTabsIfNeededHelper(const QStringList &tabNames, AppConfig *appConfig)
37293729
{
3730-
const bool isEncrypted = appConfig->option<Config::tab_encryption_enabled>();
3730+
const bool isEncrypted = appConfig->option<Config::encrypt_tabs>();
37313731
if (m_wasEncrypted == isEncrypted)
37323732
return;
37333733

@@ -3742,7 +3742,7 @@ void MainWindow::reencryptTabsIfNeededHelper(const QStringList &tabNames, AppCon
37423742

37433743
// Revert encryption option if password was not provided.
37443744
if (!oldEncryptionKey.isValid() && !newEncryptionKey.isValid()) {
3745-
appConfig->setOption(Config::tab_encryption_enabled::name(), m_wasEncrypted);
3745+
appConfig->setOption(Config::encrypt_tabs::name(), m_wasEncrypted);
37463746
return;
37473747
}
37483748

@@ -3766,7 +3766,7 @@ void MainWindow::reencryptTabsIfNeededHelper(const QStringList &tabNames, AppCon
37663766
if (appConfig->option<Config::use_key_store>())
37673767
removePasswordFromKeychain();
37683768
} else {
3769-
appConfig->setOption(Config::tab_encryption_enabled::name(), true);
3769+
appConfig->setOption(Config::encrypt_tabs::name(), true);
37703770
m_wasEncrypted = true;
37713771
m_sharedData->encryptionKey = oldEncryptionKey;
37723772
}

src/tests/itemsynctests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1077,7 +1077,7 @@ void ItemSyncTests::encryptionShouldNotAffectFiles()
10771077

10781078
QCOMPARE(dir1.files().join(sep), files.join(sep));
10791079

1080-
RUN("config" << "tab_encryption_enabled" << "true", "true\n");
1080+
RUN("config" << "encrypt_tabs" << "true", "true\n");
10811081

10821082
RUN(args << inspect,
10831083
"0: itemsync-basename:test1 text/plain:TEXT1 ;; "

src/tests/tests_encryption.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ void Tests::tabEncryption()
1313

1414
// Enable tab encryption - this should work even if the encryption support
1515
// is not build into the app.
16-
RUN("config" << "tab_encryption_enabled" << "true", "true\n");
16+
RUN("config" << "encrypt_tabs" << "true", "true\n");
1717

1818
// Verify tab doesn't exist yet
1919
QVERIFY( !hasTab(tab) );
@@ -50,7 +50,7 @@ void Tests::tabEncryption()
5050
// Password is needed when disabling encryption
5151
runMultiple(
5252
[&]() { KEYS(passwordEntryCurrentId << ":TEST123" << "ENTER"); },
53-
[&]() { RUN("config" << "tab_encryption_enabled" << "false", "false\n"); }
53+
[&]() { RUN("config" << "encrypt_tabs" << "false", "false\n"); }
5454
);
5555
KEYS(clipboardBrowserId);
5656
#endif
@@ -81,7 +81,7 @@ void Tests::tabEncryptionPasswordNew()
8181
<< passwordEntryRetypeId << ":TEST123" << "ENTER"
8282
);
8383
},
84-
[&]() { RUN("config" << "tab_encryption_enabled" << "true", "true\n"); }
84+
[&]() { RUN("config" << "encrypt_tabs" << "true", "true\n"); }
8585
);
8686
KEYS(clipboardBrowserId);
8787

@@ -113,7 +113,7 @@ void Tests::tabEncryptionPasswordCurrent()
113113
const Args args = Args("tab") << tab << "separator" << " ";
114114
RUN(args << "add" << "test data 3" << "test data 2" << "test data 1", "");
115115

116-
RUN("config" << "tab_encryption_enabled" << "true", "true\n");
116+
RUN("config" << "encrypt_tabs" << "true", "true\n");
117117

118118
m_test->setEnv("COPYQ_PASSWORD", ":TEST");
119119
m_test->ignoreErrors(QRegularExpression("Loaded password does not match the stored hash"));
@@ -151,7 +151,7 @@ void Tests::tabEncryptionPasswordRetry()
151151
<< passwordEntryRetypeId << ":TEST123" << "ENTER"
152152
);
153153
},
154-
[&]() { RUN("config" << "tab_encryption_enabled" << "true", "true\n"); }
154+
[&]() { RUN("config" << "encrypt_tabs" << "true", "true\n"); }
155155
);
156156
KEYS(clipboardBrowserId);
157157
#else
@@ -189,11 +189,11 @@ void Tests::tabEncryptionPasswordRetryFail()
189189
<< passwordMessageFailedId << "ENTER"
190190
);
191191
},
192-
[&]() { RUN("config" << "tab_encryption_enabled" << "true", "true\n"); }
192+
[&]() { RUN("config" << "encrypt_tabs" << "true", "true\n"); }
193193
);
194194

195195
// If the initial password was not provided, encryption should be disabled.
196-
RUN("config" << "tab_encryption_enabled", "false\n");
196+
RUN("config" << "encrypt_tabs", "false\n");
197197
#else
198198
SKIP("Encryption support not built-in");
199199
#endif
@@ -202,7 +202,7 @@ void Tests::tabEncryptionPasswordRetryFail()
202202
void Tests::tabEncryptionLargeItems()
203203
{
204204
#ifdef WITH_QCA_ENCRYPTION
205-
RUN("config" << "tab_encryption_enabled" << "true", "true\n");
205+
RUN("config" << "encrypt_tabs" << "true", "true\n");
206206

207207
const auto tab = testTab(1);
208208
const auto args = Args("tab") << tab;
@@ -234,7 +234,7 @@ void Tests::tabEncryptionLargeItems()
234234
void Tests::tabEncryptionChangePassword()
235235
{
236236
#ifdef WITH_QCA_ENCRYPTION
237-
RUN("config" << "tab_encryption_enabled" << "true", "true\n");
237+
RUN("config" << "encrypt_tabs" << "true", "true\n");
238238

239239
const auto tab = testTab(1);
240240
const auto args = Args("tab") << tab;
@@ -277,7 +277,7 @@ void Tests::tabEncryptionMissingHash()
277277
{
278278
// Ensure that missing hash file does not lock users out from their data.
279279
#ifdef WITH_QCA_ENCRYPTION
280-
RUN("config" << "tab_encryption_enabled" << "true", "true\n");
280+
RUN("config" << "encrypt_tabs" << "true", "true\n");
281281

282282
const auto tab = testTab(1);
283283
const auto args = Args("tab") << tab;
@@ -318,10 +318,10 @@ void Tests::tabEncryptionMissingHash()
318318
// Try to disable decryption with a wrong password
319319
runMultiple(
320320
[&]() { KEYS(passwordEntryCurrentId << ":TEST1234" << "ENTER"); },
321-
[&]() { RUN("config" << "tab_encryption_enabled" << "false", "false\n"); }
321+
[&]() { RUN("config" << "encrypt_tabs" << "false", "false\n"); }
322322
);
323323
KEYS(clipboardBrowserId);
324-
RUN("config" << "tab_encryption_enabled", "true\n");
324+
RUN("config" << "encrypt_tabs", "true\n");
325325

326326
TEST( m_test->stopServer() );
327327

@@ -335,10 +335,10 @@ void Tests::tabEncryptionMissingHash()
335335
// Disable decryption
336336
runMultiple(
337337
[&]() { KEYS(passwordEntryCurrentId << ":TEST123" << "ENTER"); },
338-
[&]() { RUN("config" << "tab_encryption_enabled" << "false", "false\n"); }
338+
[&]() { RUN("config" << "encrypt_tabs" << "false", "false\n"); }
339339
);
340340
KEYS(clipboardBrowserId);
341-
RUN("config" << "tab_encryption_enabled", "false\n");
341+
RUN("config" << "encrypt_tabs", "false\n");
342342

343343
TEST( m_test->stopServer() );
344344

src/ui/configtabgeneral.ui

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,12 @@
161161
</widget>
162162
</item>
163163
<item>
164-
<widget class="QCheckBox" name="checkBoxTabEncryption">
164+
<widget class="QCheckBox" name="checkBoxEncryptTabs">
165165
<property name="toolTip">
166166
<string>Encrypt tab data on disk (requires password to be set)</string>
167167
</property>
168168
<property name="text">
169-
<string>Enable &amp;tab encryption</string>
169+
<string>Encrypt &amp;Tabs</string>
170170
</property>
171171
</widget>
172172
</item>
@@ -399,7 +399,7 @@
399399
<tabstop>checkBoxOpenWindowsOnCurrentScreen</tabstop>
400400
<tabstop>checkBoxConfirmExit</tabstop>
401401
<tabstop>checkBoxAutostart</tabstop>
402-
<tabstop>checkBoxTabEncryption</tabstop>
402+
<tabstop>checkBoxEncryptTabs</tabstop>
403403
<tabstop>checkBoxUseKeychain</tabstop>
404404
<tabstop>pushButtonChangeEncryptionPassword</tabstop>
405405
<tabstop>comboBoxNavigationStyle</tabstop>

0 commit comments

Comments
 (0)