Commit Graph

252 Commits

Author SHA1 Message Date
Itamar Turner-Trauring
05a85b0ce2 Fix some unicode(bytes_object) bugs. 2021-02-11 12:53:48 -05:00
Itamar Turner-Trauring
cb99b27b78 Nothing to see here, move along. 2021-02-03 10:21:41 -05:00
Itamar Turner-Trauring
be59682532 Fix issue with file uploads being Unicode on Python 3. 2021-02-01 10:44:14 -05:00
Itamar Turner-Trauring
9f5e1381bf Another passing Python 3 test. 2021-01-27 11:29:46 -05:00
Chad Whitacre
bd402ce1f4 Compute Content-Length more betterly 2021-01-05 06:27:46 -05:00
Chad Whitacre
b4b4a1aabf Port webish/test_webish to Python 3 2020-12-29 12:39:00 -05:00
Itamar Turner-Trauring
cbf348f21b Get rid of debug print. 2020-12-22 13:17:46 -05:00
Itamar Turner-Trauring
c25dd57768 Make sure we can handle bytes, plus a couple other fixes. 2020-12-21 13:12:01 -05:00
Itamar Turner-Trauring
b24a9f7083 Trying to get test_grid working on Python 3. 2020-12-18 11:21:04 -05:00
Jean-Paul Calderone
5b0d20c453 Everything should be new-style 2020-11-18 16:53:28 -05:00
Jean-Paul Calderone
46955202e2 Hook into Twisted Web to control where request bodies are written 2020-11-18 15:47:06 -05:00
Itamar Turner-Trauring
92a4a5afcc Closer to more passing tests, maybe. 2020-10-30 15:04:00 -04:00
Itamar Turner-Trauring
375ed5096c Config parsing now always returns Unicode. 2020-10-26 12:12:49 -04:00
Jean-Paul Calderone
a58fd5c88e remove unused attribute 2020-10-22 07:23:02 -04:00
Jean-Paul Calderone
8401547b35 docstring for TahoeLAFSRequest 2020-10-22 07:22:41 -04:00
Jean-Paul Calderone
d1599a924e Test and fix cap censoring in HTTP access logs 2020-10-21 14:42:30 -04:00
Jean-Paul Calderone
c64a71a642 Re-arrange some of the requestReceived logic and switch to t.web Site 2020-10-21 09:45:11 -04:00
Jean-Paul Calderone
7f02128973 [wip] test form posts 2020-10-21 08:29:41 -04:00
Jean-Paul Calderone
5dd355fbfa Stop accessing the maybe-deprecated Request.channel attribute 2020-01-17 11:45:08 -05:00
Jean-Paul Calderone
8c1f536ba4 Merge remote-tracking branch 'origin/master' into integration/storage-economics 2019-10-04 12:02:00 -04:00
meejah
9050fdcea6 explicitly save refs to webish and operations (instead of using Service methods) 2019-08-24 12:31:08 -06:00
meejah
569454b1a3 get rid of child_operations from root 2019-08-20 00:17:28 -06:00
meejah
191087ef0a cleanup 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
d873a041bf remove some child_ usage 2019-08-20 00:17:28 -06:00
Jean-Paul Calderone
21bf7fc25c Merge remote-tracking branch 'origin/master' into integration/storage-economics 2019-08-16 15:39:31 -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
3152a35618 Some additional documentation 2019-08-03 06:39:31 -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
Jean-Paul Calderone
c2b8024856 remove this print
not sure where it came from
2019-03-24 11:33:41 -04:00
Jean-Paul Calderone
616fec0767 oops that should be gone too 2019-03-21 15:00:08 -04:00
meejah
816ceb12cb make more things work 2019-03-21 01:37:47 -06:00
Jean-Paul Calderone
e0c73e0ea1 Merge remote-tracking branch 'origin/master' into 1455.x-frame-options.2 2018-05-01 14:39:48 -04:00
Jean-Paul Calderone
8eb83bbfb9 avoid about-to-be-deprecated getClientIP if we can
Use the replacement, getClientAddress.  But have a fallback to
getClientIP to keep supporting older versions of Twisted.
2018-04-20 16:03:19 -04:00
Jean-Paul Calderone
edf3c7aac7 reformat to fit within 80 cols 2018-04-20 15:59:35 -04:00
Jean-Paul Calderone
36c7756890 Reference X-Frame-Options documentation 2018-04-13 12:48:03 -04:00
Daira Hopwood
718fa4493c Add "X-Frame-Options: DENY" header to all pages. refs #1455
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2018-04-13 12:43:18 -04:00
meejah
093945db22 set Referrer-Policy in one place 2017-02-13 16:07:41 -07:00
Brian Warner
5a5ba643e6 use twisted.web.static, not nevow.static, for public_html/
This avoids a privacy leak when the web.static= directory is configured
but doesn't exist (which is almost always, since we set `web.static =
public_html` in the default config file, but nothing automatically
creates it). The nevow.static.File class tries to os.stat() the
directory before doing anything else, which causes an exception, which
renders the traceback to the HTTP client as a 500 Internal Server Error,
and the traceback includes the full path of the missing public_html
directory, which reveals the node's basedir.

Plain twisted.web.static.File doesn't do this check, and a missing
web.static directory just results in a plain old 404.

Closes ticket:1720.
2016-04-28 00:42:59 -07: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
Brian Warner
597542dc77 test that web.static= is really treated as a relative path
Also ssh.authorized_keys_file .
2015-02-03 22:23:31 -08:00
Brian Warner
c4d7b7b109 write node.url and portnum files atomically, to fix race in test_runner
Previously, test_runner sometimes fails because the _node_has_started()
poller fires after the portnum file has been opened, but before it has
actually been filled, allowing the test process to observe an empty file,
which flunks the test.

This adds a new fileutil.write_atomically() function (using the usual
write-to-.tmp-then-rename approach), and uses it for both node.url and
client.port . These files are written a bit before the node is really up and
running, but they're late enough for test_runner's purposes, which is to know
when it's safe to read client.port and use 'tahoe restart' (and therefore
SIGINT) to restart the node.

The current node/client code doesn't offer any better "are you really done
with startup" indicator.. the ideal approach would be to either watch the
logfile, or connect to its flogport, but both are a hassle. Changing the node
to write out a new "all done" file would be intrusive for regular
operations.
2012-05-14 15:03:14 -07:00
david-sarah
3d7a32647c Implementation, tests and docs for blacklists. This version allows listing directories containing a blacklisted child. Inclusion of blacklist.py fixed. fixes #1425 2011-08-24 08:59:28 -07:00
david-sarah
fc98aded8a src/allmydata/webish.py: clean-ups and correction to a comment. Also change an open and write to use fileutil.write. See ref #1286 comment 13. 2011-01-17 15:31:52 -08:00
Brian Warner
09a2241471 Tolerate Twisted-10.2's endpoints, patch by David-Sarah. Closes #1286.
The service generated by strports.service() changed in 10.2, and the ugly
private-attribute-reading hack we used to glean a kernel-allocated port
number (e.g. when using "tcp:0", especially during unit tests) broke, causing
Tahoe to be completely unusable with Twisted-10.2 . The new ugly
private-attribute-reading hack starts by figuring out what sort of service
was generated, then reads different attributes accordingly.

This also hushes a warning when using schemeless strports strings like "0" or
"3456", by quietly prepending a "tcp:" scheme, since 10.2 complains about
those. It also adds getURL() and getPortnum() accessors to the "webish"
service, rather than having unit tests dig through _url and _portnum and such
to find out what they are.
2011-01-16 23:47:51 -08:00
Brian Warner
4b7c94ece0 downloader.Segmentation: unregisterProducer when asked to stopProducing, this
seems to avoid the #1155 log message which reveals the URI (and filecap).

Also add an [ERROR] marker to the flog entry, since unregisterProducer also
makes interrupted downloads appear "200 OK"; this makes it more obvious that
the download did not complete.
2010-08-06 00:07:05 -07:00
Kevan Carstensen
81ad52d6eb Change OphandleTable to use a deterministic clock, so we can test it
To test the changes for #577, we need a deterministic way to simulate
the passage of long periods of time. twisted.internet.task.Clock seems,
from my Googling, to be the way to go for this functionality. I changed
a few things so that OphandleTable would use twisted.internet.task.Clock
when testing:

  * WebishServer.__init___ now takes an optional 'clock' parameter,
  * which it passes to the root.Root instance it creates.
  * root.Root.__init__ now takes an optional 'clock' parameter, which it
    passes to the OphandleTable.__init__ method.
  * OphandleTable.__init__ now takes an optional 'clock' parameter. If
    it is provided, and it isn't None, its callLater method will be used
    to schedule ophandle expirations (as opposed to using
    reactor.callLater, which is what OphandleTable does normally).
  * The WebMixin object in test_web.py now sets a self.clock parameter,
    which is a twisted.internet.task.Clock that it feeds to the 
    WebishServer it creates. 

Tests using the WebMixin can control the passage of time in
OphandleTable by accessing self.clock.
2010-02-20 13:07:13 -08:00