1
0
mirror of https://github.com/QRouland/UTPass.git synced 2025-07-06 11:52:29 +00:00

9 Commits

Author SHA1 Message Date
63d53caad5 Update Readme wiki links 2025-01-07 20:46:15 +01:00
62c19f8ff9 Create FUNDING.yml 2025-01-07 16:44:14 +00:00
37c481ece1 Update build : use prebuild binaries + Add libgit2 2025-01-07 14:41:48 +01:00
c6d7a025ff Fix loading password before Pass plugin init 2023-06-19 14:58:09 -04:00
cec4e7dabc Update to configuration to clickable 7 2023-06-17 21:53:54 -04:00
a9b979b011 It can be useful for people that are not really into gpg/pass to know
how to export the specficic files needed for UTPass to work properly.
2020-08-03 10:25:24 +02:00
42efea67d8 Add git plugin TG-41 closed 2019-10-07 18:18:49 +02:00
1818d3d7e8 Add libgit2 as third dependencies TG-40 2019-10-07 18:18:49 +02:00
df5321644a bump version 2019-10-07 18:18:49 +02:00
45 changed files with 285 additions and 299 deletions

2
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1,2 @@
ko_fi: qrouland # Replace with a single Ko-fi username

13
.gitignore vendored
View File

@ -1,5 +1,6 @@
# Builds dirs # Builds dirs
build* build*
.cache
# IDE & Devs tools # IDE & Devs tools
.clickable .clickable
@ -10,13 +11,7 @@ build*
*.kdev4 *.kdev4
*swp *swp
scripts scripts
CMakeLists.txt.*
# Third parties ouput dir # venv
libs/third/local venv
# desktop
desktop
# Test (Not Ready yet !)
tests

30
.gitmodules vendored
View File

@ -1,30 +0,0 @@
[submodule "third/gpgme"]
path = libs/gpg/gpgme
url = https://github.com/gpg/gpgme
[submodule "third/libassuan"]
path = libs/gpg/libassuan
url = https://github.com/gpg/libassuan
[submodule "third/libgpg-error"]
path = libs/gpg/libgpg-error
url = https://github.com/gpg/libgpg-error
[submodule "third/gnupg"]
path = libs/gpg/gnupg
url = https://github.com/gpg/gnupg
[submodule "libs/utils/quazip"]
path = libs/quazip
url = https://github.com/stachenov/quazip
[submodule "libs/gpg/gpgme"]
path = libs/gpg/gpgme
url = https://github.com/gpg/gpgme
[submodule "libs/gpg/libassuan"]
path = libs/gpg/libassuan
url = https://github.com/gpg/libassuan
[submodule "libs/gpg/libgpg-error"]
path = libs/gpg/libgpg-error
url = https://github.com/gpg/libgpg-error
[submodule "libs/gpg/gnupg"]
path = libs/gpg/gnupg
url = https://github.com/gpg/gnupg
[submodule "libs/quazip"]
path = libs/quazip
url = https://github.com/stachenov/quazip

View File

