Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
curry-packages
spicey
Commits
72a69ce2
Commit
72a69ce2
authored
Nov 25, 2018
by
Michael Hanus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds private data dir to generated Spicey application
parent
1146d499
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
51 additions
and
8 deletions
+51
-8
resource_files/Config/Spicey.curry
resource_files/Config/Spicey.curry
+9
-0
resource_files/Config/UserProcesses.curry
resource_files/Config/UserProcesses.curry
+0
-0
resource_files/Makefile
resource_files/Makefile
+2
-0
resource_files/Session.curry
resource_files/Session.curry
+6
-3
resource_files/SessionInfo.curry
resource_files/SessionInfo.curry
+6
-1
resource_files/data/htaccess
resource_files/data/htaccess
+19
-0
resource_files/package.json
resource_files/package.json
+1
-0
src/Spicey/SpiceUp.curry
src/Spicey/SpiceUp.curry
+8
-4
No files found.
resource_files/Config/Spicey.curry
0 → 100644
View file @
72a69ce2
--- Some global configurations for the Spicey application.
module Config.Spicey
where
--- Location of the directory containing private run-time data
--- such as session and authentication information.
spiceyDataDir :: String
spiceyDataDir = "data"
resource_files/UserProcesses.curry
→
resource_files/
Config/
UserProcesses.curry
View file @
72a69ce2
File moved
resource_files/Makefile
View file @
72a69ce2
...
...
@@ -74,6 +74,8 @@ deploy: checkdeploy
$(CPM)
exec
$(MAKECGI)
-standalone
-m
main
-o
$(WEBSERVERDIR)
/spicey.cgi Main.curry
# copy other files
(
style sheets, images,...
)
cp
-r
public/
*
$(WEBSERVERDIR)
mkdir
-p
$(WEBSERVERDIR)
/data
# create private data dir
cp
-p
data/htaccess
$(WEBSERVERDIR)
/data/.htaccess
# and make it private
chmod
-R
go+rX
$(WEBSERVERDIR)
# clean up generated the package directory
...
...
resource_files/Session.curry
View file @
72a69ce2
...
...
@@ -13,11 +13,14 @@ module System.Session (
getSessionData, putSessionData, removeSessionData
) where
import HTML.Base
import Time
import FilePath ( (</>) )
import Global
import List
import Time
import HTML.Base
import Config.Spicey ( spiceyDataDir )
import System.Crypto
--- The life span in minutes to store data in sessions.
...
...
@@ -32,7 +35,7 @@ sessionCookieName = "spiceySessionId"
--- This global value saves time and last session id.
lastId :: Global (Int, Int)
lastId = global (0, 0) (Persistent sessionCookieName)
lastId = global (0, 0) (Persistent
(spiceyDataDir </>
sessionCookieName)
)
--- The abstract type to represent session identifiers.
...
...
resource_files/SessionInfo.curry
View file @
72a69ce2
...
...
@@ -14,7 +14,11 @@ module System.SessionInfo (
getUserSessionInfo, updateUserSessionInfo
) where
import FilePath ( (</>) )
import Global
import Config.Spicey ( spiceyDataDir )
import System.Session
--------------------------------------------------------------------------
...
...
@@ -39,7 +43,8 @@ setUserLoginOfSession login (SD _) = SD login
--------------------------------------------------------------------------
--- Definition of the session state to store the login name (as a string).
userSessionInfo :: Global (SessionStore UserSessionInfo)
userSessionInfo = global emptySessionStore (Persistent "userSessionInfo")
userSessionInfo =
global emptySessionStore (Persistent (spiceyDataDir </> "userSessionInfo"))
--- Gets the data of the current user session.
getUserSessionInfo :: IO UserSessionInfo
...
...
resource_files/data/htaccess
0 → 100644
View file @
72a69ce2
AuthType Basic
AuthName Spicey
AuthUserFile /dev/null
AuthGroupFile /dev/null
<Limit GET>
<IfVersion < 2.3>
# old access rules
order deny,allow
deny from all
satisfy any
#allow from 127.0.0.
</IfVersion>
<IfVersion >= 2.3>
# new access rules via authz_mod_core
Require all denied
#Require local
</IfVersion>
</Limit>
resource_files/package.json
View file @
72a69ce2
...
...
@@ -5,6 +5,7 @@
"synopsis"
:
"Web application 'XXXPKGNAMEXXX' generated by Spicey"
,
"category"
:
[
"Web"
],
"dependencies"
:
{
"base"
:
">= 1.0.0, < 2.0.0"
,
"cdbi"
:
">= 2.0.0"
,
"html"
:
">= 2.1.0"
,
"wui"
:
">= 2.0.0"
...
...
src/Spicey/SpiceUp.curry
View file @
72a69ce2
...
...
@@ -16,7 +16,7 @@ import Spicey.Scaffolding
systemBanner :: String
systemBanner =
let bannerText = "Spicey Web Framework (Version " ++ packageVersion ++
" of 2
4
/11/18)"
" of 2
5
/11/18)"
bannerLine = take (length bannerText) (repeat '-')
in bannerLine ++ "\n" ++ bannerText ++ "\n" ++ bannerLine
...
...
@@ -55,18 +55,22 @@ spiceyStructure pkgname =
ResourceFile NoExec "Processes.curry",
GeneratedFromERD createAuthorizations ],
Directory "View" [
ResourceFile NoExec
(
"View" </> "SpiceySystem.curry"
)
,
ResourceFile NoExec
$
"View" </> "SpiceySystem.curry",
GeneratedFromERD createViews,
GeneratedFromERD createHtmlHelpers ],
Directory "Controller" [
ResourceFile NoExec
(
"Controller" </> "SpiceySystem.curry"
)
,
ResourceFile NoExec
$
"Controller" </> "SpiceySystem.curry",
GeneratedFromERD createControllers ],
Directory "Model" [
GeneratedFromERD createModels ],
Directory "Config" [
ResourceFile NoExec "UserProcesses.curry",
ResourceFile NoExec $ "Config" </> "Spicey.curry",
ResourceFile NoExec $ "Config" </> "UserProcesses.curry",
GeneratedFromERD createRoutes ]
],
Directory "data" [
ResourceFile NoExec $ "data" </> "htaccess"
],
Directory "public" [
ResourceFile NoExec "index.html",
ResourceFile NoExec "favicon.ico",
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment