diff --git a/README.md b/README.md new file mode 100644 index 0000000..ced5f19 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# navOS Site +This repo contains the code for: +- navOS project page +- navOS tar rootfs hosting +- navOS image hosting diff --git a/docker-compose.yml b/docker-compose.yml index 75e6631..20af185 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,6 +5,7 @@ services: - "8080:8000" volumes: - ./tar:/tar + - ./iso:/iso environment: - "RUST_LOG=info" - "ROCKET_ADDRESS=0.0.0.0" diff --git a/src/banner.png b/src/banner.png new file mode 100644 index 0000000..5118418 Binary files /dev/null and b/src/banner.png differ diff --git a/src/main.rs b/src/main.rs index 84e0936..5712a30 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,8 +2,21 @@ use based::request::assets::DataResponse; use rocket::{get, launch, routes}; #[get("/")] -pub async fn index() -> String { - String::new() +pub async fn index() -> DataResponse { + DataResponse::new( + include_str!("page/index.html").as_bytes().to_vec(), + "text/html".to_string(), + Some(60 * 60), + ) +} + +#[get("/banner")] +pub async fn banner_img() -> DataResponse { + DataResponse::new( + include_bytes!("banner.png").to_vec(), + "image/png".to_string(), + Some(60 * 60), + ) } #[get("/rootfs//rootfs.tar.xz")] @@ -27,9 +40,25 @@ pub async fn rootfs_tar(arch: &str) -> DataResponse { } } +#[get("/iso/")] +pub async fn install_iso(arch: &str) -> DataResponse { + match arch { + "x86_64" | "amd64" => DataResponse::new_file( + "./iso/x86_64.iso", + "application/x-iso9660-image".to_string(), + Some(60 * 60), + ), + _ => DataResponse::new( + "Weird arch".as_bytes().to_vec(), + "text/plain".to_string(), + None, + ), + } +} + #[launch] async fn rocket() -> _ { env_logger::init(); - rocket::build().mount("/", routes![index, rootfs_tar]) + rocket::build().mount("/", routes![index, rootfs_tar, banner_img, install_iso]) } diff --git a/src/page/index.html b/src/page/index.html new file mode 100644 index 0000000..49ca268 --- /dev/null +++ b/src/page/index.html @@ -0,0 +1,136 @@ + + + + + + navOS + + + + +
+
+
+ +

navOS

+
+
+ +

everyone is always connected

+
+ +
+

Welcome to the Wired.

+
+ +
+

What is navOS?

+

navOS is an experimental operating system born from the aesthetic and philosophy of Serial Experiments Lain. It is designed to provide a unified extensible platform for every device.

+
+ +
+

arch btw

+

you use arch btw. navOS is built on Arch Linux and the pacman ecosystem.

+
+ +
+

i have two arms

+

navOS supports multiple architectures, including `x86_64` and `aarch64`.

+
+ +
+

alpha male

+

navOS is in very alpha development. So the bugs are really aggressive for now.

+
+ +
+

download

+

You can download a install iso --> here <--

+

Or you can run `navinstall create-iso` if you have it installed.

+
+ + + +