Commit graph

1891 commits

Author SHA1 Message Date
Default email
d0d8e8fc71 Project import generated by Copybara.
GitOrigin-RevId: d3f7e969b9860fb80750147aeb56dab1c730e756
2021-03-23 19:22:30 +00:00
8b173ec8a3 ci-root: remove windows for the moment 2021-03-25 18:27:40 +00:00
0e4894096a 3p/nixpkgs: openssl 1.1.1j->k 2021-03-25 17:30:22 +00:00
1883186bb8 hm/graphical-client: switch to google-chrome-beta from chromium 2021-03-25 10:54:01 +00:00
7b5ac688b8 fup: add test for disabled TokenAuthMiddleware 2021-03-23 01:31:42 +00:00
affe252f73 fup: fix config file handling
Whoops! Before, config files were being read but all the contents were basically
being discarded.

Now, we both load and actually use the config file, leading to a much more positive
experience for everyone involved :)
2021-03-23 01:21:39 +00:00
a99e0309c5 ops/nixos/fup: switch to using config file 2021-03-23 00:58:18 +00:00
8271714a18 fup: allow Fup-Token header for carrying auth credentials 2021-03-23 00:58:06 +00:00
dbd711ded8 fup: add TokenAuthMiddleware
This is an example middleware which can be used as an AuthMiddleware for only
allowing requests to non-view pages which are accompanied by an auth token via
HTTP basic auth.
2021-03-23 00:46:33 +00:00
d96cf3d34d fup/cmd/serve: add viper bindings for all the flags 2021-03-23 00:45:51 +00:00
5b74ceec4e fup: add auth middleware machinery
This allows clients to register an authentication middleware which will be
provided values in the context that it can use to make an authn/authz decision.
2021-03-23 00:45:28 +00:00
ccb7d81f1a fup: allow PUT without filename 2021-03-22 23:31:58 +00:00
48be007f79 fup: clear the file input when we start the upload
This prevents the back button from upload the same files *again*.
2021-03-22 19:33:03 +00:00
75afddacc4 fup/hashfs: actually hash the thing
This previous behaviour was to, instead of hashing the file, just return the
first few bytes of it, which is neither intuitive nor the behaviour I was
looking for.
2021-03-22 19:25:55 +00:00
11ed74003a nixos/fup: allow large file uploads 2021-03-22 13:56:16 +00:00
86d9292cd1 blade-tuvok: change fup to listen on wildcard
It's broken otherwise, since the default server is based on the incoming IP,
and the precise listed IPs are more tightly binding.
2021-03-22 13:46:28 +00:00
ff5ea120e5 blade-tuvok/fup: override listen IPs 2021-03-22 02:50:27 +00:00
ca642bfa5e blade-tuvok: add fup 2021-03-22 02:43:17 +00:00
b4e785af8a fup: fix minor issue with shorter-than-512 byte file uploads
Reader.Read is permitted to return EOF on short reads, which had not been
anticipated by this code. There's probably more instances of this lurking...
2021-03-22 02:42:34 +00:00
a9a437cee4 fup: add systemd socket activation support to fup serve 2021-03-22 02:41:59 +00:00
ba95046e84 fup: add additional mimetypes to pretty page 2021-03-22 01:09:00 +00:00
01fb49549b fup: add drag and drop uploads
There's no UI indication that this is happening yet, but...
2021-03-22 01:08:42 +00:00
bb31335319 fup: add basic view and paste UIs 2021-03-22 00:25:32 +00:00
d05aa3ace1 fup: implement frontend bits 2021-03-21 23:10:15 +00:00
45b3a1fe44 fup: add reset.min.css before I start working on styling 2021-03-21 19:48:11 +00:00
5cd85b03db fup: add cheddar to PATH for nix derivation
This ensures that we always have syntax highlighting available.