@ -28,7 +28,7 @@ set(PROJECT_NAME "UTPass")
set(FULL_PROJECT_NAME "utpass.qrouland") set(FULL_PROJECT_NAME "utpass.qrouland")
set(CMAKE_INSTALL_PREFIX /) set(CMAKE_INSTALL_PREFIX /)
set(DATA_DIR /) set(DATA_DIR /)
set(BIN_DIR ${DATA_DIR}lib/bin) # set(BIN_DIR ${DATA_DIR}lib/bin)
set(DESKTOP_FILE_NAME ${PROJECT_NAME}.desktop) set(DESKTOP_FILE_NAME ${PROJECT_NAME}.desktop)
add_executable(${PROJECT_NAME} main.cpp) add_executable(${PROJECT_NAME} main.cpp)
@ -48,13 +48,15 @@ install(FILES ${PROJECT_NAME}.contenthub DESTINATION ${DATA_DIR})
install(FILES LICENSE DESTINATION ${DATA_DIR}) install(FILES LICENSE DESTINATION ${DATA_DIR})
install(DIRECTORY qml DESTINATION ${DATA_DIR}) install(DIRECTORY qml DESTINATION ${DATA_DIR})
install(DIRECTORY assets DESTINATION ${DATA_DIR}) install(DIRECTORY assets DESTINATION ${DATA_DIR})
file(GLOB_RECURSE BIN_FILES
"build/${ARCH_TRIPLET}/gpg/local/bin/*") # file(GLOB_RECURSE BIN_FILES
install( # "/usr/bin/gpg*"
FILES ${BIN_FILES} # )
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE # install(
DESTINATION ${BIN_DIR} # FILES ${BIN_FILES}
) # PERMISSIONS OWNER_EXECUTE OWNER_READ GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
# DESTINATION ${BIN_DIR}
# )
# Translations # Translations
file(GLOB_RECURSE I18N_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/po qml/*.qml qml/*.js) file(GLOB_RECURSE I18N_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/po qml/*.qml qml/*.js)
@ -81,4 +83,3 @@ add_subdirectory(po)
add_subdirectory(plugins) add_subdirectory(plugins)
add_custom_target(${PROJECT_NAME}_FILES ALL SOURCES ${PROJECT_SRC_FILES}) add_custom_target(${PROJECT_NAME}_FILES ALL SOURCES ${PROJECT_SRC_FILES})

View File

@ -8,35 +8,36 @@ UTPass is avalaible on the [OpenStore](open-store.io)
[![OpenStore](https://open-store.io/badges/en_US.png)](https://open-store.io/app/utpass.qrouland) [![OpenStore](https://open-store.io/badges/en_US.png)](https://open-store.io/app/utpass.qrouland)
## Build & Tests
See [Build & Tests wiki page](https://taiga.rdrive.ovh/project/utpass/wiki/build-tests)
## Contributing & Issues
See [Contributing wiki page](https://taiga.rdrive.ovh/project/utpass/wiki/contributing)
## Features ## Features
The goal is to be closest possible of the features offer by [ZX2C4s pass command line application](https://www.passwordstore.org/). The goal is to be closest possible of the features offer by [ZX2C4s pass command line application](https://www.passwordstore.org/).
See [Features wiki page](https://taiga.rdrive.ovh/project/utpass/wiki/contributing) for details. See [Features wiki page](https://taiga.rdrive.ovh/project/utpass/wiki/contributing) for details.
## License ## Export/Import
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> Assuming that there are already passwords in another device using [ZX2C4s pass command line application](https://www.passwordstore.org/) and, therefore, that [gpg keys](https://gnupg.org/) have been previously generated for encryption purposes, these may be helpful commands:
This program is free software: you can redistribute it and/or modify Export gpg private keys in order to decrypt passwords:
it under the terms of the GNU General Public License as published by ```
the Free Software Foundation, either version 3 of the License, or gpg --output keys.gpg --export-secret-keys
(at your option) any later version. ```
This program is distributed in the hope that it will be useful, Export passwords, assuming they reside in *.password-store* folder:
but WITHOUT ANY WARRANTY; without even the implied warranty of ```
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the zip passwords.zip -r .password-store/
GNU General Public License for more details. ```
You should have received a copy of the GNU General Public License Both files have the correct format for UTPass to import them and work as intended. It is highly recommended to remove them after imported to **UTPass**.
along with this program. If not, see <http://www.gnu.org/licenses/>.
## Build & Tests
See [Build & Tests wiki page](https://github.com/QRouland/UTPass/wiki/Build-&-Tests)
## Contributing & Issues
See [Contributing wiki page](https://github.com/QRouland/UTPass/wiki/Contributing)
## Useful Links ## Useful Links
@ -45,4 +46,23 @@ Some useful links related to UTPass development :
* [Ubports](https://ubports.com/) : Ubuntu Touch Community * [Ubports](https://ubports.com/) : Ubuntu Touch Community
* [ZX2C4s pass command line application](https://www.passwordstore.org/) : the standard unix password manager. * [ZX2C4s pass command line application](https://www.passwordstore.org/) : the standard unix password manager.
* [Clickable](https://github.com/bhdouglass/clickable) : Compile, build, and deploy Ubuntu Touch click packages * [Clickable](https://github.com/bhdouglass/clickable) : Compile, build, and deploy Ubuntu Touch click packages
* [GnuPG](https://gnupg.org/): The GNU Privacy Guard
* [Gpgme](https://www.gnupg.org/software/gpgme/index.html) : GnuPG Made Easy (GPGME) is a library designed to make access to GnuPG easier for applications * [Gpgme](https://www.gnupg.org/software/gpgme/index.html) : GnuPG Made Easy (GPGME) is a library designed to make access to GnuPG easier for applications
## License
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

View File

@ -1,6 +1,7 @@
{ {
"policy_groups": [ "policy_groups": [
"content_exchange" "content_exchange",
"networking"
], ],
"policy_version": 16.04 "policy_version": 20.04
} }

View File

@ -4,4 +4,4 @@ Exec=UTPass
Icon=assets/logo.svg Icon=assets/logo.svg
Terminal=false Terminal=false
Type=Application Type=Application
X-Ubuntu-Touch=true X-Lomiri-Touch=true

View File

@ -1,22 +0,0 @@
{
"template": "cmake",
"kill": "UTPass",
"scripts": {
"style": "echo 'Astyle :' && astyle --options=.astylerc main.cpp && astyle --options=.astylerc --recursive 'plugins/*.cpp,*.h' && echo 'QmlFmt :' && qmlfmt -l tests && qmlfmt -w tests && qmlfmt -l qml && qmlfmt -w qml"
},
"libraries": {
"gpg": {
"template": "cmake",
"make_jobs": 4,
"dependencies_build": [
"texinfo",
"gpgsm",
"bison"
]
},
"quazip": {
"template": "cmake",
"make_jobs": 4
}
}
}

28
clickable.yaml Normal file
View File

@ -0,0 +1,28 @@
clickable_minimum_required: 8
builder: cmake
kill: UTPass
scripts:
style: >-
echo 'Astyle :' && astyle --options=.astylerc main.cpp && astyle
--options=.astylerc --recursive 'plugins/*.cpp,*.h' && echo 'QmlFmt :' &&
qmlfmt -l tests && qmlfmt -w tests && qmlfmt -l qml && qmlfmt -w qml
dependencies_target:
- libgpgmepp-dev
- libgpgme-dev
- libgit2-dev
- libquazip5-dev
- gpg
install_lib:
- "libgpg-error.so.0.28.0"
- "libassuan.so"
- "libgpgme.so"
- "libgpgmepp.so"
- "libqgpgme.so.7"
- "libgit2.so"
- "libquazip5.so"
install_bin:
- "gpg"

View File

@ -1,68 +0,0 @@
cmake_minimum_required(VERSION 3.5.1)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
include(${CMAKE_ROOT}/Modules/ExternalProject.cmake)
execute_process(
COMMAND dpkg-architecture -qDEB_HOST_MULTIARCH
OUTPUT_VARIABLE ARCH_TRIPLET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process (
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/clean.sh ${ARCH_TRIPLET}
)
set(EXTERNAL_LIBS "${CMAKE_CURRENT_BINARY_DIR}/local/")
set(THIRD_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
set(LIBGPGERROR_PATH "${THIRD_PATH}/libgpg-error")
set(LIBASSUAN_PATH "${THIRD_PATH}/libassuan")
set(LIBGPGME_PATH "${THIRD_PATH}/gpgme")
set(GNUPG_PATH "${THIRD_PATH}/gnupg")
ExternalProject_Add(
LibGpgError
INSTALL_DIR ${EXTERNAL_LIBS}
DOWNLOAD_COMMAND ""
SOURCE_DIR ${LIBGPGERROR_PATH}
CONFIGURE_COMMAND <SOURCE_DIR>/autogen.sh && <SOURCE_DIR>/configure --prefix=${EXTERNAL_LIBS} --enable-static=yes --enable-shared=no --with-pic=yes --enable-maintainer-mode --host ${ARCH_TRIPLET} --disable-doc --disable-dependency-tracking
BUILD_IN_SOURCE 1
BUILD_COMMAND make
INSTALL_COMMAND make install
)
ExternalProject_Add(
LibGpgAssuan
DEPENDS LibGpgError
INSTALL_DIR ${EXTERNAL_LIBS}
DOWNLOAD_COMMAND ""
SOURCE_DIR ${LIBASSUAN_PATH}
CONFIGURE_COMMAND <SOURCE_DIR>/autogen.sh && <SOURCE_DIR>/configure --prefix=${EXTERNAL_LIBS} --enable-static=yes --enable-shared=no --with-pic=yes --enable-maintainer-mode --with-libgpg-error-prefix=${EXTERNAL_LIBS} --host ${ARCH_TRIPLET} --disable-doc --disable-dependency-tracking
BUILD_IN_SOURCE 1
BUILD_COMMAND make
INSTALL_COMMAND make install
)
ExternalProject_Add(
LibGpgme
DEPENDS LibGpgError LibGpgAssuan
INSTALL_DIR ${EXTERNAL_LIBS}
DOWNLOAD_COMMAND ""
SOURCE_DIR ${LIBGPGME_PATH}
CONFIGURE_COMMAND <SOURCE_DIR>/autogen.sh && <SOURCE_DIR>/configure --enable-languages=cpp,qt --enable-static=yes --enable-shared=no --with-pic=yes --prefix=${EXTERNAL_LIBS} --enable-maintainer-mode --with-libgpg-error-prefix=${EXTERNAL_LIBS} --with-libassuan-prefix=${EXTERNAL_LIBS} --host ${ARCH_TRIPLET} --disable-doc --disable-largefile --disable-dependency-tracking
BUILD_IN_SOURCE 1
BUILD_COMMAND make
INSTALL_COMMAND make install
)
ExternalProject_Add(
Gnupg
DEPENDS LibGpgError LibGpgAssuan
INSTALL_DIR ${EXTERNAL_LIBS}
DOWNLOAD_COMMAND ""
SOURCE_DIR ${GNUPG_PATH}
CONFIGURE_COMMAND <SOURCE_DIR>/autogen.sh && <SOURCE_DIR>/configure --prefix=${EXTERNAL_LIBS} --with-libgpg-error-prefix=${EXTERNAL_LIBS} --with-libassuan-prefix=${EXTERNAL_LIBS} --enable-maintainer-mode --with-libassuan-prefix=${EXTERNAL_LIBS} --host ${ARCH_TRIPLET} --disable-doc --disable-dependency-tracking
BUILD_IN_SOURCE 1
BUILD_COMMAND make
INSTALL_COMMAND make install
)

View File

@ -1,14 +0,0 @@
#!/bin/bash
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
if [ ! -z "$1" ] && [ -d $SCRIPTPATH/../../build/$1/gpg ]; then
rm -rf $SCRIPTPATH/../../build/$1/gpg
fi
git submodule update --init --recursive
for LIB in $SCRIPTPATH/*/
do
echo $LIB
cd $LIB && git clean -xdf && git reset --hard HEAD
done

Submodule libs/gpg/gnupg deleted from 8ae6a246be

Submodule libs/gpg/gpgme deleted from ea11c2a13c

Submodule libs/quazip deleted from 4df6c7412e

View File

@ -10,7 +10,7 @@
"content-hub": "UTPass.contenthub" "content-hub": "UTPass.contenthub"
} }
}, },
"version": "0.0.2", "version": "0.0.3-dev",
"maintainer": "Quentin Rouland <quentin@qrouland.com>", "maintainer": "Quentin Rouland <quentin@qrouland.com>",
"framework" : "ubuntu-sdk-16.04" "framework" : "ubuntu-sdk-20.04"
} }

