From 22533fb23c3b883608f06132ae0b134cc57db06d Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Mon, 29 Jan 2018 15:50:23 +0100 Subject: [PATCH] guhd -> nymead --- libnymea-core/bluetoothserver.cpp | 2 +- libnymea-core/debugserverhandler.cpp | 8 ++-- libnymea-core/hardwaremanagerdbusservice.cpp | 34 ------------- libnymea-core/hardwaremanagerdbusservice.h | 45 ------------------ libnymea-core/servermanager.cpp | 4 +- libnymea-core/tcpserver.cpp | 2 +- libnymea-core/webserver.cpp | 8 ++-- libnymea-core/websocketserver.cpp | 2 +- server/guhapplication.cpp | 2 +- server/guhservice.cpp | 16 +++---- server/main.cpp | 14 +++--- server/server.pro | 2 +- tests/auto/loggingloading/loggingloading.qrc | 4 +- ...uhd-broken.sqlite => nymead-broken.sqlite} | Bin .../{guhd-v2.sqlite => nymead-v2.sqlite} | Bin tests/auto/webserver/testwebserver.cpp | 24 +++++----- 16 files changed, 44 insertions(+), 123 deletions(-) delete mode 100644 libnymea-core/hardwaremanagerdbusservice.cpp delete mode 100644 libnymea-core/hardwaremanagerdbusservice.h rename tests/auto/loggingloading/{guhd-broken.sqlite => nymead-broken.sqlite} (100%) rename tests/auto/loggingloading/{guhd-v2.sqlite => nymead-v2.sqlite} (100%) diff --git a/libnymea-core/bluetoothserver.cpp b/libnymea-core/bluetoothserver.cpp index e1a5edb0..7b7c1a7d 100644 --- a/libnymea-core/bluetoothserver.cpp +++ b/libnymea-core/bluetoothserver.cpp @@ -20,7 +20,7 @@ /*! \class guhserver::BluetoothServer - \brief This class represents the bluetooth server for guhd. + \brief This class represents the bluetooth server for nymead. \ingroup server \inmodule core diff --git a/libnymea-core/debugserverhandler.cpp b/libnymea-core/debugserverhandler.cpp index 3ddb62f1..af37be56 100644 --- a/libnymea-core/debugserverhandler.cpp +++ b/libnymea-core/debugserverhandler.cpp @@ -338,8 +338,8 @@ QByteArray DebugServerHandler::createDebugXmlDocument() writer.writeStartElement("div"); writer.writeAttribute("class", "download-name-column"); - //: The guhd settings download description of the debug interface - writer.writeTextElement("p", QCoreApplication::translate("main", "Guhd settings")); + //: The nymead settings download description of the debug interface + writer.writeTextElement("p", QCoreApplication::translate("main", "nymead settings")); writer.writeEndElement(); // div download-name-column writer.writeStartElement("div"); @@ -352,7 +352,7 @@ QByteArray DebugServerHandler::createDebugXmlDocument() writer.writeStartElement("form"); writer.writeAttribute("class", "download-button"); writer.writeAttribute("method", "get"); - writer.writeAttribute("action", "/debug/settings/guhd"); + writer.writeAttribute("action", "/debug/settings/nymead"); writer.writeStartElement("button"); writer.writeAttribute("class", "button"); writer.writeAttribute("type", "submit"); @@ -763,7 +763,7 @@ HttpReply *DebugServerHandler::processDebugRequest(const QString &requestPath) return reply; } - if (requestPath.startsWith("/debug/settings/guhd")) { + if (requestPath.startsWith("/debug/settings/nymead")) { QString settingsFileName = GuhSettings(GuhSettings::SettingsRoleGlobal).fileName(); qCDebug(dcWebServer()) << "Loading" << settingsFileName; QFile settingsFile(settingsFileName); diff --git a/libnymea-core/hardwaremanagerdbusservice.cpp b/libnymea-core/hardwaremanagerdbusservice.cpp deleted file mode 100644 index 2dd09adf..00000000 --- a/libnymea-core/hardwaremanagerdbusservice.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * * - * Copyright (C) 2018 Simon Stürz * - * * - * This file is part of guh. * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Lesser General Public * - * License as published by the Free Software Foundation; either * - * version 2.1 of the License, or (at your option) any later version. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; If not, see * - * . * - * * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - - -#include "hardwaremanagerdbusservice.h" - -namespace guhserver { - -HardwareManagerDBusService::HardwareManagerDBusService(const QString &objectPath, QObject *parent) : - GuhDBusService(objectPath, parent) -{ - -} - -} diff --git a/libnymea-core/hardwaremanagerdbusservice.h b/libnymea-core/hardwaremanagerdbusservice.h deleted file mode 100644 index a9e3c75a..00000000 --- a/libnymea-core/hardwaremanagerdbusservice.h +++ /dev/null @@ -1,45 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * * - * Copyright (C) 2018 Simon Stürz * - * * - * This file is part of guh. * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Lesser General Public * - * License as published by the Free Software Foundation; either * - * version 2.1 of the License, or (at your option) any later version. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; If not, see * - * . * - * * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -#ifndef HARDWAREMANAGERDBUSSERVICE_H -#define HARDWAREMANAGERDBUSSERVICE_H - -#include -#include "guhdbusservice.h" - -namespace guhserver { - -class HardwareManagerDBusService : public GuhDBusService -{ - Q_OBJECT -public: - explicit HardwareManagerDBusService(const QString &objectPath, QObject *parent = nullptr); - -signals: - -public slots: - -}; - -} - -#endif // HARDWAREMANAGERDBUSSERVICE_H diff --git a/libnymea-core/servermanager.cpp b/libnymea-core/servermanager.cpp index 617030b2..96ee5191 100644 --- a/libnymea-core/servermanager.cpp +++ b/libnymea-core/servermanager.cpp @@ -59,8 +59,8 @@ ServerManager::ServerManager(GuhConfiguration* configuration, QObject *parent) : QString configCertificateFileName = configuration->sslCertificate(); QString configKeyFileName = configuration->sslCertificateKey(); - QString fallbackCertificateFileName = GuhSettings::storagePath() + "/certs/guhd-certificate.crt"; - QString fallbackKeyFileName = GuhSettings::storagePath() + "/certs/guhd-certificate.key"; + QString fallbackCertificateFileName = GuhSettings::storagePath() + "/certs/nymead-certificate.crt"; + QString fallbackKeyFileName = GuhSettings::storagePath() + "/certs/nymead-certificate.key"; bool certsLoaded = false; if (loadCertificate(configKeyFileName, configCertificateFileName)) { diff --git a/libnymea-core/tcpserver.cpp b/libnymea-core/tcpserver.cpp index c3fa99a1..1c1eb5e9 100644 --- a/libnymea-core/tcpserver.cpp +++ b/libnymea-core/tcpserver.cpp @@ -21,7 +21,7 @@ /*! \class guhserver::TcpServer - \brief This class represents the tcp server for guhd. + \brief This class represents the tcp server for nymead. \ingroup server \inmodule core diff --git a/libnymea-core/webserver.cpp b/libnymea-core/webserver.cpp index e900fd42..164e46e1 100644 --- a/libnymea-core/webserver.cpp +++ b/libnymea-core/webserver.cpp @@ -20,7 +20,7 @@ /*! \class guhserver::WebServer - \brief This class represents the web server for guhd. + \brief This class represents the web server for nymead. \ingroup server \inmodule core @@ -384,7 +384,7 @@ void WebServer::readClient() reply->deleteLater(); return; } else { - qCWarning(dcWebServer()) << "The debug server handler is disabled. You can enable it by adding \'debugServerEnabled=true\' in the \'guhd\' section of the guhd.conf file."; + qCWarning(dcWebServer()) << "The debug server handler is disabled. You can enable it by adding \'debugServerEnabled=true\' in the \'nymead\' section of the guhd.conf file."; HttpReply *reply = RestResource::createErrorReply(HttpReply::NotFound); reply->setClientId(clientId); sendHttpReply(reply); @@ -666,7 +666,7 @@ QByteArray WebServer::createServerXmlDocument(QHostAddress address) writer.writeTextElement("manufacturer", "guh GmbH"); writer.writeTextElement("manufacturerURL", "http://guh.io"); writer.writeTextElement("modelDescription", "IoT server"); - writer.writeTextElement("modelName", "guhd"); + writer.writeTextElement("modelName", "nymead"); writer.writeTextElement("modelNumber", GUH_VERSION_STRING); writer.writeTextElement("modelURL", "http://guh.io"); // (optional) writer.writeTextElement("UDN", "uuid:" + uuid); @@ -763,7 +763,7 @@ QByteArray WebServer::createServerXmlDocument(QHostAddress address) /*! \class guhserver::WebServerClient - \brief This class represents a client the web server for guhd. + \brief This class represents a client the web server for nymead. \ingroup server \inmodule core diff --git a/libnymea-core/websocketserver.cpp b/libnymea-core/websocketserver.cpp index 7f681f8a..782a9940 100644 --- a/libnymea-core/websocketserver.cpp +++ b/libnymea-core/websocketserver.cpp @@ -20,7 +20,7 @@ /*! \class guhserver::WebSocketServer - \brief This class represents the websocket server for guhd. + \brief This class represents the websocket server for nymead. \ingroup server \inmodule core diff --git a/server/guhapplication.cpp b/server/guhapplication.cpp index 8f5984b1..35120966 100644 --- a/server/guhapplication.cpp +++ b/server/guhapplication.cpp @@ -186,7 +186,7 @@ static void catchUnixSignals(const std::vector& quitSignals, const std::vec } qCDebug(dcApplication) << "====================================="; - qCDebug(dcApplication) << "Shutting down guh daemon"; + qCDebug(dcApplication) << "Shutting down nymea daemon"; qCDebug(dcApplication) << "====================================="; s_aboutToShutdown = true; diff --git a/server/guhservice.cpp b/server/guhservice.cpp index 8697b0d6..55b1076c 100644 --- a/server/guhservice.cpp +++ b/server/guhservice.cpp @@ -26,7 +26,7 @@ \ingroup core \inmodule server - The \l{GuhService} represents the forked guhd. + The \l{GuhService} represents the forked nymead. \sa QtService */ @@ -43,26 +43,26 @@ namespace guhserver { -/*! Constructs the forked guhd application with the given argument count \a argc and argument vector \a argv. */ +/*! Constructs the forked nymead application with the given argument count \a argc and argument vector \a argv. */ GuhService::GuhService(int argc, char **argv): - QtService(argc, argv, "guh - IoT server") + QtService(argc, argv, "nymea - IoT server") { application()->setOrganizationName("guh"); - application()->setApplicationName("guhd"); + application()->setApplicationName("nymead"); application()->setApplicationVersion(GUH_VERSION_STRING); close(STDIN_FILENO); close(STDOUT_FILENO); close(STDERR_FILENO); - setServiceDescription("guh - IoT server"); + setServiceDescription("nymea - IoT server"); setServiceFlags(QtServiceBase::CanBeSuspended); } -/*! Destroyes the forked guhd application. */ +/*! Destroyes the forked nymead application. */ GuhService::~GuhService() { } -/*! Starts the forked guhd application. */ +/*! Starts the forked nymead application. */ void GuhService::start() { // check if config directory for logfile exists @@ -71,7 +71,7 @@ void GuhService::start() exit(EXIT_FAILURE); } qCDebug(dcApplication) << "====================================="; - qCDebug(dcApplication) << "guhd" << GUH_VERSION_STRING << "started as daemon."; + qCDebug(dcApplication) << "nymead" << GUH_VERSION_STRING << "started as daemon."; qCDebug(dcApplication) << "====================================="; GuhCore::instance(); } diff --git a/server/main.cpp b/server/main.cpp index b4d2e88b..97d97824 100644 --- a/server/main.cpp +++ b/server/main.cpp @@ -105,7 +105,7 @@ int main(int argc, char *argv[]) GuhApplication application(argc, argv); application.setOrganizationName("guh"); - application.setApplicationName("guhd"); + application.setApplicationName("nymead"); application.setApplicationVersion(GUH_VERSION_STRING); // logging filers for core and libnymea @@ -150,7 +150,7 @@ int main(int argc, char *argv[]) // check if there are local translations if (!translator.load(QLocale::system(), application.applicationName(), "-", QDir(QCoreApplication::applicationDirPath() + "../../translations/").absolutePath(), ".qm")) if (!translator.load(QLocale::system(), application.applicationName(), "-", GuhSettings::translationsPath(), ".qm")) - qWarning(dcApplication()) << "Could not find guhd translations for" << QLocale::system().name() << endl << (QDir(QCoreApplication::applicationDirPath() + "../../translations/").absolutePath()) << endl << GuhSettings::translationsPath(); + qWarning(dcApplication()) << "Could not find nymead translations for" << QLocale::system().name() << endl << (QDir(QCoreApplication::applicationDirPath() + "../../translations/").absolutePath()) << endl << GuhSettings::translationsPath(); @@ -165,13 +165,13 @@ int main(int argc, char *argv[]) "device available in the system and create individual scenes and behaviors \n" "for your environment.\n\n"); - applicationDescription.append(QString("guhd %1 %2 2014-2018 guh GmbH\n" + applicationDescription.append(QString("nymead %1 %2 2014-2018 guh GmbH\n" "Released under the GNU GENERAL PUBLIC LICENSE Version 2.\n\n" "API version: %3\n").arg(GUH_VERSION_STRING).arg(QChar(0xA9)).arg(JSON_PROTOCOL_VERSION)); parser.setApplicationDescription(applicationDescription); - QCommandLineOption foregroundOption(QStringList() << "n" << "no-daemon", QCoreApplication::translate("main", "Run guhd in the foreground, not as daemon.")); + QCommandLineOption foregroundOption(QStringList() << "n" << "no-daemon", QCoreApplication::translate("main", "Run nymead in the foreground, not as daemon.")); parser.addOption(foregroundOption); QString debugDescription = QCoreApplication::translate("main", "Debug categories to enable. Prefix with \"No\" to disable. Warnings from all categories will be printed unless explicitly muted with \"NoWarnings\". \n\nCategories are:"); @@ -194,7 +194,7 @@ int main(int argc, char *argv[]) QCommandLineOption allOption(QStringList() << "p" << "print-all", QCoreApplication::translate("main", "Enables all debug categories. Single debug categories can be disabled again with -d parameter.")); parser.addOption(allOption); - QCommandLineOption logOption({"l", "log"}, QCoreApplication::translate("main", "Specify a log file to write to, if this option is not specified, logs will be printed to the standard output."), "logfile", "/var/log/guhd.log"); + QCommandLineOption logOption({"l", "log"}, QCoreApplication::translate("main", "Specify a log file to write to, if this option is not specified, logs will be printed to the standard output."), "logfile", "/var/log/nymead.log"); parser.addOption(logOption); QCommandLineOption dbusOption(QStringList() << "session", QCoreApplication::translate("main", "If specified, all D-Bus interfaces will be bound to the session bus instead of the system bus.")); @@ -257,11 +257,11 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); } qCDebug(dcApplication) << "====================================="; - qCDebug(dcApplication) << "guhd" << GUH_VERSION_STRING << "started with user ID" << userId; + qCDebug(dcApplication) << "nymead" << GUH_VERSION_STRING << "started with user ID" << userId; qCDebug(dcApplication) << "====================================="; } else { qCDebug(dcApplication) << "====================================="; - qCDebug(dcApplication) << "guhd" << GUH_VERSION_STRING << "started as root."; + qCDebug(dcApplication) << "nymead" << GUH_VERSION_STRING << "started as root."; qCDebug(dcApplication) << "====================================="; } diff --git a/server/server.pro b/server/server.pro index b81a3078..4031a1d5 100644 --- a/server/server.pro +++ b/server/server.pro @@ -1,6 +1,6 @@ include(../nymea.pri) -TARGET = guhd +TARGET = nymead TEMPLATE = app INCLUDEPATH += ../libnymea ../libnymea-core diff --git a/tests/auto/loggingloading/loggingloading.qrc b/tests/auto/loggingloading/loggingloading.qrc index c38aebda..d478b7c4 100644 --- a/tests/auto/loggingloading/loggingloading.qrc +++ b/tests/auto/loggingloading/loggingloading.qrc @@ -1,6 +1,6 @@ - guhd-v2.sqlite - guhd-broken.sqlite + nymead-v2.sqlite + nymead-broken.sqlite diff --git a/tests/auto/loggingloading/guhd-broken.sqlite b/tests/auto/loggingloading/nymead-broken.sqlite similarity index 100% rename from tests/auto/loggingloading/guhd-broken.sqlite rename to tests/auto/loggingloading/nymead-broken.sqlite diff --git a/tests/auto/loggingloading/guhd-v2.sqlite b/tests/auto/loggingloading/nymead-v2.sqlite similarity index 100% rename from tests/auto/loggingloading/guhd-v2.sqlite rename to tests/auto/loggingloading/nymead-v2.sqlite diff --git a/tests/auto/webserver/testwebserver.cpp b/tests/auto/webserver/testwebserver.cpp index 5fd8ae62..ce14f16d 100644 --- a/tests/auto/webserver/testwebserver.cpp +++ b/tests/auto/webserver/testwebserver.cpp @@ -557,19 +557,19 @@ void TestWebserver::getDebugServer_data() QTest::newRow("POST /debug/syslog | server enabled | 404") << "post" << "/debug/syslog" << false << 404; QTest::newRow("DELETE /debug/syslog | server enabled | 404") << "delete" << "/debug/syslog" << false << 404; - // settings/guhd enabled - QTest::newRow("GET /debug/settings/guhd | server enabled | 200") << "get" << "/debug/settings/guhd" << true << 200; - QTest::newRow("OPTIONS /debug/settings/guhd | server enabled | 200") << "options" << "/debug/settings/guhd" << true << 200; - QTest::newRow("PUT /debug/settings/guhd | server enabled | 405") << "put" << "/debug/settings/guhd" << true << 405; - QTest::newRow("POST /debug/settings/guhd | server enabled | 405") << "post" << "/debug/settings/guhd" << true << 405; - QTest::newRow("DELETE /debug/settings/guhd | server enabled | 405") << "delete" << "/debug/settings/guhd" << true << 405; + // settings/nymead enabled + QTest::newRow("GET /debug/settings/nymead | server enabled | 200") << "get" << "/debug/settings/nymead" << true << 200; + QTest::newRow("OPTIONS /debug/settings/nymead | server enabled | 200") << "options" << "/debug/settings/nymead" << true << 200; + QTest::newRow("PUT /debug/settings/nymead | server enabled | 405") << "put" << "/debug/settings/nymead" << true << 405; + QTest::newRow("POST /debug/settings/nymead | server enabled | 405") << "post" << "/debug/settings/nymead" << true << 405; + QTest::newRow("DELETE /debug/settings/nymead | server enabled | 405") << "delete" << "/debug/settings/nymead" << true << 405; - // settings/guhd disabled - QTest::newRow("GET /debug/settings/guhd | server disabled | 404") << "get" << "/debug/settings/guhd" << false << 404; - QTest::newRow("OPTIONS /debug/settings/guhd | server disabled | 404") << "options" << "/debug/settings/guhd" << false << 404; - QTest::newRow("PUT /debug/settings/guhd | server disabled | 404") << "put" << "/debug/settings/guhd" << false << 404; - QTest::newRow("POST /debug/settings/guhd | server disabled | 404") << "post" << "/debug/settings/guhd" << false << 404; - QTest::newRow("DELETE /debug/settings/guhd | server disabled | 404") << "delete" << "/debug/settings/guhd" << false << 404; + // settings/nymead disabled + QTest::newRow("GET /debug/settings/nymead | server disabled | 404") << "get" << "/debug/settings/nymead" << false << 404; + QTest::newRow("OPTIONS /debug/settings/nymead | server disabled | 404") << "options" << "/debug/settings/nymead" << false << 404; + QTest::newRow("PUT /debug/settings/nymead | server disabled | 404") << "put" << "/debug/settings/nymead" << false << 404; + QTest::newRow("POST /debug/settings/nymead | server disabled | 404") << "post" << "/debug/settings/nymead" << false << 404; + QTest::newRow("DELETE /debug/settings/nymead | server disabled | 404") << "delete" << "/debug/settings/nymead" << false << 404; // settings/devices enabled QTest::newRow("GET /debug/settings/devices | server enabled | 200") << "get" << "/debug/settings/devices" << true << 200;