Skip to content

Commit

Permalink
Merge branch 'development' into flatglas2
Browse files Browse the repository at this point in the history
  • Loading branch information
mdornaus authored Sep 19, 2023
2 parents 3f86fe2 + 50cddc5 commit ff30b2a
Show file tree
Hide file tree
Showing 112 changed files with 5,520 additions and 2,156 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
**/.git
deps/**/.git
Dockerfile
.dockerignore
docker-compose.yml
49 changes: 21 additions & 28 deletions .github/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.15)

project(BuildWithDependencies VERSION 1.3.1)
project(BuildWithDependencies)

include(${CMAKE_ROOT}/Modules/ExternalProject.cmake)

Expand All @@ -9,14 +9,19 @@ set(BUILD_DEB_PACKAGE FALSE CACHE BOOL "Flag that defines whether to build a deb
set(DEB_PACKAGE_LIBCPP_VERSION "8.4.0" CACHE STRING "The debian package libstdc++6 dependency version")
set(PAHO_WITH_SSL TRUE CACHE BOOL "Flag that defines whether to build paho.mqtt with SSL")


externalproject_add(
JsonExternal
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../deps/json
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} -DJSON_BuildTests:BOOL=0
INSTALL_DIR "${CMAKE_INSTALL_PREFIX}"
)

ExternalProject_Add(Tinyxml2External
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../deps/tinyxml2
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
INSTALL_DIR "${CMAKE_INSTALL_PREFIX}"
)

