Load status from relative url (#5)
Remove public_url config option Use proxy_url instead for example configs Get status from relative endpoint, like /config Show version on login page Reviewed-on: #5 Co-authored-by: Sam Sartor <me@samsartor.com> Co-committed-by: Sam Sartor <me@samsartor.com>
This commit was merged in pull request #5.
This commit is contained in:
+1
-7
@@ -1,10 +1,6 @@
|
||||
use color_eyre::eyre::{anyhow, bail, Context, Result};
|
||||
use color_eyre::owo_colors::OwoColorize;
|
||||
use mumble_web2_common::{ClientConfig, ServerStatus};
|
||||
use once_cell::sync::OnceCell;
|
||||
use rand::Rng;
|
||||
use rcgen::date_time_ymd;
|
||||
use rustls::server;
|
||||
use salvo::conn::rustls::{Keycert, RustlsConfig};
|
||||
use salvo::cors::{AllowOrigin, Cors};
|
||||
use salvo::logging::Logger;
|
||||
@@ -38,7 +34,6 @@ fn default_cert_alt_names() -> Vec<String> {
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
struct Config {
|
||||
public_url: Url,
|
||||
proxy_url: Option<Url>,
|
||||
https_listen_address: SocketAddr,
|
||||
http_listen_address: Option<SocketAddr>,
|
||||
@@ -85,9 +80,8 @@ async fn main() -> Result<()> {
|
||||
let mut client_config = ClientConfig {
|
||||
proxy_url: match &server_config.proxy_url {
|
||||
Some(url) => Some(url.to_string()),
|
||||
None => Some(server_config.public_url.join("proxy")?.to_string()),
|
||||
None => None,
|
||||
},
|
||||
status_url: Some(server_config.public_url.join("status")?.to_string()),
|
||||
cert_hash: None,
|
||||
any_server: false,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user