Compare commits

...

532 Commits

Author SHA1 Message Date
Lionel Dricot 3155585c9e introducing openk 2023-08-04 19:09:48 +02:00
Lionel Dricot 2e02d06b0e we got rid of GeminiItem 2023-08-03 23:17:12 +02:00
Lionel Dricot ed019fa04e nearly got rid of geminiitem 2023-08-03 16:54:29 +02:00
Lionel Dricot 91e8b7aa16 geminiitem got rid of get_body 2023-07-31 19:01:57 +02:00
Lionel Dricot b3051efe72 working on get_body 2023-07-31 18:53:26 +02:00
Lionel Dricot 9609a8d91f moving out the self.url thing 2023-07-31 18:37:30 +02:00
Lionel Dricot 2034821325 debug XDG folders 2023-07-31 17:56:08 +02:00
Lionel Dricot a6fee03d2b next work : reimplementing list and local files 2023-07-31 13:19:28 +02:00
Lionel Dricot 7ba6bac5a4 works at Volvo 2023-07-31 09:34:12 +02:00
Lionel Dricot 26ed1769de get_link now in ansirenderer 2023-07-30 23:35:34 +02:00
Lionel Dricot 9ee95e7a1b pictures are working 2023-07-30 23:12:01 +02:00
Lionel Dricot 7786b91993 continuing work to remove GeminiItem 2023-07-30 16:59:32 +02:00
Lionel Dricot 3051f60253 more certificate management in netcache 2023-07-28 18:31:04 +02:00
Lionel Dricot dade6a3bda migrating certificate management to netcache 2023-07-28 18:08:45 +02:00
Lionel Dricot eed83a7a95 Cleaning up GeminiItem
Work has started to remove GeminiItem completely and switch to an
{url:renderer} dictionnary. Maybe also add a tmpfile.
2023-07-22 23:32:10 +02:00
Lionel Dricot 767ab82f29 Ok, it starts to work.
Offpunk is now able to display pages, pictures and follow links. A lot
of TODO have been clearly identified. I think that the whole
GeminiItem() object will be removed and URL will be accessed directly
with a dict{url, renderer} to avoid redrawing all the time.

Next challenge: remove GeminiItems!
2023-07-22 00:27:43 +02:00
Lionel Dricot 72ea43a59c debugging offpunk 2023-07-21 18:02:05 +02:00
Lionel Dricot d95d4dc5af offpunk starts to work 2023-07-21 17:33:55 +02:00
Lionel Dricot 1a3d839ab3 renderer in ansirenderer 2023-07-21 14:22:09 +02:00
Lionel Dricot 268e50a781 ansirenderer now working both directly or from stdin 2023-07-21 11:52:39 +02:00
Lionel Dricot cd3177ac87 pour le moment incapable de décider si ansirenderer doit prendre le path du fichier ou directement le texte en input 2023-07-21 01:03:40 +02:00
Lionel Dricot ce65850987 starting to adapt offpunk 2023-07-20 01:17:34 +02:00
Lionel Dricot c7734e3a92 default to stdin 2023-07-18 23:43:45 +02:00
Lionel Dricot 0b0fcc3e42 first working pipe between netcache and ansirenderer 2023-07-18 17:40:36 +02:00
Lionel Dricot 0cd988b055 ansirenderer cli 2023-07-18 12:33:30 +02:00
Lionel Dricot 965f8916c2 --offline and --path arguments 2023-07-18 12:16:08 +02:00
Lionel Dricot 4fd8b89f49 monkey patching 2023-07-18 00:45:14 +02:00
Lionel Dricot b745b04f7a netcache now works for gemini 2023-07-18 00:39:06 +02:00
Lionel Dricot a7c8ed33d5 work in progress 2023-07-09 11:35:58 +02:00
Lionel Dricot 6d43b13520 real work has started with porting Gemini code 2023-07-09 11:16:19 +02:00
Lionel Dricot 0a385d5334 gopher,finger and spartan in netcache 2023-07-09 10:56:40 +02:00
Lionel Dricot ef808afe1d netcache now downloads http 2023-07-08 00:43:56 +02:00
Lionel Dricot 3c760c914a netcache CLI 2023-07-07 23:45:52 +02:00
Lionel Dricot 76b00b8c04 working on netcache 2023-07-04 23:20:39 +02:00
Lionel Dricot a6974bb404 first netcache 2023-07-04 16:10:20 +02:00
Lionel Dricot 644e8ba08e to the point where netcache become an evidence 2023-07-04 13:59:16 +02:00
Lionel Dricot 927017d143 introducing offutils.py 2023-07-04 13:55:01 +02:00
Lionel Dricot ea36f45d94 progress toward independance 2023-07-03 23:48:55 +02:00
Lionel Dricot 86a67d47fa experiment 2023-07-03 11:43:06 +02:00
Lionel Dricot 1a40ad786f Improved help for list and sync, suggestion from smokey 2023-07-02 23:46:34 +02:00
Sotiris Papatheodorou - sotiris at papatheodorou.xyz 2cc599afdd Change the Gopher index filename to gophermap
This seems to be the most common convention among gopher servers (e.g.
Gophernicus, go-gopher).

Added a script to migrate the cache to the new format. Alternatively the
following command can be used for migration in a POSIX system:

find ~/.cache/offpunk/gopher/ -type f -name 'index.txt' -exec sh -c 'mv {} "$(dirname {})/gophermap"' \;
2023-04-14 11:11:24 +02:00
Maeve Sproule - code at sprock.dev a73790f0fb Rewrite gopher URL parsing code per RFC 4266
The previous code was using the first path segment as an item type, if
it was present and a single character long. However, the standard
requires the first character after the slash to be used, if present,
regardless of whether if forms a complete path segment. This rewrite
conforms the code to the standards behaviour, and fixes both the
original problem with gopher://alexschroeder.ch/ and the problem created
with other gopherholes in my attempt to fix it.