externalproject_add(
EasyloggingppExternal
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../deps/easyloggingpp
Expand All @@ -37,11 +42,13 @@ externalproject_add(
libreSSLExternal
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/libreSslDownload
SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/libreSslSource
URL "https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.7.0.tar.gz "
URL_HASH SHA256=3fc1290f4007ec75f6e9acecbb25512630d1b9ab8c53ba79844e395868c3e006
URL "https://mirror.leaseweb.com/pub/OpenBSD/LibreSSL/libressl-3.7.2.tar.gz"
URL_HASH SHA256=b06aa538fefc9c6b33c4db4931a09a5f52d9d2357219afcbff7d93fe12ebf6f7
PATCH_COMMAND "${Patch_EXECUTABLE}" -p1 --forward -d ${CMAKE_CURRENT_BINARY_DIR}/libreSslSource <
${CMAKE_CURRENT_SOURCE_DIR}/ciPatches/libressl-no_postfix.patch || echo "Patch returned non-zero"
CMAKE_ARGS -DLIBRESSL_APPS:BOOL=0 -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
CMAKE_ARGS -DLIBRESSL_APPS:BOOL=0
-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
INSTALL_DIR "${CMAKE_INSTALL_PREFIX}"
)

Expand All @@ -55,6 +62,7 @@ externalproject_add(
-DPAHO_BUILD_STATIC:BOOL=1
-DPAHO_ENABLE_TESTING:BOOL=1
-DLIBRESSL_ROOT_DIR:PATH=${CMAKE_INSTALL_PREFIX}/
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
DEPENDS libreSSLExternal
PATCH_COMMAND "${Patch_EXECUTABLE}" -p1 --forward -d ${CMAKE_CURRENT_SOURCE_DIR}/../deps/paho.mqtt.c <
${CMAKE_CURRENT_SOURCE_DIR}/ciPatches/paho.mqtt.c.patch || echo "Patch returned non-zero"
Expand All @@ -70,6 +78,7 @@ externalproject_add(
-DPAHO_BUILD_STATIC:BOOL=1
-DPAHO_ENABLE_TESTING:BOOL=1
-DLIBRESSL_ROOT_DIR:PATH=${CMAKE_INSTALL_PREFIX}/
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
DEPENDS PahoCExternal libreSSLExternal
PATCH_COMMAND "${Patch_EXECUTABLE}" -p1 --forward -d ${CMAKE_CURRENT_SOURCE_DIR}/../deps/paho.mqtt.cpp <
${CMAKE_CURRENT_SOURCE_DIR}/ciPatches/paho.mqtt.cpp.patch || echo "Patch returned non-zero"
Expand All @@ -85,14 +94,16 @@ externalproject_add(
-DUA_ENABLE_ENCRYPTION:STRING=LIBRESSL
-DLIBRESSL_ROOT_DIR:PATH=${CMAKE_INSTALL_PREFIX}
-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
INSTALL_DIR "${CMAKE_INSTALL_PREFIX}"
DEPENDS libreSSLExternal
)

externalproject_add(
open62541CppExternal
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../deps/open62541Cpp
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
INSTALL_DIR "${CMAKE_INSTALL_PREFIX}"
DEPENDS open62541External GTestExternal
)
Expand All @@ -102,28 +113,10 @@ externalproject_add(
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/..
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
-DLIBRESSL_ROOT_DIR:PATH=${CMAKE_INSTALL_PREFIX}/
-DBUILD_DEB_PACKAGE:BOOL=${BUILD_DEB_PACKAGE} /
-DDEB_PACKAGE_LIBCPP_VERSION:String=${DEB_PACKAGE_LIBCPP_VERSION}/

INSTALL_DIR "${CMAKE_INSTALL_PREFIX}"
DEPENDS open62541CppExternal EasyloggingppExternal JsonExternal PahoCppExternal
DEPENDS open62541CppExternal EasyloggingppExternal JsonExternal PahoCppExternal Tinyxml2External
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/Dashboard-Client-build
)


if(${BUILD_DEB_PACKAGE})
message("### Build debian package")
unset(BINARY_DIR)
ExternalProject_Get_property(Dashboard-Client BINARY_DIR)
set(BINARY_DIR_Dashboard-Client ${BINARY_DIR})
set(CPACK_INSTALL_CMAKE_PROJECTS ${BINARY_DIR_Dashboard-Client} "Dashboard-Client" "ALL" "/")
set(CPACK_PACKAGE_NAME "DashboardOpcUaClient")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "OPC UA client based on open62541 to subscribe to servers implementing umati endorsed companion specification and publish via MQTT to the demo dashboard https://umati.app")
set(CPACK_PACKAGE_VERSION ${CMAKE_PROJECT_VERSION})
set(CPACK_PACKAGE_DIRECTORY ${CMAKE_INSTALL_PREFIX})
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/../LICENSE")
set(CPACK_RESOURCE_FILE_README "${PROJECT_SOURCE_DIR}/../README.md")
set(CPACK_GENERATOR "DEB")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Marc Fischer")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libstdc++6 (>= ${DEB_PACKAGE_LIBCPP_VERSION}), openssl(>= 1.1.1), ca-certificates")
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
set(CPACK_DEB_COMPONENT_INSTALL YES)
INCLUDE(CPack)
endif()
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Environment:**

- OS: [e.g. Windows Version xx, Linux, Container]
- OPC UA Dashboard Client Version [branch, version]
- Used Enviroment [umati.app, staging.umati.app, dev.umati.app]
- OPC UA SDK of server [e.g. open62541]

**Log**
Upload log file or relevant error logs.

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
18 changes: 10 additions & 8 deletions .github/ciPatches/paho.mqtt.c.patch
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ index 0000000..6bdc069
+
+endif(LIBRESSL_FOUND)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4c06409..143106b 100644
index 4c06409..c2bfa93 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -187,14 +187,12 @@ INSTALL(FILES MQTTAsync.h MQTTClient.h MQTTClientPersistence.h MQTTProperties.h
Expand Down Expand Up @@ -275,7 +275,7 @@ index 4c06409..143106b 100644
SET_PROPERTY(TARGET common_ssl_obj_static PROPERTY POSITION_INDEPENDENT_CODE ON)
SET_PROPERTY(TARGET common_ssl_obj_static PROPERTY COMPILE_DEFINITIONS "OPENSSL=1;PAHO_MQTT_STATIC=1")

@@ -299,7 +302,12 @@ IF (PAHO_WITH_SSL)
@@ -299,7 +302,14 @@ IF (PAHO_WITH_SSL)
${CMAKE_BINARY_DIR})
TARGET_LINK_LIBRARIES(${TARGET}
PUBLIC
Expand All @@ -285,11 +285,13 @@ index 4c06409..143106b 100644
+ TARGET_LINK_LIBRARIES(${TARGET}
+ PUBLIC
+ bcrypt)
+ set(CMAKE_CURRENT_TARGET_FILE ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${TARGET}.pdb)
+ INSTALL(FILES "$<TARGET_FILE_DIR:${TARGET}>/${TARGET}.pdb" DESTINATION ${CMAKE_INSTALL_LIBDIR} OPTIONAL)
+ ENDIF()
ENDFOREACH()
ENDIF()
ENDIF()
@@ -322,7 +330,7 @@ ADD_EXECUTABLE( Base64Test EXCLUDE_FROM_ALL Base64.c Base64.h )
@@ -322,7 +332,7 @@ ADD_EXECUTABLE( Base64Test EXCLUDE_FROM_ALL Base64.c Base64.h )
TARGET_COMPILE_DEFINITIONS( Base64Test PUBLIC "-DBASE64_TEST" )
IF (PAHO_WITH_SSL)
ADD_EXECUTABLE( Base64TestOpenSSL EXCLUDE_FROM_ALL Base64.c Base64.h )
Expand All @@ -298,7 +300,7 @@ index 4c06409..143106b 100644
TARGET_COMPILE_DEFINITIONS( Base64TestOpenSSL PUBLIC "-DBASE64_TEST -DOPENSSL=1" )
ENDIF (PAHO_WITH_SSL)

@@ -331,6 +339,6 @@ ADD_EXECUTABLE( Sha1Test EXCLUDE_FROM_ALL SHA1.c SHA1.h )
@@ -331,6 +341,6 @@ ADD_EXECUTABLE( Sha1Test EXCLUDE_FROM_ALL SHA1.c SHA1.h )
TARGET_COMPILE_DEFINITIONS( Sha1Test PUBLIC "-DSHA1_TEST" )
IF (PAHO_WITH_SSL)
ADD_EXECUTABLE( Sha1TestOpenSSL EXCLUDE_FROM_ALL SHA1.c SHA1.h )
Expand All @@ -307,15 +309,15 @@ index 4c06409..143106b 100644
TARGET_COMPILE_DEFINITIONS( Sha1TestOpenSSL PUBLIC "-DSHA1_TEST -DOPENSSL=1" )
ENDIF (PAHO_WITH_SSL)
diff --git a/src/SSLSocket.c b/src/SSLSocket.c
index fd80c72..1dbd03b 100644
index a4941b6..76b2c86 100644
--- a/src/SSLSocket.c
+++ b/src/SSLSocket.c
@@ -593,7 +593,7 @@ int SSLSocket_createContext(networkHandles* net, MQTTClient_SSLOptions* opts)
}
@@ -594,7 +594,7 @@ int SSLSocket_createContext(networkHandles* net, MQTTClient_SSLOptions* opts)
}

