mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralsec.git
synced 2026-01-27 02:23:03 +00:00
Adding git hash
This commit is contained in:
@@ -30,9 +30,22 @@ else()
|
||||
file(WRITE build ${BUILD_NUM})
|
||||
endif()
|
||||
|
||||
find_package(Git QUIET)
|
||||
if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} describe --always --tags
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
RESULT_VARIABLE GIT_RESULT
|
||||
OUTPUT_VARIABLE GIT_HASH)
|
||||
if(NOT GIT_RESULT EQUAL "0")
|
||||
message(FATAL_ERROR "git describe --always --tags failed with ${GIT_RESULT}")
|
||||
endif()
|
||||
string(REGEX REPLACE "\n$" "" GIT_HASH "${GIT_HASH}")
|
||||
endif()
|
||||
|
||||
add_definitions(-DAWS_CUSTOM_MEMORY_MANAGEMENT)
|
||||
|
||||
set(BUILD_SHARED_LIBS 1)
|
||||
|
||||
add_definitions(-DAPP_VERSION="${CMAKE_PROJECT_VERSION}" -DBUILD_NUMBER="${BUILD_NUM}")
|
||||
add_definitions(-DTIP_SECURITY_SERVICE="1")
|
||||
|
||||
set(Boost_USE_STATIC_LIBS OFF)
|
||||
@@ -50,8 +63,11 @@ find_package(Poco REQUIRED COMPONENTS JSON Crypto JWT Net Util NetSSL Data DataS
|
||||
|
||||
include_directories(/usr/local/include /usr/local/opt/openssl/include src include/kafka /usr/local/opt/mysql-client/include)
|
||||
|
||||
configure_file(src/ow_version.h.in ${PROJECT_SOURCE_DIR}/src/ow_version.h @ONLY)
|
||||
|
||||
add_executable( owsec
|
||||
build
|
||||
src/ow_version.h.in
|
||||
src/framework/CountryCodes.h
|
||||
src/framework/KafkaTopics.h
|
||||
src/framework/MicroService.h
|
||||
|
||||
@@ -71,6 +71,8 @@ using namespace std::chrono_literals;
|
||||
#include "RESTObjects/RESTAPI_SecurityObjects.h"
|
||||
#include "nlohmann/json.hpp"
|
||||
|
||||
#include "ow_version.h"
|
||||
|
||||
namespace OpenWifi {
|
||||
|
||||
enum UNAUTHORIZED_REASON {
|
||||
@@ -881,8 +883,7 @@ namespace OpenWifi::Utils {
|
||||
[[nodiscard]] inline bool ValidEMailAddress(const std::string &email) {
|
||||
// define a regular expression
|
||||
static const std::regex pattern
|
||||
// ("(\\w+)(\\.|_)?(\\w*)@(\\w+)(\\.(\\w+))+");
|
||||
("(\\w+)(\\.|_\\+)?(\\w*)@(\\w+)(\\.(\\w+))+");
|
||||
(("(\\w+)(\\.|_\\+)?(\\w*)@(\\w+)(\\.(\\w+))+"));
|
||||
|
||||
// try to match the string with the regular expression
|
||||
return std::regex_match(email, pattern);
|
||||
@@ -2695,7 +2696,7 @@ namespace OpenWifi {
|
||||
std::string MyPrivateEndPoint_;
|
||||
std::string MyPublicEndPoint_;
|
||||
std::string UIURI_;
|
||||
std::string Version_{std::string(APP_VERSION) + "("+ BUILD_NUMBER + ")"};
|
||||
std::string Version_{ OW_VERSION::VERSION + "("+ OW_VERSION::BUILD + ")" + " - " + OW_VERSION::HASH };
|
||||
BusEventManager BusEventManager_;
|
||||
std::mutex InfraMutex_;
|
||||
std::default_random_engine RandomEngine_;
|
||||
|
||||
13
src/ow_version.h.in
Normal file
13
src/ow_version.h.in
Normal file
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// Created by stephane bourque on 2021-12-06.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace OW_VERSION {
|
||||
inline static const std::string VERSION{"@CMAKE_PROJECT_VERSION@"};
|
||||
inline static const std::string BUILD{"@BUILD_NUM@"};
|
||||
inline static const std::string HASH{"@GIT_HASH@"};
|
||||
}
|
||||
Reference in New Issue
Block a user