mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-23 16:58:31 +02:00
refactor: update webui rules and docker compose
- Docker compose - tmpfs update /app/.next/cache to /app/node_modules/.cache - tmpfs add /tmp - Rules - Update rules for tanstack start + nitro - Stricter webui rules - Add webui dev rules
This commit is contained in:
@@ -31,8 +31,8 @@ services:
|
|||||||
user: ${GODOXY_UID:-1000}:${GODOXY_GID:-1000}
|
user: ${GODOXY_UID:-1000}:${GODOXY_GID:-1000}
|
||||||
read_only: true
|
read_only: true
|
||||||
tmpfs:
|
tmpfs:
|
||||||
- /app/.next/cache # next image caching
|
- /tmp:rw
|
||||||
|
- /app/node_modules/.cache:rw
|
||||||
# for lite variant, do not change uid/gid
|
# for lite variant, do not change uid/gid
|
||||||
# - /var/cache/nginx:uid=101,gid=101
|
# - /var/cache/nginx:uid=101,gid=101
|
||||||
# - /run:uid=101,gid=101
|
# - /run:uid=101,gid=101
|
||||||
|
|||||||
@@ -3,12 +3,19 @@
|
|||||||
do: pass
|
do: pass
|
||||||
- name: protected
|
- name: protected
|
||||||
on: |
|
on: |
|
||||||
!path regex("(_next/static|_next/image|favicon.ico).*")
|
|
||||||
!path glob("/api/v1/auth/*")
|
!path glob("/api/v1/auth/*")
|
||||||
!path glob("/auth/*")
|
!path glob("/auth/*")
|
||||||
!path regex("[A-Za-z0-9_-]+\.(svg|png|jpg|jpeg|gif|ico|webp|woff2?|eot|ttf|otf|txt)(\?.+)?")
|
!path /icon0.svg
|
||||||
|
!path /favicon.ico
|
||||||
|
!path /apple-icon.png
|
||||||
|
!path glob("/web-app-manifest-*x*.png")
|
||||||
|
!path regex("\/assets\/(chunks\/)?[a-zA-Z0-9\-_]+\.(css|js|woff2)")
|
||||||
|
!path regex("\/assets\/workbox-window\.prod\.es5-[a-zA-Z0-9]+\.js")
|
||||||
|
!path regex("/workbox-[a-zA-Z0-9]+\.js")
|
||||||
!path /api/v1/version
|
!path /api/v1/version
|
||||||
!path /manifest.json
|
!path /manifest.webmanifest
|
||||||
|
!path /sw.js
|
||||||
|
!path /registerSW.js
|
||||||
do: require_auth
|
do: require_auth
|
||||||
- name: proxy to backend
|
- name: proxy to backend
|
||||||
on: path glob("/api/v1/*")
|
on: path glob("/api/v1/*")
|
||||||
|
|||||||
24
internal/route/rules/presets/webui_dev.yml
Normal file
24
internal/route/rules/presets/webui_dev.yml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
- name: login page
|
||||||
|
on: path /login
|
||||||
|
do: pass
|
||||||
|
- name: protected
|
||||||
|
on: |
|
||||||
|
!path glob("@tanstack-start/*")
|
||||||
|
!path /@react-refresh
|
||||||
|
!path /@vite/client
|
||||||
|
!path regex("\?token=\w{5}-\w{5}")
|
||||||
|
!path glob("/@id/*")
|
||||||
|
!path glob("/api/v1/auth/*")
|
||||||
|
!path glob("/auth/*")
|
||||||
|
!path regex("[A-Za-z0-9_\-/]+\.(css|ts|js|mjs|svg|png|jpg|jpeg|gif|ico|webp|woff2?|eot|ttf|otf|txt)(\?.+)?")
|
||||||
|
!path /api/v1/version
|
||||||
|
!path /manifest.webmanifest
|
||||||
|
do: require_auth
|
||||||
|
- name: proxy to backend
|
||||||
|
on: path glob("/api/v1/*")
|
||||||
|
do: proxy http://${API_ADDR}/
|
||||||
|
- name: proxy to auth api
|
||||||
|
on: path glob("/auth/*")
|
||||||
|
do: |
|
||||||
|
rewrite /auth /api/v1/auth
|
||||||
|
proxy http://${API_ADDR}/
|
||||||
Reference in New Issue
Block a user