Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
html
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
curry-packages
html
Commits
46df86a8
Commit
46df86a8
authored
Nov 15, 2018
by
Michael Hanus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improves localhost check
parent
65a958b2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
helpers/WebCPNSD.curry
helpers/WebCPNSD.curry
+3
-2
helpers/WebRegistry.curry
helpers/WebRegistry.curry
+1
-1
No files found.
helpers/WebCPNSD.curry
View file @
46df86a8
...
...
@@ -26,7 +26,7 @@ main :: IO HtmlForm
main = do
param <- getUrlParameter
remote <- getEnviron "REMOTE_ADDR"
if remote
== "127.0.0.1"
if remote
`elem` ["127.0.0.1","::1"]
then do result <- execCommand param
return $ answerText result
else return $ answerText $
...
...
@@ -36,6 +36,7 @@ execCommand :: String -> IO String
execCommand param = case param of
"status" -> cpnsCmd "status"
"log" -> cpnsCmd "log"
"start" -> cpnsCmd "start"
_ -> return $ unlines $
["ILLEGAL URL PARAMETER: " ++ param, "", cpnsCommands]
where
...
...
@@ -43,7 +44,7 @@ execCommand param = case param of
(_,out,err) <- evalCmd "curry-cpnsd" [cmd] ""
return $ out ++ if null err then "" else "ERROR OUTPUT:\n" ++ err
cpnsCommands = "Allowed arguments: status | log"
cpnsCommands = "Allowed arguments: status | log
| start
"
-- Install the CGI script in user homepage by:
...
...
helpers/WebRegistry.curry
View file @
46df86a8
...
...
@@ -28,7 +28,7 @@ main :: IO HtmlForm
main = do
param <- getUrlParameter
remote <- getEnviron "REMOTE_ADDR"
if remote
== "127.0.0.1"
if remote
`elem` ["127.0.0.1","::1"]
then do result <- execCommand param
return $ answerText result
else return $ answerText $
...
...
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