View File

@ -4,6 +4,7 @@ set(PLUGIN "Pass")
set( set(
SRC SRC
plugin.cpp plugin.cpp
git.cpp
pass.cpp pass.cpp
gpg.cpp gpg.cpp
passkeymodel.h passkeymodel.h
@ -26,29 +27,29 @@ add_library(${PLUGIN} MODULE ${SRC})
set_target_properties(${PLUGIN} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PLUGIN}) set_target_properties(${PLUGIN} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PLUGIN})
qt5_use_modules(${PLUGIN} Qml Quick DBus) qt5_use_modules(${PLUGIN} Qml Quick DBus)
set(EXTERNAL_LIBS "${CMAKE_SOURCE_DIR}/build/${ARCH_TRIPLET}/gpg/local/")
INCLUDE_DIRECTORIES(${EXTERNAL_LIBS}/include) add_library(gpgerror SHARED IMPORTED)
set_property(TARGET gpgerror PROPERTY IMPORTED_LOCATION "/usr/lib/${ARCH_TRIPLET}/libgpg-error.so.0.28.0")
add_library(GpgError STATIC IMPORTED) add_library(libassuan SHARED IMPORTED)
set_property(TARGET GpgError PROPERTY IMPORTED_LOCATION "${EXTERNAL_LIBS}/lib/libgpg-error.a") set_property(TARGET libassuan PROPERTY IMPORTED_LOCATION "/usr/lib/${ARCH_TRIPLET}/libassuan.so")
add_library(GpgAssuan STATIC IMPORTED) add_library(libgpgme SHARED IMPORTED)
set_property(TARGET GpgAssuan PROPERTY IMPORTED_LOCATION "${EXTERNAL_LIBS}/lib/libassuan.a") set_property(TARGET libgpgme PROPERTY IMPORTED_LOCATION "/usr/lib/${ARCH_TRIPLET}/libgpgme.so")
add_library(Gpgme STATIC IMPORTED) add_library(libgpgmepp SHARED IMPORTED)
set_property(TARGET Gpgme PROPERTY IMPORTED_LOCATION "${EXTERNAL_LIBS}/lib/libgpgme.a") set_property(TARGET libgpgmepp PROPERTY IMPORTED_LOCATION "/usr/lib/${ARCH_TRIPLET}/libgpgmepp.so")
add_library(Gpgmepp STATIC IMPORTED) add_library(libqgpgme SHARED IMPORTED)
set_property(TARGET Gpgmepp PROPERTY IMPORTED_LOCATION "${EXTERNAL_LIBS}/lib/libgpgmepp.a") set_property(TARGET libqgpgme PROPERTY IMPORTED_LOCATION "/usr/lib/${ARCH_TRIPLET}/libqgpgme.so.7")
add_library(QGpgme STATIC IMPORTED)
set_property(TARGET QGpgme PROPERTY IMPORTED_LOCATION "${EXTERNAL_LIBS}/lib/libqgpgme.a")
target_link_libraries(${PLUGIN} QGpgme Gpgmepp Gpgme GpgAssuan GpgError) add_library(libgit2 SHARED IMPORTED)
set_property(TARGET libgit2 PROPERTY IMPORTED_LOCATION "/usr/lib/${ARCH_TRIPLET}/libgit2.so")
target_link_libraries(${PLUGIN} gpgerror libassuan libgpgme libgpgmepp libgit2)
set(QT_IMPORTS_DIR "/lib/${ARCH_TRIPLET}") set(QT_IMPORTS_DIR "/lib/${ARCH_TRIPLET}")
install(TARGETS ${PLUGIN} DESTINATION ${QT_IMPORTS_DIR}/${PLUGIN}/) install(TARGETS ${PLUGIN} DESTINATION ${QT_IMPORTS_DIR}/${PLUGIN}/)
install(FILES qmldir DESTINATION ${QT_IMPORTS_DIR}/${PLUGIN}/) install(FILES qmldir DESTINATION ${QT_IMPORTS_DIR}/${PLUGIN}/)

