~vpzom/shoved

ac0ad5d75fe81177e9349bd02796e5b9ca468de9 — Colin Reeder 1 year, 19 days ago b83a894
Make system mode usable
1 files changed, 11 insertions(+), 2 deletions(-)

M src/main.rs
M src/main.rs => src/main.rs +11 -2
@@ 261,7 261,7 @@ async fn handle_client(

#[tokio::main(flavor = "current_thread")]
async fn main() {
    let system = false;
    let system = std::env::args().skip(1).next().as_deref() == Some("--system");

    let db_path = {
        let db_dir_path = if system {


@@ 310,7 310,16 @@ async fn main() {
        }
    }

    let client_listener = tokio::net::UnixListener::bind(client_socket_path).unwrap();
    let client_listener = tokio::net::UnixListener::bind(&client_socket_path).unwrap();

    if system {
        // TODO maybe restrict to a group?
        std::fs::set_permissions(
            client_socket_path,
            std::os::unix::fs::PermissionsExt::from_mode(0o777),
        )
        .unwrap();
    }

    // TODO abstract these to handle reconnections?
    let (in_tx, mut in_rx) = tokio::sync::mpsc::unbounded_channel();