From 8447c7ee48ebc4f55520e45eac7616fcca123ac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Wed, 15 Aug 2018 15:31:43 +0200 Subject: [PATCH] Update packages --- debian/control | 48 ++++++++++++++++++- debian/libnymea-remoteproxy-dev.install.in | 2 + debian/libnymea-remoteproxy.install.in | 3 ++ .../libnymea-remoteproxyclient-dev.install.in | 2 + debian/libnymea-remoteproxyclient.install.in | 4 +- debian/nymea-remoteproxy-tests.install | 3 +- debian/rules | 9 ++++ .../authentication/authenticationprocess.cpp | 10 +++- .../authentication/authenticationprocess.h | 3 ++ .../authentication/awsauthenticator.cpp | 2 +- 10 files changed, 79 insertions(+), 7 deletions(-) create mode 100644 debian/libnymea-remoteproxy-dev.install.in create mode 100644 debian/libnymea-remoteproxy.install.in create mode 100644 debian/libnymea-remoteproxyclient-dev.install.in diff --git a/debian/control b/debian/control index e33ab80..0fdaeeb 100644 --- a/debian/control +++ b/debian/control @@ -10,11 +10,42 @@ Package: nymea-remoteproxy Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, + awscli, + libnymea-remoteproxy (= ${binary:Version}), Description: The nymea remote proxy server The nymea remote proxy server + +Package: libnymea-remoteproxy +Architecture: any +Section: libs +Depends: ${shlibs:Depends}, + ${misc:Depends}, +Description: The nymea remote proxy server lib + The nymea remote proxy server lib + +Package: libnymea-remoteproxy-dev +Architecture: any +Section: libdevel +Depends: ${shlibs:Depends}, + ${misc:Depends}, + libnymea-remoteproxy (= ${binary:Version}), +Description: The nymea remote proxy server lib - development files + The nymea remote proxy server lib - development files + +Package: libnymea-remoteproxy-dbg +Architecture: any +Section: debug +Depends: ${shlibs:Depends}, + ${misc:Depends}, + libnymea-remoteproxy (= ${binary:Version}), +Description: The nymea remote proxy server lib - debug symbols + The nymea remote proxy server lib - debug symbols + + Package: nymea-remoteproxy-client Architecture: any +Section: libs Depends: ${shlibs:Depends}, ${misc:Depends}, Description: The nymea remote proxy client for testing @@ -22,6 +53,7 @@ Description: The nymea remote proxy client for testing Package: libnymea-remoteproxyclient Architecture: any +Section: libs Depends: ${shlibs:Depends}, ${misc:Depends}, Description: The nymea remote proxy server client lib @@ -29,14 +61,26 @@ Description: The nymea remote proxy server client lib Package: libnymea-remoteproxyclient-dev Architecture: any +Section: libdevel Depends: ${shlibs:Depends}, ${misc:Depends}, -Description: The nymea remote proxy server client lib, development files - The nymea remote proxy server client lib, development files + libnymea-remoteproxyclient (= ${binary:Version}), +Description: The nymea remote proxy server client lib - development files + The nymea remote proxy server client lib - development files + +Package: libnymea-remoteproxyclient-dbg +Architecture: any +Section: debug +Depends: ${shlibs:Depends}, + ${misc:Depends}, + libnymea-remoteproxyclient (= ${binary:Version}), +Description: The nymea remote proxy server client lib - debug symbols + The nymea remote proxy server client lib - debug symbols Package: nymea-remoteproxy-tests Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, + libnymea-remoteproxy (= ${binary:Version}), Description: The nymea remote proxy server tests The nymea remote proxy server tests diff --git a/debian/libnymea-remoteproxy-dev.install.in b/debian/libnymea-remoteproxy-dev.install.in new file mode 100644 index 0000000..da01e14 --- /dev/null +++ b/debian/libnymea-remoteproxy-dev.install.in @@ -0,0 +1,2 @@ +usr/lib/@DEB_HOST_MULTIARCH@/libnymea-remoteproxy.so +usr/include/nymea-remoteproxy/* usr/include/nymea-remoteproxy diff --git a/debian/libnymea-remoteproxy.install.in b/debian/libnymea-remoteproxy.install.in new file mode 100644 index 0000000..9a0a037 --- /dev/null +++ b/debian/libnymea-remoteproxy.install.in @@ -0,0 +1,3 @@ +usr/lib/@DEB_HOST_MULTIARCH@/libnymea-remoteproxy.so.1 +usr/lib/@DEB_HOST_MULTIARCH@/libnymea-remoteproxy.so.1.0 +usr/lib/@DEB_HOST_MULTIARCH@/libnymea-remoteproxy.so.1.0.0 diff --git a/debian/libnymea-remoteproxyclient-dev.install.in b/debian/libnymea-remoteproxyclient-dev.install.in new file mode 100644 index 0000000..da4196d --- /dev/null +++ b/debian/libnymea-remoteproxyclient-dev.install.in @@ -0,0 +1,2 @@ +usr/lib/@DEB_HOST_MULTIARCH@/libnymea-remoteproxyclient.so +usr/include/nymea-remoteproxyclient/* usr/include/nymea-remoteproxyclient diff --git a/debian/libnymea-remoteproxyclient.install.in b/debian/libnymea-remoteproxyclient.install.in index 8067a26..e6deb6a 100644 --- a/debian/libnymea-remoteproxyclient.install.in +++ b/debian/libnymea-remoteproxyclient.install.in @@ -1 +1,3 @@ -usr/lib/@DEB_HOST_MULTIARCH@/libnymea-remoteproxyclient.so.* +usr/lib/@DEB_HOST_MULTIARCH@/libnymea-remoteproxyclient.so.1 +usr/lib/@DEB_HOST_MULTIARCH@/libnymea-remoteproxyclient.so.1.0 +usr/lib/@DEB_HOST_MULTIARCH@/libnymea-remoteproxyclient.so.1.0.0 diff --git a/debian/nymea-remoteproxy-tests.install b/debian/nymea-remoteproxy-tests.install index ef18480..87c762f 100644 --- a/debian/nymea-remoteproxy-tests.install +++ b/debian/nymea-remoteproxy-tests.install @@ -1 +1,2 @@ -usr/bin/nymea-remoteproxy-tests +usr/bin/nymea-remoteproxy-tests-offline +usr/bin/nymea-remoteproxy-tests-online diff --git a/debian/rules b/debian/rules index b21fc88..0ed2311 100755 --- a/debian/rules +++ b/debian/rules @@ -11,5 +11,14 @@ $(PREPROCESS_FILES:.in=): %: %.in override_dh_install: $(PREPROCESS_FILES:.in=) dh_install +override_dh_strip: + dh_strip --dbg-package=libnymea-remoteproxy-dbg + dh_strip --dbg-package=libnymea-remoteproxyclient-dbg + +override_dh_auto_clean: + dh_auto_clean + find . -name *.qm -exec rm {} \; + rm -rf $(PREPROCESS_FILES:.in=) + %: dh $@ diff --git a/libnymea-remoteproxy/authentication/authenticationprocess.cpp b/libnymea-remoteproxy/authentication/authenticationprocess.cpp index 8f64df8..1790c8e 100644 --- a/libnymea-remoteproxy/authentication/authenticationprocess.cpp +++ b/libnymea-remoteproxy/authentication/authenticationprocess.cpp @@ -24,6 +24,7 @@ void AuthenticationProcess::useDynamicCredentials(bool dynamicCredentials) void AuthenticationProcess::requestDynamicCredentials() { + m_requestTimer.start(); QNetworkReply *reply = m_manager->get(QNetworkRequest(QUrl("http://169.254.169.254/latest/meta-data/iam/security-credentials/EC2-Remote-Connection-Proxy-Role"))); connect(reply, &QNetworkReply::finished, this, &AuthenticationProcess::onDynamicCredentialsReady); } @@ -52,7 +53,7 @@ void AuthenticationProcess::startVerificationProcess() m_resultFileName = "/tmp/" + QUuid::createUuid().toString().remove("{").remove("}").remove("-") + ".json"; qCDebug(dcAuthentication()) << "Start authenticator process and store result in" << m_resultFileName; - + m_processTimer.start(); m_process->start("aws", { "lambda", "invoke", "--function-name", "system-services-authorizer-dev-checkToken", "--invocation-type", "RequestResponse", @@ -66,6 +67,7 @@ void AuthenticationProcess::onDynamicCredentialsReady() QNetworkReply *reply = static_cast(sender()); reply->deleteLater(); + qCDebug(dcAuthenticationProcess()) << "Dynamic credentials request finished (" << m_requestTimer.elapsed() << "[ms] )"; if (reply->error()) { qCWarning(dcAuthenticationProcess()) << "Dynamic credentials reply error: " << reply->errorString(); emit authenticationFinished(Authenticator::AuthenticationErrorProxyError); @@ -95,16 +97,20 @@ void AuthenticationProcess::onDynamicCredentialsReady() void AuthenticationProcess::onProcessFinished(int exitCode, QProcess::ExitStatus exitStatus) { + qCDebug(dcAuthenticationProcess()) << "Authentication process finished (" << m_processTimer.elapsed() << "[ms] )";; if (exitStatus == QProcess::CrashExit) { qCWarning(dcAuthenticationProcess()) << "Authentication process crashed:" << endl << qUtf8Printable(m_process->readAll()); + emit authenticationFinished(Authenticator::AuthenticationErrorProxyError); + return; } if (exitCode != 0) { qCWarning(dcAuthenticationProcess()) << "The authentication process finished with error" << exitCode << endl << qUtf8Printable(m_process->readAll()); + emit authenticationFinished(Authenticator::AuthenticationErrorProxyError); + return; } - qCDebug(dcAuthenticationProcess()) << "Finished successfully"; QFile resultFile(m_resultFileName); if (!resultFile.exists()) { diff --git a/libnymea-remoteproxy/authentication/authenticationprocess.h b/libnymea-remoteproxy/authentication/authenticationprocess.h index e0f0d38..0ac7ccc 100644 --- a/libnymea-remoteproxy/authentication/authenticationprocess.h +++ b/libnymea-remoteproxy/authentication/authenticationprocess.h @@ -3,6 +3,7 @@ #include #include +#include #include #include "authenticator.h" @@ -28,6 +29,8 @@ private: QNetworkAccessManager *m_manager = nullptr; QProcess *m_process = nullptr; + QElapsedTimer m_requestTimer; + QElapsedTimer m_processTimer; void requestDynamicCredentials(); void startVerificationProcess(); diff --git a/libnymea-remoteproxy/authentication/awsauthenticator.cpp b/libnymea-remoteproxy/authentication/awsauthenticator.cpp index 70f9ace..2ca3870 100644 --- a/libnymea-remoteproxy/authentication/awsauthenticator.cpp +++ b/libnymea-remoteproxy/authentication/awsauthenticator.cpp @@ -9,7 +9,7 @@ AwsAuthenticator::AwsAuthenticator(QObject *parent) : Authenticator(parent), m_manager(new QNetworkAccessManager(this)) { - + // TODO: verify if aws command is installed } AwsAuthenticator::~AwsAuthenticator()