26 Commits

Author SHA1 Message Date
claude 2d2a85f06f Fix typst export 500, add export-as-latex for typst projects
Build and Deploy Verso / deploy (push) Successful in 10m4s
- clsi-nginx: allow hyphens in project-id regex — conversion IDs are UUIDs
  which nginx was rejecting, causing 500 on file download after conversion
- CLSI ConversionController/Manager: add 'latex' export type (typst→latex via pandoc)
- Web: add 'latex' to SUPPORTED_CONVERSION_TYPES
- Frontend: add Export as LaTeX button (visible only for typst projects)
- Fix visibility logic: export-as-latex shows for typst, export-as-typst shows for latex
- Add export_as_latex translation key (en + fr)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 11:55:41 +00:00
claude 94d3764c05 fix: stream HTTP 200 heartbeat before upload body to prevent proxy timeouts
Build and Deploy Verso / deploy (push) Has been cancelled
Uploads from slow connections consistently fail with 502 after ~60-120s
because an upstream proxy (Traefik or cloud load-balancer) has a
"first response byte" deadline that fires before the request body arrives.

Fix: add startStreamingResponse middleware (after auth, before multer)
that immediately writes HTTP 200 + Transfer-Encoding: chunked + '\n'.
With proxy_request_buffering off in Nginx, this reaches the proxy at T≈0,
so no timeout triggers. The upload body continues streaming; multer writes
to disk; the actual JSON result arrives as the final chunk. Periodic
heartbeat '\n' writes every 30s keep response-idle timeouts at bay too.

Client-side: override Uppy's getResponseData/validateStatus to trim
leading whitespace before JSON.parse so the extra '\n' bytes are ignored.
Server-side: sendUploadResponse() helper handles both streaming mode
(res.headersSent → res.end(json)) and normal mode (res.status(N).json()).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 08:59:02 +00:00
claude 8f372d13f8 fix: Lumière layout/navbar on settings+404, drop proxy_request_buffering
Build and Deploy Verso / deploy (push) Successful in 14m28s
- Move min-height:100vh from body to html:has(body[data-lumiere]) so the
  gradient fills the viewport on short pages without inflating document
  height or pushing the footer below the fold
- Remove min-height:60vh from .error-container (was causing scrollbar on
  404 when combined with thin footer)
- Replace Bootstrap 3 navbar selectors (.navbar-nav > li > a) with CSS
  custom property overrides (--navbar-link-color, --navbar-link-hover-*,
  --navbar-bg, etc.) consumed by navbar.scss — fixes header button colours
- Remove position:relative from .navbar-default override; base CSS already
  has position:absolute which provides the stacking context for ::before
- Drop proxy_request_buffering off from upload location: buffered mode +
  global client_body_timeout 15m (nginx.conf.template) is more compatible
  with multer's multipart stream handling on slow connections

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-13 20:38:00 +00:00
claude 211ca9c46d Fix Lumière theming + upload timeout via global middleware
Build and Deploy Verso / deploy (push) Successful in 14m26s
Theming: replace per-controller isLumiere lookups with a single
ExpressLocals middleware that sets res.locals.isLumiere for every
web request. Uses getOverallTheme() (now exported from
UserSettingsHelper) so the date-based default is handled correctly.
This covers 404, settings, setPassword, activate, and all future
server-rendered pages automatically.

Upload timeout: add client_body_timeout 15m to nginx.conf.template
at the http level (was defaulting to 60s globally). This is more
reliable than the location-specific override from build 229.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-13 19:33:53 +00:00
claude 2ec6ca827e Fix upload timeout + apply Lumière to settings/auth pages
Build and Deploy Verso / deploy (push) Successful in 15m0s
Nginx: add dedicated upload location with client_body_timeout 15m,
client_max_body_size 550m, and proxy_request_buffering off. Default
client_body_timeout of 60s was the actual culprit cutting slow uploads.
Node.js requestTimeout (build 228) remains as a backstop.

