added static and framed external rendering (untested)

This commit is contained in:
2026-02-24 23:20:56 -07:00
parent 8c2eb1bf80
commit 4652569aee
7 changed files with 138 additions and 5 deletions
+9
View File
@@ -52,6 +52,15 @@ func setupEcho() *echo.Echo {
uiset := []echo.MiddlewareFunc{ui.SessionStoreInjector, ui.ContextCreator, ui.IPBanTest, ui.CookieLoginTest}
e.RouteNotFound("/*", ui.AmWrap(AmNotFoundHandler), uiset...)
if config.GlobalConfig.Site.ExternalPath != "" {
root, err := os.OpenRoot(config.GlobalConfig.Site.ExternalPath)
if err != nil {
panic(err)
}
fs := root.FS()
e.StaticFS("/ext", fs)
e.GET("/fext/*", ui.AmWrap(ui.AmStaticFramePage(fs, "/fext/")), uiset...)
}
e.Match(GetAndPost, "/TODO/*", ui.AmWrap(NotImplPage), uiset...)
e.GET("/img/*", ui.AmServeImage)
if config.GlobalConfig.Rendering.VeniceCompatibleImageURLs {