Skip to content

Rust webserver that to replace my github.io site

Notifications You must be signed in to change notification settings

p0l1t1c1an/WebServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebServer

Rust webserver that to replace my github.io site

I cannot believe that this serves all of my github.io site without needing to configure anything

use rocket::fs::{FileServer};
use privdrop::PrivDrop;

#[rocket::main]
async fn main() -> anyhow::Result<()> {
    PrivDrop::default()
    .chroot("/home/p0l1t1c1an/Programs/WebServer/p0l1t1c1an.github.io") // should be www directory
    .user("p0l1t1c1an") // should be nobody
    .apply()?;
    let _ = rocket::build()
        .mount("/", FileServer::from("/"))
        .launch().await?; 
    Ok(())
}

I do plan on building a bit more in depth site, but the site would be static so I think I just need to implement TLS

Rocket makes this really easy but I'm unsure of how secure it is or how TLS is implemented

About

Rust webserver that to replace my github.io site

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages