feat: add publisher metadata (#3080)

This commit is contained in:
ReenigneArcher
2024-08-24 20:14:45 -04:00
committed by GitHub
parent c9f853dc09
commit 6593fa5d61
21 changed files with 279 additions and 39 deletions

View File

@@ -34,6 +34,11 @@ namespace crypto {
using pkey_ctx_t = util::safe_ptr<EVP_PKEY_CTX, EVP_PKEY_CTX_free>;
using bignum_t = util::safe_ptr<BIGNUM, BN_free>;
/**
* @brief Hashes the given plaintext using SHA-256.
* @param plaintext
* @return The SHA-256 hash of the plaintext.
*/
sha256_t
hash(const std::string_view &plaintext);

View File

@@ -109,6 +109,13 @@ namespace lifetime {
}
} // namespace lifetime
void
log_publisher_data() {
BOOST_LOG(info) << "Package Publisher: "sv << SUNSHINE_PUBLISHER_NAME;
BOOST_LOG(info) << "Publisher Website: "sv << SUNSHINE_PUBLISHER_WEBSITE;
BOOST_LOG(info) << "Get support: "sv << SUNSHINE_PUBLISHER_ISSUE_URL;
}
#ifdef _WIN32
bool
is_gamestream_enabled() {

View File

@@ -108,6 +108,12 @@ namespace lifetime {
get_argv();
} // namespace lifetime
/**
* @brief Log the publisher metadata provided from CMake.
*/
void
log_publisher_data();
#ifdef _WIN32
/**
* @brief Check if NVIDIA's GameStream software is running.

View File

@@ -114,6 +114,9 @@ main(int argc, char *argv[]) {
// the version should be printed to the log before anything else
BOOST_LOG(info) << PROJECT_NAME << " version: " << PROJECT_VER;
// Log publisher metadata
log_publisher_data();
if (!config::sunshine.cmd.name.empty()) {
auto fn = cmd_to_func.find(config::sunshine.cmd.name);
if (fn == std::end(cmd_to_func)) {