feat: assets API draft

Signed-off-by: İspik <ispik@ispik.dev>
This commit is contained in:
İspik
2026-08-01 22:08:19 +03:00
parent 457c7709c7
commit ed05f476e1
4 changed files with 59 additions and 0 deletions

View File

@@ -8,6 +8,7 @@ members = [
"crates/services/*",
"crates/daemons/*",
]
exclude = ["crates/services/assets"]
[patch.crates-io]
redis23 = { package = "redis", version = "0.23.3", git = "https://github.com/revoltchat/redis-rs", rev = "523b2937367e17bd0073722bf6e23d06042cb4e4" }

View File

@@ -86,3 +86,11 @@ services:
network_mode: "host"
volumes:
- ./livekit.yml:/etc/livekit.yml
assets:
build: ./crates/services/assets
ports:
- "14707:14707"
volumes:
- ./assets-custom:/srv/assets/custom
restart: unless-stopped

View File

@@ -0,0 +1,35 @@
{
admin off
auto_https off
}
:14707 {
encode gzip zstd
route {
header Access-Control-Allow-Origin *
header Cache-Control "public, max-age=86400"
respond /health 200
# Serve from custom/ first if the file exists there, so
# self-hosters can add new assets or override shipped ones
# just by dropping a file at the same relative path.
@custom {
file {
root /srv/assets/custom
try_files {http.request.uri.path}
}
}
handle @custom {
root * /srv/assets/custom
file_server
}
# Fall back to the assets baked into the image.
handle {
root * /srv/assets/default
file_server
}
}
}

View File

@@ -0,0 +1,15 @@
FROM caddy:2-alpine
# Baked-in default assets, shipped inside the image.
COPY default /srv/assets/default
# Self-hosters override this path with a volume mount to add or replace
# assets without rebuilding the image
COPY custom /srv/assets/custom
COPY Caddyfile /etc/caddy/Caddyfile
EXPOSE 14707
HEALTHCHECK --interval=30s --timeout=3s \
CMD wget -qO- http://localhost:14707/health || exit 1