mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-02-23 07:59:54 -05:00
Merge branch 'release/2.2.3' into develop
This commit is contained in:
commit
8651736e61
@ -87,14 +87,15 @@ else
|
|||||||
fi
|
fi
|
||||||
EOF
|
EOF
|
||||||
chmod +x ./usr/bin/keepassxc_env
|
chmod +x ./usr/bin/keepassxc_env
|
||||||
sed -i 's/Exec=keepassxc/Exec=keepassxc_env/' org.${LOWERAPP}.desktop
|
sed -i 's/Exec=keepassxc/Exec=keepassxc_env/' org.${LOWERAPP}.${APP}.desktop
|
||||||
get_desktopintegration "org.${LOWERAPP}"
|
get_desktopintegration "org.${LOWERAPP}.${APP}"
|
||||||
|
|
||||||
GLIBC_NEEDED=$(glibc_needed)
|
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
generate_type2_appimage
|
GLIBC_NEEDED=$(glibc_needed)
|
||||||
|
NO_GLIBC_VERSION=true
|
||||||
|
|
||||||
mv ../out/*.AppImage ../KeePassXC-${VERSION}-${ARCH}.AppImage
|
generate_type2_appimage -u "gh-releases-zsync|keepassxreboot|keepassxc|latest|KeePassXC-*-${ARCH}.AppImage.zsync"
|
||||||
rmdir ../out > /dev/null 2>&1
|
|
||||||
|
mv ../out/*.AppImage* ../
|
||||||
|
rm -rf ../out
|
||||||
|
37
Dockerfile
37
Dockerfile
@ -24,7 +24,8 @@ RUN set -x \
|
|||||||
&& apt-get -y install software-properties-common
|
&& apt-get -y install software-properties-common
|
||||||
|
|
||||||
RUN set -x \
|
RUN set -x \
|
||||||
&& add-apt-repository ppa:beineri/opt-qt${QT5_PPA_VERSION}-trusty
|
&& add-apt-repository ppa:beineri/opt-qt${QT5_PPA_VERSION}-trusty \
|
||||||
|
&& add-apt-repository ppa:phoerious/keepassxc
|
||||||
|
|
||||||
RUN set -x \
|
RUN set -x \
|
||||||
&& apt-get update -y \
|
&& apt-get update -y \
|
||||||
@ -42,7 +43,9 @@ RUN set -x \
|
|||||||
zlib1g-dev \
|
zlib1g-dev \
|
||||||
libxi-dev \
|
libxi-dev \
|
||||||
libxtst-dev \
|
libxtst-dev \
|
||||||
mesa-common-dev
|
mesa-common-dev \
|
||||||
|
libyubikey-dev \
|
||||||
|
libykpers-1-dev
|
||||||
|
|
||||||
ENV CMAKE_PREFIX_PATH=/opt/qt${QT5_VERSION}/lib/cmake
|
ENV CMAKE_PREFIX_PATH=/opt/qt${QT5_VERSION}/lib/cmake
|
||||||
ENV LD_LIBRARY_PATH=/opt/qt${QT5_VERSION}/lib
|
ENV LD_LIBRARY_PATH=/opt/qt${QT5_VERSION}/lib
|
||||||
@ -52,34 +55,8 @@ RUN set -x \
|
|||||||
# AppImage dependencies
|
# AppImage dependencies
|
||||||
RUN set -x \
|
RUN set -x \
|
||||||
&& apt-get install -y \
|
&& apt-get install -y \
|
||||||
wget \
|
libfuse2 \
|
||||||
libfuse2
|
wget
|
||||||
|
|
||||||
# build libyubikey
|
|
||||||
ENV YUBIKEY_VERSION=1.13
|
|
||||||
RUN set -x \
|
|
||||||
&& wget "https://developers.yubico.com/yubico-c/Releases/libyubikey-${YUBIKEY_VERSION}.tar.gz" \
|
|
||||||
&& tar xf libyubikey-${YUBIKEY_VERSION}.tar.gz \
|
|
||||||
&& cd libyubikey-${YUBIKEY_VERSION} \
|
|
||||||
&& ./configure --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu \
|
|
||||||
&& make \
|
|
||||||
&& make install \
|
|
||||||
&& cd .. \
|
|
||||||
&& rm -Rf libyubikey-${YUBIKEY_VERSION}*
|
|
||||||
|
|
||||||
# build libykpers-1
|
|
||||||
ENV YKPERS_VERSION=1.18.0
|
|
||||||
RUN set -x \
|
|
||||||
&& apt-get install -y libusb-dev
|
|
||||||
RUN set -x \
|
|
||||||
&& wget "https://developers.yubico.com/yubikey-personalization/Releases/ykpers-${YKPERS_VERSION}.tar.gz" \
|
|
||||||
&& tar xf ykpers-${YKPERS_VERSION}.tar.gz \
|
|
||||||
&& cd ykpers-${YKPERS_VERSION} \
|
|
||||||
&& ./configure --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu \
|
|
||||||
&& make \
|
|
||||||
&& make install \
|
|
||||||
&& cd .. \
|
|
||||||
&& rm -Rf ykpers-${YKPERS_VERSION}*
|
|
||||||
|
|
||||||
VOLUME /keepassxc/src
|
VOLUME /keepassxc/src
|
||||||
VOLUME /keepassxc/out
|
VOLUME /keepassxc/out
|
||||||
|
@ -298,8 +298,7 @@ bool DatabaseTabWidget::closeDatabase(Database* db)
|
|||||||
if (!saveDatabase(db)) {
|
if (!saveDatabase(db)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
} else if (dbStruct.dbWidget->currentMode() != DatabaseWidget::LockedMode) {
|
||||||
else {
|
|
||||||
QMessageBox::StandardButton result =
|
QMessageBox::StandardButton result =
|
||||||
MessageBox::question(
|
MessageBox::question(
|
||||||
this, tr("Save changes?"),
|
this, tr("Save changes?"),
|
||||||
@ -307,10 +306,9 @@ bool DatabaseTabWidget::closeDatabase(Database* db)
|
|||||||
QMessageBox::Yes | QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Yes);
|
QMessageBox::Yes | QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Yes);
|
||||||
if (result == QMessageBox::Yes) {
|
if (result == QMessageBox::Yes) {
|
||||||
if (!saveDatabase(db)) {
|
if (!saveDatabase(db)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
} else if (result == QMessageBox::Cancel) {
|
||||||
else if (result == QMessageBox::Cancel) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -355,8 +353,13 @@ bool DatabaseTabWidget::saveDatabase(Database* db)
|
|||||||
{
|
{
|
||||||
DatabaseManagerStruct& dbStruct = m_dbList[db];
|
DatabaseManagerStruct& dbStruct = m_dbList[db];
|
||||||
|
|
||||||
if (dbStruct.saveToFilename) {
|
if (dbStruct.dbWidget->currentMode() == DatabaseWidget::LockedMode) {
|
||||||
|
// Never allow saving a locked database; it causes corruption
|
||||||
|
// We return true since a save is not required
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dbStruct.saveToFilename) {
|
||||||
dbStruct.dbWidget->blockAutoReload(true);
|
dbStruct.dbWidget->blockAutoReload(true);
|
||||||
QString errorMessage = db->saveToFile(dbStruct.canonicalFilePath);
|
QString errorMessage = db->saveToFile(dbStruct.canonicalFilePath);
|
||||||
dbStruct.dbWidget->blockAutoReload(false);
|
dbStruct.dbWidget->blockAutoReload(false);
|
||||||
@ -375,7 +378,6 @@ bool DatabaseTabWidget::saveDatabase(Database* db)
|
|||||||
MessageWidget::Error);
|
MessageWidget::Error);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return saveDatabaseAs(db);
|
return saveDatabaseAs(db);
|
||||||
}
|
}
|
||||||
|
@ -1206,7 +1206,7 @@ void DatabaseWidget::onWatchedFileChanged()
|
|||||||
|
|
||||||
void DatabaseWidget::reloadDatabaseFile()
|
void DatabaseWidget::reloadDatabaseFile()
|
||||||
{
|
{
|
||||||
if (m_db == nullptr) {
|
if (!m_db || currentMode() == DatabaseWidget::LockedMode) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,9 +31,18 @@ PasswordEdit::PasswordEdit(QWidget* parent)
|
|||||||
{
|
{
|
||||||
setEchoMode(QLineEdit::Password);
|
setEchoMode(QLineEdit::Password);
|
||||||
updateStylesheet();
|
updateStylesheet();
|
||||||
|
|
||||||
// set font to system monospace font and increase letter spacing
|
// use a monospace font for the password field
|
||||||
QFont passwordFont = QFontDatabase::systemFont(QFontDatabase::FixedFont);
|
QFont passwordFont = QFontDatabase::systemFont(QFontDatabase::FixedFont);
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
// try to use Consolas on Windows, because the default Courier New has too many similar characters
|
||||||
|
QFont consolasFont = QFontDatabase().font("Consolas", passwordFont.styleName(), passwordFont.pointSize());
|
||||||
|
const QFont defaultFont;
|
||||||
|
if (passwordFont != defaultFont) {
|
||||||
|
passwordFont = consolasFont;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
passwordFont.setLetterSpacing(QFont::PercentageSpacing, 110);
|
passwordFont.setLetterSpacing(QFont::PercentageSpacing, 110);
|
||||||
setFont(passwordFont);
|
setFont(passwordFont);
|
||||||
}
|
}
|
||||||
|
@ -536,6 +536,7 @@ void EditEntryWidget::loadEntry(Entry* entry, bool create, bool history, const Q
|
|||||||
m_database = database;
|
m_database = database;
|
||||||
m_create = create;
|
m_create = create;
|
||||||
m_history = history;
|
m_history = history;
|
||||||
|
m_saved = false;
|
||||||
|
|
||||||
if (history) {
|
if (history) {
|
||||||
setHeadline(QString("%1 > %2").arg(parentName, tr("Entry history")));
|
setHeadline(QString("%1 > %2").arg(parentName, tr("Entry history")));
|
||||||
@ -712,6 +713,7 @@ void EditEntryWidget::saveEntry()
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateEntryData(m_entry);
|
updateEntryData(m_entry);
|
||||||
|
m_saved = true;
|
||||||
|
|
||||||
if (!m_create) {
|
if (!m_create) {
|
||||||
m_entry->endUpdate();
|
m_entry->endUpdate();
|
||||||
@ -790,7 +792,7 @@ void EditEntryWidget::cancel()
|
|||||||
|
|
||||||
clear();
|
clear();
|
||||||
|
|
||||||
emit editFinished(false);
|
emit editFinished(m_saved);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditEntryWidget::clear()
|
void EditEntryWidget::clear()
|
||||||
|
@ -147,6 +147,7 @@ private:
|
|||||||
|
|
||||||
bool m_create;
|
bool m_create;
|
||||||
bool m_history;
|
bool m_history;
|
||||||
|
bool m_saved;
|
||||||
#ifdef WITH_XC_SSHAGENT
|
#ifdef WITH_XC_SSHAGENT
|
||||||
bool m_sshAgentEnabled;
|
bool m_sshAgentEnabled;
|
||||||
KeeAgentSettings m_sshAgentSettings;
|
KeeAgentSettings m_sshAgentSettings;
|
||||||
|
@ -372,15 +372,27 @@ void TestGui::testAddEntry()
|
|||||||
QTest::keyClicks(passwordRepeatEdit, "something 2");
|
QTest::keyClicks(passwordRepeatEdit, "something 2");
|
||||||
QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Ok), Qt::LeftButton);
|
QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Ok), Qt::LeftButton);
|
||||||
|
|
||||||
// Add entry "something 3"
|
// Add entry "something 3" using the apply button then click ok
|
||||||
QTest::mouseClick(entryNewWidget, Qt::LeftButton);
|
QTest::mouseClick(entryNewWidget, Qt::LeftButton);
|
||||||
QTest::keyClicks(titleEdit, "something 3");
|
QTest::keyClicks(titleEdit, "something 3");
|
||||||
|
QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Apply), Qt::LeftButton);
|
||||||
QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Ok), Qt::LeftButton);
|
QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Ok), Qt::LeftButton);
|
||||||
|
|
||||||
|
// Add entry "something 4" using the apply button then click cancel
|
||||||
|
QTest::mouseClick(entryNewWidget, Qt::LeftButton);
|
||||||
|
QTest::keyClicks(titleEdit, "something 4");
|
||||||
|
QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Apply), Qt::LeftButton);
|
||||||
|
QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Cancel), Qt::LeftButton);
|
||||||
|
|
||||||
|
// Add entry "something 5" but click cancel button (does NOT add entry)
|
||||||
|
QTest::mouseClick(entryNewWidget, Qt::LeftButton);
|
||||||
|
QTest::keyClicks(titleEdit, "something 5");
|
||||||
|
QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Cancel), Qt::LeftButton);
|
||||||
|
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
|
|
||||||
// Confirm that 4 entries now exist
|
// Confirm that 5 entries now exist
|
||||||
QTRY_COMPARE(entryView->model()->rowCount(), 4);
|
QTRY_COMPARE(entryView->model()->rowCount(), 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestGui::testPasswordEntryEntropy()
|
void TestGui::testPasswordEntryEntropy()
|
||||||
@ -553,7 +565,7 @@ void TestGui::testTotp()
|
|||||||
void TestGui::testSearch()
|
void TestGui::testSearch()
|
||||||
{
|
{
|
||||||
// Add canned entries for consistent testing
|
// Add canned entries for consistent testing
|
||||||
testAddEntry();
|
Q_UNUSED(addCannedEntries());
|
||||||
|
|
||||||
QToolBar* toolBar = m_mainWindow->findChild<QToolBar*>("toolBar");
|
QToolBar* toolBar = m_mainWindow->findChild<QToolBar*>("toolBar");
|
||||||
|
|
||||||
@ -669,7 +681,7 @@ void TestGui::testSearch()
|
|||||||
void TestGui::testDeleteEntry()
|
void TestGui::testDeleteEntry()
|
||||||
{
|
{
|
||||||
// Add canned entries for consistent testing
|
// Add canned entries for consistent testing
|
||||||
testAddEntry();
|
Q_UNUSED(addCannedEntries());
|
||||||
|
|
||||||
GroupView* groupView = m_dbWidget->findChild<GroupView*>("groupView");
|
GroupView* groupView = m_dbWidget->findChild<GroupView*>("groupView");
|
||||||
EntryView* entryView = m_dbWidget->findChild<EntryView*>("entryView");
|
EntryView* entryView = m_dbWidget->findChild<EntryView*>("entryView");
|
||||||
@ -945,6 +957,42 @@ void TestGui::cleanupTestCase()
|
|||||||
delete m_mainWindow;
|
delete m_mainWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int TestGui::addCannedEntries()
|
||||||
|
{
|
||||||
|
int entries_added = 0;
|
||||||
|
|
||||||
|
// Find buttons
|
||||||
|
QToolBar* toolBar = m_mainWindow->findChild<QToolBar*>("toolBar");
|
||||||
|
QWidget* entryNewWidget = toolBar->widgetForAction(m_mainWindow->findChild<QAction*>("actionEntryNew"));
|
||||||
|
EditEntryWidget* editEntryWidget = m_dbWidget->findChild<EditEntryWidget*>("editEntryWidget");
|
||||||
|
QLineEdit* titleEdit = editEntryWidget->findChild<QLineEdit*>("titleEdit");
|
||||||
|
QLineEdit* passwordEdit = editEntryWidget->findChild<QLineEdit*>("passwordEdit");
|
||||||
|
QLineEdit* passwordRepeatEdit = editEntryWidget->findChild<QLineEdit*>("passwordRepeatEdit");
|
||||||
|
|
||||||
|
// Add entry "test" and confirm added
|
||||||
|
QTest::mouseClick(entryNewWidget, Qt::LeftButton);
|
||||||
|
QTest::keyClicks(titleEdit, "test");
|
||||||
|
QDialogButtonBox* editEntryWidgetButtonBox = editEntryWidget->findChild<QDialogButtonBox*>("buttonBox");
|
||||||
|
QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Ok), Qt::LeftButton);
|
||||||
|
++entries_added;
|
||||||
|
|
||||||
|
// Add entry "something 2"
|
||||||
|
QTest::mouseClick(entryNewWidget, Qt::LeftButton);
|
||||||
|
QTest::keyClicks(titleEdit, "something 2");
|
||||||
|
QTest::keyClicks(passwordEdit, "something 2");
|
||||||
|
QTest::keyClicks(passwordRepeatEdit, "something 2");
|
||||||
|
QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Ok), Qt::LeftButton);
|
||||||
|
++entries_added;
|
||||||
|
|
||||||
|
// Add entry "something 3"
|
||||||
|
QTest::mouseClick(entryNewWidget, Qt::LeftButton);
|
||||||
|
QTest::keyClicks(titleEdit, "something 3");
|
||||||
|
QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Ok), Qt::LeftButton);
|
||||||
|
++entries_added;
|
||||||
|
|
||||||
|
return entries_added;
|
||||||
|
}
|
||||||
|
|
||||||
void TestGui::checkDatabase(QString dbFileName)
|
void TestGui::checkDatabase(QString dbFileName)
|
||||||
{
|
{
|
||||||
if (dbFileName.isEmpty())
|
if (dbFileName.isEmpty())
|
||||||
|
@ -62,6 +62,7 @@ private slots:
|
|||||||
void testDatabaseLocking();
|
void testDatabaseLocking();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
int addCannedEntries();
|
||||||
void checkDatabase(QString dbFileName = "");
|
void checkDatabase(QString dbFileName = "");
|
||||||
void triggerAction(const QString& name);
|
void triggerAction(const QString& name);
|
||||||
void dragAndDropGroup(const QModelIndex& sourceIndex, const QModelIndex& targetIndex, int row,
|
void dragAndDropGroup(const QModelIndex& sourceIndex, const QModelIndex& targetIndex, int row,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user