summaryrefslogtreecommitdiff
path: root/Utility/WebApp.hs
Commit message (Collapse)AuthorAge
* cleanupGravatar Joey Hess2016-12-24
|
* unified AuthToken type between webapp and torGravatar Joey Hess2016-11-22
|
* webapp: Explicitly avoid checking for auth in static subsite requests.Gravatar Joey Hess2016-11-10
| | | | | | | | Yesod didn't used to do auth checks for that, but this may have changed. I don't have a way to reproduce the reported problem yet, but this change certianly won't hurt anything. This commit was sponsored by Thom May on Patreon.
* remove redundant constraintGravatar Joey Hess2016-09-15
|
* switch away from deprecated interfaceGravatar Joey Hess2016-09-05
| | | | | Again the new stuff works back to network-2.4, so no need to adjust cabal bounds.
* remove 3 build flagsGravatar Joey Hess2016-01-26
| | | | | | | | | | | | | * Removed the webapp-secure build flag, rolling it into the webapp build flag. * Removed the quvi and tahoe build flags, which only adds aeson to the core dependencies. * Removed the feed build flag, which only adds feed to the core dependencies. Build flags have cost in both code complexity and also make Setup configure have to work harder to find a usable set of build flags when some dependencies are missing.
* Added support for SHA3 hashed keys (in 8 varieties), when git-annex is built ↵Gravatar Joey Hess2015-08-06
| | | | | | | | using the cryptonite library. While cryptohash has SHA3 support, it has not been updated for the final version of the spec. Note that cryptonite has not been ported to all arches that cryptohash builds on yet.
* Dropped support for older versions of yesod and warp than the ones in Debian ↵Gravatar Joey Hess2015-04-22
| | | | | | Jessie. 466 lines of compat cruft deleted!
* update my email address and homepage urlGravatar Joey Hess2015-01-21
|
* fix some mixed space+tab indentationGravatar Joey Hess2014-10-09
| | | | | | | | | This fixes all instances of " \t" in the code base. Most common case seems to be after a "where" line; probably vim copied the two space layout of that line. Done as a background task while listening to episode 2 of the Type Theory podcast.
* unify exception handling into Utility.ExceptionGravatar Joey Hess2014-08-07
| | | | | | | | | | | | | | | | | | | | Removed old extensible-exceptions, only needed for very old ghc. Made webdav use Utility.Exception, to work after some changes in DAV's exception handling. Removed Annex.Exception. Mostly this was trivial, but note that tryAnnex is replaced with tryNonAsync and catchAnnex replaced with catchNonAsync. In theory that could be a behavior change, since the former caught all exceptions, and the latter don't catch async exceptions. However, in practice, nothing in the Annex monad uses async exceptions. Grepping for throwTo and killThread only find stuff in the assistant, which does not seem related. Command.Add.undo is changed to accept a SomeException, and things that use it for rollback now catch non-async exceptions, rather than only IOExceptions.
* Fix build with wai 0.3.0.Gravatar Joey Hess2014-06-11
| | | | | | | | | | This version of wai changed the type of Middleware, so I cannot seem to liftIO inside it. So, got rid of a lot of not really needed complexity to use System.Log.Logger's logging stuff, and just use the standard wai stdout logger when debug logging is enabled. Format may change some, and it logs http to stdout instead of stderr now. Doesn't matter for the webapp since both go to the same log anyway.
* Windows: Fix opening webapp when repository is in a directory with spaces in ↵Gravatar Joey Hess2014-06-10
| | | | the path.
* fix build with old versions of warpGravatar Joey Hess2014-06-04
|
* fix warning messageGravatar Joey Hess2014-05-29
| | | | This should work even back in debian stable's warp
* relicense general utility library code to BSDGravatar Joey Hess2014-05-10
| | | | | Omitted a couple of files what have had significant contributions from others.
* add desktop notificationsGravatar Joey Hess2014-03-22
| | | | | | | Motivation: Hook scripts for nautilus or other file managers need to provide the user with feedback that a file is being downloaded. This commit was sponsored by THM Schoemaker.
* webapp: Use securemem for constant time auth token comparisons.Gravatar Joey Hess2014-03-12
| | | | | Debian stable does not have securemem, but neither does it have warp-tls, so just disable use of securemem when not building with https support.
* quick fix to build with old warp-tlsGravatar Joey Hess2014-03-12
| | | | | | | | Debian stable's warp-tls is too old to support the new https feature well, so only use http with that old version. Note that the webapp still depends on warp-tls, because the TLSSettings type is used.
* remove buggy --listen=host:port supportGravatar Joey Hess2014-02-28
|
* use https when .git/annex/privkey.pem and .git/annex/certificate.pem exist ↵Gravatar Joey Hess2014-02-28
| | | | | | | (untested) I have not managed to generate a key that is accepted by the old version of warp-tls I have here.
* fix all remaining -Wall warnings on WindowsGravatar Joey Hess2014-02-25
|
* squash warningGravatar Joey Hess2013-12-09
|
* whupsGravatar Joey Hess2013-12-06
|
* didn't seem to helpGravatar Joey Hess2013-12-06
|
* fixGravatar Joey Hess2013-12-06
|
* try to use build-in yesod socket bind code on windows (mine seems to make t ↵Gravatar Joey Hess2013-12-06
| | | | crash)
* add withSocketsDo to hopefully appease the windows crash report godsGravatar Joey Hess2013-12-06
|
* weird DOS CMD shell is weirdGravatar Joey Hess2013-12-06
|
* Revert "try different syntax"Gravatar Joey Hess2013-12-06
| | | | This reverts commit 68b8850149a2311a2953a80777d9e747a5972468.
* try different syntaxGravatar Joey Hess2013-12-06
|
* support for opening urls on windowsGravatar Joey Hess2013-12-06
|
* same fix as android for windows getAddrInfo not workingGravatar Joey Hess2013-12-05
|
* 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