feat: add /files/serve/{path} endpoint for iframe relative URL resolution
Some checks failed
Build Docker Image / build (linux/amd64, map[file:Dockerfile name:default short_tag:latest suffix:]) (push) Has been cancelled
Build Docker Image / build (linux/amd64, map[file:Dockerfile.alpine name:alpine short_tag:alpine suffix:-alpine]) (push) Has been cancelled
Build Docker Image / build (linux/amd64, map[file:Dockerfile.slim name:slim short_tag:slim suffix:-slim]) (push) Has been cancelled
Build Docker Image / build (linux/arm64, map[file:Dockerfile name:default short_tag:latest suffix:]) (push) Has been cancelled
Build Docker Image / build (linux/arm64, map[file:Dockerfile.alpine name:alpine short_tag:alpine suffix:-alpine]) (push) Has been cancelled
Build Docker Image / build (linux/arm64, map[file:Dockerfile.slim name:slim short_tag:slim suffix:-slim]) (push) Has been cancelled
Release / release (push) Has been cancelled
Build Docker Image / merge (map[name:alpine short_tag:alpine suffix:-alpine]) (push) Has been cancelled
Build Docker Image / merge (map[name:default short_tag:latest suffix:]) (push) Has been cancelled
Build Docker Image / merge (map[name:slim short_tag:slim suffix:-slim]) (push) Has been cancelled

This commit is contained in:
Timothy Jaeryang Baek 2026-04-08 14:49:49 -07:00
parent f74428ffb8
commit 9162e808c3
3 changed files with 17 additions and 1 deletions

View file

@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
## [0.11.34] - 2026-04-08
### Added
- 🌐 **Path-based file serving** — new `GET /files/serve/{path}` endpoint enables HTML files loaded in iframes to resolve relative CSS, JS, and image references to sibling files. Used by Open WebUI's FileNav to render multi-file websites.
## [0.11.33] - 2026-04-08
### Fixed

View file

@ -594,6 +594,16 @@ async def view_file(
return Response(content=raw, media_type=mime)
@app.get(
"/files/serve/{path:path}",
include_in_schema=False,
dependencies=[Depends(verify_api_key)],
)
async def serve_file(path: str, fs: UserFS = Depends(get_filesystem)):
"""Path-based alias for view_file — enables relative URL resolution in iframes."""
return await view_file(path=f"/{path}", fs=fs)
@app.post(
"/files/write",
operation_id="write_file",

View file

@ -1,6 +1,6 @@
[project]
name = "open-terminal"
version = "0.11.33"
version = "0.11.34"
description = "A remote terminal API."
license = "MIT"
readme = "README.md"