From f27d4af0d4128efba39c4082015ba749ce187c53 Mon Sep 17 00:00:00 2001 From: Jon Schoning Date: Sun, 11 Sep 2022 14:44:40 -0500 Subject: [PATCH] Avoid tmp file creation for static resources Fixes #45 --- Makefile | 3 --- changelog.md | 3 +++ espial.cabal | 2 +- package.yaml | 2 +- src/Foundation.hs | 16 ---------------- 5 files changed, 5 insertions(+), 21 deletions(-) diff --git a/Makefile b/Makefile index b582ae4..4ee4e6f 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/changelog.md b/changelog.md index 366ecc4..78f0a27 100644 --- a/changelog.md +++ b/changelog.md @@ -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 diff --git a/espial.cabal b/espial.cabal index aa5f71d..4970b7f 100644 --- a/espial.cabal +++ b/espial.cabal @@ -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. diff --git a/package.yaml b/package.yaml index dda0440..4e783ee 100644 --- a/package.yaml +++ b/package.yaml @@ -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. diff --git a/src/Foundation.hs b/src/Foundation.hs index 8b779fe..7ebcd97 100644 --- a/src/Foundation.hs +++ b/src/Foundation.hs @@ -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