Avoid tmp file creation for static resources Fixes #45

This commit is contained in:
Jon Schoning 2022-09-11 14:44:40 -05:00 committed by Yann Esposito (Yogsototh)
parent 84e0260396
commit f27d4af0d4
Signed by untrusted user who does not match committer: yogsototh
GPG key ID: 7B19A4C650D59646
5 changed files with 5 additions and 21 deletions

View file

@ -31,7 +31,6 @@ serve:
_ESPIAL_PS_ID = $$($(_DOCKER_COMPOSE) ps -q espial)
_LOCAL_INSTALL_PATH = $$(stack path | grep local-install-root | awk -e '{print $$2}')
_EKG_ASSETS_PATH = $$(find ~/.stack -type d | grep ekg.*assets)
docker-compose-build: build
@rm -Rf dist && mkdir -p dist
@ -39,8 +38,6 @@ docker-compose-build: build
@cp -R static dist
@rm -Rf dist/static/tmp
@cp -R config dist
@mkdir -p dist/ekg/assets
@cp -R $(_EKG_ASSETS_PATH) dist/ekg
@$(_DOCKER_COMPOSE) build espial
docker-compose-up:
@$(_DOCKER_COMPOSE) up --no-deps --no-build espial

View file

@ -1,3 +1,6 @@
__v0.0.15__
Avoid using external static/tmp folder for generated static files
__v0.0.14__
upgrade to purescript v0.15
increase bookmarklet window height

View file

@ -5,7 +5,7 @@ cabal-version: 1.12
-- see: https://github.com/sol/hpack
name: espial
version: 0.0.14
version: 0.0.15
synopsis: Espial is an open-source, web-based bookmarking server.
description: .
Espial is an open-source, web-based bookmarking server.

View file

@ -1,6 +1,6 @@
name: espial
synopsis: Espial is an open-source, web-based bookmarking server.
version: "0.0.14"
version: "0.0.15"
description: ! '
Espial is an open-source, web-based bookmarking server.

View file

@ -8,10 +8,8 @@ module Foundation where
import Import.NoFoundation
import Database.Persist.Sql (ConnectionPool, runSqlPool)
import Text.Hamlet (hamletFile)
import Text.Jasmine (minifym)
import PathPiece()
import Yesod.Default.Util (addStaticContentExternal)
import Yesod.Core.Types
import Yesod.Auth.Message
import qualified Data.CaseInsensitive as CI
@ -105,20 +103,6 @@ instance Yesod App where
$(widgetFile "default-layout")
withUrlRenderer $(hamletFile "templates/default-layout-wrapper.hamlet")
addStaticContent ext mime content = do
master <- getYesod
let staticDir = appStaticDir (appSettings master)
addStaticContentExternal
minifym
genFileName
staticDir
(StaticR . flip StaticRoute [])
ext
mime
content
where
genFileName lbs = "autogen-" ++ base64md5 lbs
shouldLogIO app _source level =
pure $ appShouldLogAll (appSettings app) || level == LevelWarn || level == LevelError
makeLogger = return . appLogger