26
plugins/Pass/git.cpp Normal file
View File

@ -0,0 +1,26 @@
#include <QDebug>
#include <QUrl>
extern "C" {
#include <git2.h>
}
#include "git.h"
Git::Git()
{
git_libgit2_init();
}
Git::~Git() {
git_libgit2_shutdown();
}
bool Git::clone(QString url)
{
return false;
}

27
plugins/Pass/git.h Normal file
View File

@ -0,0 +1,27 @@
#ifndef GIT_H
#define GIT_H
#include <QObject>
#include <QUrl>
#include <memory>
class Git
{
private:
Git();
public:
~Git();
static std::shared_ptr<Git> instance()
{
static std::shared_ptr<Git> s{new Git};
return s;
}
Git(Git const &) = delete;
void operator=(Git const &) = delete;
bool clone(QString url);
};
#endif

View File

@ -4,7 +4,6 @@
#include <QDir> #include <QDir>
#include <QtCore/QStandardPaths> #include <QtCore/QStandardPaths>
#include <gpgme.h> #include <gpgme.h>
#include <gpgme++/data.h> #include <gpgme++/data.h>
#include <gpgme++/global.h> #include <gpgme++/global.h>
@ -24,8 +23,8 @@
#include <qgpgme/changeownertrustjob.h> #include <qgpgme/changeownertrustjob.h>
#include "gpg.h" #include "gpg.h"
#include "pass.h"
#include "passphraseprovider.h" #include "passphraseprovider.h"
#include "qprocess.h"
@ -37,11 +36,9 @@ Gpg::Gpg()
{ {
m_window = nullptr; m_window = nullptr;
initializeLibrary();
Gpg::initGpgConfig(); Gpg::initGpgConfig();
auto error = checkEngine(OpenPGP); auto error = checkEngine(OpenPGP);
if (error) { if (error) {
qDebug() << "Code Error : " << error.code(); qDebug() << "Code Error : " << error.code();
qDebug() << "Error str : " << error.asString(); qDebug() << "Error str : " << error.asString();
@ -66,15 +63,32 @@ QString Gpg::initGpgHome()
} }
QString Gpg::findCommandPath(const QString &command) {
// Retrieve the PATH environment variable
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
QString pathEnv = env.value("PATH");
// Split the PATH by colon
QStringList pathDirs = pathEnv.split(":", QString::SkipEmptyParts);
// Check each directory in the PATH
foreach (const QString &dir, pathDirs) {
QFileInfo fileInfo(QDir(dir).filePath(command));
// If the file exists and is executable, return the path
if (fileInfo.exists() && fileInfo.isExecutable()) {
return fileInfo.absoluteFilePath();
}
}
return QString::null;
}
QString Gpg::initGpgExec() QString Gpg::initGpgExec()
{ {
QString path = QDir::currentPath().append("/lib/bin/gpg"); QString path = findCommandPath("gpg");
QFileInfo file(path); if (path.isNull()) {
if (!file.isFile()) { qFatal("No valid gpg exec found !");
qFatal("GNUPGEXEC file not found !");
}
if (!file.isExecutable()) {
qFatal("GNUPGEXEC file not executable !");
} }
return path; return path;
} }
@ -82,20 +96,30 @@ QString Gpg::initGpgExec()
void Gpg::initGpgConfig() void Gpg::initGpgConfig()
{ {
auto home = initGpgHome(); initializeLibrary();
auto exec = initGpgExec(); gpgme_set_global_flag("disable-gpgconf", "1");
QString home = initGpgHome();
qDebug() << "Gpg home is " << home;
QString exec = initGpgExec();
qDebug() << "Gpg exec is " << exec;
QFile agentConf(home + QStringLiteral("/gpg-agent.conf")); QFile agentConf(home + QStringLiteral("/gpg-agent.conf"));
agentConf.remove(); agentConf.remove();
agentConf.open(QIODevice::WriteOnly); agentConf.open(QIODevice::WriteOnly);
agentConf.write("allow-loopback-pinentry"); agentConf.write("allow-loopback-pinentry\n");
agentConf.close(); agentConf.close();
gpgme_set_engine_info ( auto err = gpgme_set_engine_info (
GPGME_PROTOCOL_OpenPGP, GPGME_PROTOCOL_OpenPGP,
exec.toLocal8Bit().data(), exec.toLocal8Bit().data(),
home.toLocal8Bit().data() home.toLocal8Bit().data()
); );
if (err != GPG_ERR_NO_ERROR) {
qDebug() << "Error code : " << err;
qDebug() << "Error str : " << gpg_strerror(err);
qFatal("GPGME set engine info failed !");
}
} }

View File

@ -15,6 +15,7 @@ private:
Gpg(); Gpg();
QObject *m_window; QObject *m_window;
QString findCommandPath(const QString &command);
QString initGpgHome(); QString initGpgHome();
QString initGpgExec(); QString initGpgExec();
void initGpgConfig(); void initGpgConfig();

View File

@ -3,8 +3,8 @@
#include <QtCore/QDir> #include <QtCore/QDir>
#include "pass.h" #include "pass.h"
#include "git.h"
#include "gpg.h" #include "gpg.h"
#include "passphraseprovider.h"
#include "passkeymodel.h" #include "passkeymodel.h"
@ -18,44 +18,46 @@ void Pass::init(QObject *window)
if (!window) { if (!window) {
qFatal("window is invalid. Abording."); qFatal("window is invalid. Abording.");
} }
Gpg::instance()->setWindow(window); Gpg::instance()->setWindow(window);
QDir dir(m_password_store); QDir dir(m_password_store);
if (!dir.exists()) if (!dir.exists())
dir.mkpath("."); dir.mkpath(".");
qDebug() << "Password Store is :" << m_password_store; qInfo() << "Password Store is :" << m_password_store;
} }
void Pass::decrypt(QUrl url) void Pass::decrypt(QUrl url)
{ {
qDebug() << "Start decrypting"; qInfo() << "Decrypting";
auto decrypt_ret = Gpg::instance()->decryptFromFile(url.toLocalFile()); auto decrypt_ret = Gpg::instance()->decryptFromFile(url.toLocalFile());
if (decrypt_ret.first) { if (decrypt_ret.first) {
qDebug() << "Decrypt Failed"; qInfo() << "Decrypt Failed";
emit decryptFailed(); emit decryptFailed();
} else if (decrypt_ret.second.isNull()) { } else if (decrypt_ret.second.isNull()) {
qDebug() << "Decrypt Canceled"; qInfo() << "Decrypt Canceled";
emit decryptCanceled(); emit decryptCanceled();
} else { } else {
qDebug() << "Decrypt OK"; qInfo() << "Decrypt OK";
emit decrypted(decrypt_ret.second); emit decrypted(decrypt_ret.second);
} }
} }
bool Pass::gpgDeleteKeyId(QString id) bool Pass::gpgDeleteKeyId(QString id)
{ {
qDebug() << "Start deleting Key id " << id; qInfo() << "Deleting Key id " << id;
return !Gpg::instance()->deleteKeyId(id); return !Gpg::instance()->deleteKeyId(id);
} }
bool Pass::gpgImportKeyFromFile(QUrl url) bool Pass::gpgImportKeyFromFile(QUrl url)
{ {
qDebug() << "Start importing Key from " << url; qInfo() << "Importing Key from " << url;
return !Gpg::instance()->importKeysFromFile(url.toLocalFile()); return !Gpg::instance()->importKeysFromFile(url.toLocalFile());
} }
QVariant Pass::gpgGetAllKeysModel() QVariant Pass::gpgGetAllKeysModel()
{ {
qInfo() << "Getting all key form gpg ";
return QVariant::fromValue(PassKeyModel::keysToPassKeyQObjectList( return QVariant::fromValue(PassKeyModel::keysToPassKeyQObjectList(
Gpg::instance()->getAllKeys().second)); Gpg::instance()->getAllKeys().second));
} }
@ -64,3 +66,9 @@ QString Pass::getPasswordStore()
{ {
return m_password_store; return m_password_store;
} }
bool Pass::gitClone(QString url)
{
qInfo() << "Cloning . password_store from " << url;
return Git::instance()->clone(url);
}

