56 lines
2.6 KiB
Plaintext
56 lines
2.6 KiB
Plaintext
# Firefly III, поверх него Firefly UI (репа apps/firefly-ui, стек firefly-ui).
|
|
# Новый UI отдаёт свои ассеты и свои страницы на GET/HEAD. Всё остальное:
|
|
# API, вход, MFA, OAuth, cron, ассеты Firefly, любые не-GET и страницы,
|
|
# которых в новом UI нет, отдаёт сам Firefly. Список путей генерирует
|
|
# scripts/caddy-matcher.ts в apps/firefly-ui (из src/lib/spa-paths.ts).
|
|
# Отказ от нового UI: вернуть этот файл к одному reverse_proxy и задеплоить
|
|
# personal-main-caddy. Если фронт Firefly UI лежит, страницы сами уходят
|
|
# в Firefly (второй апстрим, lb_policy first).
|
|
#
|
|
# Переключатель на любом адресе:
|
|
# ?ffui=old только этот запрос в старый UI, без куки
|
|
# ?ffui=off старый UI до конца сессии браузера (кука ffui=off)
|
|
# ?ffui=on снять куку, снова новый UI
|
|
{$FIREFLY_DOMAIN} {
|
|
import cf_tls
|
|
import compress
|
|
|
|
@ffui_off query ffui=off
|
|
header @ffui_off Set-Cookie "ffui=off; Path=/; Secure; HttpOnly; SameSite=Lax"
|
|
@ffui_on query ffui=on
|
|
header @ffui_on Set-Cookie "ffui=; Path=/; Max-Age=0; Secure; HttpOnly; SameSite=Lax"
|
|
|
|
@ffui_assets path /_app/* /favicon.svg
|
|
handle @ffui_assets {
|
|
reverse_proxy firefly-ui-frontend:3000
|
|
}
|
|
|
|
@ffui_pages {
|
|
method GET HEAD
|
|
path / /home /accounts /budgets /categories /tags
|
|
path /bills /subscriptions /piggy-banks /groups /reports /search
|
|
path /currencies /exchange-rates /attachments /preferences /export /administrations
|
|
path /recurring /webhooks/index /settings/links /accounts/* /inactive-accounts/* /transactions/*
|
|
path /budgets/* /categories/* /tags/* /bills/* /subscriptions/* /piggy-banks/*
|
|
path /groups/* /reports/* /currencies/* /exchange-rates/* /attachments/* /administrations/*
|
|
path /recurring/show/* /webhooks/show/* /settings/links/show/*
|
|
not path /accounts/reconcile/* /attachments/download/* /attachments/view/* /transactions/convert/* /transactions/debug/* /transactions/link/*
|
|
not path /transactions/mass/* /transactions/bulk/* /transactions/show-by-journal/* /piggy-banks/add/* /piggy-banks/remove/* /reports/options/*
|
|
not expression `{query.ffui} in ["off", "old"] || ({cookie.ffui} == "off" && {query.ffui} != "on")`
|
|
}
|
|
handle @ffui_pages {
|
|
reverse_proxy firefly-ui-frontend:3000 firefly_iii_app:8080 {
|
|
lb_policy first
|
|
lb_try_duration 3s
|
|
fail_duration 10s
|
|
transport http {
|
|
dial_timeout 1s
|
|
}
|
|
}
|
|
}
|
|
|
|
handle {
|
|
reverse_proxy firefly_iii_app:8080
|
|
}
|
|
}
|