summaryrefslogtreecommitdiff
path: root/src/compiler/GFServer.hs
AgeCommit message (Collapse)Author
2014-10-15Rename modules GFI, GFC & GFServer...hallgren
... to GF.Interactive, GF.Compiler & GF.Server, respectively.
2014-09-08(1) Refactor concurrency, (2) write to .gfo.tmp then rename to .gfohallgren
(1) introduces the module GF.Infra.Concurreny with lifted concurrency operators (to reduce uses of liftIO) and some additional concurrency utilities, e.g. a function for sequential logging that is used in both GF.CompileInParallel and GFServer. (2) avoids leaving broken .gfo files behind if compilation is aborted.
2014-09-02src/server: refactoring to isolate dependencies on the cgi/fastcgi packageshallgren
* Introducing the module CGI, re-exporting a subset of the cgi package. It might complete replace the cgi package in the future. * Introducing the module CGIUtils, containing functions from FastCGIUtils that have nothing to do with fastcgi. Some low level hackery with unsafePerformIO and global variables was left in FastCGIUtils, but it is actually not used, neither for gf -server nor exec/pgf-fcgi.hs.
2014-08-20Add lifted directory operations in GF.System.Directory to eliminate the need ↵hallgren
for liftIO in various places
2014-05-12gf -server: include list of loaded PGFs in version infohallgren
2014-04-09PGF web service: add unlexers and enable client side cachinghallgren
Most PGF web API commands that produce linearizations now accept an unlexer parameter. Possible values are "text", "code" and "mixed". The web service now include Date and Last-Modified headers in the HTTP, responses. This means that browsers can treat responses as static content and cache them, so it becomes less critical to cache parse results in the server. Also did some cleanup in PGFService.hs, e.g. removed a couple of functions that can now be imported from PGF.Lexing instead.
2014-03-19gf -server: add a command to manually flush the PGF cachehallgren
This can be used if the cloud service seems slow, but it would probably be better to automatically expire unused PGFs from the cache after some time.
2014-02-11GFServer.hs: avoid intertwined log messages from parallel requestshallgren
2014-01-27gf -server: fix a redirection bug...hallgren
...that was introduced with the recent changes to the handling of the current working directory
2014-01-24gf -server: allow multiple PGF service requests to be handled in parallelhallgren
PGF service requests are stateless and can run in parallel, but some other requests handled by the server are not and might even change the current working directory temporarily, and this affects all threads, so it is important that the PGF service requests access PGF files by absolute paths.
2014-01-20Optionally include C run-time supporthallgren
If the C run-time library is compiled and installed on your system, you can now do 'cabal configure -fc-runtime' to get the following extras: + The haskell binding to the C run-time library will be included in the PGF library (so you can import it in Haskell applications). Documentation on the new modules will be included when you run 'cabal haddock'. + The new command 'pgf-shell', implemented on top of haskell binding to the C run-time system. + Three new commands in the web API: c-parse, c-linearize and c-translate. Their interfaces are similar to the corresponding commands without the "c-" prefix, but they should be considered preliminary.
2013-11-20Reduced clutter in monadic codehallgren
+ Eliminated vairous ad-hoc coersion functions between specific monads (IO, Err, IOE, Check) in favor of more general lifting functions (liftIO, liftErr). + Generalized many basic monadic operations from specific monads to arbitrary monads in the appropriate class (MonadIO and/or ErrorMonad), thereby completely eliminating the need for lifting functions in lots of places. This can be considered a small step forward towards a cleaner compiler API and more malleable compiler code in general.
2013-08-20gf -server: fix for directory URLs without a trailing slashhallgren
When a browser requests a URL that refers to a directory, web server usually redirect the browser to the same URL with a trailing '/' added, if one was not already present. This is to prevent relative links in the returned document from being interpreted relative to the parent directory instead of the current document. This type of redirection was missing in gf -server.
2013-07-29Cloud & PGF service: use Content-Type application/json for JSON outputhallgren
This is in accordance with RFC 4627. http://tools.ietf.org/html/rfc4627 Use application/javascript for JSONP output.
2013-07-25Allow cross origin requests to GF cloud & PGF serviceshallgren
By adding a header Access-Control-Allow-Origin: * to the HTTP responses, web browsers are informed that it is OK to call the services from web pages hosted on other sites. This is apparently supported in most modern browsers, so it should no longer be necessary to resort to JSONP. See https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS
2013-06-13Fix UTF-8 decoding problem in gf -serverhallgren
The package network-2.4.1.1 thoughlessly introduced a backward incompatible change to the function Network.URI.unEscapeString, see https://github.com/haskell/network/commit/f2168b1f8978b4ad9c504e545755f0795ac869ce This also affects the function Network.Shed.Httpd.queryToArguments, which is used in GFServer.hs. To remain compatible with older and newer versions of the network package, we need to stay clear of queryToArguments and unEscapeString. A replacement function has been added to server/URLEncoding.hs.
2013-03-11Additional changes for GHC 7.4 & 7.6 compatibilityhallgren
2013-03-09ghc-7.6: allow directory-1.2Sergei Trofimovich
Get rid of old-time depend (and ClockTime in favour of UTCTime). time-compat helps to retain backward compatibility with directory-1.1 and lower.
2013-01-13gf -server: fix bug in bug fix for current directoryhallgren
2013-01-12gf -server: small logging improvementshallgren
2013-01-12gf -server: defend against problems with the current directory caused ↵hallgren
unhandled errors
2012-11-23gf -server + gfse: show modification time of public grammarshallgren
2012-11-14Add flag --document-root for user with gf --serverhallgren
This can make it easier to test cloud service updates before installing them.
2012-11-08Eliminate warnings about deprecated use of catch and tryhallgren
This is also needed for compatibility with GHC 7.6.
2012-11-06gf -server: make it possible to pass arbitrary flags/options to gf when ↵hallgren
compiling grammars For example, you can add -optimize-pgf: http://localhost:41296/cloud?dir=...&command=remake&-optimize-pgf=&Foods2Eng.gf=&Foods2Swe.gf=
2012-10-23gf -server: introduce command=remake for recompiling previously uploaded ↵hallgren
grammars Also remove some old commented out code.
2012-09-26gf -server: add a GF version info requesthallgren
GF version info can now be obtained from http://localhost:41926/version Also removed some unused imports.
2012-09-25Use the SIO monad in the GF shellhallgren
+ The restrictions on arbitrary IO when GF is running in restricted mode is now enforced in the types. + This hopefully also solves an intermittent problem when accessing the GF shell through the web API provided by gf -server. This was visible in the Simple Translation Tool and probably caused by some low-level bug in the GHC IO libraries.
2012-09-22GFServer.hs: code improvementshallgren
Use a monad in the request handler to make the code a bit more modular and readable.
2012-09-21gf -server: also restrict the paths of uploaded fileshallgren
2012-09-21gf -server: improved security checkshallgren
+ More restrictive limits on which file paths can be downloaded and removed. + Add more extensions to the list of file types that may be removed. In particular, allow documents created by simple translation tool to be removed.
2012-08-01GFServer.hs: binary files can now be uploaded to the cloudhallgren
Karel wants to upload PGF files.
2012-06-12translator: documents can now be saved in the cloudhallgren
some other small fixes
2012-05-28GFServer.hs: apply UTF8 encoding when saving uploaded fileshallgren
This fixes a bug introduced on May 16.
2012-05-27gf -server: remove debug outputhallgren
2012-05-16GFServer.hs: apply UTF8 decoding to all server inputhallgren
2012-02-29PGFService.hs bug fix: pattern match failure in doParsehallgren
doParse was missing a branch for PGF.ParseIncomplete. Also introduced the operator .= to simply the code that builds JSON objects.
2012-02-28gf -server mode: JSONP support for grammar listshallgren
Needed by the translation quiz.
2012-02-24gfse: text mode editing: accept grammars with printname judgementshallgren
But printname judgements are ignored for now. Also fixed an UTF-8 encoding bug when parsing uploaded grammars in gf -server mode.
2012-02-21gfse: edit abstract syntax in text mode with instant syntax error reportinghallgren
This is an experimental feature. It requires server support for parsing and is thus not available while offline, unlike most other editing functionality.
2012-02-13gfse: added a button to go directly from the editor to the minibarhallgren
If there is an error in the grammar, the error message is shown below the grammar instead. Also: GFServer.hs now returns compiler output in a JSON structure instead of as a HTML page.
2012-02-10gfse: stay on the same page when compiling grammarshallgren
The link to the minibar (or compiler errors) are now shown below the grammar on the same page. If you go to the minibar, you only have to press the back button once to get back to the editor. Also some output formatting changes in GFServer.hs.
2012-02-10gfse&minibar: select the right grammar in minibar when invoked from gfsehallgren
The grammar that the user is currently working is now the one shown initially in minibar, instead of the first grammar in alphabetical order. Also GFServer.hs now removes absolute paths to the grammar files on the server in error messages from GF returned to to gfse.
2012-02-01gf -server: better error message for requests with unsupported HTTP methodshallgren
2012-02-01gf -server: fix bug that caused '+' to be converted to ' ' in uploaded grammarshallgren
Fixed buggy workaround for bug in httpd-shed function queryToArguments.
2011-12-14gf -server[=port]hallgren
You can now specify which port the HTTP server should run on in server mode. The default is 41296.
2011-12-14gf -server mode improvementshallgren
+ Avoid looping if it is not possible to create a new server directory. + Work on FastCGI support using the direct-fastcgi package (commented out for now because of buggy behavior).
2011-11-01gfse: grammar sharing: bug fixes and win32 supporthallgren
win32 support is untested
2011-10-12Show version & configuration info when gf -server startshallgren
2011-10-12Bug fixes for gf -server mode and setuphallgren