|
Hermes 0.7.0
Linux game streaming host
|
Declarations for the Web UI Config HTTP server. More...
#include <functional>#include <chrono>#include <string>#include <unordered_map>#include <string_view>#include <nlohmann/json.hpp>#include "thread_safe.h"Go to the source code of this file.
Macros | |
| #define | WEB_DIR HERMES_ASSETS_DIR "/web/" |
Functions | |
| void | confighttp::start () |
| Start the HTTPS server. | |
| nlohmann::json | confighttp::hestia_preflight_json () |
| Aggregate "is the host ready to stream?" checks. | |
| nlohmann::json | confighttp::hestia_capabilities_json () |
| The Hestia extension capabilities document. | |
| nlohmann::json | confighttp::computed_config_json () |
| Get the configuration settings. | |
| nlohmann::json & | confighttp::overlay_config_file (nlohmann::json &response, const std::unordered_map< std::string, std::string > &file_values) |
Overlay a parsed hermes.conf onto response, in place. | |
| bool | confighttp::local_api_token_origin_allowed (std::string_view address) |
| Whether an address may authenticate with the Game Mode local token. | |
Variables | |
| constexpr auto | confighttp::PORT_HTTPS = 1 |
| constexpr auto | confighttp::SESSION_EXPIRE_DURATION = 24h * 15 |
| const std::map< std::string, std::string > | mime_types |
Declarations for the Web UI Config HTTP server.
Definition in file confighttp.h.
| #define WEB_DIR HERMES_ASSETS_DIR "/web/" |
Definition at line 20 of file confighttp.h.
| nlohmann::json confighttp::computed_config_json | ( | ) |
Get the configuration settings.
The fields the Web UI's config response computes for itself: host status, platform and version. Never configuration.
| response | The HTTP response object. |
| request | The HTTP request object. |
Every key here must also be in config::server_computed_keys(), which is what keeps a hermes.conf from overwriting one of them; a test asserts it.
Definition at line 1619 of file confighttp.cpp.
| nlohmann::json confighttp::hestia_capabilities_json | ( | ) |
The Hestia extension capabilities document.
Exposed so the served document can be checked against the capabilities.schema.json this repository ships. The two had drifted - the document advertised a virtual display backend the schema does not allow - and every shipped Hestia rejected the whole document for it.
Definition at line 1684 of file confighttp.cpp.
| nlohmann::json confighttp::hestia_preflight_json | ( | ) |
Aggregate "is the host ready to stream?" checks.
Definition at line 2283 of file confighttp.cpp.
| bool confighttp::local_api_token_origin_allowed | ( | std::string_view | address | ) |
Whether an address may authenticate with the Game Mode local token.
The token is capped at this machine and private/local networks even when normal Web UI logins are configured to accept WAN clients.
Definition at line 78 of file confighttp.cpp.
| nlohmann::json & confighttp::overlay_config_file | ( | nlohmann::json & | response, |
| const std::unordered_map< std::string, std::string > & | file_values ) |
Overlay a parsed hermes.conf onto response, in place.
A key the response already carries is left alone. The Web UI posts the whole config response back and saveConfig() persists it, so a read-only field really does end up in the file - and a parsed value is always a string, which replaced a JSON array with "[]" and took the home page down with it.
response, for chaining. Definition at line 1637 of file confighttp.cpp.
| void confighttp::start | ( | ) |
Start the HTTPS server.
Definition at line 4137 of file confighttp.cpp.
| const std::map<std::string, std::string> mime_types |
Definition at line 77 of file confighttp.h.
|
constexpr |
Definition at line 25 of file confighttp.h.
|
constexpr |
Definition at line 26 of file confighttp.h.