Commit Graph

210 Commits

Author SHA1 Message Date
Solderpunk d5666c9c19 Merge pull request 'Swap GUS for geminispace.info' (#36) from sario528/AV-98:search-fix into master
Reviewed-on: #36
2023-11-12 10:22:39 +00:00
Solderpunk a1cb220113 Merge pull request 'improve compatibility with Python 3.10' (#40) from nic/AV-98:master into master
Reviewed-on: #40
2023-11-12 10:18:29 +00:00
Aleksey Ryndin 22c7efce7c Fix: ValueError if MIME is empty string (like a #20) 2023-08-27 16:49:36 +03:00
Nic Waller 6ee2a0716d improve compatibility with Python 3.10 2022-06-29 20:57:34 -07:00
sario528 5dfe62fc63
Swap GUS for geminispace.info 2021-04-15 05:04:58 -05:00
Callum Brown 92da876795 Pass extra information to _handle_cert_request
This fixes a bug introduced in f45630 when handling a certificate request was
factored out of _fetch_over_network.
Also make the options consistent in terms of grammar.
2021-01-03 11:07:22 +00:00
rmgr ab913ebf54 Add support for touring a range where the start index is bigger than the end index 2020-09-15 20:19:32 +09:30
rmgr 20395cb826 Add support for http/https -> gemini proxy 2020-09-15 20:02:29 +09:30
Solderpunk 129c56c1d4 Fix another hasty cache hack bug. 2020-09-03 21:21:04 +02:00
Solderpunk ba0f707669 Ignore the cache when reloading a page. 2020-09-01 23:27:59 +02:00
Solderpunk 67f9c662b3 Add option to disable caching. 2020-09-01 23:11:55 +02:00
Solderpunk 545d5f917d Count cache hits in black box output. 2020-09-01 21:14:17 +02:00
Solderpunk f45630450f Make sure early terminations of _fetch_over_network happen via an exception, not by returning None. Factor out certificate handling interface. 2020-08-31 21:18:15 +02:00
Solderpunk 4e8f3dcd05 Fix variable name bug introduced by hasty hacking of cache system. 2020-08-31 21:17:06 +02:00
Solderpunk 08c60e202b Turn some magic numbers into constants. 2020-08-30 23:17:21 +02:00
Solderpunk 0f328141b9 Initial implementation of short-term caching. 2020-08-30 20:21:15 +02:00
Solderpunk 4d652e0fef Remove more transient client certificate stuff. 2020-08-30 18:16:31 +02:00
Solderpunk da8b6cc7f3 Visually distinguish non-Gemini links from Gemini links. 2020-08-30 17:23:36 +02:00
Solderpunk 969d3c1b18 Permit use of ~ in key/cert files. 2020-08-30 16:52:06 +02:00
Solderpunk e20ac17107 Stop treating transient client certificates as a special case. 2020-08-18 21:41:51 +02:00
Solderpunk d39cddcc84 Make default MIME handlers more generic. 2020-08-18 21:14:04 +02:00
Solderpunk 03be5bfebf Use proper handler resolution logic for the text/gemini case (so that settings for text/* can apply). 2020-08-18 21:13:26 +02:00
Solderpunk 72754114f4 Error out if a URL attempts to redirect to itself. 2020-08-18 21:06:12 +02:00
Solderpunk 1509f895f1 Rename handle_index handle_gemtext, for clarity. It should have been called handle_menu in VF-1 in the first place, anyway. 2020-08-18 21:05:49 +02:00
govynnus 99e5ceec65 Fix some bugs in the 'cert' UI
- os.path.exists() allows directories so use os.path.isfile() instead
- os.path.isfile() does not interpret '~' as /home/<user> so add note to users
- Use right certificate directory in `mycert` example
- Display a message and abort if no previously generated certs
2020-08-14 22:13:21 +01:00
Solderpunk ce834dd231 Use correct handler for text/gemini content. 2020-08-11 22:01:47 +02:00
Solderpunk 96cf8e13fe ACTUALLY fix time conversion bug as attempted in 76d7d, grumble, grumble... 2020-06-14 12:28:34 +02:00
Solderpunk 097458754e Bump version for development. 2020-06-13 23:42:36 +02:00
Solderpunk b972ca7d5d Release 1.0.1. 2020-06-13 23:39:04 +02:00
Solderpunk 76d7d23a2a Fix time conversion bug in blackbox command. 2020-06-13 15:36:05 +02:00
Vee 3cf447cc3a Standardize abbrevs formatting
The output format for `help` includes a trailing and leading blank line,
which were missing from `abbrevs` output. Additionally, `help` includes
a colon at the end of the header line, which this commit also adds to
`abbrevs` output.
2020-06-13 06:39:18 -04:00
Solderpunk dfa1dd7fd0 Don't choke on non gopher/gemini/http(s) links. Closes #18. 2020-06-09 22:13:42 +02:00
Solderpunk 44ee42ba8a Check that a file exists before trying to delete it. Rare errors can cause code paths leading to attempted double deletion. 2020-06-08 21:52:28 +02:00
Solderpunk 9526c384db Bump version for development. 2020-06-08 18:49:26 +02:00
Solderpunk 9a80987587 Cut 1.0.0! 2020-06-07 22:51:02 +02:00
Solderpunk be20eb4a50 Add docstrings for client cert methods. 2020-06-07 20:42:19 +02:00
Solderpunk b8fa8233bc Support new status code 11. 2020-06-07 19:13:00 +02:00
Solderpunk 94cf54df18 Recognise quote line type. 2020-06-07 19:09:53 +02:00
Solderpunk 5331d5254d Update recognition of list item lines to match recent spec update. 2020-06-07 19:07:30 +02:00
Solderpunk 6306e4ef58 Do not strip non-breaking spaces from advanced line types. 2020-06-07 19:06:39 +02:00
Solderpunk 1bc6a69bb9 Permit use of ECDSA. 2020-06-04 16:21:11 +02:00
Solderpunk 8d7715ee4b Add dancek to contributors, sort contributors alphabetically. 2020-06-02 22:57:48 +02:00
Hannu Hartikainen 9c82b63ff1 Add gemini:// support directly to urllib.parse 2020-06-01 10:22:49 +03:00
Solderpunk 2fd8fe919b Do not read more than the maximum number of bytes in a valid response header. 2020-05-31 18:33:32 +02:00
Solderpunk d5ed0c5d7a Don't crash when buggy servers send no header at all. 2020-05-31 18:33:08 +02:00
Solderpunk 08ce625575 Arglblargl *actually* fix redirects. 2020-05-31 14:24:23 +02:00
Solderpunk 34e97e4cf3 Fix redirect logic. 2020-05-31 14:23:30 +02:00
Solderpunk 5187e75566 Fix cross-domain redirect warning, and add cross-protocol redirect warning. 2020-05-31 14:06:23 +02:00
Solderpunk 088c415987 Make openssl binary calls compatible with LibreSSL. 2020-05-31 10:58:45 +02:00
Solderpunk 16dc7dc831 Cipher hardening. 2020-05-31 00:02:37 +02:00
Solderpunk fecd46378c Use current UTC time for comparison against certificate validity. Closes #14. Thanks, mozz! 2020-05-28 21:01:04 +02:00
Vee e558c80740 Add `abbrevs` command
It lists all available AV-98 command abbreviations.
2020-05-27 09:16:22 -04:00
Solderpunk dbe08ee787 Another silly bug fix, closes #12. 2020-05-27 09:00:42 +02:00
Solderpunk 49531bfb25 Fix silly copy/paste bug. Closes #11. 2020-05-27 08:57:44 +02:00
Solderpunk a3fd543aa6 Correctly test individual names, not Common Name over and over. 2020-05-23 17:20:26 +02:00
Solderpunk 16cf9fecb6 Don't crash when cert has no Common Name. 2020-05-23 17:13:30 +02:00
Solderpunk 94e8abe934 Slightly better wording around certs. 2020-05-23 13:35:13 +02:00
Solderpunk 2c7e6502f8 Fix umask call. 2020-05-23 13:24:39 +02:00
Solderpunk c48c85b5e1 Notify upon creation of config directory. 2020-05-23 13:18:37 +02:00
Solderpunk 68d5f9b42e Set umask so that config directory is private. 2020-05-23 13:17:12 +02:00
Solderpunk 8945fa4f7e Don't follow cross-domain redirects automatically. 2020-05-23 12:53:20 +02:00
Solderpunk 7a3f1c77a5 Present expiration information about previous certificates in TOFU warning messages. 2020-05-23 12:53:02 +02:00
Solderpunk e455d2ec85 Actually create a missing config directory! 2020-05-22 23:24:49 +02:00
Solderpunk a68e092593 Add option to toggle between CA and TOFU certificate validation. 2020-05-19 23:14:09 +02:00
Solderpunk ec07491578 Check alternative subject names. 2020-05-17 22:36:10 +02:00
Solderpunk 094e3117c4 Better reporting of certificate errors. 2020-05-17 22:36:00 +02:00
Solderpunk 9ce8d2481a Use cryptography library to do better certificate checking, if it's available. 2020-05-17 20:38:06 +02:00
Solderpunk ca1a0a62e6 Cache certificates to disk in the expectation of more advanced cert wrangling in future. 2020-05-17 18:35:35 +02:00
Solderpunk 68e55d245a Add AV-98 contributors, in place of VF-1 contributors. 2020-05-17 17:57:34 +02:00
Solderpunk 991de05512 Immediately commit all changes to the TOFU DB, so it gets unlocked and multiple clients can access it at once. 2020-05-17 14:02:36 +02:00
Solderpunk 13f885c226 Make transient clients expire after 1 day, not 365! 2020-05-17 12:18:09 +02:00
Solderpunk d1412377da Initial implementation of TOFU security model. 2020-05-16 18:58:53 +02:00
jprjr 78e0134c8a spec states meta max length is 1024 2020-05-16 13:59:05 +00:00
jprjr 0b79cd174f enforce a maximum header line length 2020-05-16 13:58:33 +00:00
Vee c174836159 Add command to search GUS 2020-05-15 07:38:51 -04:00
Solderpunk d828965979 Fix bug introduced when refactoring rcfile path wrangling. 2020-05-14 09:37:12 +02:00
Solderpunk 08bc6e2102 Don't do client certificates in restricted mode. 2020-05-12 22:23:22 +02:00
Solderpunk 8af6d9e478 Better presentation of query prompts. 2020-05-12 22:00:35 +02:00
Solderpunk 74d8511474 Properly escape query text before putting it into a URL. 2020-05-12 22:00:17 +02:00
Solderpunk 42e81ee859 Don't assume a gopher-to-gemini proxy is running on localhost by default. 2020-05-12 21:20:36 +02:00
Solderpunk a05ecfad4f Add easy loading of previously generated certs. 2020-05-11 23:27:48 +02:00
Solderpunk 676ab85a9e Add support for transient client certificates. 2020-05-11 22:33:04 +02:00
Solderpunk cf92e12653 Make locations of files more consistent. 2020-05-10 22:51:33 +02:00
Solderpunk 0d49b3e859 Put bookmark and rc files in same location as certificates. 2020-05-10 18:53:31 +02:00
Solderpunk 34cfa54de6 Tiny tweak to Macros -> Patlabor theme change. :) 2020-05-10 18:47:07 +02:00
Solderpunk 94e796ee5e Opt out of transient certs for now, better messaging about certificates. 2020-05-10 18:46:16 +02:00
Solderpunk e0552df853 Add support for generating client certs (if openssl is installed). 2020-05-10 17:25:03 +02:00
Solderpunk d4e9feebc5 Small bugfix. 2020-05-10 17:00:30 +02:00
Solderpunk 24563acf6d Give 'cert' command a menu interface, and trigger a similar interface in response to status codes 6x. 2020-05-10 16:09:54 +02:00
Solderpunk b272a563cb Use ansiwrap if available. 2020-05-10 15:02:24 +02:00
Solderpunk 28cf34e585 Add version info. Closes #1. 2020-05-10 14:34:48 +02:00
Solderpunk d8ef677ab1 Make sure supplied filenames exist. 2020-05-10 14:32:41 +02:00
Solderpunk cbb7b3fd6c Offer to reload previously used certificates for domains visited earlier. 2020-05-10 14:19:12 +02:00
Solderpunk d04c472600 Reduce code duplication. 2020-05-10 14:17:35 +02:00
Solderpunk cd2faaa958 Fix input parsing bug. 2020-05-10 14:17:20 +02:00
Solderpunk 6cb9f6a65e Nicer prompts. 2020-05-10 14:17:07 +02:00
Solderpunk 3207f8b382 Reduce code duplication. 2020-05-10 13:48:25 +02:00
Solderpunk 6bb2e20e69 Try to prevent 'certificate leaks' when visiting a new domain with an active client cert. 2020-05-10 13:44:40 +02:00
Solderpunk a2aff0d2a5 Move client certificate details out of the options dictionary and into their own, so that the 'cert' and 'set' commands don't become parallel interfaces to the same config. 2020-05-10 12:59:26 +02:00
Solderpunk 6d4c8e2dc9 First stab at putting an interactive interface on client certificates. 2020-05-10 12:35:46 +02:00