Compare commits
No commits in common. "3ec13397f460dc9cff9aa8208cee8344bbceb900" and "4ceb0fc7a67988a76ad94ced401dfb499e399031" have entirely different histories.
3ec13397f4
...
4ceb0fc7a6
31
.github/workflows/docker.yaml
vendored
@ -1,31 +0,0 @@
|
|||||||
name: Build and Push Docker Image
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v2
|
|
||||||
|
|
||||||
- name: Log in to Docker registry
|
|
||||||
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login git.jabuxas.com -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
|
|
||||||
|
|
||||||
- name: Build and push Docker image
|
|
||||||
run: |
|
|
||||||
docker build -t git.jabuxas.com/jabuxas/refinement:latest .
|
|
||||||
docker push git.jabuxas.com/jabuxas/refinement:latest
|
|
||||||
|
|
||||||
- name: Log out of Docker registry
|
|
||||||
run: docker logout git.jabuxas.com
|
|
1
.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
/target
|
|
1756
Cargo.lock
generated
14
Cargo.toml
@ -1,14 +0,0 @@
|
|||||||
[package]
|
|
||||||
name = "refinement"
|
|
||||||
version = "0.1.0"
|
|
||||||
edition = "2024"
|
|
||||||
|
|
||||||
[profile.release]
|
|
||||||
opt-level = 3
|
|
||||||
lto = true
|
|
||||||
codegen-units = 1
|
|
||||||
panic = 'abort'
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
rocket = "0.5.1"
|
|
||||||
rust-embed = "8.5.0"
|
|
@ -1,9 +0,0 @@
|
|||||||
FROM rustlang/rust:nightly-slim
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
RUN cargo build --release --bin refinement
|
|
||||||
|
|
||||||
CMD ["target/release/refinement"]
|
|
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 9.7 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 8.7 KiB |
Before Width: | Height: | Size: 491 B After Width: | Height: | Size: 491 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 94 KiB |
@ -5,25 +5,11 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<meta name="description" content="jabuxas' website" />
|
<meta name="description" content="jabuxas' website" />
|
||||||
<title>jabuxas' hub</title>
|
<title>jabuxas' hub</title>
|
||||||
<link
|
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
|
||||||
rel="apple-touch-icon"
|
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
|
||||||
sizes="180x180"
|
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
|
||||||
href="/dist/apple-touch-icon.png"
|
<link rel="manifest" href="/site.webmanifest" />
|
||||||
/>
|
<link href="style.css?version=1" rel="stylesheet" />
|
||||||
<link
|
|
||||||
rel="icon"
|
|
||||||
type="image/png"
|
|
||||||
sizes="32x32"
|
|
||||||
href="/dist/favicon-32x32.png"
|
|
||||||
/>
|
|
||||||
<link
|
|
||||||
rel="icon"
|
|
||||||
type="image/png"
|
|
||||||
sizes="16x16"
|
|
||||||
href="/dist/favicon-16x16.png"
|
|
||||||
/>
|
|
||||||
<link rel="manifest" href="/dist/site.webmanifest" />
|
|
||||||
<link href="/dist/style.css?version=1" rel="stylesheet" />
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
@ -31,7 +17,7 @@
|
|||||||
<div class="top-level">
|
<div class="top-level">
|
||||||
<div>
|
<div>
|
||||||
<div class="image-container">
|
<div class="image-container">
|
||||||
<img src="/dist/images/maybe.jpg" alt="jabuxas' icon" />
|
<img src="./images/maybe.jpg" alt="jabuxas' icon" />
|
||||||
</div>
|
</div>
|
||||||
<h2>jabuxas</h2>
|
<h2>jabuxas</h2>
|
||||||
</div>
|
</div>
|
@ -1,8 +1,8 @@
|
|||||||
services:
|
services:
|
||||||
web-server:
|
web:
|
||||||
image: refinement
|
image: darkhttpd
|
||||||
ports:
|
ports:
|
||||||
- "8880:8000"
|
- "28080:80"
|
||||||
environment:
|
volumes:
|
||||||
ROCKET_ADDRESS: 0.0.0.0
|
- ./dev/:/var/www/htdocs:ro
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
35
src/main.rs
@ -1,35 +0,0 @@
|
|||||||
#[macro_use]
|
|
||||||
extern crate rocket;
|
|
||||||
|
|
||||||
use std::{borrow::Cow, ffi::OsStr, path::PathBuf};
|
|
||||||
|
|
||||||
use rocket::{http::ContentType, response::content::RawHtml};
|
|
||||||
use rust_embed::Embed;
|
|
||||||
|
|
||||||
#[derive(Embed)]
|
|
||||||
#[folder = "static/"]
|
|
||||||
struct Asset;
|
|
||||||
|
|
||||||
#[get("/")]
|
|
||||||
fn index() -> Option<RawHtml<Cow<'static, [u8]>>> {
|
|
||||||
let asset = Asset::get("index.html")?;
|
|
||||||
Some(RawHtml(asset.data))
|
|
||||||
}
|
|
||||||
|
|
||||||
#[get("/dist/<file..>")]
|
|
||||||
fn dist(file: PathBuf) -> Option<(ContentType, Cow<'static, [u8]>)> {
|
|
||||||
let filename = file.display().to_string();
|
|
||||||
let asset = Asset::get(&filename)?;
|
|
||||||
let content_type = file
|
|
||||||
.extension()
|
|
||||||
.and_then(OsStr::to_str)
|
|
||||||
.and_then(ContentType::from_extension)
|
|
||||||
.unwrap_or(ContentType::Bytes);
|
|
||||||
|
|
||||||
Some((content_type, asset.data))
|
|
||||||
}
|
|
||||||
|
|
||||||
#[launch]
|
|
||||||
fn rocket() -> _ {
|
|
||||||
rocket::build().mount("/", routes![index, dist])
|
|
||||||
}
|
|