From 47d2c1264eb14e55ade42f993be5163ffc6cfaae Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Thu, 23 Nov 2023 10:39:06 +0100 Subject: embed html frontend content as binary compiled data (#559) - Feature: Added xmake task `updatefrontend` which updates the zip file containing the frontend html (`/src/zenserver/frontend/html.zip`) - Improvement: The frontend html content is no longer appended at the end of the executable which prevented signing, instead it is compiled in from the `/src/zenserver/frontend/html.zip` archive - Improvement: MacOS now does ad-hoc code signing by default when issuing `xmake bundle`, signing with proper cert is done on CI builds --- src/zenserver/frontend/frontend.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/zenserver/frontend/frontend.cpp') diff --git a/src/zenserver/frontend/frontend.cpp b/src/zenserver/frontend/frontend.cpp index 8c8e5cb9c..9bc408711 100644 --- a/src/zenserver/frontend/frontend.cpp +++ b/src/zenserver/frontend/frontend.cpp @@ -14,6 +14,9 @@ ZEN_THIRD_PARTY_INCLUDES_START #endif ZEN_THIRD_PARTY_INCLUDES_END +static unsigned char gHtmlZipData[] = { +#include +}; namespace zen { //////////////////////////////////////////////////////////////////////////////// @@ -22,8 +25,8 @@ HttpFrontendService::HttpFrontendService(std::filesystem::path Directory) : m_Di std::filesystem::path SelfPath = GetRunningExecutablePath(); // Locate a .zip file appended onto the end of this binary - IoBuffer SelfBuffer = IoBufferBuilder::MakeFromFile(SelfPath); - m_ZipFs = ZipFs(std::move(SelfBuffer)); + IoBuffer HtmlZipDataBuffer(IoBuffer::Wrap, gHtmlZipData, sizeof(gHtmlZipData) - 1); + m_ZipFs = ZipFs(std::move(HtmlZipDataBuffer)); if (m_Directory.empty() && !m_ZipFs) { -- cgit v1.2.3