/*
-#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER))
SSL_CTX_set_security_level(net->ctx, 1);
#endif

*/
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ updates:
directory: "/"
target-branch: "development"
schedule:
interval: "daily"
interval: "weekly"

- package-ecosystem: "docker"
directory: "/"
Expand Down
12 changes: 12 additions & 0 deletions .github/linters/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
BasedOnStyle: Google
IndentWidth: 2
---
Language: Cpp
ColumnLimit: 160
BinPackParameters: false
BinPackArguments: false
AlignAfterOpenBracket: AlwaysBreak
ContinuationIndentWidth: 2
ConstructorInitializerIndentWidth: 2
SortIncludes: false
3 changes: 2 additions & 1 deletion .github/linters/.jscpd.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"consoleFull"
],
"ignore": [
"**/__snapshots__/**"
"**/__snapshots__/**",
"**/mqtt_test/schemas/**"
],
"absolute": true
}
2 changes: 1 addition & 1 deletion .github/linters/.yaml-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ rules:
key-duplicates: enable
line-length:
level: warning
max: 80
max: 120
allow-non-breakable-words: true
allow-non-breakable-inline-mappings: true
new-line-at-end-of-file: disable
Expand Down
17 changes: 16 additions & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,22 @@
"extends": [
"config:base"
],
"rebaseWhen": "behind-base-branch",
"dependencyDashboard": true,
"git-submodules": {
"enabled": true
}
},
"regexManagers": [
{
"fileMatch": ["^Dockerfile$"],
"matchStringsStrategy": "any",
"matchStrings": [
"\\s\\s(?<package>[a-z0-9][a-z0-9-_]+)=(?<currentValue>[a-z0-9-_.]+)\\s+"
],
"versioningTemplate": "loose",
"datasourceTemplate": "repology",
"depNameTemplate": "alpine_3_18/{{package}}"
}
]
}

Loading

0 comments on commit ff30b2a

Please sign in to comment.