Hermes 0.7.0
Linux game streaming host
Loading...
Searching...
No Matches
prelogin.h
Go to the documentation of this file.
1
13#pragma once
14
15// standard includes
16#include <optional>
17#include <string>
18#include <string_view>
19#include <vector>
20
21namespace platf::prelogin {
22
23 enum class state_e {
24 ready,
28 };
29
30 struct check_t {
31 std::string id;
32 state_e state;
33 std::string title;
34 std::string detail;
35 std::string fix;
36 };
37
38 struct report_t {
39 bool enabled {false};
40 bool ready {false};
41 std::vector<check_t> checks;
42 };
43
45 std::string display_server;
46 std::string autologin_user;
47 };
48
50 struct facts_t {
51 std::string user;
52 std::string unit_name;
53 bool unit_from_boot {false};
54 bool unit_generated {false};
55 bool unit_enabled {false};
56 std::optional<bool> linger;
57 std::string display_manager;
58 std::optional<sddm_settings_t> sddm;
59 std::optional<bool> input_without_session;
60 std::string virtual_display_backend;
61 std::optional<bool> hermes_kms_without_session;
62 };
63
79 std::string from_boot_unit(std::string_view packaged_unit, std::string_view source_path);
80
82 bool is_generated_unit(std::string_view unit);
83
88 bool unit_waits_for_session(std::string_view unit);
89
96 sddm_settings_t sddm_settings(const std::vector<std::string> &files);
97
99 report_t assess(const facts_t &facts);
100
101 std::string state_name(state_e state);
102
105
108
113 void log_report();
114
124 int command(const char *name, int argc, char *argv[]);
125
126} // namespace platf::prelogin
@ unknown
Unknown.
Definition common.h:215
report_t report()
assess(collect_facts()).
Definition prelogin.cpp:609
bool is_generated_unit(std::string_view unit)
Whether unit was written by from_boot_unit().
Definition prelogin.cpp:366
int command(const char *name, int argc, char *argv[])
hermes --prelogin status|enable|disable.
Definition prelogin.cpp:632
report_t assess(const facts_t &facts)
Decide every check from facts.
Definition prelogin.cpp:492
void log_report()
Say at startup what stands between this host and being reachable before login. Silent unless Hermes i...
Definition prelogin.cpp:613
facts_t collect_facts()
Look at this machine.
Definition prelogin.cpp:565
bool unit_waits_for_session(std::string_view unit)
Whether unit depends on a target that only exists once somebody has logged in, whoever wrote it.
Definition prelogin.cpp:375
sddm_settings_t sddm_settings(const std::vector< std::string > &files)
Read SDDM's settings from its configuration files.
Definition prelogin.cpp:463
std::string from_boot_unit(std::string_view packaged_unit, std::string_view source_path)
Turn the packaged unit into one that starts with the user manager.
Definition prelogin.cpp:395
@ note
Worth saying, and no obstacle.
Definition prelogin.h:27
@ missing
Known to be absent; fix says what to do.
Definition prelogin.h:25
std::string id
Stable name for the Web UI: "unit", "linger", "greeter", ...
Definition prelogin.h:31
std::string fix
Empty unless something is to be done.
Definition prelogin.h:35
std::string unit_name
"hermes.service"; empty when no packaged unit was found.
Definition prelogin.h:52
std::string display_manager
"sddm", "gdm", ...; empty when none is enabled.
Definition prelogin.h:57
std::optional< bool > hermes_kms_without_session
A Hermes-KMS node opens with no seat grant.
Definition prelogin.h:61
bool unit_from_boot
A unit in the user's own directory that does not wait for the session.
Definition prelogin.h:53
bool unit_generated
...and it is the copy --prelogin enable writes.
Definition prelogin.h:54
std::optional< bool > input_without_session
/dev/uinput opens with no seat grant.
Definition prelogin.h:59
std::optional< sddm_settings_t > sddm
Unset when SDDM's configuration could not be read.
Definition prelogin.h:58
bool unit_enabled
The unit is wanted by default.target.
Definition prelogin.h:55
bool enabled
Hermes' unit is set to start at boot.
Definition prelogin.h:39
bool ready
Every requirement is known to be in place.
Definition prelogin.h:40
std::string display_server
[General] DisplayServer, lower-case; empty when unset.
Definition prelogin.h:45
std::string autologin_user
[Autologin] User; SDDM logs in by itself whenever it is set.
Definition prelogin.h:46