Skip to content

Commit

Permalink
chore: upgrade deps
Browse files Browse the repository at this point in the history
  • Loading branch information
ginkoid committed Apr 23, 2024
1 parent 6d0a1f6 commit 2961d63
Show file tree
Hide file tree
Showing 11 changed files with 383 additions and 483 deletions.
563 changes: 229 additions & 334 deletions Cargo.lock

Large diffs are not rendered by default.

15 changes: 5 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,8 @@ edition = "2021"
strip = true

[dependencies]
anyhow = "1.0.75"
async-recursion = "1.0.5"
axum = "0.6.20"
base64 = "0.21.4"
futures = "0.3.28"
hmac = "0.12.1"
serde = { version = "1.0.188", features = ["derive"] }
sha2 = "0.10.8"
thiserror = "1.0.49"
tokio = { version = "1.32.0", features = ["full"] }
anyhow = "1.0.82"
async-recursion = "1.1.0"
axum = "0.7.5"
thiserror = "1.0.59"
tokio = { version = "1.37.0", features = ["full"] }
4 changes: 2 additions & 2 deletions Dockerfile.proxy
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM node:20.7.0-bookworm-slim AS build
FROM node:21.7.3-bookworm-slim AS build
WORKDIR /app
COPY package.json package-lock.json ./
RUN --mount=type=cache,target=/root/.npm npm ci
COPY client client
COPY render/preamble.tex render/
RUN npm run build

FROM nginx:1.25.2-bookworm
FROM nginx:1.25.5-bookworm
COPY --from=build /app/dist /etc/nginx/public
COPY proxy /etc/nginx/
11 changes: 5 additions & 6 deletions Dockerfile.render
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# syntax=docker/dockerfile:1.6.0

FROM debian:bookworm-20230919-slim AS mupdf
FROM debian:bookworm-20240408-slim AS mupdf
WORKDIR /app
RUN apt-get update && apt-get install -y build-essential
ADD https://mupdf.com/downloads/archive/mupdf-1.23.3-source.tar.gz mupdf.tar.gz
ADD https://mupdf.com/downloads/archive/mupdf-1.24.1-source.tar.gz mupdf.tar.gz
RUN mkdir mupdf && tar xf mupdf.tar.gz --strip-components 1 -C mupdf && \
cd mupdf && make HAVE_X11=no HAVE_GLUT=no -j$(nproc)

FROM debian:bookworm-20230919-slim AS latex
FROM debian:bookworm-20240408-slim AS latex
WORKDIR /app
RUN apt-get update && apt-get install -y perl curl
ADD https://mirrors.rit.edu/CTAN/systems/texlive/tlnet/install-tl-unx.tar.gz install-tl.tar.gz
Expand All @@ -22,13 +22,12 @@ COPY render/texmf.cnf texlive/texdir
COPY render/preamble.tex .
RUN ./texlive/texdir/bin/*-linux/pdflatex -ini -output-format pdf '&latex preamble.tex'

FROM rust:1.72.1-slim-bookworm AS render
FROM rust:1.77.2-slim-bookworm AS render
WORKDIR /app
COPY Cargo.lock Cargo.toml ./
COPY src src
RUN --mount=type=cache,sharing=private,target=/usr/local/cargo/registry --mount=type=cache,target=/app/target \
cargo build --locked --release --bin render && \
mkdir bin && cp target/release/render bin
cargo build --locked --release --bin render && mkdir bin && cp target/release/render bin

FROM pwn.red/jail:0.4.1
COPY --link --from=busybox:1.36.1-glibc / /srv
Expand Down
5 changes: 2 additions & 3 deletions Dockerfile.web
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# syntax=docker/dockerfile:1.6.0

FROM rust:1.72.1-slim-bookworm AS web
FROM rust:1.77.2-slim-bookworm AS web
WORKDIR /app
COPY Cargo.lock Cargo.toml ./
COPY src src
RUN --mount=type=cache,sharing=private,target=/usr/local/cargo/registry --mount=type=cache,target=/app/target \
cargo build --locked --release --bin web && \
mkdir bin && cp target/release/web bin
cargo build --locked --release --bin web && mkdir bin && cp target/release/web bin

FROM busybox:1.36.1-glibc
ARG TARGETARCH
Expand Down
26 changes: 12 additions & 14 deletions client/app.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
import { EditorView } from 'codemirror'
import extensions from './codemirror'
import './app.css'
import preamble from '../render/preamble.tex'
import './app.css'

const maximumUrlLength = 2000
const maxUrlLength = 2000
const initialValue = String.raw`
\TeX.flag.sh can render \textbf{text}, \( m \alpha \tau h \), and even pictures:
\center{\scalebox{0.3}{\begin{tikzpicture} \duck[hat] \end{tikzpicture}}}
`.trimStart()

void (async () => {
await new Promise(resolve => addEventListener('DOMContentLoaded', resolve))
const debounce = (time, cb) => {
let timeout
return (...args) => {
clearTimeout(timeout)
timeout = setTimeout(() => cb(...args), time)
}
}

addEventListener('DOMContentLoaded', () => {
document.getElementById('preamble').textContent = preamble

const debounce = (time, cb) => {
let timeout
return (...args) => {
clearTimeout(timeout)
timeout = setTimeout(() => cb(...args), time)
}
}

const imageEl = document.getElementById('image')
const actionsEl = document.getElementById('actions')
const downloadEl = document.getElementById('download')
Expand Down Expand Up @@ -78,7 +76,7 @@ void (async () => {
let imageUrl
const updateLink = (content) => {
const url = new URL(`/render/${encodeURIComponent(content)}`, location)
if (url.href.length > maximumUrlLength) {
if (url.href.length > maxUrlLength) {
imageUrl = undefined
copyEl.classList.add('hidden')
} else {
Expand Down Expand Up @@ -112,4 +110,4 @@ void (async () => {
parent: document.getElementById('editor'),
})
handleInput(view.state.doc.toString())
})()
})
2 changes: 1 addition & 1 deletion client/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ <h2>TeX.flag.sh</h2>
<span id="actions" class="hidden">
<button class="action" id="copy">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5" stroke="#212529" fill="none">
<path d="M9 15l6 -6M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463" />
<path d="m9 15 6-6m-4-3 .5-.5a5 5 0 0 1 7 7l-.5.5m-5 5-.4.5a5 5 0 0 1-7.1 0 5 5 0 0 1 0-7L6 11" />
</svg>
</button>
<a class="action" id="download" download="tex.png">
Expand Down
Loading

0 comments on commit 2961d63

Please sign in to comment.