For people using it directly, it's their responsibility to make sure that
cheddar is available in their path, if they want syntax highlighting.
2021-03-21 19:06:38 +00:00
c187956f19 fup/minicheddar: add basic spawn test 2021-03-21 19:05:59 +00:00
b7cd0d0e29 fup: add cheddar as a syntax highlighter 2021-03-21 18:52:22 +00:00
d604c261e0 3p: add cheddar 2021-03-21 18:52:09 +00:00
2306915e2c fup: implement file uploads!
TODO: tests for this.
2021-03-21 18:04:37 +00:00
a3601c2946 fup: add mimetype package to dependency set 2021-03-21 17:13:05 +00:00
7eac2c0c07 fup/fuphttp: add badRequest handler
We might get bad requests for e.g. file uploads, so we should have an error
handler for that.

This also disables mime type sniffing for the other text/plain error handler.
2021-03-21 17:08:29 +00:00
5d9b444a56 fup/fuphttp: add filename generator to options and application 2021-03-21 17:07:47 +00:00
7b969570a9 fup/fuphttp/fngen: expose UniqueName function, add tests for it 2021-03-21 17:02:56 +00:00
691babc0f7 fup: add fngen package, for generating filenames 2021-03-21 16:52:53 +00:00
de4897da06 fup/fuphttp: add missing SPDX comments 2021-03-21 15:34:50 +00:00
ad67e1025a fup/fuphttp: split download logic into a separate file.
It's neatly partitionable away from the rest of the logic, so it's easier to
put it in a separate file.
2021-03-21 15:23:43 +00:00
4c4bd46aa8 fup: factor out metadata retrieval into a separate file
We'll need this for cleanup operations as well. This should likely be factored
out again into an entirely separate package that deals with storage access.
2021-03-21 15:17:46 +00:00
7bac0aee74 fup: implement deleting expired files on request
This is a very basic implementation of gating that we only return files which
haven't expired.  If the file has expired, then we just delete it.
2021-03-21 14:56:42 +00:00
0e69199569 fup: shore up serving and add tests for supported methods
We support several methods of serving assets:

* Redirect to blobstore
    - This requires the backend to support signed URLs.
      We rely on the backend to support HTTP semantics, like supporting
      Range headers.
* Serve-using-http.ServeContent
    - This requires the backend to actually be providing a io.ReadSeeker.
      net/http provides Range/If- conditional support.
* Serve-proxy
    - This is the safest and most compatible method.
      We don't support conditionals nor Range headers. This mode is unlikely
      to be suitable for multimedia, like MP3s or video.
2021-03-21 14:35:04 +00:00
04eb6c0299 fup: fixup 2021-03-21 03:29:34 +00:00
08098fb666 fup: add file serving
This adds both redirect-to-signed-URL and proxy fileserving.

The proxy fileserving is somewhat limited: we don't support the Range header,
and it isn't easy to reuse the net/http ServeContent implementation because
that requires a SeekCloser. I think it might be possible to "bodge" a
SeekCloser on top of dynamically opening files, but it'll be a bit wonky and
will be slower than strictly necessary.
2021-03-21 03:04:38 +00:00
e21db7a061 fup: add a template function for getting paths to static assets
We add the hash of the file to the static assets, so they can be cached
indefinitely.  This also, however, means that we need some way of referring to
them.
2021-03-21 03:03:15 +00:00
5846385513 fup: move hashfs into its own package.
We need to depend on its API for fuphttp, so it's better if it's a separate
package to avoid embedding things we don't need.

In general it's probably a good idea to separate the logic from the embedded
content...
2021-03-20 23:43:59 +00:00
25443cfaab fup: add bucket-url flag for specifying storage
This allows setting the persistent storage location to save files into.

NOTE: defaults to mem:// for development purposes, which... is gonna be a bad
time.
2021-03-20 23:33:39 +00:00
7e4fb52cef fup: add viper for persistent config 2021-03-20 23:32:56 +00:00
cb44e7894f fup: add gocloud.dev blob backends 2021-03-20 23:17:02 +00:00
Default email
71ea7b1625 Project import generated by Copybara.
GitOrigin-RevId: f5e8bdd07d1afaabf6b37afc5497b1e498b8046f
2021-03-19 18:17:44 +01:00
a0a853c3c9 3p/nixpkgs: fix python38Packages.cherrypy 2021-03-21 03:20:06 +00:00
Default email
07d6a74cbb Project import generated by Copybara.
GitOrigin-RevId: f5e8bdd07d1afaabf6b37afc5497b1e498b8046f
2021-03-19 18:17:44 +01:00