From 2b32ab159c0eb9bb617154d977c155f8ca9162d9 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Sun, 18 Dec 2022 20:16:11 -0700 Subject: cock --- .dockerignore | 13 +++++++++++++ Dockerfile | 13 +++++++++++++ fly.toml | 38 ++++++++++++++++++++++++++++++++++++++ src/main.rs | 7 ++++++- 4 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 fly.toml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..83566f6 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,13 @@ +### Rust template +# Generated by Cargo +# will have compiled files and executables +debug/ +target/ + +# These are backup files generated by rustfmt +**/*.rs.bk + +# MSVC Windows builds of rustc generate these, which store debugging information +*.pdb + +dist/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d358729 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM rust:1.66 AS build + +RUN cargo install --locked trunk +RUN rustup target add wasm32-unknown-unknown + +WORKDIR /usr/src/ffxiv-uptime +COPY . . + +RUN trunk build + +FROM nginx:latest + +COPY --from=build /usr/src/ffxiv-uptime/dist/* /usr/share/nginx/html diff --git a/fly.toml b/fly.toml new file mode 100644 index 0000000..08c2f90 --- /dev/null +++ b/fly.toml @@ -0,0 +1,38 @@ +# fly.toml file generated for ffxiv-uptime on 2022-12-18T19:48:10-07:00 + +app = "ffxiv-uptime" +kill_signal = "SIGINT" +kill_timeout = 5 +processes = [] + +[env] + +[experimental] +allowed_public_ports = [] +auto_rollback = true + +[[services]] +http_checks = [] +internal_port = 80 +processes = ["app"] +protocol = "tcp" +script_checks = [] +[services.concurrency] +hard_limit = 25 +soft_limit = 20 +type = "connections" + +[[services.ports]] +force_https = true +handlers = ["http"] +port = 80 + +[[services.ports]] +handlers = ["tls", "http"] +port = 443 + +[[services.tcp_checks]] +grace_period = "1s" +interval = "15s" +restart_limit = 0 +timeout = "2s" diff --git a/src/main.rs b/src/main.rs index 3ad6e62..d463b99 100644 --- a/src/main.rs +++ b/src/main.rs @@ -68,7 +68,12 @@ fn main() { let active_time_duration = create_memo(cx, move || start_time.get().map(|start_time| now_for_active_time.clone().get().signed_duration_since(start_time))); view! { cx, - h1 { "FFXIV Uptime" } + h1 { + "FFXIV Uptime " + small { + a(href="https://code.boringcactus.com/misc/ffxiv-uptime/") { "(source)"} + } + } form { StartPicker(value=start_time) PlayTimePicker(value=play_time_str) -- cgit v1.2.3