aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2022-12-18 20:16:11 -0700
committerMelody Horn <melody@boringcactus.com>2022-12-18 20:16:11 -0700
commit2b32ab159c0eb9bb617154d977c155f8ca9162d9 (patch)
treee0774acced2fa253b8b6ad22c08468cf3c4290b9
parentf762714bfb7cdd45327814bc1caa8b2a41aa84fc (diff)
downloadffxiv-uptime-canon.tar.gz
ffxiv-uptime-canon.zip
-rw-r--r--.dockerignore13
-rw-r--r--Dockerfile13
-rw-r--r--fly.toml38
-rw-r--r--src/main.rs7
4 files changed, 70 insertions, 1 deletions
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)