diff --git a/CMakeLists.txt b/CMakeLists.txt index 59d6ee5..a188298 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,7 @@ CMAKE_MINIMUM_REQUIRED (VERSION 3.27.5) PROJECT (Pocketbook-Nextcloud VERSION 1.10) +find_package(CURL REQUIRED) add_compile_options(-std=c++17) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) @@ -69,7 +70,7 @@ add_executable(Nextcloud.app ${SOURCES}) target_compile_options(Nextcloud.app PRIVATE -Wall -Wextra -Wpedantic -Werror -pedantic -pedantic -Wall -Wextra -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wmissing-declarations -Wmissing-include-dirs -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-overflow=5 -Wswitch-default -Wundef -Wno-unused) -TARGET_LINK_LIBRARIES (Nextcloud.app PRIVATE inkview freetype sqlite3 stdc++fs curl) +TARGET_LINK_LIBRARIES (Nextcloud.app PRIVATE inkview freetype sqlite3 stdc++fs CURL::libcurl) target_compile_definitions(Nextcloud.app PRIVATE DBVERSION=2 PROGRAMVERSION="1.10") diff --git a/README.md b/README.md index c805ca0..142bf48 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,8 @@ Currently there are multiple methods to build the application. It is recommended ### Dockerimage The easiest way to build applications as of now to use the Dockerimage. (https://github.com/JuanJakobo/Pocketbook-dev-docker) +conan install . --output-folder=build --build=missing -pr=pocketbook + ### Setup Toolchain First you need to install the basic build tools for linux. diff --git a/conanfile.py b/conanfile.py new file mode 100644 index 0000000..ddb0aca --- /dev/null +++ b/conanfile.py @@ -0,0 +1,17 @@ +from conan import ConanFile +from conan.tools.cmake import cmake_layout + +class CompressorRecipe(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeToolchain", "CMakeDeps" + + def requirements(self): + self.requires("libcurl/8.4.0") + if self.settings.build_type == "Debug": + self.requires("gtest/1.14.0") + + def build_requirements(self): + self.tool_requires("cmake/3.27.5") + + def layout(self): + cmake_layout(self) diff --git a/src/api/webDAV.cpp b/src/api/webDAV.cpp index b2cd052..fa6b4a2 100644 --- a/src/api/webDAV.cpp +++ b/src/api/webDAV.cpp @@ -288,6 +288,9 @@ string WebDAV::propfind(const string &pathUrl) curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, Util::writeCallback); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer); + if (iv_access(CACERT_PATH, R_OK) == 0) + curl_easy_setopt(curl, CURLOPT_CAINFO, CACERT_PATH); + if (_ignoreCert) { Log::writeInfoLog("Cert ignored"); @@ -414,6 +417,10 @@ bool WebDAV::get(WebDAVItem &item) curl_easy_setopt(curl, CURLOPT_NOPROGRESS, false); curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, Util::progress_callback); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); + + if (iv_access(CACERT_PATH, R_OK) == 0) + curl_easy_setopt(curl, CURLOPT_CAINFO, CACERT_PATH); + if (_ignoreCert) { Log::writeInfoLog("Cert ignored"); diff --git a/src/api/webDAV.h b/src/api/webDAV.h index 1e2b65c..43a1c6f 100644 --- a/src/api/webDAV.h +++ b/src/api/webDAV.h @@ -19,6 +19,7 @@ using namespace std::string_literals; const auto NEXTCLOUD_ROOT_PATH{"/remote.php/dav/files/"s}; constexpr auto NEXTCLOUD_START_PATH{"/remote.php/"}; +constexpr auto CACERT_PATH{"/mnt/ext1/applications/cacert.pem"}; class WebDAV {