Commit Graph

696 Commits

Author SHA1 Message Date
meejah
dc19e7379e validate capability before doing anything 2019-09-27 11:51:03 -06:00
meejah
488e40ce86 unused import 2019-09-27 11:51:03 -06:00
meejah
da882df23b comment 2019-09-27 11:51:03 -06:00
meejah
a7c8407127 use hyperlink.URL instead of custom code 2019-09-27 11:51:03 -06:00
meejah
24faca46a9 more-correct URI 2019-09-27 11:51:03 -06:00
meejah
c507971e62 unused import 2019-09-27 11:51:03 -06:00
meejah
6195b2680b fix up ctx/req and add docstrings 2019-09-27 11:51:03 -06:00
meejah
2897b5767e do the weird redirect thing properly 2019-09-27 11:51:03 -06:00
meejah
0f6fc706ed port URIHandler to twisted.web 2019-09-27 11:51:03 -06:00
hab
029695399a
Merge pull request #652 from habnabit/move-to-twt--info
Port allmydata.web.info to twisted.web.template
2019-09-17 12:22:22 +01:00
meejah
9050fdcea6 explicitly save refs to webish and operations (instead of using Service methods) 2019-08-24 12:31:08 -06:00
meejah
168bf33e1c remove comment 2019-08-20 00:18:14 -06:00
meejah
0a5aa61a70 must be new-style class (and I guess Resource isn't?) 2019-08-20 00:18:14 -06:00
meejah
ec70fa7090 fail gracefully on invalid URLs 2019-08-20 00:17:28 -06:00
meejah
a307adb7f5 there's no download timeline anymore 2019-08-20 00:17:28 -06:00
meejah
ba9a4e590b remove debug 2019-08-20 00:17:28 -06:00
meejah
baa773588e comment 2019-08-20 00:17:28 -06:00
meejah
3f8954be08 refactor download status to get rid of a 'def child_' 2019-08-20 00:17:28 -06:00
meejah
569454b1a3 get rid of child_operations from root 2019-08-20 00:17:28 -06:00
meejah
385df39981 get rid of .remember() / IOpHandleTable 2019-08-20 00:17:28 -06:00
meejah
217e32e385 make '/operations' work again 2019-08-20 00:17:28 -06:00
meejah
9e999d0c68 work around lack of getChild in nevow.rend.Page 2019-08-20 00:17:28 -06:00
meejah
d873a041bf remove some child_ usage 2019-08-20 00:17:28 -06:00
meejah
48cb51097f keep using Page 2019-08-20 00:17:28 -06:00
meejah
5cdf5a667a more hacky test 2019-08-20 00:17:28 -06:00
meejah
3a2182309d whitespace 2019-08-20 00:17:28 -06:00
hab
77e6803f3c Add some docstrings. 2019-08-19 19:57:45 +01:00
hab
a01c375327 Port info.xhtml to twt. 2019-08-19 19:57:45 +01:00
Jean-Paul Calderone
4053b6c56f make it new-style 2019-08-19 11:26:32 -04:00
Jean-Paul Calderone
21bf7fc25c Merge remote-tracking branch 'origin/master' into integration/storage-economics 2019-08-16 15:39:31 -04:00
hab
a5dfcd0d8c Add another docstring. 2019-08-16 17:49:39 +01:00
hab
e670bb5d3b Add more docstrings; add a test hook.
In place of nevow's renderSynchronously, I think it'll be good enough
to return the Element directly so it can be flattened. It still gets
flattened with a None request, which might need to change.
2019-08-16 17:43:31 +01:00
hab
e2c2c30574 Add more docstrings. 2019-08-16 17:36:48 +01:00
hab
4e6ff4c7c7 Style fixups; be explicit about literals. 2019-08-16 16:59:15 +01:00
hab
46cc5ab8ed Remove unused imports. 2019-08-14 20:35:15 +01:00
hab
258dde98ed Correct the documentation for these new classes.
The old documentation was copy-pasted or didn't exist.

Also, I forgot that tag() doesn't copy a tag, even if as written this
_did_ work for my purposes.
2019-08-14 20:25:06 +01:00
hab
8ce18541c6 Tidy up introweb.
Fix imports; make all parameter names the same; use " for string
literals.
2019-08-14 20:24:35 +01:00
hab
b6d9d58449 Remove all nevow from introweb.
These were the last references to it, and I think it's still working
fine without. I'm not _entirely_ positive but I think t.w.Static's
File has caught up to the features that were added to nevow's File.
2019-08-14 19:05:37 +01:00
hab
be735208a3 Kludge JSON/multi-format support back in.
I need to fix these docstrings but this is the right idea at
least. Maybe MultiFormatResource could use a name less easily confused
with its predecessor MultiFormatPage.
2019-08-14 19:05:37 +01:00
hab
4e8e35a7d6 Sequence headers are always shown.
I wasn't sure if that was the case, but I've checked nevow now.
2019-08-14 19:05:37 +01:00
hab
c96de2c4ed Remove unused methods. 2019-08-14 19:05:36 +01:00
hab
ae1f41af98 Preliminary port of introweb to t.w.template.
It doesn't do JSON yet, so this is more of a proof of a concept than
anything usable yet.
2019-08-14 19:05:36 +01:00
Jean-Paul Calderone
3d2d61f853 Merge remote-tracking branch 'origin/master' into 3239.python2-new-style-regression-test 2019-08-13 18:27:23 -04:00
Jean-Paul Calderone
b7e3633056 Fix a lot of classic classes in Tahoe-LAFS 2019-08-13 16:55:40 -04:00
Jean-Paul Calderone
13409a2449 Move the remaining package checking machinery to its own module. 2019-08-13 15:11:01 -04:00
Jean-Paul Calderone
d69de15664 implement the feature
improve the test slightly, too, to verify the configuration supplied to the
plugin is as expected.
2019-08-03 06:39:31 -04:00
meejah
f9d1c4b06d delete ancient jquery, d3 and the thing that depends on them 2019-07-15 19:40:31 -06:00
heartsucker
9e31bfe2f4 update code/test to use new ed25512 module 2019-06-13 22:19:28 -06:00
tpltnt
c8f11dc2d3 ported old-style classes to new-style 2019-05-26 08:28:18 +02:00
heartsucker
be910fe269
updated syntax in directory.py to make whole allmydata.web python3 compatible 2019-03-28 12:32:13 +01:00
Jean-Paul Calderone
a26b9ca8af workaround https://github.com/crossbario/autobahn-python/issues/1151 2019-03-25 12:01:36 -04:00
Jean-Paul Calderone
336e69c270 Hotfix for nevow#106 2019-03-24 11:26:58 -04:00
Jean-Paul Calderone
febfa50a83 make sure we get bytes here 2019-03-22 16:42:50 -04:00
Jean-Paul Calderone
794314668a this is not unicode, it came from a file, I guess 2019-03-22 15:50:58 -04:00
Jean-Paul Calderone
9de97dbdd5 Use guard and add some tests (integration failing) 2019-03-22 13:47:32 -04:00
Jean-Paul Calderone
58deb54cfc import cleanups 2019-03-21 15:01:25 -04:00
Jean-Paul Calderone
d00c4212a8 futurize 2019-03-21 15:01:14 -04:00
Jean-Paul Calderone
5f4f8d9dbb Create the /private hierarchy 2019-03-21 15:00:57 -04:00
Jean-Paul Calderone
2877c9b3c1 unused import 2019-03-21 15:00:19 -04:00
Jean-Paul Calderone
e02962c3a3 Remove one more webport thingy 2019-03-21 14:39:52 -04:00
Jean-Paul Calderone
edf01d7817 don't compute the url, it doesn't seem to be necessary 2019-03-21 13:58:46 -04:00
meejah
956a39a6c1 clarify 2019-03-21 02:01:33 -06:00
meejah
dbea69c2d2 refactor 2019-03-21 01:52:45 -06:00
meejah
816ceb12cb make more things work 2019-03-21 01:37:47 -06:00
meejah
b734c893df prototype token-authenticated WebSocket stream 2019-03-20 18:14:47 -06:00
Jean-Paul Calderone
e36c850da4 == instead of is for string comparison 2019-01-24 09:53:02 -05:00
Jean-Paul Calderone
20084506b3 Handle all the status cases 2018-05-23 13:59:42 -04:00
Jean-Paul Calderone
b6d33c92ff Remove disabled ad hoc debug logging 2018-04-26 15:26:17 -04:00
meejah
0ebb587666 report download sizes in magic-folder status 2018-03-20 11:40:49 -06:00
meejah
42766da553 add a 'size' to pending uploads 2018-03-20 11:40:49 -06:00
tpltnt
95acd57fdd removed exact version info from header 2018-01-04 22:29:57 +01:00
tpltnt
48b442f8c1 mentioned ctx 2018-01-04 22:29:57 +01:00
tpltnt
6d4f4f4a65 adjusted doc string 2018-01-04 22:29:57 +01:00
tpltnt
68b1271190 added docstring 2018-01-04 22:29:57 +01:00
tpltnt
005bcf5012 added code as described in ticket 1307 2018-01-04 22:29:57 +01:00
Brian Warner
da4e7dcfbe hush a bunch of not-really-problems caught by the lgtm.com static analyzer
This is all minor stuff: unreachable debug code (that should be commented-out
instead of in an 'if False:' block), unnecessary 'pass' and 'global'
statements, redundantly-initialized variables. No behavior changes. Nothing
here was actually broken, it just looked suspicious to the static analysis at
https://lgtm.com/projects/g/tahoe-lafs/tahoe-lafs/alerts/?mode=list .
2017-12-31 00:19:41 +01:00
meejah
672475cb2b Multiple magic-folders
This moves all magic-folder configs to a single YAML
file. We load legacy config fine and don't mess with
legacy config unless you use a magic-folder command that
changes the config.

Increase test coverage
2017-12-05 10:34:48 -07:00
Jean-Paul Calderone
e32f581d07 Get rid of the reliance on rref
It provides information more correctly obtained from
get_connection_status().
2017-07-27 16:31:41 -04:00
Jean-Paul Calderone
1f16a173f0 flatten the result structure
flat is better than nested
2017-07-27 15:32:47 -04:00
Jean-Paul Calderone
7027547ecc fix buggy test; restructure data
scared about duplicate nodeids in the data getting lost, switch to a list
2017-07-27 15:26:30 -04:00
Jean-Paul Calderone
754304e4d5 Switch Root over to MultiFormatPage 2017-07-27 15:26:30 -04:00
Jean-Paul Calderone
f518c2a521 Switch over to stdlib json 2017-07-27 15:26:30 -04:00
David Stainton
16e56611f3 web: set json welcome content type to json utf8 2017-07-27 15:26:29 -04:00
David Stainton
876a7b6602 Fix indention 2017-07-27 15:26:29 -04:00
David Stainton
ad66caeaff Make sure server.rref is not None 2017-07-27 15:26:29 -04:00
David Stainton
180975b0af Make sure version is not None 2017-07-27 15:26:29 -04:00
David Stainton
b2d4374976 Add more server info to welcome json page 2017-07-27 15:26:29 -04:00
David Stainton
32110bfc68 Add storage and introducer summaries to json welcome output 2017-07-27 15:26:29 -04:00
David Stainton
822ed78b13 Add rough sketch of json welcome page 2017-07-27 15:26:29 -04:00
Jean-Paul Calderone
1e885fa40b Convert storage.py over to MultiFormatPage 2017-07-27 13:57:02 -04:00
Jean-Paul Calderone
6e4c4b7abc Convert status.py over to MultiFormatPage 2017-07-27 13:57:02 -04:00
Jean-Paul Calderone
5a30bd6169 Convert introweb.py over to MultiFormatPage 2017-07-27 13:57:02 -04:00
Jean-Paul Calderone
0581ce7270 Convert directory.py over to MultiFormatPage 2017-07-27 13:57:02 -04:00
Jean-Paul Calderone
7c8c63a01f a helper for the ?t=json resources 2017-07-27 13:57:02 -04:00
meejah
4f1dd95963 Add a 'tahoe status' command
This required also fixing the JSON output from
the "recent and active operations" page.
2017-04-04 12:48:41 -06:00
Brian Warner
2ceea6df0d Merge PR406: use @implementer instead of implements
This also updates several classes to be new-style (inheriting from 'object').
2017-03-23 19:25:56 -07:00
Brian Warner
0abcbe3339 update some comments where plain cut+paste was confusing 2017-03-23 19:19:00 -07:00
meejah
49ae2c5eb7 use @implementer instead of implements
Also, derive some more things from 'object'
2017-02-27 11:01:30 -07:00
meejah
031a88c25f simplejson -> json 2017-02-23 15:21:36 -07:00
Stefan Lew
12844220ec use rel="noreferrer" to prevent leakage of dircap 2016-12-23 23:20:52 -05:00
Brian Warner
5cbe580d90 improve ConnectionStatus and welcome-page display
* replace "last_details" with "non_connected_statuses" dict
* rename "last_connection_summary" to just "summary"
* for connected servers, show other hints in a tooltip
* for not-yet-connected servers, show all hints in a list
* build the list (in STAN) on the server side, not using IContainer
2016-12-09 18:41:38 -08:00
meejah
74209e643e Show the connection-status of all hints until we're connected to one 2016-12-09 18:41:38 -08:00
Brian Warner
70a616826c welcome.xhtml: update copyright year
Not sure why we have this in there, but it might as well be current.
2016-12-09 11:19:26 -08:00
Brian Warner
77fd41b66e update WUI welcome page with new connection-status info
This shows current-connection info, and provides per-hint status details in a
tooltip.

The "Connection" section no longer shows seconds-since-loss when the server
was not connected (previously it showed seconds-since-connect when connected,
and flipped to seconds-since-loss when disconnected). We already have the
"Last RX" column, which is arguably more meaningful (and I can't think of a
good case when these would differ), so we don't really need
seconds-since-loss, and the new ConnectionStatus doesn't track it anyways.

So now the "Connection" timestamp for non-connected servers is just
"N/A" (both the main text and the tooltip). The "Introducers" section was
changed the same way.

This moves the per-server connection timestamp out of the nickname/serverid
box and over into the Connection box. It also right-floats all timestamps,
regardless of which box they're in, which makes them share the box with
connection_status more politely.

Internally, this adds code to create ConnectionStatus objects when necessary.
2016-12-08 16:24:32 -08:00
David Stainton
4f717ba808 Add a multi-introducer implementation
this is based the previous work of warner, killyourtv and leif
 fixes ticket #68
2016-09-13 00:15:52 +00:00
Brian Warner
ed91398a3f WUI: disable google timing chart on mapupdate page
The google image chart API has been deprecated since 2012, sending the
URL to google leaks server IDs and the client's IP address (especially
important when the client is otherwise behind Tor), and the X-axis has
no units anyways.