I've also changed one piece of code that generates a gopher URL to
better conform to the standard, by avoiding the introduction of leading
slashes. This should prevent any gopherholes that don't accept leading
slashes (including gopher://alexschroeder.ch/) from having problems with
requests sent from offpunk.
2023-04-09 12:10:34 +02:00
Maeve Sproule - code at sprock.dev be2836e218 Fix gopher requests 2023-04-08 22:09:30 +02:00
Lionel Dricot b1de7c59e4 forgot debug statement 2023-04-04 20:57:17 +02:00
Lionel Dricot 5b0e63b5a5 should fix gopher requests 2023-04-03 23:18:45 +02:00
Lionel Dricot 25b2c4ef53 removing an else condition which is obviously crashing and should not be there 2023-04-03 21:18:42 +02:00
Sotiris Papatheodorou - sotiris at papatheodorou.xyz 454994002a Fix merging dictionaries with common keys
The previous code would throw KeyError if a key was present in both
os.environ and env, e.g. when LESSHISTFILE is defined in the
environment. The current code ensures that for keys present in both
dictionaries the value from env will be used.
2023-04-02 14:39:56 +02:00
Lionel Dricot fff1f39877 set accept_bad_certificates now also works for expired Gemini certificates 2023-03-30 11:28:58 +02:00
Lionel Dricot a0ce56d45e Adding chardet to README 2023-03-27 20:51:03 +02:00
Anna “CyberTailor” - cyber+misc at sysrq.in 453f8af9f9 add chardet to optional dependencies 2023-03-27 20:45:41 +02:00
Sotiris Papatheodorou - sotiris at papatheodorou.xyz dc38a3f9bc Add missing chardet module
This fixes text encoding detection for gopher requests which was using
the chardet module without importing it.

Here's a URL that causes a crash before the fix:
gopher://sdf.org/0/users/d1337/textfiles/hacker_crackdown.txt
2023-03-27 17:39:54 +02:00
Lionel Dricot faf5e0c649 version 1.9.2 2023-03-13 17:02:15 +01:00
Lionel Dricot 8da1eff920 changelog for 3.7 2023-03-12 19:54:02 +01:00
Anna “CyberTailor” 5ddc06b903 bump requires-python to >=3.7 2023-03-12 19:52:58 +01:00
Lionel Dricot 7a05e211e6 changelog for flit 2023-03-12 12:53:27 +01:00
Anna “CyberTailor” 46668d2b4c switch to a PEP517 build system
Flit is the simplest of PEP517 build systems so I used it.

Packagers will need to switch from legacy (setup.py) mode to PEP517, if
not already.

Most offpunk.py changes are stripped whitespace. Relevant are:
- Added module docstring (__doc__ variable)
- Added __version__ variable

These two will be used by Flit so you will need to bump version in one
place only.
2023-03-12 12:52:43 +01:00
Lionel Dricot 826aa4e1c2 incrementing to 1.9.1 2023-03-11 00:00:32 +01:00
Lionel Dricot 65a445627e release 1.9.1 to fix #8 2023-03-08 23:11:32 +01:00
Lionel Dricot 1333d1b8e6 added debian package to README 2023-03-08 11:39:11 +01:00
Lionel Dricot ca6728e607 1.9 2023-03-08 11:21:04 +01:00
Lionel Dricot 520b53f2a3 man page created by phoebos 2023-03-07 16:23:25 +01:00
Lionel Dricot d14e1ba0a9 fix bug #11 2023-03-07 14:36:24 +01:00
Lionel Dricot 2fd2479b53 Assume utf-8 when the header answers with an unknown encoding 2023-03-05 22:57:34 +01:00
Lionel Dricot 891684136f fixing a crash related to bug #10 2023-03-03 15:21:03 +01:00
Lionel Dricot f7a773d03a removing custom debian 2023-02-28 19:56:23 +01:00
Lionel Dricot 2b4162be5b Fix a crash by casting HTML content a string (for whatever reason, it is sometimes
seen as bytes)
2023-02-15 15:54:11 +01:00
Lionel Dricot d8771cb267 Revert ""set cache" now allows to set a custom cache folder."
This reverts commit 2582e00cab.
2023-02-15 15:22:09 +01:00
Lionel Dricot 2582e00cab "set cache" now allows to set a custom cache folder.
The implementation is bad as it uses a global variable.
Also, there’s currently no way to revert to the default without restarting offpunk.
2023-01-26 15:20:48 +01:00
Lionel Dricot 39b5abeeac unionising env and os.environ should give precedence to env 2023-01-13 22:38:27 +01:00
Lionel Dricot 6fd1bd4341 Improve compatibility with python 3.7 by replacing a dict union 2023-01-13 09:56:29 +01:00
Lionel Dricot 3438a94155 This should fix #7
Starting now, we don’t assume a valid GeminiItem and thus a valid cache_path.
More crashes might be uncovered.
2023-01-12 17:11:54 +01:00
Lionel Dricot 99e3fc1772 fix error handling assuming that requests is installed 2022-12-29 14:44:09 +01:00
Maeve Sproule - code at sprock.dev 5b432112d0 Fix support for UTF-8 domains in Gemini (fixes #5)
Previously, offpunk would send the UTF-8 host in the Gemini request.
This changes it to first IDNA-encode the hostname in the URL before
making the request. This bug only existed for Gemini requests, since the
host is already being encoded for Spartan requests and `requests`
handles this for HTTP URLs.

Additionally, the code now treats both UTF-8 hosts and their IDNA
equivalents as the same host for the purposes of identifying
cross-domain redirects.
2022-12-22 12:13:47 +01:00
Lionel Dricot 7e363f740b better feedback of streaming urls 2022-12-18 20:09:48 +01:00
Lionel Dricot 5a5ff15f90 blocking doubleclick.net by default 2022-12-16 21:03:44 +01:00
Sotiris Papatheodorou - sotiris at papatheodorou.xyz 39669df9ec Handle .. as an alias to the up command
* It allows passing an argument as in the up command.
* Prevents some weird errors when passing an argument.
2022-12-16 12:40:36 +01:00
Lionel Dricot 250f3ebe66 added a comment about a function because it took me 15 minutes to understand why it was there 2022-12-14 16:26:03 +01:00
Lionel Dricot d1cbe0acf0 Default handlers have been removed.
Not everyone use zathura and feh so they are not removed by default.
To restore previous behaviour, add the following lines to your offpunkrc:

handler image/* feh -. %s
handler application/pdf zathura %s
2022-12-12 15:57:28 +01:00
Lionel Dricot 194e9ed62d fix crash when susbcribing without GI 2022-12-12 15:30:49 +01:00
Ben Winston - ben at benwinston.us 1667952153 bugfix: don't crash when there's no links to index 2022-12-11 00:51:42 +01:00
Lionel Dricot 45a689a5b8 RELEASE 1.8 2022-12-10 22:46:23 +01:00
Ben Winston - ben at benwinston.us 95d48fb38d bugfix: readline needs ANSI codes escaped
In order for `readline` to handle up/down arrow presses with ANSI
escape codes in the prompt, all non-printable characters must be
prefaced with \001 and suffixed with \002. Otherwise, long lines
do not get entirely cleared when scrolling up/down.
2022-12-10 22:22:18 +01:00
Lionel Dricot 1754f7a9dd preparing 1.8 release 2022-12-10 22:16:12 +01:00
Lionel Dricot 49705594f8 updating readme 2022-12-10 21:50:43 +01:00
Ben Winston - ben at benwinston.us 8875a0068c Detecting "New" Chafa 2022-12-09 22:51:34 +01:00
Lionel Dricot 7d57fd9919 adding a space after autocompleting a list 2022-12-07 23:23:31 +01:00
Lionel Dricot b773243623 misplaced check for mode was breaking elif 2022-12-02 13:11:26 +01:00
Lionel Dricot 7bcd0e2af5 fixing a crash with data:image svg 2022-12-02 12:49:37 +01:00
Lionel Dricot af65662f0f Fix images not being downloaded for "full" mode
(the mode was not preserved for each call. We now default to the gi.last_mode if 
no mode is explicitely set during the _go_to_gi call)
2022-12-01 17:39:04 +01:00
Maeve Sproule - code at sprock.dev 1f516b6733 Avoid passing improperly escaped paths to shell
This should fix https://notabug.org/ploum/offpunk/issues/9 . This
involves a few closely-related changes to subprogram execution:
- If a path, url or file contents were being passed using `cat` or
  `echo`, the code was changed to pass the file/string on stdin. This
  also makes several pipelines into single programs and should allow for
  the removal of `shell=True` in the future.
- For `file`, `xdg-open` and `less`, which either can't accept their
  input on stdin or otherwise use the path, the paths are now being
  escaped with `shlex.quote()`.
- Finally, the environment variable $LESSHISTFILE is now being set in
  python code, where escaping is not necessary.

Notably, the argument to `grep` in `less_cmd()` is not quoted in this
commit, since I was unsure of how it was meant to be used. If the
argument is not already quoted, this should probably be passed through
`shlex.quote()`.

This does not do the following, which may be desired:
- This does not disable `shell=True` anywhere, since `subprocess.run()`
  requires the command to be already split into a list of strings. I
  think this would just require a `shlex.split()` in `run()` when this
  is disabled, but it may require more thought.
- Some of the invoked programs (with the notable exception of `echo` and
  `xdg-open`) support the use of "--" to prevent any following arguments
  from being treated as program flags if they start with "-". I don't
  believe there are any paths that start with "-", but it may make sense
  to include this where possible.

I have briefly tested this commit, but it touches quite a few code
paths, so there might be bugs that I missed.
2022-12-01 17:07:44 +01:00
Lionel Dricot e76b2a13e0 accept_bad_ssl_certificates with --assume-yes 2022-11-30 21:02:17 +01:00
Lionel Dricot c15d452d34 deprecating restricted mode 2022-11-30 20:57:23 +01:00
Lionel Dricot fc8cb2f163 moved all references to sourcehut repository 2022-11-30 16:07:33 +01:00
Lionel Dricot 1c9380835c removing dependency on cgi and implementing our own mime parser 2022-11-30 00:11:44 +01:00
Lionel Dricot 75b20e4982 deep bug in handling display modes that became apparent by breaking cp raw 2022-11-27 01:15:37 +01:00
Lionel Dricot 464fcf3773 highly experimental : trying to access gemini://océane.fr and it still fails 2022-11-24 16:26:36 +01:00
Sotiris Papatheodorou - sotiris at papatheodorou.xyz c02eba5e3e add support for the finger protocol 2022-11-24 12:36:55 +01:00
Lionel Dricot afa89097b2 better feedback when streaming 2022-11-24 10:48:38 +01:00
Lionel Dricot 2d5c17d2fd changelog 2022-11-21 00:07:21 +01:00
Marty Oehme - marty.oehme at gmail.com 0af34aa7e1 fix crash on missing index when listing contents
Fixes a crash when trying to look up the contents of the current index
using `ls` command whenever there is no current page loaded by making a
current item a requirement.
2022-11-21 00:05:25 +01:00
Lionel Dricot c1f6119e80 accepting_bad_ssl_certificates requires python-requests 2022-11-17 10:30:12 +01:00
Lionel Dricot 2e566f7220 accept localhost as a valid url 2022-11-16 21:45:51 +01:00
Lionel Dricot ff04177d53 set accept_bad_ssl_certificates 2022-11-16 14:44:47 +01:00
Lionel Dricot 06b2a56ed3 certdir variable was not initialised without HAS_CRYPTOGRAPHY (see bug #2) 2022-11-16 10:06:35 +01:00
Lionel Dricot 7baccbb15f v 1.7.1 2022-11-15 17:01:13 +01:00
Lionel Dricot af361bd4ad typo in changelog 2022-11-15 14:13:37 +01:00
Lionel Dricot 041146e3f1 offpunk 1.7 2022-11-15 13:55:39 +01:00
Sotiris Papatheodorou - sotiris at papatheodorou.xyz fb550a19bc fix typo in package name 2022-11-15 13:36:07 +01:00
Lionel Dricot 539b287901 new search and wikipedia commands 2022-11-14 21:33:40 +01:00
Lionel Dricot 39ad7ee7b7 comment for debugging stuck requests 2022-11-14 19:17:20 +01:00
Lionel Dricot f9b8ccaf9b hidden links in gopher/gemini 2022-11-10 23:50:16 +01:00
Lionel Dricot dd02476ae2 fixing list creation with fetch-later 2022-11-09 23:30:54 +01:00
Lionel Dricot 01b1bd56c4 automatically create system lists when needed 2022-11-05 23:14:41 +01:00
Lionel Dricot a60cbd9297 solving crash when adding wrong url to tour 2022-11-03 12:59:15 +01:00
Lionel Dricot c1538f2f9b autocompletion now working as expected 2022-11-02 15:47:57 +01:00
Lionel Dricot 8bd68ca02b introducing autocompletion for list/add/move 2022-11-02 00:58:41 +01:00
Lionel Dricot fbdff91f01 trying to not use shell=True (Wip) 2022-11-01 17:34:04 +01:00
Lionel Dricot f3bb6cd7f0 avoid a crash related to bug #9 2022-11-01 17:04:30 +01:00
Lionel Dricot bee6fd9e40 computing size of http body out of the if condition seems to help being stuck in some strange cases 2022-10-25 01:15:57 +02:00
Lionel Dricot c6d52b3c19 investigating sync perf 2022-10-20 22:53:33 +02:00
Lionel Dricot 68b278fe13 solve a crash when loading html pages with empty links 2022-10-15 18:25:15 +02:00
Lionel Dricot b3b9bff849 fix screenshot link for sourcehut 2022-10-12 13:17:29 +02:00
Lionel Dricot f388be39d6 releasing offpunk 1.6 2022-10-12 11:29:37 +02:00
Lionel Dricot 1ff77e796d consider .xml as feeds to avoid false detection as SVG by file 2022-10-10 11:00:58 +02:00
Lionel Dricot addab31f49 yet another try at fixing timg bugs 2022-10-08 23:20:30 +02:00
Lionel Dricot 8d242ef06e workaround old timg bug 2022-10-08 00:42:46 +02:00
Lionel Dricot 15d76dd05d redirect reddit to teddit (fix #12) 2022-10-08 00:16:28 +02:00
Lionel Dricot 230c359aff handling the case where gi is none 2022-10-07 16:07:03 +02:00
Lionel Dricot 0b06c360da base64 support seems to work. More testing needed 2022-10-07 15:51:26 +02:00
Lionel Dricot f7f78564a2 refactoring: replacing the self.lookup table with calls to gi.get_links for consistency 2022-10-07 14:45:44 +02:00
Lionel Dricot 93c666458a refactoring base64 support 2022-10-07 13:56:55 +02:00
Lionel Dricot 9ae464f154 initial support for base64 images in html. Still a bug with link counting. 2022-10-07 11:19:23 +02:00
Lionel Dricot 0a3024f765 automatically download the rss feed of a webpage during sync (fix #14) 2022-10-06 22:30:09 +02:00
Lionel Dricot 268d864cdb Close #15, redirects are now working also in --sync mode (thanks kelbot) 2022-10-06 18:22:34 +02:00
Lionel Dricot d93db54f55 only use timg > 1.3.2 (thanks Valvin for the bug report) 2022-10-06 11:59:03 +02:00
Lionel Dricot 54dcec340a removing libreddit redirection 2022-10-03 20:35:19 +02:00
Lionel Dricot 45fd77603e small typo in README 2022-09-29 14:49:46 +02:00
Lionel Dricot e7ebff8d34 touring a list in one command 2022-09-25 23:33:36 +02:00
ploum 2eb5c63716 Merge branch 'doc-alpine-pkg' of miyopan/offpunk into master 2022-08-13 12:14:06 +00:00
mio d1793b6da0 add Alpine package in README 2022-08-12 16:36:41 +00:00
Lionel Dricot 2e5b4bff5c add link to mailing list 2022-08-08 22:29:36 +02:00
Lionel Dricot d646c9dccb date in changelog 2022-08-04 12:13:57 +02:00
Lionel Dricot 1663c1bc01 offpunk 1.5 2022-08-04 12:07:41 +02:00
Lionel Dricot e51d04ece8 changelog 2022-07-24 10:40:08 +02:00
Lionel Dricot cc7f92222d solving a bug with base64 images and blocking facebook by default 2022-07-24 10:17:33 +02:00
Lionel Dricot d7c1492150 refactor redirections and add blocking 2022-07-21 17:02:36 +02:00
Lionel Dricot 052d9fdb83 typo fixed thanks to shawn nock 2022-07-18 14:53:49 +02:00
ploum c240abe7ee Merge branch 'add-nixpkgs-to-readme' of DamienCassou/offpunk into master 2022-07-11 17:09:54 +00:00
Damien Cassou b0621842d9
adding Nix package in README 2022-07-10 11:36:17 +02:00
Lionel Dricot 329a1ad58a introducing --features for #3 2022-07-03 15:38:29 +02:00
Lionel Dricot a74229f1fd not creating config file when running --version, close #2 2022-07-03 15:31:33 +02:00
Lionel Dricot 5614cbdf01 explicit license close #4 2022-07-03 15:25:47 +02:00
Lionel Dricot 39c26fa59f removing an old commented out line 2022-05-07 17:45:56 +02:00
Lionel Dricot cdd040f19a open url 2022-04-29 10:41:08 +02:00
Lionel Dricot 947183e0a7 removing commented-out code 2022-04-28 23:06:36 +02:00
Lionel Dricot 3e76ca2368 removed optional dependency to ripgrep 2022-04-26 13:15:20 +02:00
Lionel Dricot 63ebb8067d release 1.4 2022-04-25 16:01:00 +02:00
Lionel Dricot 43bb41a37a slight improvement to handle transparency with chafa 2022-04-18 21:24:26 +02:00
Lionel Dricot 51f5b35a1e stupid bug in previous commit 2022-04-12 15:03:26 +02:00
Lionel Dricot ab2271e6bf archiving regardless of the view used 2022-04-10 23:45:34 +02:00
Lionel Dricot c1981b4cf2 official repo 2022-04-09 19:07:30 +02:00
Lionel Dricot 10ab7323bd do not try to render non-image files with chafa to avoid errors 2022-04-09 17:15:56 +02:00
Lionel Dricot ac80f537e2 removing next and previous 2022-04-06 12:14:57 +02:00
Lionel Dricot 2e9e236dc8 not stripping html from left CR 2022-04-06 11:41:56 +02:00
Lionel Dricot 292e53b031 adding draft of doc 2022-04-05 09:57:41 +02:00
Lionel Dricot a8cc54b4ee Merge branch 'master' of notabug.org:ploum/offpunk 2022-04-05 09:55:38 +02:00
ploum 30e83919e7 Merge branch 'master' of ivanruvalcaba/offpunk into master 2022-04-05 07:54:42 +00:00
Iván Ruvalcaba 03f02e0ce2 🎉 First Debian packaging commit 2022-04-04 20:26:07 -05:00
Lionel Dricot 614ff254d2 adding AUR package in README 2022-04-04 22:49:36 +02:00
Lionel Dricot fe948a66ad putting myself as the main licensee 2022-04-04 16:13:46 +02:00
Lionel Dricot 9707a1f2bf adding less to dependencies. 2022-04-02 22:08:51 +02:00
Lionel Dricot 217447f021 updating URL in setup.py 2022-04-02 21:09:55 +02:00
Lionel Dricot f0e151b40c python readability is now optional 2022-04-02 18:25:40 +02:00
Lionel Dricot 2cff973f3f try to not crash on empty pages 2022-04-02 17:55:45 +02:00
Lionel Dricot 5c59da3c16 adding url to changelog 2022-04-02 17:27:07 +02:00
Lionel Dricot 66454dc2e7 releasing 1.3 2022-04-02 16:56:03 +02:00
Lionel Dricot 3ddb782c7a cleaning some old comments 2022-04-01 00:20:34 +02:00
Lionel Dricot fcd279db16 escaping by default each time we call a shell command 2022-03-31 11:41:37 +02:00
Lionel Dricot 7f3ac6d273 adding pip requirements.txt 2022-03-31 11:13:11 +02:00
Lionel Dricot 9adfb955d7 automatically create bookmarks list 2022-03-31 11:00:55 +02:00
Lionel Dricot 97f31c0762 Refactor every call to subprocess to improve compatibility with python 3.6 2022-03-30 19:23:44 +02:00
Lionel Dricot b71dd77f7d replacing subproccess.call with subprocess.run 2022-03-30 17:42:48 +02:00
Lionel Dricot 6e5760f27d Introducting redirections for twitter,medium, youtube and reddit 2022-03-30 15:46:25 +02:00
Lionel Dricot 026ce534ac displaying animated gifs (but only one loop) 2022-03-30 14:35:37 +02:00
Lionel Dricot 3e560d21de downloading images only if support for them is enabled, of course 2022-03-30 12:09:08 +02:00
Lionel Dricot 9528d3d5f6 downloading images first to display them 2022-03-30 12:04:07 +02:00
Lionel Dricot 6dbeaa828e It seems a bunch of ssl validation code was dropped, I don’t know how. Got it back from AV-98 2022-03-29 22:30:57 +02:00
Lionel Dricot 5207164d3c removed dependency to python-magic 2022-03-29 22:08:30 +02:00
Lionel Dricot 007076ab0a adding documentation to install dependencies on Ubuntu 2022-03-29 16:15:28 +02:00
Lionel Dricot bbaa1dbbcb improved dependencies clarity 2022-03-29 13:28:20 +02:00
Lionel Dricot 5f16b89e95 removing dependency to python-editor 2022-03-29 13:12:49 +02:00
Lionel Dricot a401e75ec9 handle better old less versions 2022-03-29 10:26:53 +02:00
Lionel Dricot 040f077836 solving a crash when directly entering an unknown gopher address while offline 2022-03-27 16:25:03 +02:00
Lionel Dricot 9a3013fa5c experiment with lstrip 2022-03-27 16:15:34 +02:00
Lionel Dricot a227d7d000 bug in the streaming detection would sometimes make valid http request fail 2022-03-25 20:53:45 +01:00
Lionel Dricot ad56f82901 added support for html span 2022-03-25 14:08:34 +01:00
Lionel Dricot 4acebf6fba Implemented find with ripgrep/grep 2022-03-25 13:45:57 +01:00
Lionel Dricot 05da20801c Streaming servers without content-length are closed after 5Mo of download 2022-03-24 22:00:04 +01:00
Lionel Dricot c2879828d6 fixing a crash when the cache is already a directory 2022-03-24 21:03:03 +01:00
Lionel Dricot 9a1d0fa255 switch back to default width of 80 as most hard-wrapped gemlogs and gopher assume this width 2022-03-24 11:06:35 +01:00
Lionel Dricot 54f5be3bd5 crashing when requesting the title of a feed 2022-03-24 10:51:36 +01:00
Lionel Dricot c0ae6e4f47 1.2 Experimental release 2022-03-23 22:19:31 +01:00
Lionel Dricot 431d5d81cb exiting cleanly if less is not found 2022-03-23 16:35:10 +01:00
Lionel Dricot 5247813b21 view normal to get back from view full 2022-03-23 16:19:23 +01:00
Lionel Dricot d3775542ae support for bookmarking specific modes like full 2022-03-23 14:28:19 +01:00
Lionel Dricot c1f0146411 crash in --fetch-later 2022-03-23 08:48:45 +01:00
Lionel Dricot 2bd1f04571 lists now have their own protocol and solved the irritating namebug in history 2022-03-23 08:38:58 +01:00
Lionel Dricot 41b28d412a small improv to cleaning html 2022-03-22 18:21:31 +01:00
Lionel Dricot e89bd26cde small cleanup 2022-03-22 11:11:35 +01:00
Lionel Dricot 80cdf1bb5c small improv to version 2022-03-22 09:07:37 +01:00
Lionel Dricot af86a08e31 Removed definitely ansiwrap. This is a huge achievement. 2022-03-21 22:50:55 +01:00
Lionel Dricot 68fb345ccc switched Gemtext to the new renderer 2022-03-21 21:45:53 +01:00
Lionel Dricot 17066d0f86 stupid bug in the gemtext renderer that went nearly unnoticed 2022-03-21 17:49:37 +01:00
Lionel Dricot 48f9e9b8c1 new gemtext renderer in beta 2022-03-21 16:54:17 +01:00
Lionel Dricot d2dc6795e3 switching GemText to the new renderer 2022-03-21 16:21:02 +01:00
Lionel Dricot d2a0b38e5e NewHTML: we now switched to the new HTML rendering engine 2022-03-21 11:57:35 +01:00
Lionel Dricot 0499527da5 moving representation to abstract renderer 2022-03-21 11:36:01 +01:00
Lionel Dricot bf77dec666 NewHTML: handling PRE, indents and tables 2022-03-20 21:58:17 +01:00
Lionel Dricot ce36d1adbc NewHTML: add title before pictures 2022-03-20 11:29:06 +01:00
Lionel Dricot fedd4622a9 NewHTML : support for reverse indent and good centering of img alttext 2022-03-20 00:00:55 +01:00
Lionel Dricot 822ead9cfb NewHTML: simplifying outputed ANSI code by cancelling opposites and concatenating others 2022-03-19 23:01:53 +01:00
Lionel Dricot 20e09a6e28 improved link parsing logic in html 2022-03-19 22:03:31 +01:00
Lionel Dricot e2c07b6fab NewHTML: title set 2022-03-19 21:26:49 +01:00
Lionel Dricot 3ab7c76207 set beta to true to test the new html renderer 2022-03-19 20:58:18 +01:00
Lionel Dricot b19604525e NewHTML: support for indentations. It starts to look very promising. 2022-03-19 17:44:28 +01:00
Lionel Dricot 8957cda24e limit width of --sync output 2022-03-19 15:58:28 +01:00
Lionel Dricot 517e0f0e9e fix a crash when saving a folder 2022-03-19 12:17:02 +01:00
Lionel Dricot 1e16c415fd really tired 2022-03-18 23:17:59 +01:00
Lionel Dricot c64f633ebd fix view full for feeds 2022-03-18 23:02:21 +01:00
Lionel Dricot b6aa36d423 quick 1.1 fix 2022-03-18 22:30:40 +01:00
Lionel Dricot a49022d56f releasing 1.1 2022-03-18 22:27:45 +01:00
Lionel Dricot 0e8557480a NewHTML: solved centering and other stuff 2022-03-18 22:11:58 +01:00
Lionel Dricot a9b5c37b8a better performance by using links_only when needed 2022-03-18 21:12:21 +01:00
Lionel Dricot 6b1b527b04 NewHTML: trying to center img comments 2022-03-18 18:10:38 +01:00
Lionel Dricot f5c10392c3 working on a textwrap-compatible html renderer 2022-03-18 17:35:14 +01:00
Lionel Dricot ea31d72b9e force saving animation as gif to avoid a crash by PIL 2022-03-18 13:40:54 +01:00
Lionel Dricot 51c2bd966e first try at reimplementing the html renderer (currently commented out) 2022-03-18 11:25:47 +01:00
Lionel Dricot e388b4f49c understand links in html titles 2022-03-17 15:34:43 +01:00
Lionel Dricot 435ab36525 support for timg as an alternative to chafa 2022-03-17 10:23:35 +01:00
Lionel Dricot a651537052 initial work to support timg instead of chafa 2022-03-17 00:01:18 +01:00
Lionel Dricot c9f2191f71 fixing the fix_ipv6 which was breaking some domain names 2022-03-16 19:26:46 +01:00
Lionel Dricot ab08d28537 fix crash when getting links for pictures 2022-03-16 10:08:29 +01:00
Lionel Dricot 8170c26532 full support for multiple view modes 2022-03-16 10:03:29 +01:00
Lionel Dricot 5ddd309bce links were broken in v full 2022-03-16 09:47:53 +01:00
Lionel Dricot 452ae6015f dont crash if a picture is in the clipboard 2022-03-16 00:41:56 +01:00
Lionel Dricot 76ba0104d5 repair broken view full and got saved position in different views 2022-03-16 00:21:55 +01:00
Lionel Dricot 03f62d2e57 cp url X to copy the url of a link 2022-03-15 23:43:21 +01:00
Lionel Dricot 4f4e1cc72c fixed missing links in feeds 2022-03-15 23:23:29 +01:00
Lionel Dricot c6d164e743 refactor: display is now handled by the renderer. Also, removal of fold 2022-03-15 23:01:04 +01:00
Lionel Dricot 0d282b7ccf drop html comments 2022-03-15 20:24:06 +01:00
Lionel Dricot 190139e431 refactor: removing reable=True for mode=readable 2022-03-15 20:14:21 +01:00
Lionel Dricot 543455e1c6 starting refactorisation to support better chafa 2022-03-15 16:23:44 +01:00
Lionel Dricot 133be0dc13 ensure we are using chafa with symbols to allow upgrading to 1.8 2022-03-15 15:30:30 +01:00
Lionel Dricot 10a576838b use html unescape instead of implementing it ourselves 2022-03-15 00:04:11 +01:00
Lionel Dricot ca1cd780a3 cp cache to get the path of the cached file 2022-03-14 22:36:34 +01:00
Lionel Dricot 112ff11d3d proper support for <pre> 2022-03-14 18:46:14 +01:00
Lionel Dricot 378de2479e added 1.0 post 2022-03-14 12:10:11 +01:00
Lionel Dricot 7182059fa5 fix crash if python readability not present 2022-03-14 11:43:40 +01:00
Lionel Dricot 438d8b9363 error with NEW_CHAFA 2022-03-14 10:23:14 +01:00
Lionel Dricot ac07ddb5c4 release 1.0 and fix view full for feeds 2022-03-13 17:45:41 +01:00
Lionel Dricot 5589568d8b simplifying chafa detection 2022-03-13 14:36:21 +01:00
Lionel Dricot 58dc23b50f switching to the more standard width of 72 for 1.0 2022-03-12 22:19:54 +01:00
Lionel Dricot 9e37442d86 screenshots for 1.0 2022-03-12 22:18:37 +01:00
Lionel Dricot e92d57a94a Handling chafa > 1.10 2022-03-12 18:41:38 +01:00
Lionel Dricot d74d00feb1 crash in subscribe 2022-03-09 11:34:41 +01:00
Lionel Dricot 1e18cb71a3 added man as an abbrevs for help. Because I typed it spontanously. 2022-03-09 10:15:24 +01:00
Lionel Dricot db5e922af9 up can take an integer as argument 2022-03-08 22:21:44 +01:00
Lionel Dricot 672a1a9c4b dropping python-xdg dependancy. It’s easier to implement our own version of it 2022-03-08 10:14:36 +01:00
Lionel Dricot 7de6cf5d1f download limit seems to work 2022-03-08 09:12:01 +01:00
Lionel Dricot c1f2206937 less has been renamed view and feed/feeds options have been added 2022-03-07 23:16:17 +01:00
Lionel Dricot b37fb2f599 dropping javascript from full view 2022-03-07 22:29:55 +01:00
Lionel Dricot d6cf0962b7 centering pictures in html pages 2022-03-07 21:54:43 +01:00
Lionel Dricot 636e8bb4b8 content is now centered in the terminal 2022-03-07 18:23:48 +01:00
Lionel Dricot 35123e920c fix crash reported by Matthieu Talbot 2022-03-07 15:36:16 +01:00
Lionel Dricot 907fc70b5d fallback less frequently to text/gemini mime 2022-03-06 19:36:02 +01:00
Lionel Dricot f322c8d73c small typo inducing crash 2022-03-06 16:02:30 +01:00
Lionel Dricot 4e5dbe4882 added spartan to README 2022-03-05 16:36:39 +01:00
Lionel Dricot 100f69ebe7 releasing 0.9 2022-03-05 11:45:26 +01:00
Lionel Dricot 42f0f06494 Add support for spartan protocol 2022-03-04 23:38:35 +01:00
Lionel Dricot 1e44ae76a0 forgot to increase version number 2022-03-04 16:50:33 +01:00
Lionel Dricot 28feaf6f6d reload doesn’t care about cache anymore 2022-03-04 12:38:41 +01:00
Lionel Dricot b7c34f3bb9 stupid white space bug 2022-03-04 10:18:57 +01:00
Lionel Dricot d28a3423d6 Http download which are not to be put in tour are now limited to 20Mo, to avoid downloading large unwanted files 2022-03-03 16:16:32 +01:00
Lionel Dricot 484987e21f max 20mo for http downloads 2022-03-01 22:03:42 +01:00
Lionel Dricot 3faca54050 &mldr; spotted in a wild page and implemented 2022-02-27 22:54:28 +01:00
Lionel Dricot f73577ae08 warn if alreaday subscribed to a feed 2022-02-27 22:32:25 +01:00
Lionel Dricot b0a2961acc more feedback from subscribe 2022-02-27 22:20:42 +01:00
Lionel Dricot af57715f99 feed without entries are not feed but html pages 2022-02-25 22:13:40 +01:00
Lionel Dricot 7a05e5514e do not quit on ctrl+c, behaviour is annoying 2022-02-25 14:36:46 +01:00
Lionel Dricot edb71471dc rare crash on rss detection with some websites 2022-02-25 10:59:54 +01:00
Lionel Dricot 3231f425a9 binary files in gopher 2022-02-24 10:29:14 +01:00
Lionel Dricot ff12498b49 handle relative path for subscribing to feeds 2022-02-23 12:06:53 +01:00
Lionel Dricot 8b53ce8561 screenshots in README 2022-02-23 11:17:21 +01:00
Lionel Dricot 8c8b6763b2 quit on ctrl+c 2022-02-23 10:43:46 +01:00
Lionel Dricot 6d87b2f4bc solve a crash when calling less after a mailto link 2022-02-22 13:24:36 +01:00
Lionel Dricot 4f56a85e28 move from PROTOCOL_TLS to PROTOCOL_TLS_CLIENT. This should be enough to close #7 2022-02-22 11:15:19 +01:00
Lionel Dricot d468aced2f abstracting wrapping methods to try replace ansiwrap 2022-02-21 21:20:34 +01:00
Lionel Dricot 3b809c4146 Releasing 0.4 2022-02-21 00:46:14 +01:00
Lionel Dricot aa8e0cdb3e solve two gopher bugs related to path 2022-02-19 22:09:57 +01:00
Lionel Dricot fb29a83cc6 displaying lists where a page appear in info 2022-02-19 21:36:54 +01:00
Lionel Dricot f669bd9bed change process name to offpunk 2022-02-18 23:50:08 +01:00
Lionel Dricot f6820ba244 sync can now be called inside offpunk 2022-02-18 22:55:32 +01:00
Lionel Dricot d1ce7bd662 removing reference to cmdqueue in case we want to migrate to cmd2 2022-02-18 17:13:20 +01:00
Lionel Dricot 6f36970b34 new info command 2022-02-18 15:52:27 +01:00
Lionel Dricot cd5bba7b7b subscribe now detect embeded RSS feeds 2022-02-18 14:11:09 +01:00
Lionel Dricot f0623c1b93 should fix a rare crash when fetching redirected urls 2022-02-18 12:14:42 +01:00
Lionel Dricot 7d91ee0eb9 using new --incsearch for less if available 2022-02-17 23:16:16 +01:00
Lionel Dricot 87e8364932 cleaning up the less history file 2022-02-17 17:47:16 +01:00
Lionel Dricot 75397963cf restoring last position when less-ing a page 2022-02-17 17:19:11 +01:00
Lionel Dricot 80bf937f03 get less version 2022-02-17 15:57:04 +01:00
Lionel Dricot 279bd12748 proper separation of get_cache_path 2022-02-17 12:51:48 +01:00
Lionel Dricot 78e428d3a7 starting to remove self.path from GeminiItem 2022-02-17 12:38:50 +01:00
Lionel Dricot 136c8cfce7 cache_path is now generated upon request for case where it might become a folder afterward 2022-02-17 10:42:18 +01:00
Lionel Dricot 06f2c1b838 how a directory went to get mime ? 2022-02-17 10:02:45 +01:00
Lionel Dricot cf4dc86b03 tentatively improve html rendering 2022-02-17 09:58:42 +01:00
Lionel Dricot b9e0cf4b0b fix for gopher selectors 2022-02-16 09:45:38 +01:00
Lionel Dricot 45e894b041 changelog 2022-02-16 09:21:50 +01:00
Lionel Dricot 4fa3a718a8 fixing a tour bug and making the width dynamic 2022-02-15 21:57:14 +01:00
Lionel Dricot 430943a9b3 upgrade instructions 2022-02-15 19:43:50 +01:00
Lionel Dricot 0b5e516361 list help is synonym for help list 2022-02-15 16:50:33 +01:00
Lionel Dricot 33cc967df1 don’t save gi if it doesn’t exist 2022-02-15 16:05:10 +01:00
Lionel Dricot 39caf95381 we fetch frozen list if no valid cache exists 2022-02-15 15:18:07 +01:00
Lionel Dricot 4464a605b0 I was too quick to commit the new feature 2022-02-15 15:05:08 +01:00
Lionel Dricot bc0358f6c9 New list subscribe and list freeze commands 2022-02-15 14:56:35 +01:00
Lionel Dricot aa75f713ea reverting the non-recursive render of image in links 2022-02-15 10:17:00 +01:00
Lionel Dricot 8ae7587ab4 improving rendering of images nested in links and of non-breaking spaces 2022-02-15 00:04:30 +01:00
Lionel Dricot fdd1f36de6 vastly improved version command to see status of different features 2022-02-14 23:02:53 +01:00
Lionel Dricot 5cf26e28fa improve unicode handling and rss detection 2022-02-14 11:54:51 +01:00
Lionel Dricot e1ab504f69 --fetch-later now directly add to tour if a cached version already exists 2022-02-14 11:28:12 +01:00
Lionel Dricot 26009c7f75 RSS feeds are now rendered as gemlogs 2022-02-14 11:05:39 +01:00
Lionel Dricot 7781d7123c fixing blue title for RSS feeds 2022-02-14 10:25:55 +01:00
Lionel Dricot bf20721be5 fix crash with some mailto links 2022-02-13 23:18:42 +01:00
Lionel Dricot 176bcd438b Making Html renderer working with fragments to improve FeedRenderer 2022-02-13 22:59:16 +01:00
Lionel Dricot 85551f5af5 abstracting renderers to make them more coherent 2022-02-13 17:50:15 +01:00
Lionel Dricot 67fbf9902e fixing, once again, a crash wit too long path 2022-02-13 16:35:30 +01:00
Lionel Dricot ed5298b67e avoid crash with badly formatted images 2022-02-13 10:59:10 +01:00
Lionel Dricot 74bbf76814 FolderRenderer (currently only used for listing lists 2022-02-13 01:12:55 +01:00
Lionel Dricot 3029a3a218 Improving lists and making an abstract renderer 2022-02-13 00:37:31 +01:00
Lionel Dricot b85e9e8f04 handlers are now only used for non-text 2022-02-12 19:07:55 +01:00
Lionel Dricot 15b7591424 fixing a crash because a variable interfered witht the CMD module 2022-02-12 14:41:05 +01:00
Lionel Dricot 980ad72510 We now render images in terminal and introduce the open command. Beware, it is very experimental 2022-02-12 14:24:43 +01:00
Lionel Dricot ff9adf4aea Making offpunk working for variable width. Thanks to Kelbot for pointing it was not working 2022-02-12 13:12:37 +01:00
Lionel Dricot ec8fb1fda6 optimisation to not run image processor when syncing 2022-02-11 12:32:59 +01:00
Lionel Dricot 9cdb52383d improved image robustness 2022-02-11 12:01:05 +01:00
Lionel Dricot 4b39b7eac1 releasing 0.3 2022-02-11 11:33:37 +01:00
Lionel Dricot dc7e9156c8 improved handling of gopher connections and support for animated gif 2022-02-11 11:12:36 +01:00
Lionel Dricot 2413c1bf19 support for gopher 2022-02-10 23:46:59 +01:00
Lionel Dricot f0177f62f8 support for images nested in links 2022-02-10 17:19:20 +01:00
Lionel Dricot 691d2ee07c This is a very funny experiment with chapa to display image in
webpages
2022-02-09 21:46:29 +01:00
Lionel Dricot d0294fb58c trying to fallback on html if theres no entries in the feed. 2022-02-07 00:29:26 +01:00
Lionel Dricot f205dde0b6 full functionnal support for RSS and Atom 2022-02-06 15:48:24 +01:00
Lionel Dricot 8b1e28427b Basic support for RSS/Atom feeds 2022-02-06 14:08:25 +01:00
Lionel Dricot 81f3ff9f5b use magic by default if available to get mimetype 2022-02-06 12:55:54 +01:00
Lionel Dricot 79572a93ca small html rendering improvement 2022-02-05 14:42:35 +01:00
Lionel Dricot c405f8ddd9 improved title for non-fetched ressource 2022-02-05 12:46:32 +01:00
Lionel Dricot 08aedd4b42 improving html rendering 2022-02-05 00:26:51 +01:00
Lionel Dricot 11e6b3ccbc README improvments 2022-02-04 16:10:49 +01:00
Lionel Dricot 8de8c9ff7f new option --disable-http 2022-02-04 15:55:22 +01:00
Lionel Dricot 1cb3f48845 minor improvement in handling html titles 2022-02-04 13:38:33 +01:00
Lionel Dricot c985f1e8b4 aborting when an url is too long (this is an OS limitation) 2022-02-04 13:00:29 +01:00
Lionel Dricot 5d19662e3e adding depth and support for img in html 2022-02-04 01:14:22 +01:00
Lionel Dricot db991b2fd2 new argument to command less : full, allowing to disable readability 2022-02-03 21:56:23 +01:00
Lionel Dricot ba2c2f0d0e updated VERSIONS 2022-02-03 16:49:23 +01:00
Lionel Dricot e7f7e417e6 vastly improved syncing performance by building caches in more situation and disabling https_everywhere 2022-02-03 13:38:07 +01:00
Lionel Dricot ee1c660d74 This is an experiment to make --sync more intuitive based on Bjorn
Westergard’s feedback

See his post:
gemini://bjornwestergard.com/log/offpunk.gmi
2022-02-02 12:57:55 +01:00
Lionel Dricot 1881b98d96 adding our own user-agent else offpunk is considered as a bot by many http servers 2022-02-01 15:53:07 +01:00
Lionel Dricot c038fc9579 Merge branch 'master' of tildegit.org:ploum/AV-98-offline 2022-02-01 12:39:23 +01:00
Lionel Dricot 591c848478 close #6 (please test). It seems there are two XDG modules out there which are both incompatibles. The one is Debian seems to be a mix of both so I migrated to the correct way of using it (thanks to Klaus Alexander for providing code example). If this doesn’t work for everyone, we will have to support both way (code also provided by Klaus Alexander) 2022-02-01 12:32:51 +01:00
Lionel Dricot 19007edcd7 close #6 (please test). It seems there are two XDG modules out there which are both incompatibles. The one is Debian seems to be a mix of both so I migrated to the correct way of using it (thanks to Klaus Alexander for providing code example). If this doesn’t work for everyone, we will have to support both way (code also provided by Klaus Alexander) 2022-02-01 11:22:52 +01:00
Lionel Dricot 6b0c362b5e do not update history while syncing 2022-01-31 15:32:34 +01:00
Lionel Dricot ed81c3245f removing a forgotten print 2022-01-31 15:07:59 +01:00
Lionel Dricot d572f17903 Merge branch 'master' of tildegit.org:ploum/AV-98-offline 2022-01-31 14:55:55 +01:00
Lionel Dricot 635dfdbf80 releasing 0.2 2022-01-31 14:55:34 +01:00
Lionel Dricot dc3fbcc8a5 releasing 0.2 2022-01-31 14:43:00 +01:00
Lionel Dricot 4980890ac4 fixing a crash 2022-01-31 11:54:17 +01:00
Lionel Dricot 2dbe7de21c improving documentation 2022-01-30 19:33:04 +01:00
Lionel Dricot fb6511d51d pretty titles in list and not adding lists to history 2022-01-30 19:11:23 +01:00
Lionel Dricot b611c1ec87 fixing a bug where mailto: url were not counted as URL in a page 2022-01-30 17:47:03 +01:00
Lionel Dricot f2944d35af first step to transform renderers into their own objects 2022-01-29 15:37:18 +01:00
Lionel Dricot 69db426ab8 fixing bug #4 (thanks for the report) 2022-01-28 13:25:55 +01:00
Lionel Dricot 06b2e178fb history is now a list 2022-01-26 19:35:05 +01:00
Lionel Dricot 41f0900373 implementing the archive list 2022-01-26 18:52:38 +01:00
Lionel Dricot bd09d7cc61 localhost:// is now the widely used file:// 2022-01-25 12:20:11 +01:00
Lionel Dricot a961596f69 solved 2 nasty crashes and one infinite loop 2022-01-25 11:49:31 +01:00
Lionel Dricot 70cc059528 get_filename would crash while accessing local ressources 2022-01-24 19:23:03 +01:00
Lionel Dricot bd5ba00991 improving README 2022-01-24 17:15:54 +01:00
Lionel Dricot 9fa216c11e search is now find (because it’s on current page only) 2022-01-24 17:04:03 +01:00
Lionel Dricot 682631c4cd https_everywhere enabled by default 2022-01-24 16:50:22 +01:00
Lionel Dricot 2e7d213c26 improving subscribtions 2022-01-24 16:21:30 +01:00
Lionel Dricot 976c958bc3 lists can now be deleted 2022-01-24 15:11:49 +01:00
Lionel Dricot fd5da8761d new command : list edit 2022-01-24 12:24:19 +01:00
Lionel Dricot fcf8605af9 size of lists 2022-01-24 11:23:22 +01:00
Lionel Dricot daece10ce5 fixing bugs in the new sync code 2022-01-24 10:58:32 +01:00
Lionel Dricot 3c8db67844 multiple lists are now implemented 2022-01-23 23:14:06 +01:00
Lionel Dricot 1b4e1bf6bf added support for mailto links 2022-01-23 17:40:28 +01:00
Lionel Dricot ffc939094f tour is now a list 2022-01-23 17:09:05 +01:00
Lionel Dricot c8c32e4640 bookmarks are now a list 2022-01-23 13:52:34 +01:00
Lionel Dricot ac4d6547d2 debug of automatic choice 2022-01-23 10:44:19 +01:00
Lionel Dricot 9131c5621f new --assume-yes option for answering question when sync. Without it, no is assumed 2022-01-22 15:33:39 +01:00
Lionel Dricot 0894be5167 new method to manage lists: move 2022-01-22 15:08:06 +01:00
Lionel Dricot 5db7a47e72 you can create lists and add pages to them 2022-01-21 17:42:14 +01:00
Lionel Dricot 57c69df5b6 support query in the URL 2022-01-19 18:44:39 +01:00
Lionel Dricot 5505443132 I wrote offmini instead of offpunk in the README 2022-01-19 15:27:33 +01:00
Lionel Dricot 7ff4065493 added the --fetch-later command line 2022-01-19 15:21:28 +01:00
Lionel Dricot 7a17f04343 remove offline_web option (not used anymore) 2022-01-19 11:02:49 +01:00
Lionel Dricot d688a5d8ba better handling of paths 2022-01-19 10:46:53 +01:00
Lionel Dricot 9047dbd718 another stupid refactoring bug 2022-01-19 09:41:04 +01:00
Lionel Dricot 14e5fbcc83 refactoring and cleanup: now accessing links directly from gi instead of hiding a go_to 2022-01-18 22:19:43 +01:00
Lionel Dricot bdd006c896 offpunk now respects XDG 2022-01-18 18:04:29 +01:00
Lionel Dricot 9b8c06efce getting rid of from_map_line, never liked that odd method 2022-01-18 14:45:37 +01:00
Lionel Dricot 103610b077 t . was recognized as url, not a tour command 2022-01-18 14:42:09 +01:00
Lionel Dricot 7e9c535c1d stupid bug which break rendering with preformtted content 2022-01-18 14:16:14 +01:00
Lionel Dricot 00a8cf7580 stupid refactoring bug about localhost 2022-01-18 11:40:16 +01:00
Lionel Dricot ab645a82a6 solving bug #3 2022-01-18 11:39:01 +01:00
Lionel Dricot 94bed58364 fixing bugs after refactorisation 2022-01-18 10:53:56 +01:00
Lionel Dricot e40c0439b2 this is a huge refactorisation so gemtext/html renderers are now handled by each GeminiItem and not by the GeminiClient. Expect bugs 2022-01-17 23:37:12 +01:00
Lionel Dricot 76c2d9a491 consider that all .gmi files are text/gemini mimetype, even if they are not recognized as such 2022-01-17 14:32:46 +01:00
Lionel Dricot e3147d61d0 cosmetic change 2022-01-14 21:42:46 +01:00
Lionel Dricot c6a45ba819 cosmetic changes 2022-01-14 14:54:27 +01:00
Lionel Dricot 2158b78e77 improved README 2022-01-14 12:22:03 +01:00
Lionel Dricot b02b2603f0 fixed gemini:// not being added by default 2022-01-14 12:14:46 +01:00
Lionel Dricot 456095bd07 improve handling of nested <pre> 2022-01-14 11:28:30 +01:00
Lionel Dricot 5ad8dd61e7 html rendering starts to become really acceptable 2022-01-13 10:47:39 +01:00
Lionel Dricot 3bc6022348 fixed a bug while caching binary files 2022-01-13 10:06:10 +01:00
Lionel Dricot b1318e0289 solving that rendering bug where some spaces were removed 2022-01-12 16:23:55 +01:00
Lionel Dricot 2d26bc255c wrapping long links 2022-01-12 15:39:03 +01:00
Lionel Dricot bf6527d8e6 implemented blockquote 2022-01-12 13:23:22 +01:00
Lionel Dricot b7fa06322d makes the from_map_line method more robust to handle failures and bad URL 2022-01-12 12:21:11 +01:00
Lionel Dricot 0a26759d04 wrap long titles 2022-01-12 10:41:21 +01:00
Lionel Dricot 52735962c0 added standard_ports for http/https 2022-01-12 10:05:52 +01:00
Lionel Dricot e2d69df398 handle html page without body 2022-01-12 09:23:27 +01:00
Lionel Dricot 63e8c0e678 another crash with badly parsed url 2022-01-12 09:19:08 +01:00
Lionel Dricot fa9678895d vastly improved html rendering 2022-01-11 22:26:57 +01:00
Lionel Dricot 37918995d6 fix bad url crash 2022-01-11 14:04:20 +01:00
Lionel Dricot 4153a12f2b make to_fetch list more resilient to crashes 2022-01-11 09:39:09 +01:00
Lionel Dricot 257ee2f66d solving crashes 2022-01-11 09:16:34 +01:00
Lionel Dricot 305a736074 small changes 2022-01-10 21:29:19 +01:00
Lionel Dricot b3821d7719 removing debug log 2022-01-10 16:50:13 +01:00
Lionel Dricot 1d5f3b94b3 implementig hX 2022-01-10 16:48:35 +01:00
Lionel Dricot a92130db00 implement pre and li 2022-01-10 16:35:37 +01:00
Lionel Dricot a75cd96f65 less was not working with http 2022-01-10 15:53:41 +01:00
Lionel Dricot 6a77582606 README modified to announce web support 2022-01-10 15:42:39 +01:00
Lionel Dricot 35b884e9ff browsing the web seems to work 2022-01-10 15:30:23 +01:00
Lionel Dricot 8f5240f982 basic html rendering engine 2022-01-10 12:49:24 +01:00
Lionel Dricot 1d780fb1a3 refactor get_title 2022-01-10 11:19:29 +01:00
Lionel Dricot 1110bf5e0c gi might be None. Strange but it seems to happen in --sync. 2022-01-10 09:45:21 +01:00
Lionel Dricot d92a6db6b6 allowing http in --sync 2022-01-09 21:21:09 +01:00
Lionel Dricot 1edeab027c disable readability for now 2022-01-09 21:10:34 +01:00
Lionel Dricot fd88a5181f first working http support (work in progress) 2022-01-09 20:41:47 +01:00
Lionel Dricot c9a478d0eb starting to have http support 2022-01-09 16:12:07 +01:00
Lionel Dricot 2f7fa5daae starting to implement http support 2022-01-09 15:53:14 +01:00
Lionel Dricot a79f5da2cc refactoring write_body 2022-01-09 15:27:02 +01:00
Lionel Dricot 78c2728e96 some comments 2022-01-09 11:35:09 +01:00
Lionel Dricot 1d458c88f1 local files can be opened again 2022-01-08 22:18:54 +01:00
Lionel Dricot 818ae874a3 removing the never-used cache implementation 2022-01-08 21:55:19 +01:00
Lionel Dricot 28908078c3 fixing bugs introduced by the refactoring 2022-01-08 21:46:57 +01:00
Lionel Dricot 2f212848d8 big refactorisation incoming. Lot of bugs to expect. 2022-01-08 21:32:25 +01:00
Lionel Dricot 53d17d0f3b start of a huge refactoring : moving mime into a GeminiItem 2022-01-08 14:16:55 +01:00
Lionel Dricot 2f78452f9c add the longer prompt in less to see position 2022-01-06 13:44:02 +01:00
Lionel Dricot c9ec5eb243 new feature : copy content or url to main clipboard 2022-01-05 21:15:10 +01:00
Lionel Dricot 4aec75a753 new feature : copy content or url to main clipboard 2022-01-05 21:12:59 +01:00
Lionel Dricot 9974dab934 new feature: tour . 2022-01-03 16:40:52 +01:00
Lionel Dricot 3b0c69dcbf small README improvements 2022-01-03 14:48:58 +01:00
Lionel Dricot 74687a2ec8 Improving README 2022-01-01 22:36:06 +01:00
Lionel Dricot ae198f8f6e fixed a crash of the save command 2022-01-01 22:05:02 +01:00
Lionel Dricot c294e4cace improved README 2021-12-31 00:54:25 +01:00
Lionel Dricot 81e821f994 cache_path depends of the protocol 2021-12-30 16:46:52 +01:00
Lionel Dricot 4569bfeb1e Ploum’s url 2021-12-30 16:23:33 +01:00
Lionel Dricot 4303d451e6 Offpunk README 2021-12-30 16:18:35 +01:00
Lionel Dricot 700cba7184 Introducing Offpunk 2021-12-30 16:03:08 +01:00
Lionel Dricot 3d66f99c95 making magic dependancy optional 2021-12-30 15:43:00 +01:00
Lionel Dricot ed7b182281 better default for browsing (less instead of cat) 2021-12-27 14:05:16 +01:00
Lionel Dricot f4aec13ba6 access time added in title when offline 2021-12-24 14:52:55 +01:00
Lionel Dricot 5189cfac29 adding a title to each page, inspired by Lagrange 2021-12-23 21:47:44 +01:00
Lionel Dricot 16cde598c4 new feature: go automatically fetch content from clipboard if xsel is installed 2021-12-22 13:20:10 +01:00
Lionel Dricot 256c28e916 tour is now completely file based, reducing the risk of losing your tour 2021-12-22 10:21:32 +01:00
Lionel Dricot 0260bf1a04 small fixes 2021-12-20 16:32:54 +01:00
Lionel Dricot e26b10f668 strip URL to avoid blank lines being transformed as / 2021-12-20 15:32:19 +01:00
Lionel Dricot c09fa3fc2b we now cache errors (such as not found) in order to not try to refresh dead links all the time 2021-12-20 13:44:26 +01:00
Lionel Dricot 6c818f553a the refresh/add new to tour logic was broken after refactorisation 2021-12-19 15:51:59 +01:00
Lionel Dricot baa0aca61b sanitizing 2021-12-18 10:16:19 +01:00
Lionel Dricot 053502e214 only read text/gemini file and give all the rest to the mime handler 2021-12-17 23:29:47 +01:00
Lionel Dricot e23f80ab28 forgot to increment a counter 2021-12-17 18:09:55 +01:00
Lionel Dricot 586bffd30c gemlog link not working on tildegit 2 2021-12-17 16:11:29 +01:00
Lionel Dricot c7727bcb4a gemlog link not working on tildegit 2021-12-17 16:10:52 +01:00
Lionel Dricot 6bbcf3e0fe gemlog link in README 2021-12-17 16:07:34 +01:00
Lionel Dricot fa014ead75 fixing small bug with some bad formatted links 2021-12-17 15:50:20 +01:00
Lionel Dricot ba429946ec add / at the end of url if cache is a dir 2021-12-17 15:15:09 +01:00
Lionel Dricot 2e6bd28563 updating README 2021-12-17 14:11:46 +01:00
Lionel Dricot 8651a14e34 no blank line in tour file 2021-12-17 13:59:34 +01:00
Lionel Dricot 843ce388c8 solve a bug when white lines appended it tour file 2021-12-17 12:35:46 +01:00
Lionel Dricot 45a0da6d42 refactorization of fetch_catch, adding logic to add to tour smartly and to randomly reload some old stuff 2021-12-17 12:08:27 +01:00
Lionel Dricot 77ce33173e sugar: http and gemini link are understood without the go command 2021-12-16 16:09:54 +01:00
Lionel Dricot 8ede39dd4d adding --cache-validity option 2021-12-16 15:58:05 +01:00
Lionel Dricot 9d5a1a9e4c don’t refresh more than every 1h 2021-12-16 13:10:55 +01:00
Lionel Dricot de840bdf9f Solve accessing url without trailing / and add online command 2021-12-16 10:43:25 +01:00
Lionel Dricot ce38b49ba6 by default, mimetype is text/gemini 2021-12-15 11:49:40 +01:00
Lionel Dricot 502668c3c6 support for caching every MIMETYPE 2021-12-15 11:45:55 +01:00
Lionel Dricot 3d6c702fda more elegant solution when redirecting to index.gmi 2021-12-15 11:05:38 +01:00
Lionel Dricot 10d6c3110f Hell of a hack for naughty bug + handle offline reload 2021-12-14 16:33:17 +01:00
Lionel Dricot 1a21c902cb content not cached will be marked for next sync 2021-12-14 16:07:02 +01:00
Lionel Dricot f457f08c2f new links found while syncing are automatically added to tour (and tour is preserved accross session 2021-12-14 15:26:37 +01:00
Lionel Dricot f1d85094c9 tour is now saved accross session 2021-12-14 15:12:43 +01:00
Lionel Dricot 72f2b5f91c --synconly is now --sync and has a fancy output 2021-12-14 14:06:07 +01:00
Lionel Dricot 1bf23193c4 trying to not open xml files in synconly also prevented parsing and thus recursive retrieval 2021-12-14 13:29:09 +01:00
Lionel Dricot 2ac144dc00 offline web browser option 2021-12-13 14:30:40 +01:00
Lionel Dricot a5c2341785 synconly a lot more faster and efficient 2021-12-13 13:49:12 +01:00
Lionel Dricot 4212a4fd2b off-98 prompt 2021-12-10 15:24:26 +01:00
Lionel Dricot 9da4fd150b basic --synconly mode is now working 2021-12-10 11:27:48 +01:00
Lionel Dricot 6586f0834a some links are still crashing with sync_only 2021-12-09 18:05:46 +01:00
Lionel Dricot 0c333ce4bb sync-only mode now cache bookmarks 2021-12-09 17:23:50 +01:00
Lionel Dricot f58b96e894 first step for a sync_only mode 2021-12-09 15:12:32 +01:00
Lionel Dricot 9342bccec7 more bugs listed in README 2021-12-07 14:06:48 +01:00
Lionel Dricot 9fb7c610bf ugly hack to fix caching for URL without / at the end 2021-12-07 13:08:43 +01:00
Lionel Dricot 25247eaa90 README 2021-12-06 17:13:19 +01:00
Lionel Dricot 26e083d894 README 2021-12-06 17:12:45 +01:00
Lionel Dricot 9cc713431c Offline now works for basic usecase ! 2021-12-06 17:03:22 +01:00
Lionel Dricot b1c9220fc5 offline switchg 2021-12-06 16:43:16 +01:00
Lionel Dricot acdc83ed6d permanent cache is now created 2021-12-06 16:17:01 +01:00
Lionel Dricot 07ee2e9782 cache path by default 2021-12-04 21:01:11 +01:00
Lionel Dricot 1fff962e45 bad code to have cache_path 2021-12-04 19:52:08 +01:00
Lionel Dricot 79b24e960c adding comment to understand 2021-12-02 16:27:14 +01:00
Björn Wärmedal 62898d3938 Jake's solution for the local files bug 2021-11-18 12:02:00 +01:00
Björn Wärmedal 292a68fc23 Removed a bunch of unnecessary certificate checks. 2021-10-06 11:07:08 +02:00
Björn Wärmedal 37e2c671e4 Updated version in setup.py as well 2021-08-25 08:34:24 +02:00
Björn Wärmedal 49db2732be Updated contributors list. Thank you Jake for the tour reverse-range and https proxy solutions! 2021-08-25 08:07:18 +02:00
Björn Wärmedal 6c38132259 Added https proxy setting, similar to gopher proxy. Also bumped version number. 2021-08-25 08:03:12 +02:00
Björn Wärmedal 4408963c69 Reverse tour add: 'tour 50-40' will now add all links in that range in that order. 2021-08-25 08:01:16 +02:00
Björn Wärmedal 94c0de9b15 Clarify status as a fork of AV-98 in Readme 2021-05-05 09:13:49 +02:00
Björn Wärmedal 7468dcef77 replaced GUS with geminispace.info, since GUS is dead 2021-04-27 09:55:12 +02:00
Björn Wärmedal c86cbdedca Increased default timeout (geminispace.info searches usually take longer) 2021-04-27 09:53:58 +02:00
Björn Wärmedal b6bae540ba Show name of activated client cert 2021-02-03 08:06:27 +01:00
25 changed files with 5104 additions and 1722 deletions

221
CHANGELOG Normal file
View File

@ -0,0 +1,221 @@
# Offpunk History
## 2.0 - unreleased
This is an an experimental and unstable release. Lot of breakages are expected.
Wait for 2.1 if you are not willing to do testing/bug reporting.
- New command-line tool: "netcache"
- New command-line tool: "ansirenderer"
## 1.10 - unreleased
- IMPORTANT : new optional dependency : python-chardet
- IMPORTANT : Gopher directory index filename changed from "index.txt" to "gophermap". To update the cache to the new format run the `migrate-offpunk-cache` script (Sotiris Papatheodorou)
- "set accept_bad_ssl_certificates True" now also used for Gemini expired certificates
- Add missing chardet module (Sotiris Papatheodorou)
- Fix merging dictionaries with common keys (Sotiris Papatheodorou)
- Fix Gopher requests (rewrite URL parsing code per RFC 4266)
## 1.9.2 - March 13th 2023
- Switch from setup.py to flit (Anna cybertailor Vyalkova)
- Bump requirements to python >= 3.7 (Anna cybertailor Vyalkova)
## 1.9.1 - March 8th 2023
- Fixed crash with archive without GI (thanks Étienne Mollier)
## 1.9 - March 8th 2023
This is a bug-fixing release.
- We now have a man page thanks to phoebos!
- ".." as abbreviation to "up" (by Sotiris Papatheodorou)
- Fix support for UTF-8 domains in Gemini (Maeve Sproule, fixes #5)
- Assume UTF-8 when the header answer with an unknown encoding
- Default handlers have been removed (not everybody use feh and zathura)
- Fix a crash when subscribing without GI (reported by sodimel on linuxfr)
- Fix a crash when trying to access a link without GI (Ben Winston)
- Fix a crash when rss items dont have a title (eg: Mastodon rss)
- Fix a crash with badly formatted links in gopher ( #7 by xiu)
- Fix a crash were some HTML content is seen a bytes instead of a string
- Fix a crash when displaying embedded CDATA html in feed. But #10 is still open.
- Fix error handling assuming that requests is installed
- Ugly fix for a rare certificate bug (fix #11)
- Improve compatibility with python prior 3.9 by replacing a dict union
## 1.8 - December 11th 2022
- Official URL is now https://sr.ht/~lioploum/offpunk/
- SECURITY: Avoid passing improperly-escaped paths to shell (fixes notabug #9) (by Maeve Sproule)
- Add support for the finger protocol (by Sotiris Papatheodorou)
- "restricted" mode has been removed because unmaintained (code cleanup)
- "set accept_bad_ssl_certificates True" allows to lower HTTPS SSL requirements (also with --assume-yes)
- Accept "localhost" as a valid URL
- Better feedback when --sync an URL which is streaming
- Removed cgi dependency (soon deprecated)
- Fix: crash with some svg data:image (which are now ignored)
- Fix images from "full" mode not being downloaded
- Fix a crash when ls on empty page (thanks Marty Oehme)
- Fix: A variable was not initialised without python-cryptography
- Fix: "cp raw" was not accessing the temp_file correctly
- Fix: ANSI handling off arrows in readline (by Ben Winston)
## 1.7.1 - November 15th 2022
- Correcting a stupid crash in search (thanks kelbot for the report)
## 1.7 - November 15th 2022
- New "search" command which uses kennedy.gemi.dev by default.
- New "wikipedia" command, which uses vault.transjovian.org by default.
- Aliases "wen", "wfr" and "wes" for Wikipedia in English, French and Spanish.
- Autocompletion for the list/add/move commands (thats incredibly useful!)
- If a link is found in plain text in a gopher/gemini page, it is now
added to the list of links for that page. Useful for gopher.
- Create system lists when needed to avoid failure on clean system
- Solve a crash when parsing wrong URL (related to bug #9 )
- Solve a crash when loading webpages with empty links
- Solve a crash when trying to load a wrong URL into tour
=> gemini://ploum.be/2022-11-15-offpunk17-sourcehut.gmi
## 1.6 - October 12th 2022
- Support for base64 encoded pictures in HTML pages (opening them full screen only works offline)
- A list can be added to a tour with "tour $LIST_NAME".
- Check for timg > 1.3.2 to avoid dealing with old versions (bug reported by Valvin)
- Redirect are now honoured also when --sync (bug #15, thanks kelbot)
- RSS feeds are now automatically downloaded with a webpage (bug #14)
- Solved the bug where an invalid URL would break correspondance between url and numbers
- Considers .xml files as feed by default to avoid false-detection as SVG
- Replaced default libreddit.com redirection to teddit.net (bug #12 by kelbot)
- The "beta" option has been removed as it is not used (update your config if needed)
## 1.5 - August 4th 2022
- Removed optional dependency to ripgrep. "grep --color=auto" is good enough.
- "open url" to open current URL in a browser with xdg-open
- "redirect" now replaces "set redirects" to improve discoverability
- "redirect" now allows urls to be blocked. By default, facebook.com and google-analytics.com are blocked
- Fixed a bug when trying to download base64 image
=> gemini://rawtext.club/~ploum/2022-08-04-offpunk15.gmi
## 1.4 - April 25th 2022
- Making python-readability optional
- Removing "next" and "previous" which are quite confusing and not obvious
- Archiving now works regardless of the view you are in.
- Fixing a crash when accessing an empty html page
- Not trying to display non-image files to avoid errors. (this requires "file")
## 1.3 - April 2th 2022
- Removed dependency to python-magic. File is now used directly (and should be on every system).
- Removed dependency to python-editor. If no $VISUAL or $EDITOR, please use "set editor" in Offpunk.
- Images are now downloaded before displaying an HTML page (can be disabled with "set download_images_first False")
- Introduced "set redirects" which redirects twitter,youtube,medium,reddit to alternative frontends.
- New behaviour for "find" (or "/") which is to grep through current page (ripgrep used if detected)
- Default width set to 80 as many gopherholes and gemini capsules have it hardcoded
- Streaming URL without valid content-length are now closed after 5Mo of download (thanks to Eoin Carney for reporting the issue)
- Gif animations are now displayed once when viewed (instead of a still frame).
- Restored some AV-98 certificate validation code that was lost Idont know how.
- Improved clarity of dependencies in "version"
- Fixed a crash when the cache is already a dir inside a dir.
- Fixed a crash when manually entering an unknown gopher URL while offline
- Fixed an error with older less version
- Fixed bookmarks not being automatically created at first "add"
- Call to shell commands has been refactorised to improve compatibility with python 3.6 (with testing from Pelle Nilsson)
- requirements.txt has been contributed by Toby Kurien. Thanks!
=> gemini://rawtext.club/~ploum/2022-04-02-offpunk13.gmi
## 1.2 - March 24th 2022
Very experimental release:
- Completely rewritten the HMTL, Gemtext and Gopher renderer. Tests needed!
- Removed dependancy to ansiwrap. We dont use it anymore (which is an important achievement)
- Lists are now accessed via the protocol "list://".
- "view full" can now be bookmarked/synchronized as a separate entity.
- "view normal" introduced to get back to the normal view.
Small improvements:
- Limit width of --sync output
- Solved list names becoming very long in the history
- Fixed a crash when trying to save a folder
=> gemini://rawtext.club/~ploum/2022-03-24-ansi_html.gmi
## 1.1 - March 18th 2022
- Perfect rendering of pictures with chafa 1.8+ and compatible terminal (Kitty)
- timg is supported as an alternative to chafa (with a little glitch)
- "cp cache" put the path of the cached content in clipboard
- "cp url X" will copy the URL of link X (suggested by Eoin Carney)
- "fold" has been removed as it doesnt work well and can be replaced with "!fold".
- Improved clipboard URL detection an fixed crash when binary in clipboard
- HTML: renderering of <pre> has been improved
- HTML: links in titles were previously missed
- Fixed crash when chafa is not installed (Thanks Xavier Hinault for the report)
- Fixed crash when python-readability not installed (Thanks Nic for the report)
- Fixed some gif not being displayed
- Fixed some URL being wronlgy interpreted as IPv6
## 1.0 - March 14th 2022
- Default width is now the standard 72
- Content and pictures now centered for more elegant reading
- "less" has been renamed "view"
- "view feed" and "view feeds" to see the first/all feeds on a HTML page
- "view full" has been improved by dropping inline CSSand JS.
- "up" can now take integer as argument to go up multiple steps.
- Fixed a crash when accessing links in list (thanks Matthieu Talbot for the report)
- Fixed a crash in "info" due to a typo in a variable name rarely accessed.
- Removed dependancy to python-xdg by implementing the logic (which saved lines of code!)
- python-pil is only needed if chafa < 1.10
=> gemini://rawtext.club/~ploum/2022-03-14-offpunk_and_cyberpunk.gmi
## 0.9 - March 05th 2022
- Initial Spartan protocol support
- Http links with content above 20Mo are not downloaded during sync (except when explicitely requested)
- Improving subscriptions with more feedback and better detection
- Avoid deprecated SSL methods (thanks Phoebos for the report)
- Links in to_fetch are fetched, no matter the cache
- Fixed multiple crashes
=> gemini://rawtext.club/~ploum/2022-03-05-offpunk09.gmi
## 0.4 - Feb 21st 2022
UPGRADE: Users who subscribed to pages before 0.4 should run once the command "list subscribe subscribed". Without that, the subscribed list will be seen as a normal list by sync.
- New list command : "list freeze" and "list suscribe"
- Pictures are now displayed directely in terminal (suggested by kelbot)
- "open" command to open current page/image/file with external handler.
- "set width XX" now works to set the max width. If smaller, terminal width is used (thanks kelbot for reporting the bug)
- RSS feeds are now rendered as Gemlogs to improve consistency while browsing
- "subscribe" will detect feeds in html pages if any
- "less" will restore previous position in a page (requires less 572+)
- Improved syncing performances and multiple bug/crash fixes.
- "version" will now display info about your system installation
- "info" command will display technical information about current page
- "sync" allows you to do the sync from within Offpunk
=> gemini://rawtext.club/~ploum/2022-02-21-offpunk04.gmi
## 0.3 - Feb 11th 2022
New Features:
- Gopher supported natively (early version, might have many bugs)
- support for RSS and Atom feed (you can subscribe to them)
- "less full" allows to see the full html page instead of only the article view
(also works with feeds to see descriptions of each post instead of a simple list)
- Option --depth to customize your sync. Be warned, more than 1 is crazy.
- Option --disable-http to allows deep syncing of gemini-only ressources
- Vastly improved HTML rendering with support for images (you need the binary "chafa" on your system)
Other Small Improvements:
- Disabled https_everywhere by default (caching problems and some websites not supporting it)
- Modified --sync logic to make it more intuitive (thanks Bjorn Westergard)
- Caching more problems to avoid refetch
- Offpunk has now an User-Agent when http browsing to avoid being blocked as a bot
- Changed XDG logic to improve compatibility (thanks Klaus Alexander)
=> gemini://rawtext.club/~ploum/2022-02-11-offpunk03.gmi
## 0.2 - Jan 31st 2022
- config directories have been moved to follow the XDG specifications
- support for http, https and mailto links (https_everywhere is enabled by default, see "set" command)
- support for HTML pages, rendered as articles
- Mutiple bookmarks lists and management of them through commands list, add, archive, move
- Subscriptions have been moved to a separate list with the subscribe command
- History is persistent and saved to disk
- Copy command allows to copy content or url into buffer
- Search as been renamed find, in the hope of implementing a real search in the future
- --fetch-later allows to mark a content to be fetched from other software.
- --assume-yes allows to choose the default answer to certificates warnings during --sync.
=> gemini://rawtext.club/~ploum/2022-01-31-offpunk02.gmi Announcing Offpunk 0.2
## 0.1 - Jan 3rd 2022
- initial release as an independant software from AV-98 (thanks solarpunk)
- Including contributions published by Bjorn on Notabug (thanks ew0k)
- less used by default for all content with custom options
- online/offline mode
- content is cached for offline use
- bookmarks are cached and subscribed through the --sync option
- tour is persistent and saved to disk
- reload while offline mark the content to be fetched during next --sync
=> gemini://rawtext.club/~ploum/2022-01-03-offpunk.gmi Announce of Offpunk 0.1

View File

@ -1,4 +1,6 @@
Copyright (c) 2020, Solderpunk <solderpunk@sdf.org> and contributors.
BSD 2-Clause License
Copyright (c) 2022, Ploum <offpunk@ploum.eu> and contributors.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,

151
README.md
View File

@ -1,62 +1,125 @@
# AV-98
# OFFPUNK
AV-98 is an experimental client for the
[Gemini protocol](https://gemini.circumlunar.space). It is derived from the
[gopher client VF-1](https://github.com/solderpunk/VF-1) by the same author.
AV-98 is "experimental" in the sense that it may occasionally extend or deviate
from the official Gemini specification for the purposes of, well,
experimentation. Despite this, it is expected to be stable enough for regular
daily use at the same time.
A command-line and offline-first smolnet browser/feed reader for Gemini, Gopher, Spartan and Web by [Ploum](https://ploum.net).
The goal of Offpunk is to be able to synchronise your content once (a day, a week, a month) and then browse/organise it while staying disconnected.
Official project page (repository/mailing lists) : https://sr.ht/~lioploum/offpunk/
![Screenshot HTML page with picture](screenshot_offpunk1.png)
![Screenshot Gemini page](screenshot_offpunk2.png)
Offpunk is a fork of the original [AV-98](https://tildegit.org/solderpunk/AV-98) by Solderpunk and was originally called AV-98-offline as an experimental branch.
## How to use
Offpunk is a single python file. Installation is optional, you can simply download and run "./offpunk.py" or "python3 offpunk.py" in a terminal.
You use the `go` command to visit a URL, e.g. `go gemini.circumlunar.space`. (gemini:// is assumed if no protocol is specified. Supported protocols are gemini, gopher, finger, http, https, mailto, spartan and file).
Links in pages are assigned numerical indices. Just type an index to follow that link. If page is too long to fit on your screen, the content is displayed in the less pager (by default). Type `q` to quit and go back to Offpunk prompt. Type `view` or `v` to display it again. (`view full` or `v full` allows to see the full html page instead of the article view. `v feed` try to display the linked RSS feed and `v feeds` displays a list of available feeds. This only applies to html pages)
Use `add` to add a capsule to your bookmarks and `bookmarks` or `bm` to show your bookmarks (you can create multiple bookmarks lists, edit and remove them. See the `list` manual with `help list`).
Use `offline` to only browse cached content and `online` to go back online. While offline, the `reload` command will force a re-fetch during the next synchronisation.
Use the `help` command to learn about additional commands. Some abreviations are available. See `abbrevs`.
When launched with the "--sync" option, offpunk will run non-interactively and fetch content from your bookmarks, lists and ressources tentatively accessed while offline. New content found in your subscriptions (see `help subscribe`) will be automatically added to your tour (use `tour ls` to see your current tour, `tour` without argument to access the next item and `tour X` where X is a link number to add the content of a link to your tour).
With "--sync", one could specify a "--cache validity" in seconds. This option will not refresh content if a cache exists and is less than the specified amount of seconds old.
For example, running
`offpunk --sync --cache-validity 43200`
will refresh your bookmarks if those are at least 12h old. If cache-validity is not set or set to 0, any cache is considered good and only content never cached before will be fetched. `--assume-yes` will automatically accept SSL certificates with errors instead of refusing them.
Offpunk can also be configured as a browser by other tool. If you want to use offpunk directly with a given URL, simply type:
`offpunk URL`
To have offpunk fetch the URL at next sync and close immediately, run:
`offpunk --fetch-later URL`
## More
Important news and releases will be announced on the offpunk-devel mailing list
=> https://lists.sr.ht/~lioploum/offpunk-devel
Questions can be asked on the users mailing list:
=> https://lists.sr.ht/~lioploum/offpunk-users
## Dependencies
AV-98 has no "strict dependencies", i.e. it will run and work without anything
else beyond the Python standard library. However, it will "opportunistically
Offpunk has no "strict dependencies", i.e. it should run and work without anything
else beyond the Python standard library and the "less" pager. However, it will "opportunistically
import" a few other libraries if they are available to offer an improved
experience.
experience or some other features. Python libraries requests, bs4 and readability are required for http/html support. Images are displayed if chafa or timg are presents (python-pil is needed for chafa version before 1.10). When displaying only a picture (not inline), rendering will be pixel perfect in compatible terminals (such as Kitty) if chafa is at least version 1.8 or if timg is used.
* The [ansiwrap library](https://pypi.org/project/ansiwrap/) may result in
neater display of text which makes use of ANSI escape codes to control colour.
* The [cryptography library](https://pypi.org/project/cryptography/) will
provide a better and slightly more secure experience when using the default
TOFU certificate validation mode and is highly recommended.
To avoid using unstable or too recent libraries, the rule of thumb is that a library should be packaged in Debian/Ubuntu. Keep in mind that Offpunk is mainly tested will all libraries installed. If you encounter a crash without one optional dependencies, please report it. Patches and contributions to remove dependencies or support alternatives are highly appreciated.
* PIP: [requirements file to install dependencies with pip](requirements.txt)
* Debian Unstable: [Official Package by Étienne Mollier](https://packages.debian.org/sid/offpunk)
* Ubuntu/Debian: [command to install dependencies on Ubuntu/Debian without pip](ubuntu_dependencies.txt)
* Arch: [AUR package for Arch Linux, maintained by kseistrup](https://aur.archlinux.org/packages/offpunk-git)
* [Nix](https://nixos.org/): [package](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/networking/browsers/offpunk/default.nix), maintained by [DamienCassou](https://github.com/DamienCassou)
* Alpine Linux: [package maintained by mio](https://pkgs.alpinelinux.org/packages?name=offpunk)
* Please contribute packages for other systems, theres a [mailing-list dedicated to packaging](https://lists.sr.ht/~lioploum/offpunk-packagers).
Run command `version` in offpunk to see if you are missing some dependencies.
Mandatory or highly recommended (packagers should probably make those mandatory):
* [less](http://www.greenwoodsoftware.com/less/): mandatory but is probably already on your system
* [file](https://www.darwinsys.com/file/) is used to get the MIME type of cached objects. Should already be on your system.
* [xdg-utils](https://www.freedesktop.org/wiki/Software/xdg-utils/) provides xdg-open which is highly recommended to open files without a renderer or a handler. It is also used for mailto: command.
* The [cryptography library](https://pypi.org/project/cryptography/) will provide a better and slightly more secure experience when using the default TOFU certificate validation mode and is recommended (apt-get install python3-cryptography).
Dependencies to enable web browsing (packagers may put those in an offpunk-web meta-package but it is recommended to have it for a better offpunk experience)
* [Python-requests](http://python-requests.org) is needed to handle http/https requests natively (apt-get install python3-requests). Without it, http links will be opened in an external browser
* [BeautifulSoup4](https://www.crummy.com/software/BeautifulSoup) and [Readability](https://github.com/buriy/python-readability) are both needed to render HTML. Without them, HTML will not be rendered or be sent to an external parser like Lynx. (apt-get install python3-bs4 python3-readability or pip3 install readability-lxml)
* [Python-feedparser](https://github.com/kurtmckee/feedparser) will allow parsing of RSS/Atom feeds and thus subscriptions to them. (apt-get install python3-feedparser)
* [Chafa](https://hpjansson.org/chafa/) allows to display pictures in your console. Install it and browse to an HTML page with picture to see the magic.
* [Timg](https://github.com/hzeller/timg) is a slower alternative to chafa for inline images. But it has better rendering when displaying only the image. Install both to get the best of both world but if you need to choose one, choose Chafa.
* [Python-pil](http://python-pillow.github.io/) is required to only display the first frame of animated gif with chafa if chafa version is lower than 1.10.
Nice to have (packagers should may make those optional):
* [Xsel](http://www.vergenet.net/~conrad/software/xsel/) allows to `go` to the URL copied in the clipboard without having to paste it (both X and traditional clipboards are supported). Also needed to use the `copy` command. (apt-get install xsel)
* [Python-setproctitle](https://github.com/dvarrazzo/py-setproctitle) will change the process name from "python" to "offpunk". Useful to kill it without killing every python service.
* [Python-chardet](https://github.com/chardet/chardet) is used to detect the character encoding on Gopher (and may be used more in the future)
## Features
* TOFU or CA server certificate validation
* Extensive client certificate support if an `openssl` binary is available
* Ability to specify external handler programs for different MIME types
* Gopher proxy support (e.g. for use with
[Agena](https://tildegit.org/solderpunk/agena))
* Advanced navigation tools like `tour` and `mark` (as per VF-1)
* Bookmarks
* Browse https/gemini/gopher/spartan without leaving your keyboard and without distractions
* Built-in documentation: type `help` to get the list of command or a specific help about a command.
* Offline mode to browse cached content without a connection. Requested elements are automatically fetched during the next synchronization and are added to your tour.
* HTML pages are prettified to focus on content. Read without being disturbed or see the full page with `view full`.
* RSS/Atom feeds are automatically discovered by `subscribe` and rendered as gemlogs. They can be explored with `view feed` and `view feeds`.
* Support "subscriptions" to a page. New content seen in subscribed pages are automatically added to your next tour.
* Complex bookmarks management through multiple lists, built-in edition, subscribing/freezing lists and archiving content.
* Advanced navigation tools like `tour` and `mark` (as per VF-1). Unlike AV-98, tour is saved on disk accross sessions.
* Ability to specify external handler programs for different MIME types (use `handler`)
* Enhanced privacy with `redirect` which allows to block a http domain or to redirect all request to a privacy friendly frontent (such as nitter for twitter).
* Non-interactive cache-building with configurable depth through the --sync command. The cache can easily be used by other software.
* IPv6 support
* Supports any character encoding recognised by Python
## Lightning introduction
You use the `go` command to visit a URL, e.g. `go gemini.circumlunar.space`.
Links in Gemini documents are assigned numerical indices. Just type an index to
follow that link.
If a Gemini document is too long to fit on your screen, use the `less` command
to pipe it to the `less` pager.
Use the `help` command to learn about additional commands.
* Cryptography : TOFU or CA server certificate validation
* Cryptography : Extensive client certificate support if an `openssl` binary is available
## RC files
You can use an RC file to automatically run any sequence of valid AV-98
You can use an RC file to automatically run any sequence of valid Offpunk
commands upon start up. This can be used to make settings controlled with the
`set` or `handler` commanders persistent. You can also put a `go` command in
your RC file to visit a "homepage" automatically on startup, or to pre-prepare
a `tour` of your favourite Gemini sites.
a `tour` of your favourite Gemini sites or `offline` to go offline by default.
The RC file should be called `offpunkrc` and goes in $XDG_CONFIG_DIR/offpunk (or .config/offpunk or .offpunk if xdg not available). In that file, simply write one command per line, just like you would type them in offpunk.
## Cache design
The offline content is stored in ~/.cache/offpunk/ as plain .gmi/.html files. The structure of the Gemini-space is tentatively recreated. One key element of the design is to avoid any database. The cache can thus be modified by hand, content can be removed, used or added by software other than offpunk.
Theres no feature to automatically trim the cache. But part of the cache can safely be removed manually.
The RC file should be called `av98rc`. AV-98 will look for it first in
`~/.av98/` and second in `~/.config/av98/`. Note that either directory might
already exist even if you haven't created it manually, as AV-98 will, if
necessary, create the directory itself the first time you save a bookmark (the
bookmark file is saved in the same location). AV-98 will create
`~/.config/av98` only if `~/.config/` already exists on your system, otherwise
it will create `~/.av98/`.

1388
ansirenderer.py Executable file

File diff suppressed because it is too large Load Diff

1654
av98.py

File diff suppressed because it is too large Load Diff

0
doc/config.gmi Normal file
View File

0
doc/dev.gmi Normal file
View File

17
doc/index.gmi Normal file
View File

@ -0,0 +1,17 @@
# OFFPUNK - An Offline-First Browser for the Smolnet
Offpunk is a command-line browser and feed reader dedicated to browsing the Web, Gemini, Gopher and Spartan. Thanks to its permanent cache, it is optimised to be used offline with rare connections but works as well when connected.
Offpunk is optimised for reading and supports readability mode, displaying pictures, subscribing to pages or RSS feeds, managing complex lists of bookmarks. Its integrated help and easy commands make it a perfect tool for command-line novices while power-users will be amazed by its shell integration.
Offpunk is written in Python 3 by Ploum. It aims to be portable and minimise dependencies, making them optional. It supports http/https/gopher/gemini/spartan on both IPv4 and IPv6.
=> install.gmi Installing Offpunk and dependencies
=> tutorial.gmi First steps
=> config.gmi Configuring Offpunk
=> offline.gmi Using Offpunk offline
=> lists.gmi Lists and subscriptions
=> shell.gmi Shell and OS integrations
=> dev.gmi Roadmap & Contributions

0
doc/install.gmi Normal file
View File

0
doc/lists.gmi Normal file
View File

0
doc/offline.gmi Normal file
View File

0
doc/shell.gmi Normal file
View File

0
doc/tutorial.gmi Normal file
View File

89
man/offpunk.1 Normal file
View File

@ -0,0 +1,89 @@
.Dd March 3, 2023
.Dt OFFPUNK 1
.Os
.
.Sh NAME
.Nm offpunk
.Nd command line gemini client
.
.Sh SYNOPSIS
.Nm
.Op Fl \-bookmarks
.Op Fl \-tls\-cert Ar FILE
.Op Fl \-tls\-key Ar FILE
.Op Fl \-sync
.Op Fl \-assume\-yes
.Op Fl \-disable\-http
.Op Fl \-fetch\-later
.Op Fl \-depth Ar DEPTH
.Op Fl \-cache\-validity Ar CACHE_VALIDITY
.Op Ar URL ...
.Nm
.Fl h | \-help
.Nm
.Fl \-version
.Nm
.Fl \-features
.
.Sh DESCRIPTION
Offpunk is a command-line browser and feed reader dedicated to browsing the Web,
Gemini, Gopher and Spartan.
Thanks to its permanent cache, it is optimised to be used offline with rare
connections but works as well when connected.
.Pp
Offpunk is optimised for reading and supports readability mode, displaying
pictures, subscribing to pages or RSS feeds,
managing complex lists of bookmarks.
Its integrated help and easy commands make it a perfect tool for command-line
novices while power-users will be amazed by its shell integration.
.Ss Positional arguments
.Bl -tag -width Ds -offset indent
.It URL
start with this URL
.El
.Ss Keyword arguments
.Bl -tag -width Ds -offset indent
.It Fl h , \-help
Show a help message and exit
.It Fl \-bookmarks
start with your list of bookmarks
.It Fl \-tls\-cert Ar FILE
TLS client certificate file
.It Fl \-tls\-key Ar FILE
TLS client certificate private key file
.It Fl \-sync
run non\-interactively to build cache by exploring bookmarks
.It Fl \-assume\-yes
assume\-yes when asked questions about certificates/redirections during sync
(lower security)
.It Fl \-disable\-http
do not try to get http(s) links (but already cached will be displayed)
.It Fl \-fetch\-later
run non\-interactively with an URL as argument to fetch it later
.It Fl \-depth Ar DEPTH
depth of the cache to build.
Default is 1.
More is crazy.
Use at your own risks!
.It Fl \-cache\-validity Ar CACHE_VALIDITY
duration for which a cache is valid before sync (seconds)
.It Fl \-version
display version information and quit
.It Fl \-features
display available features and dependancies then quit
.El
.
.Sh EXIT STATUS
.Ex -std
.
.Sh SEE ALSO
.Lk https://sr.ht/~lioploum/offpunk/
.
.Sh HISTORY
.Nm
is a fork of the original AV-98 by
.An Solderpunk
and was originally called AV-98-offline as an experimental branch.
.
.Sh AUTHORS
.An Lionel Dricot (Ploum) Aq Mt offpunk@ploum.eu

47
migrate-offpunk-cache Executable file
View File

@ -0,0 +1,47 @@
#!/usr/bin/env python3
# SPDX-FileCopyrightText: 2023 Sotiris Papatheodorou
# SPDX-License-Identifier: BSD-2-Clause
"""
A script to migrate the offpunk cache to the newest version.
For each new version of offpunk that requires changes to the cache a migration
function should be written. The name of the function should have the format
v<major-version>_<minor-version>_<patch-version> and it should accept the
offpunk cache directory as a string. The function should perform a migration
from the immediately previous cache format. All migration functions must be
called at the end of this script from oldest to newest.
"""
import argparse
import os
import os.path
def v1_10_0(cache_dir: str) -> None:
"""
Rename index.txt to gophermap in the Gopher protocol cache.
"""
for root, _, files in os.walk(os.path.join(cache_dir, 'gopher')):
for f in files:
if f == 'index.txt':
src = os.path.join(root, f)
dst = os.path.join(root, 'gophermap')
os.rename(src, dst)
if __name__ == '__main__':
# Compute the default offpunk cache directory.
xdg_cache_home = os.environ.get('XDG_CACHE_HOME')
if xdg_cache_home:
default_cache_dir = os.path.join(xdg_cache_home, 'offpunk')
else:
default_cache_dir = os.path.join(os.path.expanduser('~'), '.cache/offpunk')
# Parse command line arguments.
parser = argparse.ArgumentParser(
description='Migrate the offpunk cache to a newer version.')
parser.add_argument('cache_dir', metavar='CACHE_DIR', nargs='?',
default=default_cache_dir, help='the path to the cache')
args = parser.parse_args()
# Run the cache migration functions from the oldest to the newest version.
v1_10_0(args.cache_dir)

1064
netcache.py Executable file

File diff suppressed because it is too large Load Diff

2013
offpunk.py Executable file

File diff suppressed because it is too large Load Diff

57
offutils.py Normal file
View File

@ -0,0 +1,57 @@
#!/bin/python
#This file contains some utilities common to offpunk, ansirenderer and netcache.
#Currently, there are the following utilities:
#
# run : run a shell command and get the results with some security
# term_width : get or set the width to display on the terminal
import os
import io
import subprocess
import shutil
import shlex
# In terms of arguments, this can take an input file/string to be passed to
# stdin, a parameter to do (well-escaped) "%" replacement on the command, a
# flag requesting that the output go directly to the stdout, and a list of
# additional environment variables to set.
def run(cmd, *, input=None, parameter=None, direct_output=False, env={}):
#print("running %s"%cmd)
if parameter:
cmd = cmd % shlex.quote(parameter)
#following requires python 3.9 (but is more elegant/explicit):
# env = dict(os.environ) | env
e = os.environ
e.update(env)
if isinstance(input, io.IOBase):
stdin = input
input = None
else:
if input:
input = input.encode()
stdin = None
if not direct_output:
# subprocess.check_output() wouldn't allow us to pass stdin.
result = subprocess.run(cmd, check=True, env=e, input=input,
shell=True, stdin=stdin, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
return result.stdout.decode()
else:
subprocess.run(cmd, env=e, input=input, shell=True, stdin=stdin)
global TERM_WIDTH
TERM_WIDTH = 80
def term_width(new_width=None):
if new_width:
global TERM_WIDTH
TERM_WIDTH = new_width
width = TERM_WIDTH
cur = shutil.get_terminal_size()[0]
if cur < width:
width = cur
return width

39
opnk.py Normal file
View File

@ -0,0 +1,39 @@
#!/bin/python
#opnk stand for "Open like a PuNK".
#It will open any file or URL and display it nicely in less.
#If not possible, it will fallback to xdg-open
#URL are retrieved through netcache
import netcache
import offutils
class opencache():
def __init__(self):
self.temp_files = {}
self.rendererdic = {}
def opnk(inpath,terminal=True):
#if terminal = False, we dont try to open in the terminal,
#we immediately fallback to xdg-open.
#netcache currently provide the path if its a file.
#may this should be migrated here.
path = netcache.get_cache_path(inpath)
#TODO: migrate here ansirenderer display
1. À partir du path, tenter le ansirenderer
2. Sauver le rendu dans self.temp_files[mode] (donc le mode doit être passé à opnk)
3. Sauver le renderer dans self.rendererdic
3. Donner à less
4. sinon, donner à xdg-open
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("content",metavar="INPUT", nargs="*", type=argparse.FileType("r"),
default=sys.stdin, help="Path to the file or URL to open")
args = parser.parse_args()
cache = opencache()
for f in args.content:
cache.opnk(f)
if __name__ == "__main__":
main()

49
pyproject.toml Normal file
View File

@ -0,0 +1,49 @@
[build-system]
requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"
[project]
name = "offpunk"
authors = [
{name = "Solderpunk", email = "solderpunk@sdf.org"},
{name = "Lionel Dricot (Ploum)", email = "offpunk@ploum.eu"},
]
maintainers = [
{name = "Lionel Dricot (Ploum)", email = "offpunk@ploum.eu"},
]
readme = "README.md"
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Communications",
"Topic :: Internet",
]
keywords = ["gemini", "browser"]
requires-python = ">=3.7"
dynamic = ["version", "description"]
[project.license]
file = "LICENSE"
[project.optional-dependencies]
better-tofu = ["cryptography"]
chardet = ["chardet"]
html = ["bs4", "readability-lxml"]
http = ["requests"]
process-title = ["setproctitle"]
rss = ["feedparser"]
timg = ["timg>=1.3.2"]
[project.urls]
Homepage = "https://sr.ht/~lioploum/offpunk/"
Source = "https://git.sr.ht/~lioploum/offpunk"
"Bug Tracker" = "https://todo.sr.ht/~lioploum/offpunk"
[project.scripts]
offpunk = "offpunk:main"
[tool.flit.sdist]
include = ["doc/", "man/", "CHANGELOG"]

9
requirements.txt Normal file
View File

@ -0,0 +1,9 @@
chardet
cryptography
requests
feedparser
bs4
readability-lxml
pillow
setproctitle
timg

BIN
screenshot_offpunk1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

BIN
screenshot_offpunk2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

View File

@ -1,23 +0,0 @@
from setuptools import setup
setup(
name='AV-98',
version='1.0.2dev',
description="Command line Gemini client.",
author="Solderpunk",
author_email="solderpunk@sdf.org",
url='https://tildegit.org/solderpunk/AV-98/',
classifiers=[
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 3 :: Only',
'Topic :: Communications',
'Intended Audience :: End Users/Desktop',
'Environment :: Console',
'Development Status :: 4 - Beta',
],
py_modules = ["av98"],
entry_points={
"console_scripts": ["av98=av98:main"]
},
install_requires=[],
)

1
ubuntu_dependencies.txt Normal file
View File

@ -0,0 +1 @@
sudo apt install less file xdg-utils xsel chafa timg python3-cryptography python3-requests python3-feedparser python3-bs4 python3-readability python3-pil python3-setproctitle python3-chardet