From f4eb269f9d043f7328da2f7ded9d8a6e97888c14 Mon Sep 17 00:00:00 2001 From: Khue Doan Date: Mon, 8 Feb 2021 08:52:53 +0700 Subject: [PATCH] Clean up --- .gitmodules | 3 --- Makefile | 18 ------------------ apps/README.md | 0 apps/index/Cargo.toml | 11 ----------- apps/index/Dockerfile | 25 ------------------------- apps/index/src/main.rs | 18 ------------------ apps/pastebin/Dockerfile | 7 ------- apps/scripts/docker-build.sh | 6 ------ apps/scripts/docker-push.sh | 6 ------ docs/00_metal.md | 1 + docs/01_infra.md | 1 + docs/02_platform.md | 1 + docs/03_apps.md | 1 + infra/README.md | 0 infra/pxe-server | 1 - metal/README.md | 0 {infra/scripts => metal}/reset.py | 0 platform/README.md | 0 18 files changed, 4 insertions(+), 95 deletions(-) delete mode 100644 Makefile create mode 100644 apps/README.md delete mode 100644 apps/index/Cargo.toml delete mode 100644 apps/index/Dockerfile delete mode 100644 apps/index/src/main.rs delete mode 100644 apps/pastebin/Dockerfile delete mode 100755 apps/scripts/docker-build.sh delete mode 100755 apps/scripts/docker-push.sh create mode 120000 docs/00_metal.md create mode 120000 docs/01_infra.md create mode 120000 docs/02_platform.md create mode 120000 docs/03_apps.md create mode 100644 infra/README.md delete mode 160000 infra/pxe-server create mode 100644 metal/README.md rename {infra/scripts => metal}/reset.py (100%) create mode 100644 platform/README.md diff --git a/.gitmodules b/.gitmodules index 7e891e83..e69de29b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "infra/pxe-server"] - path = infra/pxe-server - url = https://github.com/khuedoan/pxe-server diff --git a/Makefile b/Makefile deleted file mode 100644 index 1975dc61..00000000 --- a/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -#TODO -.POSIX: - -default: help - -help: - @echo "Khue's homelab" - -platform: - cd ./platform \ - && terraform init \ - && terraform apply - -apps: - echo hello - -reset-infra: - ./infra/scripts/reset.py diff --git a/apps/README.md b/apps/README.md new file mode 100644 index 00000000..e69de29b diff --git a/apps/index/Cargo.toml b/apps/index/Cargo.toml deleted file mode 100644 index c1403ae8..00000000 --- a/apps/index/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "index" -version = "0.1.0" -authors = ["Khue Doan "] -edition = "2018" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -actix-web = "2.0" -actix-rt = "1.0" diff --git a/apps/index/Dockerfile b/apps/index/Dockerfile deleted file mode 100644 index 61ed3e02..00000000 --- a/apps/index/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -FROM rust:1.44.1-slim AS base - -ENV USER=root - -WORKDIR /usr/local/src/index/ - -RUN cargo init -COPY ./Cargo.toml ./Cargo.toml -RUN cargo fetch - -COPY ./src/ ./src/ - -CMD [ "cargo", "test", "--offline" ] - -FROM base AS builder - -RUN cargo build --release --offline - -FROM rust:1.44.1-slim - -COPY --from=builder /usr/local/src/index/target/release/index /usr/local/bin/index - -EXPOSE 8000 - -ENTRYPOINT [ "/usr/local/bin/index" ] diff --git a/apps/index/src/main.rs b/apps/index/src/main.rs deleted file mode 100644 index c2421b90..00000000 --- a/apps/index/src/main.rs +++ /dev/null @@ -1,18 +0,0 @@ -use actix_web::{web, App, HttpRequest, HttpServer, Responder}; - -async fn greet(req: HttpRequest) -> impl Responder { - let name = req.match_info().get("name").unwrap_or("World"); - format!("Hello {}!", &name) -} - -#[actix_rt::main] -async fn main() -> std::io::Result<()> { - HttpServer::new(|| { - App::new() - .route("/", web::get().to(greet)) - .route("/{name}", web::get().to(greet)) - }) - .bind("0.0.0.0:8000")? - .run() - .await -} diff --git a/apps/pastebin/Dockerfile b/apps/pastebin/Dockerfile deleted file mode 100644 index 4cf04c87..00000000 --- a/apps/pastebin/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM alpine:3.12.0 - -ADD https://github.com/w4/bin/releases/download/v1.0.3/bin-v1.0.3-x86_64-unknown-linux-musl.tar.gz /tmp/ - -RUN tar -xvzf /tmp/bin-*.tar.gz -C /usr/local/bin/ && rm /tmp/bin-*.tar.gz - -CMD [ "bin" ] diff --git a/apps/scripts/docker-build.sh b/apps/scripts/docker-build.sh deleted file mode 100755 index 6936cac8..00000000 --- a/apps/scripts/docker-build.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -docker build -t khuedoan/khuedoan.com-nginx nginx/ -docker build -t khuedoan/khuedoan.com-index index/ -docker build -t khuedoan/khuedoan.com-gitea gitea/ -docker build -t khuedoan/khuedoan.com-mariadb mariadb/ diff --git a/apps/scripts/docker-push.sh b/apps/scripts/docker-push.sh deleted file mode 100755 index 8be6a0de..00000000 --- a/apps/scripts/docker-push.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -docker push khuedoan/khuedoan.com-nginx -docker push khuedoan/khuedoan.com-index -docker push khuedoan/khuedoan.com-gitea -docker push khuedoan/khuedoan.com-mariadb diff --git a/docs/00_metal.md b/docs/00_metal.md new file mode 120000 index 00000000..cd66aacb --- /dev/null +++ b/docs/00_metal.md @@ -0,0 +1 @@ +../metal/README.md \ No newline at end of file diff --git a/docs/01_infra.md b/docs/01_infra.md new file mode 120000 index 00000000..c472447d --- /dev/null +++ b/docs/01_infra.md @@ -0,0 +1 @@ +../infra/README.md \ No newline at end of file diff --git a/docs/02_platform.md b/docs/02_platform.md new file mode 120000 index 00000000..41d24f7a --- /dev/null +++ b/docs/02_platform.md @@ -0,0 +1 @@ +../platform/README.md \ No newline at end of file diff --git a/docs/03_apps.md b/docs/03_apps.md new file mode 120000 index 00000000..5611ee4d --- /dev/null +++ b/docs/03_apps.md @@ -0,0 +1 @@ +../apps/README.md \ No newline at end of file diff --git a/infra/README.md b/infra/README.md new file mode 100644 index 00000000..e69de29b diff --git a/infra/pxe-server b/infra/pxe-server deleted file mode 160000 index 028f617e..00000000 --- a/infra/pxe-server +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 028f617e4dc9018182ec8d8c9fa26dfffd56522a diff --git a/metal/README.md b/metal/README.md new file mode 100644 index 00000000..e69de29b diff --git a/infra/scripts/reset.py b/metal/reset.py similarity index 100% rename from infra/scripts/reset.py rename to metal/reset.py diff --git a/platform/README.md b/platform/README.md new file mode 100644 index 00000000..e69de29b