refs ticket:1942 , which is both about removing the URL-based chart, and
eventually replacing it with a browser-rendered d3.js-based one
2016-09-02 16:30:21 -07:00
Brian Warner
663e39593b static servers: tolerate missing nickname/versions
A minimally-defined static server only specifies server_id,
anonymous-storage-FURL, and permutation-seed-base32. But the WUI Welcome
page wouldn't render (it raised an exception) without also defining
nickname and version. This allows those values to be missing.
2016-08-27 11:34:32 -07:00
Brian Warner
54f974d44c make IServer.get_serverid() use pubkey, not tubid
This is a change I've wanted to make for many years, because when we get
to HTTP-based servers, we won't have tubids for them. What held me back
was that there's code all over the place that uses the serverid for
various purposes, so I wasn't sure it was safe. I did a big push a few
years ago to use IServer instances instead of serverids in most
places (in #1363), and to split out the values that actually depend upon
tubid into separate accessors (like get_lease_seed and
get_foolscap_write_enabler_seed), which I think took care of all the
important uses.

There are a number of places that use get_serverid() as dictionary key
to track shares (Checker results, mutable servermap). I believe these
are happy to use pubkeys instead of tubids: the only thing they do with
get_serverid() is to compare it to other values obtained from
get_serverid(). A few places in the WUI used serverid to compute display
values: these were fixed.

The main trouble was the Helper: it returns a HelperUploadResults (a
Copyable) with a share->server mapping that's keyed by whatever the
Helper's get_serverid() returns. If the uploader and the helper are on
different sides of this change, the Helper could return values that the
uploader won't recognize. This is cosmetic: that mapping is only used to
display the upload results on the "Recent and Active Operations" page.
I've added code to StorageFarmBroker.get_stub_server() to fall back to
tubids when looking up a server, so this should still work correctly
when the uploader is new and the Helper is old. If the Helper is new and
the uploader is old, the upload results will show unusual server ids.

refs ticket:1363
2016-08-26 14:29:50 -07:00
meejah
c3035dc409 remove unnecessary error-handling 2016-08-10 19:44:26 -06:00
meejah
8a33fc612a Add magic-folder indicator to main welcome page
This doesn't reveal very much information, but does tell
you if magic-folder is currently working and if not it will
indicate when the last attempt to do a remote scan was.
2016-08-09 18:07:00 -06:00
meejah
a6920d9799 Improve error-reporting from JSON APIs, and use it better in CLI
Improve error-handling for directories if you ask for JSON from
the /uri endpoint, but an error occurs (you get a proper HTTP
status code and a valid JSON object).

For 'tahoe magic-folder status' e now retrieve *all* the remote data
required in the CLI before doing anything else so that errors can be
shown immediately. Use the improved JSON endpoints to print better
errors.
2016-08-09 14:36:09 -06:00
meejah
87acfe968e pyflakes warnings 2016-07-21 12:35:59 -07:00
meejah
4509c7dafd Fix magic-folder 'status' command 2016-07-21 12:35:59 -07:00
Daira Hopwood
dd0597f869 Work in progress to fix incorrect statistics output for Magic Folder. refs ticket:2709 2016-07-21 12:35:59 -07:00
Daira Hopwood
807cfbf0dc Fix pyflakes warnings.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
meejah
2573cf18ef Add simple auth-token to get JSON data 2016-07-21 12:35:59 -07:00
meejah
86abe56d91 Flesh out "tahoe magic-folder status" command
Adds:

 - a JSON endpoint
 - CLI to display information
 - QueuedItem + IQueuedItem for uploader/downloader
 - IProgress interface + PercentProgress implementation
 - progress= args to many upload/download APIs
2016-07-21 12:35:59 -07:00
Brian Warner
c64ff7b310 more v1 removal cleanup
Historical note: V2 introducers have been around for three years
now (released in 1.10.0), so it's time to drop v1. This branch removes a
lot of fallback code, and tests which exercised it. refs ticket:2784

This patch removes some now-unused code: v1-related support functions on
the client, "stub-client" handlers, and v1-tolerant remote methods on
the server. The unit tests have been cleaned up a bit too, now that
there are fewer cases to exercise.
2016-06-29 22:58:14 -07:00
Brian Warner
d05da27ae8 hush pyflakes 2016-04-26 10:43:26 -07:00
meejah
6910309e8f use Resource instead of Page for web-status 2016-04-26 10:33:59 -06:00
meejah
01b09f3bac Only accept 'token' in POST fields (stop using get_arg()) 2016-04-25 15:42:54 -07:00
meejah
4a25573e2d Add simple auth-token to get JSON data 2016-04-12 12:58:27 -06:00
Brian Warner
67af736db1 web/status.py: minor renaming to hush pyflakes 2016-01-31 11:02:50 -08:00
Leif Ryge
5b33f1fdf3 wui: improved columns in welcome page server list
As discussed at https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1973 and in
previous pull request #129.

 - replace lengthy timestamps with human-readable deltas (eg 1h 2m 3s)
 - replace "announced" column with "Last RX" column
 - remove service column (it always said the same thing, "storage")
 - fix colspan on 'You are not presently connected' message

Previous versions, some with github comments: 3fe9053134 , 486dbfc7bd , and c89ea62580, 9fabb92486, bbd8b42a25

Unlike previous attempts, the tests on this one should pass in any timezone.
(But like current master, will fail with Nevow >=0.12...)

Thanks to an anonymous contributor who wrote some of the tests.
2016-01-23 14:28:09 +00:00
Leif Ryge
c86388b79c revert previous commit to fix attribution (vanity)
This reverts the previous commit (modulo the one line that daira added) so that
my contributions will be properly attributed by git blame etc.
2016-01-23 14:27:11 +00:00
Daira Hopwood
a2d724aab7 wui: improved columns in welcome page server list
As discussed at https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1973 and in
previous pull request #129.

 - replace lengthy timestamps with human-readable deltas (eg 1h 2m 3s)
 - replace "announced" column with "Last RX" column
 - remove service column (it always said the same thing, "storage")
 - fix colspan on 'You are not presently connected' message

Previous versions, some with github comments: 3fe9053134 , 486dbfc7bd , and c89ea62580, 9fabb92486, bbd8b42a25

Unlike previous attempts, the tests on this one should pass in any timezone.
(But like current master, will fail with Nevow >=0.12...)

Thanks to an anonymous contributor who wrote some of the tests.
2016-01-15 20:02:19 +00:00
Leif Ryge
6226f6b497 wui: use standard time format (#1077) 2016-01-15 19:46:39 +00:00
Brian Warner
67dcedd8df introweb: fix connection hints for server announcements
A long time ago, the introducer's status web page would show the
advertised IP addresses for all published services, by parsing their
FURL's connection hints. This hasn't worked since about 12-Aug-2014 when
foolscap-0.6.5 changed the internal format of these hints (the column
has been empty this whole time).

This removes the "Advertised IPs" column from the Service Announcements
table. Instead, the service's full connection hints (not just the IP
address) is displayed in a tooltip/popup on the "Announced" timestamp
column.

The code that pulls these connection hints is now tolerant of all three
foolscap styles:

* foolscap<=0.6.4 : tuples of ("ipv4",host,port)
* 0.6.5 .. 0.8.0  : tuples of ("tcp",host,port)
* foolscap>=0.9.0 : strings

fixes ticket:2510
2015-09-22 17:19:52 -07:00
Brian Warner
8f0c417910 remove "announcement_distinct_hosts" from introweb JSON
The machine-parseable JSON output for the introducer status web page
used to include a key named "announcement_distinct_hosts", which counted
the number of distinct IP addresses advertised by all connected storage
servers. This hasn't worked since Aug-2014 when foolscap-0.6.5 change
the internal hints format.

This removes that field.
2015-09-22 17:19:47 -07:00
Brian Warner
71323fbd8f introducer: stop tracking hints for subscribed clients
A long time ago, the introducer's status web page would show the
advertised IP addresses for all subscribers, by parsing their
RemoteReference's FURL's connection hints. This hasn't worked since
about 12-Aug-2014 when foolscap-0.6.5 changed the internal format of
these hints.

This removes the feature: we no longer attempt to show advertised IP
addresses of subscribed clients. It also removes the code that looked
inside foolscap internals for this information.
2015-09-22 17:19:43 -07:00
Brian Warner
38a4acd623 Appease req.setHeader by passing bytes, not ints.
twisted.web.http.Request.setHeader() really wants a "bytes" object, but
we've been passing integers like len(body). Twisted-12.3 started to
complain about this (with a DeprecationWarning), but the warning is
usually silenced because py2.7 disables deprecations by default.

This fixes Tahoe's misbehavior, but others remain (in Nevow, at least).
I plan to set up some tooling to run tests with
PYTHONWARNINGS=default::DeprecationWarning and collect others. We won't
be able to fix the ones that occur outside of Tahoe, but at least we
should be able to fix our own.

refs ticket:2312
2015-01-21 10:31:31 -08:00
Brian Warner
3ad18648dd welcome.xhtml: improve layout by floating the icons to the left.
This uses less vertical space.
2015-01-20 17:24:27 -08:00
Nathan Wilcox
e499d84755 Introduce icons with distinct shape for connection status display on the front wui page...
This replaces the status display which was only distinct by color which is a usability issue for color-blind users.  This commit includes test coverage by way of pattern matching on rendered templates.  The PNG icons are conversions of original SVG source which I've included and placed in the public domain.
2015-01-20 16:41:01 -08:00
Leif Ryge
335c2ed06a add "Available" column to welcome page (#648)
add get_available_space() to NativeStorageServer

It uses a new 'available-space' key in the server's v1 version dict, or falls
back to 'maximum-immutable-share-size' (which presently always has the same
value but could have a different meaning in the future).

This is a squash merge of 9773555bb87fab71145ad7a0e84785a4e92d11f7
2014-11-23 06:03:00 +00:00
Daira Hopwood
346b5c4c3d Don't call filenode.get_size() twice. refs #1634
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-10-10 20:36:08 +01:00
zooko
200492760a Merge pull request #120 from zancas/1634-dont-return-none_5
1634 dont return none 5
2014-10-10 19:16:12 +00:00
zancas
425b9049ea Do not report 'size' metadata if get_size returns None 2014-10-10 11:27:28 -06:00
zancas
0baa744411 refactor get_filenode_metadata(...) into common.py 2014-10-10 11:19:25 -06:00
Loose Cannon
7bfa9c64fb 1901 - Fix Welcome Page
Solution was very simple to implement, no content disposition header was
necessary.
Tested with both Firefox and Chrome, using binary image file stored in
folder, as well as with text data using LIT cap.
2014-09-26 17:02:14 -04:00
Brian Warner
528364a421 welcome.xhtml: explain MDMF too 2014-09-11 21:32:27 -07:00
Scott Arciszewski
62a4b2721c Update welcome.xhtml
Add a tooltip to explain what SDMF means. Cannot find a definition for MDMF; I presume "Medium" but at the risk of being wrong, I don't want to just blindly make that suggested change.
2014-09-11 21:29:13 -07:00
Leif Ryge
d7aef0cffb add a <br> 2014-09-02 13:55:13 -07:00
Mark J. Berger
52859423ba Updates webui directory forms 2014-09-02 13:55:13 -07:00
Tony Arcieri
c1f3008d03 Redesigned directory pages (WIP)
This is an initial conversion of the directory pages from the old style
to the new style which is based on Twitter Bootstrap.

Still some remaining work to be done. You can see a screenshot here:

http://i.imgur.com/MPEngGx.png
2014-09-02 13:55:12 -07:00
Brian Warner
7015f21e5a welcome page: improve CSS slightly for narrow windows
Thanks to tarcieri for the patch.

refs ticket:1931
2014-09-02 13:44:53 -07:00
Brian Warner
99479226ed hush current pyflakes warnings (list comprehensions)
closes #2245
2014-06-23 13:54:07 -07:00
Brian Warner
b6c0297dee Include unminified versions of d3+jquery. Addresses #2208.
This should hopefully satisfy the Debian requirement to include original
sources. The old minified files for d3 and jquery were 63k and 91k
respectively, while the new unminified files are 133k and 293k.
2014-04-25 16:16:05 -07:00
Daira Hopwood
7db853a777 setup.py: include data files in package_data= with paths relative to src/allmydata/web.
Remove packages= entries and unneeded __init__.py files for those subdirectories.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-03-29 00:41:33 +00:00
Daira Hopwood
0ef5939477 Remove 'needs-rebalancing' and add 'count-happiness' to checker reports; repair tests. fixes #1784, #2105
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-03-20 16:13:57 +00:00
David
34517f5f68 Right aligning services div 2013-12-26 23:26:56 +01:00
Daira Hopwood
ec191bfca6 WUI: add time page was rendered to client and introducer welcome pages. closes #1972
Author: Leif Ryge <leif@synthesize.us>
Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
2013-05-19 23:27:23 +01:00
Leif Ryge
30924a506c properly describe saving incident reports. closes #1974 2013-05-19 07:31:43 +00:00
Daira Hopwood
2fa832b060 Add dummy __init__.py files for directories containing data. fixes #1960
Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
2013-05-14 23:07:19 +01:00
Brian Warner
f14602cb34 welcome page: display new nodeid (ed25519-based) instead of old tubid
The old tubid is displayed in a tooltip. Also cleaned up the regexps in
the relevant tests.
2013-04-14 15:07:56 -07:00
Daira Hopwood
35f37cc5b8 Change web-API to support t=relink instead of t=move (+ docs and tests). fixes #1732
Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
2013-04-05 19:38:43 +01:00
David-Sarah Hopwood
9be1a94043 Censor the introducer and helper furls' swissnums from the web welcome page. refs #1802
Signed-off-by: David-Sarah Hopwood <david-sarah@jacaranda.org>
2013-03-21 00:25:49 +00:00
David-Sarah Hopwood
1f38c92011 New Welcome page: ensure 'not connected' status for Introducer and Helper is shown via text as well as bullet colour. refs #1713
Signed-off-by: David-Sarah Hopwood <david-sarah@jacaranda.org>
2013-03-19 05:37:09 +00:00
David-Sarah Hopwood
709be93a29 Redesigned Welcome page using Twitter Bootstrap CSS.
Author: Tony Arcieri <tarcieri>
Signed-off-by: David-Sarah Hopwood <david-sarah@jacaranda.org>
2013-03-17 16:53:32 +00:00
David-Sarah Hopwood
456955e4f0 Make WUI headings and titles more consistent and accurate:
'Recent and Active Operations' and 'Operational Statistics'. fixes #1457

Signed-off-by: David-Sarah Hopwood <davidsarah@jacaranda.org>
2012-12-29 23:54:54 +00:00
David-Sarah Hopwood
a5895b9d59 If a helper is not configured, make the banner on the welcome page say that, and have a white background.
fixes #1735

Author: kick
Signed-off-by: David-Sarah Hopwood <davidsarah@jacaranda.org>
2012-12-29 04:17:00 +00:00
David-Sarah Hopwood
0d4a826f0e Allow welcome and storage status pages to display a non-ASCII node nickname. fixes #1298
Signed-off-by: David-Sarah Hopwood <davidsarah@jacaranda.org>
2012-12-27 05:08:53 +00:00
David-Sarah Hopwood
e097cf96b2 web/unlinked.py: don't use % operator to expand %(uri)s. fixes #1860.
Signed-off-by: David-Sarah Hopwood <david-sarah@jacaranda.org>
2012-11-15 04:16:19 +00:00
David-Sarah Hopwood
1df7f114b7 src/allmydata/web/directory.py: fix HTML double-encoding issue for filenames.
Nevow automatically HTML-escapes strings passed in stan without a raw marker.
Written by MK_FG. fixes #1143

Signed-off-by: David-Sarah Hopwood <david-sarah@jacaranda.org>
2012-10-25 01:01:25 +01:00
Brian Warner
ef2db56104 introweb: the Subscribed Clients list shows tubids, not serverids
Improve the column headers to make it clear that this list shows Tub
IDs. (we can't show pubkey-based serverids because clients don't give
those to us: only servers provide pubkeys). This should be the only
place in the whole webapi that shows TubIDs for modern (V2-introducer)
nodes.
2012-06-12 14:37:27 -07:00
Brian Warner
c073565ecc Display serverids consistently as 8-char pubkey, or 6-char tubid.
This makes it easy to distinguish between old V1-Introducer
nodes (identified by their Foolscap TubID) and new V2 nodes (identified
by their ed25519 pubkey).

This fixes a few places where we used to display a tubid even if we had
a pubkey, making it hard to visually correlate servers in two different
displays. It also cleans up the way we pass serverids to the JS-based
download timeline.

The "introweb" subscribed-clients list still shows tubids.
2012-06-12 14:30:34 -07:00
Brian Warner
518e4cec98 Fix text in Publish Status results. Closes #1762. 2012-06-08 15:21:46 -07:00
Brian Warner
188c7fecf5 CheckResults corrupt/incompatible shares now return IServers
DeepResultsBase also has a get_corrupt_shares(), and it is populated
from CheckResults.get_corrupt_shares(). It has been updated too, along
with get_remaining_corrupt_shares().

Remove temporary get_new_corrupt_shares() and
get_new_incompatible_shares().
2012-06-02 11:39:12 -07:00
Brian Warner
da9ac55294 CheckResults.get_servers_responding() now returns IServers
Remove temporary get_new_servers_responding().
2012-06-02 11:39:12 -07:00
Brian Warner
957a5315aa CheckResults.get_sharemap() now returns IServers
Remove temporary get_new_sharemap().
2012-06-02 11:39:11 -07:00
Brian Warner
8daacbcf69 CheckResults: replace get_data() with as_dict(), use getters in web status 2012-06-02 11:39:10 -07:00
Brian Warner
4867dca3f0 use the new CheckResult getters almost everywhere
The remaining get_data() calls are either in
web.check_results.json_check_results(), or functioning as repr()s in
various unit test failure cases.
2012-06-02 11:39:10 -07:00
Brian Warner
3a1c02cfdf change UploadResults to return IServers, update users to match
This finally changes all callers of get_servermap()/get_sharemap() to
accept IServers, and changes UploadResults to provide them.
2012-05-21 21:18:37 -07:00
Brian Warner
3d771132a8 switch UploadResults to use get_uri(), hide internal ._uri
Complete the getter-based transformation, by hiding ".uri" and updating
callers to use get_uri(). Also don't set a dummy self._uri, leave it
undefined until someone calls set_uri().
2012-05-21 21:14:44 -07:00
Brian Warner
29b11531b5 switch UploadResults to use getters, hide internal data, for all but .uri
This hides attributes with e.g. _sharemap, and creates getters like
get_sharemap() to access them, for every field except .uri . This will
make it easier to modify the internal representation of .sharemap
without requiring callers to adjust quite yet.

".uri" has so many users that it seemed better to update it in a
subsequent patch.
2012-05-21 21:14:28 -07:00
Brian Warner
e60982c851 helper: remove timings["existence_check"], aka "Already-In-Grid Check"
This measured how long the Helper took to do a filecheck before asking
for ciphertext. The "Contacting Helper" report includes both
existence_check and the client-helper RTT.

For non-overlapping uploads, it was being returned correctly. But when
multiple upload requests overlapped, and the file was not already in the
grid, the filecheck would only run once, and its existence_check time
would be reported for all uploaders (even if they didn't have to wait
for that time). Cleaning that up proved too difficult: the only correct
place to report this time is from the initial remote_upload_chk() call,
but the return value of that is too constrained to accomodate it in the
needs-upload case.

So I'm removing it altogether. Eventually I plan to add a proper
events/times field and record more data, including this check, in a form
that can be drawn on a nice zoomable timeline view.

Old clients talking to a new Helper (which doesn't supply the value)
will tolerate the loss (they'll just display an empty field on the web
view).
2012-05-21 21:13:11 -07:00
Brian Warner
5d404db898 webapi: don't allow ETags in t=info or t=rename-form, both are variable
t=info contains randomly-generated ophandles, and t=rename-form contains the
name of the child being renamed, so neither is eligible for a
short-circuiting ETag. Enhanced test_web to exercise this. Had to improve
FakeCHKFileNode slightly to let it participate. Refs #443.
2012-05-13 00:45:11 -07:00
Andrew Miller
16eddc35e8 Added unit tests covering #466:comment-15. Refactored the 'etag' behavior for immutable files to respond to all GET '?t=' flags, not just t=None
Signed-off-by: Andrew Miller <amiller@dappervision.com>
2012-05-13 00:45:11 -07:00
Jeremy Fitzhardinge
4f1bc1b387 Short circuit GET on ETags match
When client does a conditional GET/HEAD with If-none-match:, if the condition
fails (ie, the client's ETag matches the file's) then we can short-circuit
the whole process and immediately return an empty body.
2012-05-13 00:45:11 -07:00
Jeremy Fitzhardinge
518ef25bdb Add ETags for immutable directories
Like immutable files, the ETag is based on the storage index. However, since
a directory is a special interpretation of a file, it is distinguished from
the file by prepending "DIR:" onto the start of the ETag, and adding
-representation on the end (where -representation is the ?t= argument, json,
info, etc).

It also checks the return of setETag and avoids generating a representation
if the client already has it.
2012-05-13 00:45:11 -07:00
Brian Warner
eb2a4ef246 webapi: remove undocumented t=mkdir-p operation
Closes #380
2012-05-12 19:19:43 -07:00
Brian Warner
8417579147 webui: merge 'move' form with 'rename' form 2012-05-09 14:21:37 -07:00
Brian Warner
a92385b54b webapi 'move'-button cleanups
test_web.py: use shouldFail2(), safer than old shouldFail()
directory.py: forbid slashes in from_name=, return BAD_REQUEST instead of
              GONE when trying to move into a non-directory
2012-05-09 14:18:27 -07:00
Marcus Wanner
e58a01270b Change the arbitrary URI support from implied to explicit
The move webapi function now takes a target_type argument which lets it
know whether the target is a subdirectory name or URI. This is an
improvement over the old system in which the move handler tried to guess
whether the target was a name or a URI. Also fixed a little docs
copypaste problem and tweaked some line wrapping.
2012-05-09 13:07:14 -07:00
Marcus Wanner
b29d0920d3 Adding 'move' button to web UI, closes #1579
This adds "move file" capability to the web UI's directory display. The
support and test framework is heavily based on the similar "rename file"
feature. Unit tests and documentation are included. Multiple in-progress
versions of this patch may be found in ticket 1579. This version
includes arbitrary URI target support and is compatible with the change
from tahoe_css to tahoe.css.
2012-05-09 13:07:13 -07:00
Brian Warner
842a3a132b introweb announcements: show serverid, not tubid
'serverid' is the pubkey (for V2 clients), falling back to the tubid (for V1
clients). This also required cleaning up the way the index is created for the
old V1 introducer.
2012-04-24 01:37:28 -04:00
Brian Warner
84c9f3bfb4 Fix introweb display for mixed V1/V2 clients. Closes #1721.
This significantly cleans up the IntroducerServer web-status renderers.
Instead of poking around in the introducer's internals, now the web-status
renderers get clean AnnouncementDescriptor and SubscriberDescriptor
objects. They are still somewhat foolscap-centric, but will provide a clean
abstraction boundary for future improvements.

The specific #1721 bug was that old (V1) subscribers were handled by
wrapping their RemoteReference in a special WrapV1SubscriberInV2Interface
object, but the web-status display was trying to peek inside the object to
learn what host+port it was associated with, and the wrapper did not proxy
those extra attributes.

A test was added to test_introducer to make sure the introweb page renders
properly and at least contains the nicknames of both the V1 and V2 clients.
2012-04-23 18:30:53 -04:00
david-sarah
9d87f8ddd5 Change capitalization of WUI and introducer welcome page headings; add test for introducer welcome page. Also fix a typo in a CSS class name. fixes #1708 2012-04-05 23:57:23 +00:00
Brian Warner
bf390cca4b Rename web CheckResults to -Renderer, to avoid confusion. Closes #1705.
This avoids the name collision between the actual results
objects (defined in allmydata.check_results) and the code that renders
these objects into HTML (defined in allmydata.web.check_results). Only
the web-side objects were renamed.
2012-04-02 20:04:51 -07:00
Brian Warner
a56e639346 Fix mutable status (mapupdate/retrieve/publish) to use serverids, not tubids
This still leaves immutable-publish results incorrectly using tubids instead
of serverids. That will need some more work, since it might change the Helper
interface.
2012-03-17 17:01:35 -07:00
david-sarah
d9c7dfa4a0 Update more links from http: to https: in documentation and comments. 2012-03-13 20:26:54 +00:00
Brian Warner
bc21726dfd new introducer: signed extensible dictionary-based messages! refs #466
This introduces new client and server halves to the Introducer (renaming the
old one with a _V1 suffix). Both have fallbacks to accomodate talking to a
different version: the publishing client switches on whether the server's
.get_version() advertises V2 support, the server switches on which
subscription method was invoked by the subscribing client.

The V2 protocol sends a three-tuple of (serialized announcement dictionary,
signature, pubkey) for each announcement. The V2 server dispatches messages
to subscribers according to the service-name, and throws errors for invalid
signatures, but does not otherwise examine the messages. The V2 receiver's
subscription callback will receive a (serverid, ann_dict) pair. The
'serverid' will be equal to the pubkey if all of the following are true:

  the originating client is V2, and was told a privkey to use
  the announcement went through a V2 server
  the signature is valid

If not, 'serverid' will be equal to the tubid portion of the announced FURL,
as was the case for V1 receivers.

Servers will create a keypair if one does not exist yet, stored in
private/server.privkey .

The signed announcement dictionary puts the server FURL in a key named
"anonymous-storage-FURL", which anticipates upcoming Accounting-related
changes in the server advertisements. It also provides a key named
"permutation-seed-base32" to tell clients what permutation seed to use. This
is computed at startup, using tubid if there are existing shares, otherwise
the pubkey, to retain share-order compatibility for existing servers.
2012-03-13 18:24:32 -07:00
david-sarah
aaee828abb Make the link on the Welcome page to 'https://tahoe-lafs.org/', not 'http:'. Includes a test. fixes #1682 2012-03-08 23:17:58 +00:00
Brian Warner
880af4e1fd Add nickname/nodeid to storage-status web page. Closes #1204.
Also add tahoe.css to the page, to make it look slightly prettier.
2012-03-12 19:57:36 -07:00
Brian Warner
e27423e4a9 introducer web page: add CSS styling, roughly match client Welcome page
Also add /static and the top-level /tahoe.css -type stuff to the introducer's
web server.
2012-03-06 18:25:05 -08:00
Brian Warner
ec7bc05c04 tahoe.css: fix #section typo, update welcome.xhtml to match
The "#section" declaration (which matches id="section") should have been
".section" (which matches class="section").

The welcome page has a feature that I actually liked: the little "This
Client" sidebar sits just to the right of the start of the Controls block.
Fixing .section broke that (the clear:both introduces a gap, forcing the
Controls block to start strictly below the bottom of the This Client block).
So I also removed class="section" from the Controls block to allow them to
share the horizontal space again.
2012-03-06 18:22:41 -08:00
Brian Warner
11f9394704 remove 'provisioning'/'reliability' from WUI, add to misc/operations_helpers
Also remove docs related to reliability/provisioning pages
2012-02-16 22:29:05 +00:00
david-sarah
054374400e Marcus Wanner's favicon patch. fixes #1592 2011-12-17 03:32:01 +00:00
Brian Warner
990f294eea remove remaining uses of nevow's "formless" module
We're slowly moving away from Nevow, and marcusw's previous patch removed
uses of the formless CSS file, so now we can stop testing that nevow can find
that file, and remove the lingering unused "import formless" call.
2011-11-17 14:54:23 -08:00
Marcus Wanner
0ed6260a3c 1585-webui.darcs.patch 2011-11-17 21:49:23 +00:00
Brian Warner
1445953adc Remove duplicate tahoe_css links from manifest.xhtml and rename-form.xhtml
They were probably meant to be links to webform_css, but we aren't really
using Nevow's form-generation code anyways, so they can just be removed.
Thanks to 'marcusw' for the catch.
2011-11-16 14:42:25 -08:00