Skip to content

Commit

Permalink
fix tui chars
Browse files Browse the repository at this point in the history
  • Loading branch information
aschey committed May 3, 2024
1 parent 89ea4e8 commit 8d8d30e
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
cargo llvm-cov --all-features --codecov --ignore-filename-regex ".cargo|.*_test\.rs" > ./codecov.json
- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
verbose: true
fail_ci_if_error: true
Expand Down
13 changes: 8 additions & 5 deletions libplatune/player/src/http_stream_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@ impl HttpStreamReader {
pub async fn new(url: String) -> Result<Self> {
let mut client_builder = Client::builder();
if url.starts_with("https://") {
let mtls_cert = env::var("PLATUNE_MTLS_CLIENT_CERT_PATH");
let mtls_key = env::var("PLATUNE_MTLS_CLIENT_KEY_PATH");
if let (Ok(mtls_cert), Ok(mtls_key)) = (mtls_cert, mtls_key) {
let mut cert = fs::read(mtls_cert).wrap_err_with(|| "mtls cert path invalid")?;
let mut key = fs::read(mtls_key).wrap_err_with(|| "mtls key path invalid")?;
let mtls_cert_path = env::var("PLATUNE_MTLS_CLIENT_CERT_PATH");
let mtls_key_path = env::var("PLATUNE_MTLS_CLIENT_KEY_PATH");
if let (Ok(mtls_cert_path), Ok(mtls_key_path)) = (mtls_cert_path, mtls_key_path) {
info!("Using cert paths: {mtls_cert_path} {mtls_key_path}");
let mut cert =
fs::read(mtls_cert_path).wrap_err_with(|| "mtls cert path invalid")?;
let mut key = fs::read(mtls_key_path).wrap_err_with(|| "mtls key path invalid")?;
cert.append(&mut key);

client_builder = client_builder.identity(Identity::from_pem(&cert)?);
}
}
Expand Down
8 changes: 4 additions & 4 deletions platune-cli/internal/statusbar/event_loop.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ var (
defaultStyle = lipgloss.NewStyle().Background(lipgloss.Color("8"))
infoIconStyle = defaultStyle.Copy().Foreground(lipgloss.Color("14"))
textStyle = defaultStyle.Copy().Foreground(lipgloss.Color("15"))
separator = defaultStyle.Copy().Foreground(lipgloss.Color("7")).Render(" ")
songIcon = ""
albumIcon = ""
artistIcon = ""
separator = defaultStyle.Copy().Foreground(lipgloss.Color("7")).Render(" ")
songIcon = ""
albumIcon = "󰀥"
artistIcon = ""
spacer = textStyle.Render(" ")
)

Expand Down
3 changes: 3 additions & 0 deletions platuned/server/src/cert_gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use rcgen::{
};
use time::OffsetDateTime;
use tonic::transport::{Identity, ServerTlsConfig};
use tracing::info;
use uuid::Uuid;

pub(crate) struct TlsConfig {
Expand Down Expand Up @@ -49,6 +50,8 @@ pub(crate) async fn get_tls_config(path: &Path) -> Result<TlsConfig, rcgen::Erro
},
});
}

info!("Generating TLS certs");
let path = path.to_owned();
let res = tokio::task::spawn_blocking(move || {
let (ca, server_key_pair) = gen_cert_for_ca()?;
Expand Down
4 changes: 3 additions & 1 deletion platuned/server/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,12 +208,14 @@ async fn run_server(
Ok("1" | "true")
)
{
info!("Enabling TLS");
let config_dir = config_dir()?;
let server_tls = get_tls_config(&config_dir.join("server")).await?;
let client_tls = if matches!(
std::env::var("PLATUNE_ENABLE_CLIENT_TLS").as_deref(),
Ok("1" | "true")
) {
info!("Enabling client TLS");
Some(get_tls_config(&config_dir.join("client")).await?)
} else {
None
Expand Down Expand Up @@ -249,7 +251,7 @@ async fn run_server(
}

Transport::Ipc(path) => {
let ipc_path = ServerId(path).into_ipc_path()?;
let ipc_path = ServerId(path).into_ipc_path()?;
info!("Running IPC server on {}", ipc_path.display());
builder
.serve_with_incoming_shutdown(IpcStream::get_async_stream(ipc_path)?, async {
Expand Down
1 change: 1 addition & 0 deletions platuned/server/src/services/management.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ async fn get_connection_type<T>(
if !global_addr.ends_with('/') {
global_addr.push('/');
}
info!("Using global file URL {global_addr}");
return Ok(ConnectionType::Remote {
folders,
local_addr: global_addr,
Expand Down

0 comments on commit 8d8d30e

Please sign in to comment.