View File

@ -27,6 +27,7 @@ public:
Q_INVOKABLE bool gpgDeleteKeyId(QString id); Q_INVOKABLE bool gpgDeleteKeyId(QString id);
Q_INVOKABLE bool gpgImportKeyFromFile(QUrl url); Q_INVOKABLE bool gpgImportKeyFromFile(QUrl url);
Q_INVOKABLE QVariant gpgGetAllKeysModel(); Q_INVOKABLE QVariant gpgGetAllKeysModel();
Q_INVOKABLE bool gitClone(QString url);
}; };
#endif #endif

View File

@ -23,15 +23,6 @@ add_library(${PLUGIN} MODULE ${SRC})
set_target_properties(${PLUGIN} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PLUGIN}) set_target_properties(${PLUGIN} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PLUGIN})
qt5_use_modules(${PLUGIN} Qml Quick DBus) qt5_use_modules(${PLUGIN} Qml Quick DBus)
set(EXTERNAL_LIBS "${CMAKE_SOURCE_DIR}/build/${ARCH_TRIPLET}/quazip/install/")
INCLUDE_DIRECTORIES(${EXTERNAL_LIBS}/include)
add_library(quazip STATIC IMPORTED)
set_property(TARGET quazip PROPERTY IMPORTED_LOCATION "${EXTERNAL_LIBS}/lib/libquazip5.a")
target_link_libraries(${PLUGIN} quazip)
set(QT_IMPORTS_DIR "/lib/${ARCH_TRIPLET}") set(QT_IMPORTS_DIR "/lib/${ARCH_TRIPLET}")