Lumière: pass isLumiere from UserPagesController (settings),
PasswordResetController (set-password), and UserActivateController
(first-time activation). auth.scss adds card styling for auth pages.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-13 17:47:03 +00:00
claude 2ae860a1a8 Raise upload limit from 50 MB to 500 MB
Build and Deploy Verso / deploy (push) Has been cancelled
Both limits that gate uploads are bumped in tandem so they don't conflict:
- settings.defaults.js maxUploadSize: 50 MB → 500 MB (app-level check)
- nginx.conf.template client_max_body_size: 50m → 500m (proxy body limit)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 19:38:21 +00:00
claude a89b8bd282 Enable gzip for HTML/CSS/JS output in clsi-nginx
Build and Deploy Verso / deploy (push) Successful in 11m13s
RevealJS presentations are served as (currently embed-resources) HTML that
went over the wire uncompressed, because gzip_types only listed text/plain.
This made the HTML preview slow to load for heavy decks.

Add text/html, text/css, application/javascript, application/json and
image/svg+xml to gzip_types so the text-based portion of the output is
compressed. Already-compressed formats (pdf, png/jpeg/webp, woff/woff2)
are intentionally excluded to avoid wasting CPU. Also set gzip_min_length
1024 so tiny responses aren't compressed needlessly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 18:52:39 +00:00
claude 48fd24a6b2 Add HTML/RevealJS preview alongside existing PDF preview
Build and Deploy Verso / deploy (push) Successful in 11m0s
clsi-nginx.conf: the types{} block was overriding all nginx defaults,
  leaving HTML/CSS/JS/fonts as application/octet-stream. Add the full
  set of web MIME types so RevealJS assets are served correctly. Also
  needed for X-Content-Type-Options: nosniff to pass.

CompileController.js: success was hardcoded to require output.pdf.
  Also accept output.html so a RevealJS compile is reported as
  'success' rather than 'failure'.

QuartoRunner.js: remove hardcoded --to typst --output output.pdf.
  Instead run `quarto render` without --to/--output so the YAML
  frontmatter decides the format (typst → PDF, revealjs → HTML, etc.).
  Pass --embed-resources so HTML output is self-contained (flag is
  silently ignored by the typst backend). After render, rename
  main.pdf → output.pdf or main.html → output.html so the pipeline
  finds the standard canonical filename.

output-files.ts: handleOutputFiles now falls back to output.html when
  output.pdf is absent. Download URL uses outputFile.path instead of
  the hardcoded 'output.pdf' string.

pdf-viewer.tsx: when pdfUrl contains output.html, bypass PDF.js
  entirely and render a sandboxed iframe (allow-scripts for RevealJS
  interactivity, allow-presentation for fullscreen).

Usage: set `format: revealjs` in the .qmd YAML frontmatter to get
  an HTML presentation preview; set `format: typst` for PDF.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 15:32:00 +00:00
