Skip to content

Commit

Permalink
Avoid tmp file creation for static resources Fixes #45
Browse files Browse the repository at this point in the history
  • Loading branch information
jonschoning committed Sep 11, 2022
1 parent 77b109c commit 804e500
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 21 deletions.
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,13 @@ 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
@cp $(_LOCAL_INSTALL_PATH)/bin/* dist
@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
Expand Down
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion espial.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion package.yaml
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
16 changes: 0 additions & 16 deletions src/Foundation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 804e500

Please sign in to comment.