summaryrefslogtreecommitdiff
path: root/Utility/WebApp.hs
Commit message (Collapse)AuthorAge
* qualify import; also available in crypto-randomGravatar Joey Hess2013-10-11
|
* Use cryptohash rather than SHA for hashing.Gravatar Joey Hess2013-09-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a massive win on OSX, which doesn't have a sha256sum normally. Only use external hash commands when the file is > 1 mb, since cryptohash is quite close to them in speed. SHA is still used to calculate HMACs. I don't quite understand cryptohash's API for those. Used the following benchmark to arrive at the 1 mb number. 1 mb file: benchmarking sha256/internal mean: 13.86696 ms, lb 13.83010 ms, ub 13.93453 ms, ci 0.950 std dev: 249.3235 us, lb 162.0448 us, ub 458.1744 us, ci 0.950 found 5 outliers among 100 samples (5.0%) 4 (4.0%) high mild 1 (1.0%) high severe variance introduced by outliers: 10.415% variance is moderately inflated by outliers benchmarking sha256/external mean: 14.20670 ms, lb 14.17237 ms, ub 14.27004 ms, ci 0.950 std dev: 230.5448 us, lb 150.7310 us, ub 427.6068 us, ci 0.950 found 3 outliers among 100 samples (3.0%) 2 (2.0%) high mild 1 (1.0%) high severe 2 mb file: benchmarking sha256/internal mean: 26.44270 ms, lb 26.23701 ms, ub 26.63414 ms, ci 0.950 std dev: 1.012303 ms, lb 925.8921 us, ub 1.122267 ms, ci 0.950 variance introduced by outliers: 35.540% variance is moderately inflated by outliers benchmarking sha256/external mean: 26.84521 ms, lb 26.77644 ms, ub 26.91433 ms, ci 0.950 std dev: 347.7867 us, lb 210.6283 us, ub 571.3351 us, ci 0.950 found 6 outliers among 100 samples (6.0%) import Crypto.Hash import Data.ByteString.Lazy as L import Criterion.Main import Common testfile :: FilePath testfile = "/run/shm/data" -- on ram disk main = defaultMain [ bgroup "sha256" [ bench "internal" $ whnfIO internal , bench "external" $ whnfIO external ] ] sha256 :: L.ByteString -> Digest SHA256 sha256 = hashlazy internal :: IO String internal = show . sha256 <$> L.readFile testfile external :: IO String external = do s <- readProcess "sha256sum" [testfile] return $ fst $ separate (== ' ') s
* now builds with both yesod 1.2 and 1.1Gravatar Joey Hess2013-06-03
|
* WIP yesod 1.2Gravatar Joey Hess2013-06-03
|
* Android: Work around Android devices where the `am` command doesn't work.Gravatar Joey Hess2013-05-31
|
* rename moduleGravatar Joey Hess2013-05-12
|
* work around strange endianness bug in port number on AndroidGravatar Joey Hess2013-05-02
|
* work around getAddrInfo segfault on AndroidGravatar Joey Hess2013-05-02
| | | | | | | | For an unknown reason, getAddrInfo currently is segfaulting. Note that in February, I had used warpDebug, which uses getAddrInfo, and it worked. Don't know if my toolchain has changed and broke it, or it's due to having a different Android device now. Anyway, work around it by hardcoding the address to use.
* stop setting ai_addrconfigGravatar Joey Hess2013-05-02
| | | | | | | This caused the code to fail on Android, which doesn't know that flag. It seems best to let the OS default flags be used. Tested working ok on Linux. The only difference on Linux is it might return a v4mapped ipv6 address sometimes.
* untested browser opening on AndroidGravatar Joey Hess2013-04-18
| | | | | I've found multiple references to using the `am` command from the adb shell to open a browser. So I assume it also works in a terminal emulator.
* allow --listen to have a port specified as well as the addressGravatar Joey Hess2013-04-09
|
* webapp: New --listen= option allows running the webapp on one computer and ↵Gravatar Joey Hess2013-04-08
| | | | | | | connecting to it from another. Does not yet use HTTPS. I'd need to generate a certificate, and I'm not sure what's the best way to do that.
* use clientSessionBackend2 where availableGravatar Joey Hess2013-03-10
| | | | avoids a warning, which says it's faster
* simpler use of MIN_VERSION checksGravatar Joey Hess2013-03-10
|
* webapp: Work around bug in Warp's slowloris attack prevention code, that ↵Gravatar Joey Hess2013-03-09
| | | | caused regular browsers to stall when they reuse a connection after leaving it idle for 30 seconds. (See https://github.com/yesodweb/wai/issues/146)
* webapp: Now always logs to .git/annex/daemon.logGravatar Joey Hess2013-01-15
| | | | | | | | It used to not log to daemon.log when a repository was first created, and when starting the webapp. Now both do. Redirecting stdout and stderr to the log is tricky when starting the webapp, because the web browser may want to communicate with the user. (Either a console web browser, or web.browser = echo) This is handled by restoring the original fds when running the browser.
* webapp: Use IP address, rather than localhostGravatar Joey Hess2013-01-09
| | | | | | | | | since some systems may have configuration problems or other issues that prevent web browsers from connecting to the right localhost IP for the webapp. Tested on both ipv4 and ipv6 localhost. Url for the latter looks like: http://[::1]:50676
* restart UIGravatar Joey Hess2013-01-03
| | | | | Browser behavior is not ideal; a new tab is opened on restart. Browsers won't let me redirect to a file:// so I cannot use the old tab.
* finished where indentation changesGravatar Joey Hess2012-12-13
|
* The standalone builds now unset their special path and library path ↵Gravatar Joey Hess2012-11-27
| | | | | | variables before running the system web browser. Should fix a crash reported on OSX.
* fix warning seen on OSX, apparently something there defines a closeGravatar Joey Hess2012-11-07
|
* let's not -DOSX, that results in unwanted manglingGravatar Joey Hess2012-09-29
|
* retry bindGravatar Joey Hess2012-09-27
| | | | | | This is a workaround for bind failing with EINVAL sometimes on OSX. I don't know why; EVINAL should mean the socket is already bound to an address, but this is with a new socket.
* prefer ipv4 localhost when both are availableGravatar Joey Hess2012-09-18
| | | | | | | | | | The webapp can only run on one of ipv4 and ipv6, no both. Some web browsers may not support ipv6, so ipv4 is the safe choice. The actual problem I ran into with it only listening to ipv6 was that Utility.Url.exists was failing to connect to it. I doubt that haskell's HTTP library is ipv4 only. More likely, it was only trying one address, and tried ipv4 first.
* import yesod qualifiedGravatar Joey Hess2012-08-30
| | | | | | To avoid conflict with different liftIO from MonadIO (in some version of yesod not the one I have here), and because it's generally clearer, since this module has both Wai and Yesod stuff, to qualify them both.
* support building with yesod-default 1.1.0Gravatar Joey Hess2012-08-09
| | | | | | | | | Old 1.0.1 version is still supported as well. Cabal autodetects which version is available, but in the Makefile, WITH_OLD_YESOD has to be configured appropriately. I have not squashed all the $newline warnings with the new Yesod. They should go away eventually anyway as Yesod moves past that transition.
* avoid headGravatar Joey Hess2012-08-05
|
* fix the auto token leak on auth error page issue permanantlyGravatar Joey Hess2012-07-29
|
* much better webapp startup of the assistantGravatar Joey Hess2012-07-27
| | | | | | This avoids forking another process, avoids polling, fixes a race, and avoids a rare forkProcess thread hang that I saw once time when starting the webapp.
* remove bogus AI_NUMERICSERVGravatar Joey Hess2012-07-27
| | | | | Not needed, and causes a segfault on OSX when it tries to dereference the NULL servicename. (Linux handles this case better.)
* fix OSX open callGravatar Joey Hess2012-07-26
|
* on second thought, the session cookie is still useful to support setMessageGravatar Joey Hess2012-07-26
|
* git annex webapp --force forces a restart of the daemonGravatar Joey Hess2012-07-26
| | | | Useful for testing..
* update build depsGravatar Joey Hess2012-07-26
|
* use the secret token for authentication, and add to all dynamic urlsGravatar Joey Hess2012-07-26
|
* generate random token and launch webapp using itGravatar Joey Hess2012-07-26
|
* run yesod, and launch webapp on startupGravatar Joey Hess2012-07-25