40 namespace fs = std::filesystem;
42 std::string version =
"?.?";
43 std::string build =
"?";
45 const std::string path =
"/usr/share/BastionGuard/data/version.bs";
47 if (!fs::exists(path))
48 return {version, build};
50 std::ifstream file(path);
52 return {version, build};
55 while (std::getline(file, line)) {
56 line.erase(0, line.find_first_not_of(
" \t"));
57 line.erase(line.find_last_not_of(
" \t") + 1);
59 if (line.starts_with(
"version="))
60 version = line.substr(8);
61 else if (line.starts_with(
"build="))
62 build = line.substr(6);
65 return {version, build};
77 auto box_program = Gtk::make_managed<Gtk::Box>(Gtk::Orientation::VERTICAL, 8);
80 auto picture_icon = Gtk::make_managed<Gtk::Picture>();
82 picture_icon->set_file(Gio::File::create_for_path(
resource(
"logo.png")));
83 picture_icon->set_size_request(64, 64);
87 picture_icon->set_halign(Gtk::Align::CENTER);
88 box_program->append(*picture_icon);
93 auto label_name = Gtk::make_managed<Gtk::Label>();
94 label_name->set_use_markup(
true);
95 label_name->set_halign(Gtk::Align::CENTER);
97 label_name->set_markup(
98 Glib::ustring::compose(
99 "<b>BastionGuard™ Endpoint</b> "
100 "<span size='medium'><i>%1 · build %2</i></span>",
107 box_program->append(*label_name);
110 auto label_copy = Gtk::make_managed<Gtk::Label>();
111 label_copy->set_use_markup(
true);
112 std::time_t t = std::time(
nullptr);
114 localtime_r(&t, &tm);
116 int year = tm.tm_year + 1900;
117 std::string year_str = std::to_string(year);
118 label_copy->set_markup(
119 Glib::ustring::compose(
120 _(
"© 2025-%1 Calogero Scarnà — BastionGuard™\n"
121 "BastionGuard è stato depositato il 16/12/2025 presso UIBM (Italia) con il numero 302025000196519.\n"
122 "Il motore anti-ransomware e anti-phishing è parte integrante della piattaforma di sicurezza.\n"
123 "Il sistema include la scansione delle periferiche USB,\n"
124 "scansione delle cartelle samba\n"
125 "e le funzionalità di blocco di microfono e webcam.\n"
126 "La protezione comprende la scansione in tempo reale con inotify.\n"
127 "ClamAV® è un marchio registrato da Cisco\n"
130 "<a href='https://www.codelinsoft.it' title='Visita CodeLinSoft'>"
131 "Powered by <b>CodeLinSoft</b></a>"
136 label_copy->set_halign(Gtk::Align::CENTER);
137 label_copy->set_justify(Gtk::Justification::CENTER);
138 label_copy->set_wrap(
true);
139 box_program->append(*label_copy);
142 notebook_.append_page(*box_program,
_(
"Programma"));
145 auto box_thirdparty = Gtk::make_managed<Gtk::Box>(Gtk::Orientation::VERTICAL, 8);
146 Glib::ustring thirdparty_text =
147 _(
"Questa applicazione utilizza:\n"
148 "- ClamAV Antivirus Engine\n"
164 "- DNSmasq /blocco pagine\n"
165 "- Antiphishing server/ libsoup\n");
167 thirdparty_text +=
_(
"- Sandbox bancario/ chromium sandbox (CEF)\n");
169 thirdparty_text +=
_(
"- MISP lista per le banche\n");
171 auto label_thirdparty = Gtk::make_managed<Gtk::Label>(thirdparty_text);
172 label_thirdparty->set_wrap(
true);
173 box_thirdparty->append(*label_thirdparty);
174 notebook_.append_page(*box_thirdparty,
_(
"Terze Parti"));
177 auto box_license = Gtk::make_managed<Gtk::Box>(Gtk::Orientation::VERTICAL, 8);
179 auto sw = Gtk::make_managed<Gtk::ScrolledWindow>();
180 sw->set_expand(
true);
181 sw->set_policy(Gtk::PolicyType::AUTOMATIC, Gtk::PolicyType::AUTOMATIC);
183 auto tv = Gtk::make_managed<Gtk::TextView>();
184 tv->set_editable(
false);
185 tv->set_wrap_mode(Gtk::WrapMode::WORD);
187 auto buf = Gtk::TextBuffer::create();
192 box_license->append(*sw);
194 notebook_.append_page(*box_license,
_(
"Licenza"));
197 auto box_db = Gtk::make_managed<Gtk::Box>(Gtk::Orientation::VERTICAL, 8);
199 auto swdb = Gtk::make_managed<Gtk::ScrolledWindow>();
200 swdb->set_expand(
true);
201 swdb->set_policy(Gtk::PolicyType::AUTOMATIC, Gtk::PolicyType::AUTOMATIC);
203 auto tvdb = Gtk::make_managed<Gtk::TextView>();
204 tvdb->set_editable(
false);
205 tvdb->set_wrap_mode(Gtk::WrapMode::WORD);
207 auto bufdb = Gtk::TextBuffer::create();
209 tvdb->set_buffer(bufdb);
211 swdb->set_child(*tvdb);
212 box_db->append(*swdb);
214 notebook_.append_page(*box_db,
_(
"Database"));
std::string load_license_text()
std::pair< std::string, std::string > load_version_build()
std::string load_database_info()