View File

@ -1,5 +1,5 @@
# UTPass # SOME DESCRIPTIVE TITLE.
# Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the utpass.qrouland package. # This file is distributed under the same license as the utpass.qrouland package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# #
@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: utpass.qrouland\n" "Project-Id-Version: utpass.qrouland\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-09-21 14:01+0000\n" "POT-Creation-Date: 2025-01-07 13:36+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -57,20 +57,7 @@ msgstr ""
msgid "Success !" msgid "Success !"
msgstr "" msgstr ""
#: ../qml/pages/headers/MainHeader.qml:8 ../qml/pages/headers/StackHeader.qml:8 #: ../qml/pages/Info.qml:11 ../qml/pages/headers/MainHeader.qml:58
#: UTPass.desktop.in.h:1
msgid "UTPass"
msgstr ""
#: ../qml/pages/headers/MainHeader.qml:23
msgid "Search"
msgstr ""
#: ../qml/pages/headers/MainHeader.qml:51 ../qml/pages/settings/Settings.qml:14
msgid "Settings"
msgstr ""
#: ../qml/pages/headers/MainHeader.qml:58 ../qml/pages/Info.qml:11
msgid "Info" msgid "Info"
msgstr "" msgstr ""
@ -103,6 +90,19 @@ msgid ""
"No password found<br>You can import a password store zip in the settings" "No password found<br>You can import a password store zip in the settings"
msgstr "" msgstr ""
#: ../qml/pages/headers/MainHeader.qml:8 ../qml/pages/headers/StackHeader.qml:8
#: UTPass.desktop.in.h:1
msgid "UTPass"
msgstr ""
#: ../qml/pages/headers/MainHeader.qml:23
msgid "Search"
msgstr ""
#: ../qml/pages/headers/MainHeader.qml:51 ../qml/pages/settings/Settings.qml:14
msgid "Settings"
msgstr ""
#: ../qml/pages/settings/ImportKeyFile.qml:17 #: ../qml/pages/settings/ImportKeyFile.qml:17
msgid "GPG Key Import" msgid "GPG Key Import"
msgstr "" msgstr ""

View File

@ -1,7 +1,7 @@
import QtQuick 2.4 import QtQuick 2.4
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import Ubuntu.Components 1.3 import Lomiri.Components 1.3
import Ubuntu.Components.Popups 1.3 import Lomiri.Components.Popups 1.3
import Pass 1.0 import Pass 1.0
import "dialogs" import "dialogs"
@ -19,6 +19,7 @@ MainView {
function initPass(rootView) { function initPass(rootView) {
Pass.init(rootView) Pass.init(rootView)
pageStack.push(Qt.resolvedUrl("pages/PasswordList.qml"));
} }
function callPassphraseDialog(useridHint, description, previousWasBad) { function callPassphraseDialog(useridHint, description, previousWasBad) {
@ -43,8 +44,6 @@ MainView {
id: pageStack id: pageStack
anchors.fill: parent anchors.fill: parent
Component.onCompleted: { Component.onCompleted: {}
pageStack.push(Qt.resolvedUrl("pages/PasswordList.qml"))
}
} }
} }

View File

