CI / Linux checks (push) Failing after 1s
The public client repository must not carry third_party/schema-api: TeamSpeak's non-public myTeamSpeak API protocol definitions, which came without a licence. The account sign-in built on them (crates/voelin-myts) goes with it, since nothing else in the client used that snapshot. Removed: third_party/schema-api, crates/voelin-myts, the account module of voelin-ui (sign-in, saved session, profile, avatar, badges, User Tag), the login page at start and the live account test of voelin-core. The workspace members, default-members and exclude lists, both manifests and Cargo.lock no longer name them (tonic, prost-build and their dependencies drop out of the lock file and THIRD_PARTY_NOTICES.md; about.hbs has no schema-api section). Settings -> My Account keeps the identity in use and shows a note that account sign-in is not available in this build. The Slint account screens stay, fed neutral values (Bridge.myts keeps its default: signed out, not available, no prompt), so the account can return without redoing them. The TeamSpeak protocol parts in tsproto/tsclientlib (myTS ID, other users' badges and avatars) are untouched. The account returns later through the gateway library (VoelinGateWay); the research notes in docs/research/myteamspeak.md stay and say so. CHANGELOG, docs/ui.md, docs/identity.md and SECURITY.md no longer describe the account as present. A session an earlier build saved stays in the system keyring (item myts/session) until the user deletes it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
69 lines
2.8 KiB
Rust
69 lines
2.8 KiB
Rust
//! Desktop client.
|
|
|
|
// Release builds on Windows are GUI programs (no console window); debug
|
|
// builds keep the console for logs.
|
|
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
|
|
|
use anyhow::Result;
|
|
use tracing_subscriber::{EnvFilter, Layer, fmt, prelude::*};
|
|
use voelin_platform::logs;
|
|
|
|
/// What the log file gets without `VOELIN_LOG`: our crates' information,
|
|
/// everyone's warnings. zbus's warnings are left out: it warns when a desktop
|
|
/// portal's request or session object is gone before it reads the object's
|
|
/// properties, which is harmless; its errors stay.
|
|
const FILE_FILTER: &str = "warn,zbus=error,voelin=info,voelin_ui=info,voelin_core=info,voelin_media=info,\
|
|
voelin_stream=info,voelin_audio=info,voelin_store=info,voelin_observer=info,\
|
|
voelin_query=info,voelin_gateway_proto=info,voelin_platform=info,tsclientlib=info";
|
|
|
|
fn main() -> Result<()> {
|
|
// The terminal (RUST_LOG, warnings by default) and the log file in the
|
|
// state directory (VOELIN_LOG, `FILE_FILTER` by default): release builds
|
|
// on Windows have no terminal.
|
|
let file = logs::LogFile::open(logs::default_dir());
|
|
let console = fmt::layer().with_writer(std::io::stderr).with_filter(
|
|
EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("warn,zbus=error")),
|
|
);
|
|
let to_file = file.as_ref().ok().map(|log| {
|
|
let log = log.clone();
|
|
fmt::layer().with_ansi(false).with_writer(move || log.clone()).with_filter(
|
|
EnvFilter::try_from_env("VOELIN_LOG").unwrap_or_else(|_| EnvFilter::new(FILE_FILTER)),
|
|
)
|
|
});
|
|
tracing_subscriber::registry().with(console).with(to_file).init();
|
|
match &file {
|
|
Ok(log) => tracing::info!(
|
|
version = env!("CARGO_PKG_VERSION"),
|
|
os = std::env::consts::OS,
|
|
log = %log.path().display(),
|
|
"Voelin starting"
|
|
),
|
|
Err(error) => tracing::warn!(%error, "no log file this time"),
|
|
}
|
|
// Banners go through the proxy the desktop's settings name (GNOME, KDE),
|
|
// as a browser's requests do; Windows and macOS settings are read anyway.
|
|
#[cfg(all(unix, not(any(target_os = "macos", target_os = "android"))))]
|
|
voelin_core::set_proxy_resolver(
|
|
|url| async move { voelin_platform::proxy::proxy_for(&url).await },
|
|
);
|
|
let options = voelin_ui::RunOptions {
|
|
setting_overrides: setting_overrides(std::env::args().skip(1)),
|
|
..Default::default()
|
|
};
|
|
voelin_ui::run(options)
|
|
}
|
|
|
|
/// `--set key=value` (or `--set=key=value`), repeatable: settings for this
|
|
/// run, below those changed in the app.
|
|
fn setting_overrides(mut args: impl Iterator<Item = String>) -> Vec<String> {
|
|
let mut overrides = Vec::new();
|
|
while let Some(arg) = args.next() {
|
|
match arg.strip_prefix("--set") {
|
|
Some("") => overrides.extend(args.next()),
|
|
Some(rest) if rest.starts_with('=') => overrides.push(rest[1..].to_owned()),
|
|
_ => eprintln!("ignoring argument {arg:?}; usage: voelin [--set key=value]..."),
|
|
}
|
|
}
|
|
overrides
|
|
}
|