mirror of
https://github.com/house-of-vanity/furumi.git
synced 2025-07-07 13:44:07 +00:00
init
This commit is contained in:
36
src/main.rs
Normal file
36
src/main.rs
Normal file
@ -0,0 +1,36 @@
|
||||
use std::path::PathBuf;
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
use env_logger::Env;
|
||||
use std::{process,path::Path};
|
||||
|
||||
mod config;
|
||||
mod filesystem;
|
||||
mod http;
|
||||
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), std::io::Error> {
|
||||
env_logger::from_env(Env::default().default_filter_or("info")).init();
|
||||
let cfg = config::read();
|
||||
//let http::list_directory(&cfg.server, &cfg.username, &cfg.password, "/").await;
|
||||
warn!("{:?}", cfg);
|
||||
|
||||
//let mut args = pico_args::Arguments::from_env();
|
||||
|
||||
let mountpoint: PathBuf = PathBuf::from(&cfg.mountpoint);
|
||||
if !mountpoint.is_dir() {
|
||||
error!("The mountpoint must be a directory");
|
||||
process::exit(0x0004);
|
||||
}
|
||||
|
||||
let memfs = filesystem::MemFS::new(&cfg);
|
||||
memfs.fetch_remote(Path::new("/"), 1).await;
|
||||
polyfuse_tokio::mount(memfs, mountpoint, &[]).await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
/*
|
||||
Mkdir { parent: 1, name: "123", mode: 493, umask: 18 }
|
||||
Mknod { parent: 1, name: "123233", mode: 33188, rdev: 0, umask: 18 }
|
||||
*/
|
Reference in New Issue
Block a user