@ -1,5 +1,5 @@
import QtQuick 2.4 import QtQuick 2.4
import Ubuntu.Components 1.3 import Lomiri.Components 1.3
import "../styles" import "../styles"
Item { Item {
@ -12,7 +12,7 @@ Item {
property int tBorderwidth: 0 property int tBorderwidth: 0
property int bBorderwidth: 0 property int bBorderwidth: 0
property int commonBorderWidth: 0 property int commonBorderWidth: 0
property string borderColor: UbuntuColors.warmGrey property string borderColor: LomiriColors.warmGrey
width: parent.width width: parent.width
height: units.gu(6) height: units.gu(6)
@ -33,13 +33,13 @@ Item {
anchors.rightMargin: units.gu(2) anchors.rightMargin: units.gu(2)
height: units.gu(4) height: units.gu(4)
name: "edit-copy" name: "edit-copy"
color: UbuntuColors.orange color: LomiriColors.orange
} }
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
onPressed: { onPressed: {
parent.color = UbuntuColors.warmGrey parent.color = LomiriColors.warmGrey
} }
onClicked: { onClicked: {
var mimeData = Clipboard.newData() var mimeData = Clipboard.newData()

View File

@ -1,5 +1,5 @@
import QtQuick 2.4 import QtQuick 2.4
import Ubuntu.Components 1.3 import Lomiri.Components 1.3
import "../styles" import "../styles"
Item { Item {
@ -14,7 +14,7 @@ Item {
property int tBorderwidth: 0 property int tBorderwidth: 0
property int bBorderwidth: 0 property int bBorderwidth: 0
property int commonBorderWidth: 0 property int commonBorderWidth: 0
property string borderColor: UbuntuColors.warmGrey property string borderColor: LomiriColors.warmGrey
width: parent.width width: parent.width
height: units.gu(6) height: units.gu(6)
@ -36,7 +36,7 @@ Item {
width: units.gu(4) width: units.gu(4)
height: units.gu(4) height: units.gu(4)
name: "go-next" name: "go-next"
color: UbuntuColors.orange color: LomiriColors.orange
} }
MouseArea { MouseArea {

View File

@ -1,6 +1,6 @@
import QtQuick 2.4 import QtQuick 2.4
import Ubuntu.Components 1.3 import Lomiri.Components 1.3
import Ubuntu.Components.Popups 1.3 import Lomiri.Components.Popups 1.3
import Pass 1.0 import Pass 1.0
import "../styles" import "../styles"
import "../dialogs" import "../dialogs"
@ -27,7 +27,7 @@ Component {
anchors.rightMargin: units.gu(2) anchors.rightMargin: units.gu(2)
height: units.gu(4) height: units.gu(4)
name: fileIsDir ? "go-next" : "lock" name: fileIsDir ? "go-next" : "lock"
color: UbuntuColors.orange color: LomiriColors.orange
} }
MouseArea { MouseArea {
@ -62,7 +62,7 @@ Component {
rBorderwidth: 0 rBorderwidth: 0
tBorderwidth: 0 tBorderwidth: 0
bBorderwidth: 1 bBorderwidth: 1
borderColor: UbuntuColors.warmGrey borderColor: LomiriColors.warmGrey
} }
Component { Component {

View File

@ -1,5 +1,5 @@
import QtQuick 2.4 import QtQuick 2.4
import Ubuntu.Components 1.3 import Lomiri.Components 1.3
import "../styles" import "../styles"
Item { Item {
@ -17,7 +17,7 @@ Item {
property int tBorderwidth: 0 property int tBorderwidth: 0
property int bBorderwidth: 0 property int bBorderwidth: 0
property int commonBorderWidth: 0 property int commonBorderWidth: 0
property string borderColor: UbuntuColors.warmGrey property string borderColor: LomiriColors.warmGrey
width: parent.width width: parent.width
height: units.gu(6) height: units.gu(6)
@ -39,7 +39,7 @@ Item {
width: units.gu(4) width: units.gu(4)
height: units.gu(4) height: units.gu(4)
name: "go-next" name: "go-next"
color: UbuntuColors.orange color: LomiriColors.orange
} }
MouseArea { MouseArea {

View File

@ -1,6 +1,6 @@
import QtQuick 2.4 import QtQuick 2.4
import Ubuntu.Components 1.3 import Lomiri.Components 1.3
import Ubuntu.Components.Popups 1.3 import Lomiri.Components.Popups 1.3
Dialog { Dialog {
id: doubleValidationDialog id: doubleValidationDialog
@ -26,7 +26,7 @@ Dialog {
Button { Button {
text: i18n.tr("Ok") text: i18n.tr("Ok")
color: UbuntuColors.green color: LomiriColors.green
onClicked: { onClicked: {
if (nb_validation == 1) { if (nb_validation == 1) {
@ -42,7 +42,7 @@ Dialog {
Button { Button {
id: cancelButton id: cancelButton
text: i18n.tr("Cancel") text: i18n.tr("Cancel")
color: UbuntuColors.red color: LomiriColors.red
onClicked: { onClicked: {
nb_validation = 0 nb_validation = 0
canceled() canceled()

View File

@ -1,6 +1,6 @@
import QtQuick 2.4 import QtQuick 2.4
import Ubuntu.Components 1.3 import Lomiri.Components 1.3
import Ubuntu.Components.Popups 1.3 import Lomiri.Components.Popups 1.3
Dialog { Dialog {
id: dialogSuccess id: dialogSuccess
@ -13,7 +13,7 @@ Dialog {
text: textError text: textError
Button { Button {
text: i18n.tr("OK") text: i18n.tr("OK")
color: UbuntuColors.red color: LomiriColors.red
onClicked: function () { onClicked: function () {
dialogClosed() dialogClosed()
PopupUtils.close(dialogSuccess) PopupUtils.close(dialogSuccess)

View File

@ -1,6 +1,6 @@
import QtQuick 2.4 import QtQuick 2.4
import Ubuntu.Components 1.3 import Lomiri.Components 1.3
import Ubuntu.Components.Popups 1.3 import Lomiri.Components.Popups 1.3
Dialog { Dialog {
id: passphraseProvider id: passphraseProvider
@ -27,7 +27,7 @@ Dialog {
id: okButton id: okButton
text: i18n.tr("Ok") text: i18n.tr("Ok")
color: UbuntuColors.green color: LomiriColors.green
onClicked: { onClicked: {
validated(passphraseField.text) validated(passphraseField.text)
@ -40,7 +40,7 @@ Dialog {
id: cancelButton id: cancelButton
text: i18n.tr("Cancel") text: i18n.tr("Cancel")
color: UbuntuColors.red color: LomiriColors.red
onClicked: { onClicked: {
canceled() canceled()

View File

@ -1,6 +1,6 @@
import QtQuick 2.4 import QtQuick 2.4
import Ubuntu.Components 1.3 import Lomiri.Components 1.3
import Ubuntu.Components.Popups 1.3 import Lomiri.Components.Popups 1.3
Dialog { Dialog {
id: doubleValidationDialog id: doubleValidationDialog
@ -17,7 +17,7 @@ Dialog {
Button { Button {
text: i18n.tr("Ok") text: i18n.tr("Ok")
color: UbuntuColors.green color: LomiriColors.green
onClicked: { onClicked: {
validated() validated()
@ -28,7 +28,7 @@ Dialog {
Button { Button {
id: cancelButton id: cancelButton
text: i18n.tr("Cancel") text: i18n.tr("Cancel")
color: UbuntuColors.red color: LomiriColors.red
onClicked: { onClicked: {
canceled() canceled()
PopupUtils.close(doubleValidationDialog) PopupUtils.close(doubleValidationDialog)

View File

@ -1,6 +1,6 @@
import QtQuick 2.4 import QtQuick 2.4
import Ubuntu.Components 1.3 import Lomiri.Components 1.3
import Ubuntu.Components.Popups 1.3 import Lomiri.Components.Popups 1.3
Dialog { Dialog {
id: dialogSuccess id: dialogSuccess
@ -13,7 +13,7 @@ Dialog {
text: textSuccess text: textSuccess
Button { Button {
text: i18n.tr("OK") text: i18n.tr("OK")
color: UbuntuColors.green color: LomiriColors.green
onClicked: function () { onClicked: function () {
dialogClosed() dialogClosed()
PopupUtils.close(dialogSuccess) PopupUtils.close(dialogSuccess)

View File

@ -1,5 +1,5 @@
import QtQuick 2.4 import QtQuick 2.4
import Ubuntu.Components 1.3 import Lomiri.Components 1.3
import "headers" import "headers"
import "../components" import "../components"

View File

@ -1,6 +1,6 @@
import QtQuick 2.4 import QtQuick 2.4
import Ubuntu.Components 1.3 import Lomiri.Components 1.3
import Ubuntu.Components.Popups 1.3 import Lomiri.Components.Popups 1.3
import "headers" import "headers"
Page { Page {

View File

@ -1,5 +1,5 @@
import QtQuick 2.4 import QtQuick 2.4
import Ubuntu.Components 1.3 import Lomiri.Components 1.3
import Qt.labs.folderlistmodel 2.1 import Qt.labs.folderlistmodel 2.1
import Pass 1.0 import Pass 1.0
import "../components" import "../components"

View File

@ -1,5 +1,5 @@
import QtQuick 2.4 import QtQuick 2.4
import Ubuntu.Components 1.3 import Lomiri.Components 1.3
PageHeader { PageHeader {
id: mainHeader id: mainHeader

View File

@ -1,5 +1,5 @@
import QtQuick 2.4 import QtQuick 2.4
import Ubuntu.Components 1.3 import Lomiri.Components 1.3
PageHeader { PageHeader {
id: stackHeader id: stackHeader

View File

@ -1,7 +1,7 @@
import QtQuick 2.4 import QtQuick 2.4
import Ubuntu.Components 1.3 import Lomiri.Components 1.3
import Ubuntu.Content 1.3 import Lomiri.Content 1.3
import Ubuntu.Components.Popups 1.3 import Lomiri.Components.Popups 1.3
import Pass 1.0 import Pass 1.0
import Utils 1.0 import Utils 1.0
import "../headers" import "../headers"

View File

@ -1,7 +1,7 @@
import QtQuick 2.4 import QtQuick 2.4
import Ubuntu.Components 1.3 import Lomiri.Components 1.3
import Ubuntu.Content 1.3 import Lomiri.Content 1.3
import Ubuntu.Components.Popups 1.3 import Lomiri.Components.Popups 1.3
import Pass 1.0 import Pass 1.0
import Utils 1.0 import Utils 1.0
import "../headers" import "../headers"

View File

@ -1,6 +1,6 @@
import QtQuick 2.4 import QtQuick 2.4
import Ubuntu.Components 1.3 import Lomiri.Components 1.3
import Ubuntu.Components.Popups 1.3 import Lomiri.Components.Popups 1.3
import Pass 1.0 import Pass 1.0
import "../headers" import "../headers"
import "../../components" import "../../components"
@ -47,7 +47,7 @@ Page {
Button { Button {
id: buttonDeleteKey id: buttonDeleteKey
text: i18n.tr("Delete this key") text: i18n.tr("Delete this key")
color: UbuntuColors.red color: LomiriColors.red
onClicked: { onClicked: {
infoKeysPage.currentKey = model.modelData.uid infoKeysPage.currentKey = model.modelData.uid
PopupUtils.open(infoKeysPageDeleteValidation, infoKeysPage) PopupUtils.open(infoKeysPageDeleteValidation, infoKeysPage)

View File

@ -1,5 +1,5 @@
import QtQuick 2.4 import QtQuick 2.4
import Ubuntu.Components 1.3 import Lomiri.Components 1.3
import Pass 1.0 import Pass 1.0
import "../headers" import "../headers"
import "../../components" import "../../components"
@ -51,7 +51,7 @@ Page {
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
width: parent.width width: parent.width
height: units.gu(4) height: units.gu(4)
color: UbuntuColors.red color: LomiriColors.red
text: i18n.tr( text: i18n.tr(
'Warning: importing delete any exiting Password Store') 'Warning: importing delete any exiting Password Store')
} }