Compare commits

..

2 Commits

6 changed files with 23 additions and 9 deletions

View File

@@ -51,6 +51,8 @@ add_definitions(-DHTTP_MAX_PAYLOAD=200000000)
add_subdirectory(dependencies/control_system_client)
include_directories(src/)
add_executable(terminal-web-server
src/server/mime_types.hpp
src/server/mime_types.cpp
@@ -74,6 +76,7 @@ add_executable(terminal-web-server
src/auth/jwt.h
src/auth/utils.cpp
src/auth/utils.h
src/version.h
)
add_definitions(-DBOOST_LOG_DYN_LINK)

View File

@@ -71,7 +71,7 @@
this.statDevice.adrv = vals["mainState"]["device.adrv"]
this.statDevice.zynq = vals["mainState"]["device.zynq"]
this.statDevice.fpga = vals["mainState"]["device.fpga"]
{% if modem == 'tdma' %},
{% if modem == 'tdma' %}
this.statDevice.upgradeStatus = vals["mainState"]["device.upgradeStatus"]
this.statDevice.upgradePercent = vals["mainState"]["device.upgradePercent"]
this.statDevice.upgradeImage = vals["mainState"]["device.upgradeImage"]

View File

@@ -17,6 +17,7 @@
#include <fstream>
#include "terminal_api_driver.h"
#include "version.h"
#include "auth/resources.h"
#include "auth/jwt.h"
#include "auth/utils.h"
@@ -590,9 +591,12 @@ int main(int argc, char *argv[]) {
#ifdef USE_DEBUG
BOOST_LOG_TRIVIAL(info) << "Starting DEBUG " << argv[0];
#else
BOOST_LOG_TRIVIAL(info) << "Starting RELEASE build" << argv[0];
BOOST_LOG_TRIVIAL(info) << "Starting RELEASE " << argv[0];
#endif
BOOST_LOG_TRIVIAL(info) << ("Build time: " PROJECT_BUILD_TIME);
BOOST_LOG_TRIVIAL(info) << ("Git version: " PROJECT_GIT_REVISION);
#ifdef USE_DEBUG
http::auth::jwt::secretKey = "^}u'ZKyQ%;+:lnh^GS7!=G~nRK?7[{``";
BOOST_LOG_TRIVIAL(info) << "DEBUG build use pre-created key " << http::auth::jwt::secretKey;

View File

@@ -3,14 +3,10 @@
#include <boost/log/trivial.hpp>
#include <boost/beast.hpp>
#include "server.hpp"
#include "version.h"
namespace http::server {
const char* SERVER_HEADER_VALUE = "TerminalWebServer"
#ifdef PROJECT_GIT_REVISION
" " PROJECT_GIT_REVISION
#endif
;
const char* SERVER_HEADER_VALUE = "TerminalWebServer " PROJECT_GIT_REVISION;
Connection::Connection(boost::asio::ip::tcp::socket socket, ConnectionManager &manager, request_handler handler)
: socket_(std::move(socket)), connection_manager_(manager), request_handler_(std::move(handler)), request_(false), reply_() {

12
src/version.h Normal file
View File

@@ -0,0 +1,12 @@
#ifndef VERSION_H
#define VERSION_H
#ifndef PROJECT_GIT_REVISION
#warning "PROJECT_GIT_REVISION should be defined!"
#define PROJECT_GIT_REVISION "no-git"
#endif
#define PROJECT_BUILD_TIME __TIMESTAMP__
#endif //VERSION_H

View File

@@ -655,7 +655,6 @@
this.statDevice.adrv = vals["mainState"]["device.adrv"]
this.statDevice.zynq = vals["mainState"]["device.zynq"]
this.statDevice.fpga = vals["mainState"]["device.fpga"]
,
this.statDevice.upgradeStatus = vals["mainState"]["device.upgradeStatus"]
this.statDevice.upgradePercent = vals["mainState"]["device.upgradePercent"]
this.statDevice.upgradeImage = vals["mainState"]["device.upgradeImage"]