Jakob Ackermann 6c6e8d9a97 [monorepo] switch all output file reads to clsi-nginx (#31691)
* [monorepo] switch all output file reads to clsi-nginx

* [clsi-lb] allow gallery download requests

* [terraform] clsi: use nginx.conf from clsi service

* [clsi] fix flakey tests

* [clsi] replace alias with rewrite and root in nginx config

* [k8s] clsi-lb: expose download port on internal service

* [web] add explicit endpoint for downloading all output files

Serve the output.zip endpoint from clsi.

* [clsi] fix regex for latexqc submission ids

Previously, we only handled template submission ids.

GitOrigin-RevId: 6c3b21b01ec41ae767530b14aac31fbe3d640dd5
2026-02-24 09:07:12 +00:00
Jakob Ackermann 8ada51158f [clsi] add support for downloading output files with dot in extension (#24342)
E.g. output.tar.gz

GitOrigin-RevId: d119a41172bb21fb2de429a64b82d05a1efc2375
2025-03-24 10:46:29 +00:00
Miguel Serrano e08057828f [CE/SP] Hotfix 5.1.1 and 4.2.8 (#19771)
* [CE/SP] Hotfix 5.1.1 and 4.2.8

* Add script to build hotfix releases

GitOrigin-RevId: 8ece5e5fd5ec360b66069ce774319511ed82a13a
2024-08-14 08:05:03 +00:00
Miguel Serrano c22e6a5926 Merge pull request #17694 from overleaf/bg-ipv6-fix-editing
Force services to use ipv4 in server-ce container

GitOrigin-RevId: 9cf2734f8506bba15ef3ac11060508d2604d09ad
2024-04-04 08:04:06 +00:00
Jakob Ackermann 6d98d6a7c0 Merge pull request #16923 from overleaf/jpa-server-pro-fs-rebranding
[server-pro] remove ShareLaTeX branding from filesystem

GitOrigin-RevId: c1d2c63bdc888d81e03bb1721e44b6ed6f64524b
2024-02-12 09:03:39 +00:00
Wielewout 25145708b8 Fix 502 errors due to IPv6 2023-12-16 13:25:24 +01:00
Jakob Ackermann 5a8857be97 Merge pull request #14857 from overleaf/jpa-server-pro-web-api
[server-ce] add web-api service

GitOrigin-RevId: c0f33573e85c0fb4031df39c500cc2a110e07687
2023-09-19 08:03:57 +00:00
Jimmy Domagala-Tang 1f71e339fb Merge pull request #12802 from overleaf/jdt-parse-all-blg
fetch all blg files to report errors

GitOrigin-RevId: eea9b0809e6b2efcf5df20961e94197c583463ef
2023-07-17 10:36:21 +00:00
Jakob Ackermann a0e8958a9c Merge pull request #13229 from overleaf/jpa-server-pro-block-metrics-access
[server-pro] block access to metrics and debug endpoints

GitOrigin-RevId: 6f0f09de8e13b4e478eb16eae707acf3b1cd8cbd
2023-07-17 10:24:57 +00:00
Eric Mc Sween 330d671c96 Merge pull request #12428 from overleaf/em-server-pro-git-bridge-proxy
Git bridge proxy in Server Pro

GitOrigin-RevId: 298c63c89e71865432512fdb4612cb42a762f29b
2023-04-04 12:22:41 +00:00
Jakob Ackermann 8d3bc8422e Merge pull request #11597 from overleaf/jpa-server-ce-nginx-keepalive
[server-ce] nginx: make keepalive_timeout configurable

GitOrigin-RevId: 3a0bb049b57f0a4ee065c86463fd6300d97934c7
2023-02-02 18:22:01 +00:00
Timothée Alby 1ae3061f16 Merge pull request #9972 from overleaf/jpa-fix-rate-limited-output-download
[server-ce] serve output files via nginx

GitOrigin-RevId: 0ba3b27f85f928b1d95646e663dfa42a22a9f832
2022-10-18 08:03:09 +00:00
Jakob Ackermann d5dd92c034 Merge pull request #6567 from overleaf/jpa-server-ce-pro-layout
[misc] align directory layout of server-ce/pro with production docker images

GitOrigin-RevId: d3e6b9f8793e83df59f86105d511c6fb87c3eea3
2022-02-02 09:03:33 +00:00
Rainshaw 05885efe93 fix nginx conf (#896)
* fix nginx conf
2021-06-24 17:12:46 +02:00
Shane Kilkelly f849b94005 Variables in Nginx configuration (#853)
* Add envsubst binary to image

* Generate nginx.conf from template, with env-vars

* Remove nginx.conf, now generated from template

* Reload nginx config after writing file

Co-authored-by: Shane Kilkelly <shane.kilkelly@overleaf.com>
2021-04-07 15:19:06 +02:00
Miguel Serrano 1a23887a85 addressed PR feedback 2020-10-22 18:24:40 +02:00
Miguel Serrano a017d08f05 updated nginx timeout to 4m 2020-10-22 13:38:33 +02:00
mserranom 276281e7e4 moved files from docker-image imported repo to root 2020-02-17 13:56:49 +01:00