offpunk 2.4__tar.gz → 2.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. {offpunk-2.4 → offpunk-2.6}/CHANGELOG +32 -0
  2. {offpunk-2.4 → offpunk-2.6}/PKG-INFO +56 -76
  3. offpunk-2.6/README.md +114 -0
  4. offpunk-2.6/TODO +34 -0
  5. {offpunk-2.4 → offpunk-2.6}/ansicat.py +591 -414
  6. {offpunk-2.4 → offpunk-2.6}/cert_migration.py +3 -2
  7. {offpunk-2.4 → offpunk-2.6}/man/ansicat.1 +13 -11
  8. {offpunk-2.4 → offpunk-2.6}/man/netcache.1 +32 -18
  9. {offpunk-2.4 → offpunk-2.6}/man/offpunk.1 +13 -7
  10. {offpunk-2.4 → offpunk-2.6}/man/opnk.1 +14 -15
  11. {offpunk-2.4 → offpunk-2.6}/netcache.py +387 -263
  12. {offpunk-2.4 → offpunk-2.6}/netcache_migration.py +3 -4
  13. {offpunk-2.4 → offpunk-2.6}/offpunk.py +836 -635
  14. {offpunk-2.4 → offpunk-2.6}/offutils.py +129 -71
  15. {offpunk-2.4 → offpunk-2.6}/opnk.py +156 -80
  16. {offpunk-2.4 → offpunk-2.6}/pyproject.toml +7 -0
  17. offpunk-2.6/requirements-dev.txt +2 -0
  18. {offpunk-2.4 → offpunk-2.6}/requirements.txt +0 -1
  19. offpunk-2.6/screenshots/decvt220bis.jpg +0 -0
  20. offpunk-2.6/tests/geminiclient_test.py +50 -0
  21. offpunk-2.6/tutorial/gemini.gmi +23 -0
  22. {offpunk-2.4 → offpunk-2.6}/tutorial/index.gmi +3 -1
  23. {offpunk-2.4 → offpunk-2.6}/tutorial/subscriptions.gmi +4 -5
  24. offpunk-2.6/tutorial/sync.gmi +25 -0
  25. {offpunk-2.4 → offpunk-2.6}/tutorial/tour3.gmi +4 -0
  26. {offpunk-2.4 → offpunk-2.6}/tutorial/view.gmi +3 -2
  27. offpunk-2.6/tutorial/workflow_jmcs.gmi +110 -0
  28. {offpunk-2.4 → offpunk-2.6}/tutorial/workflow_ploum.gmi +1 -1
  29. {offpunk-2.4 → offpunk-2.6}/ubuntu_dependencies.txt +1 -1
  30. offpunk-2.4/README.md +0 -134
  31. {offpunk-2.4 → offpunk-2.6}/.build.yml +0 -0
  32. {offpunk-2.4 → offpunk-2.6}/.gitignore +0 -0
  33. {offpunk-2.4 → offpunk-2.6}/CONTRIBUTORS +0 -0
  34. {offpunk-2.4 → offpunk-2.6}/LICENSE +0 -0
  35. {offpunk-2.4 → offpunk-2.6}/debug.sh +0 -0
  36. {offpunk-2.4 → offpunk-2.6}/doc/config.gmi +0 -0
  37. {offpunk-2.4 → offpunk-2.6}/doc/dev.gmi +0 -0
  38. {offpunk-2.4 → offpunk-2.6}/doc/index.gmi +0 -0
  39. {offpunk-2.4 → offpunk-2.6}/doc/install.gmi +0 -0
  40. {offpunk-2.4 → offpunk-2.6}/doc/lists.gmi +0 -0
  41. {offpunk-2.4 → offpunk-2.6}/doc/offline.gmi +0 -0
  42. {offpunk-2.4 → offpunk-2.6}/doc/shell.gmi +0 -0
  43. {offpunk-2.4 → offpunk-2.6}/doc/tutorial.gmi +0 -0
  44. {offpunk-2.4 → offpunk-2.6}/offblocklist.py +0 -0
  45. {offpunk-2.4 → offpunk-2.6}/offthemes.py +0 -0
  46. {offpunk-2.4 → offpunk-2.6}/screenshots/1.png +0 -0
  47. {offpunk-2.4 → offpunk-2.6}/screenshots/2.png +0 -0
  48. {offpunk-2.4 → offpunk-2.6}/screenshots/decvt220.jpg +0 -0
  49. {offpunk-2.4 → offpunk-2.6}/tutorial/bookmarks.gmi +0 -0
  50. {offpunk-2.4 → offpunk-2.6}/tutorial/firststeps.gmi +0 -0
  51. {offpunk-2.4 → offpunk-2.6}/tutorial/frozen.gmi +0 -0
  52. {offpunk-2.4 → offpunk-2.6}/tutorial/install.gmi +0 -0
  53. {offpunk-2.4 → offpunk-2.6}/tutorial/lists.gmi +0 -0
  54. {offpunk-2.4 → offpunk-2.6}/tutorial/make_website.py +1 -1
  55. {offpunk-2.4 → offpunk-2.6}/tutorial/myfirstlink.gmi +0 -0
  56. {offpunk-2.4 → offpunk-2.6}/tutorial/offline.gmi +0 -0
  57. {offpunk-2.4 → offpunk-2.6}/tutorial/open.gmi +0 -0
  58. {offpunk-2.4 → offpunk-2.6}/tutorial/page_template.html +0 -0
  59. {offpunk-2.4 → offpunk-2.6}/tutorial/tour.gmi +0 -0
  60. {offpunk-2.4 → offpunk-2.6}/tutorial/tour1.gmi +0 -0
  61. {offpunk-2.4 → offpunk-2.6}/tutorial/tour2.gmi +0 -0
  62. {offpunk-2.4 → offpunk-2.6}/tutorial/whatisoffpunk.gmi +0 -0
@@ -1,5 +1,37 @@
1
1
  # Offpunk History
2
2
 
3
+ ## 2.6 - February 24th 2025
4
+ FOR PACKAGERS: dependency to python-pil (or pillow) has been dropped
5
+ - NEW BEHAVIOUR: not rendered ressources (like PDF) are not opened automatically.
6
+ The user is prompted to type "open" to see the ressource. This allows the ressource
7
+ to be part of history, be bookmarked, etc…
8
+ Offpunk:
9
+ - new "--command" command-line argument to immediately launch one or multiple commands
10
+ - "add" now accepts link number as a second argument (suggested by JMCS)
11
+ - "url" now accepts link number as an argument (suggested by JMCS)
12
+ - "url" can be piped to any shell command: "url|" or "url 121|" (suggestion of Stephen)
13
+ Ansicat and rendering:
14
+ - new "preformat_wrap" option available to wrap even <pre>
15
+ - PlainText rendering has been vastly improved with wrap, margin and link detection
16
+ - fix wrong wraping in gophermap (patch by JMCS)
17
+ Opnk and opening files:
18
+ note: "opnk" will be renamed "openk" in 3.0
19
+ - "opnk" now supports following link like in "opnk $URL XX" where XX is a link number.
20
+ - "opnk" is now reading the offpunrc file to use predefined handlers
21
+ - "handler" with now automatically add "%s" at the end of the command if not present
22
+ - "handler" now supports file exension or full mimetype
23
+ Deprecation and removal:
24
+ - removed support for chafa < 1.10, as announced in 2.4. python-pil is not used anymore.
25
+ - removed the "cat" command as it has no purpose (you can use "!cat" instead) and there was a potential crash (reported by Stephen)
26
+ - new "feed" command to replace the "view feed" (which is deprecated)
27
+
28
+ ## 2.5 - January 30th 2025
29
+ - "abbrevs" has been replaced by "alias"
30
+ - "alias" now allows custom command to be aliased
31
+ - PEP8-ification by Vincent Jousse
32
+ - changing "datetime.UTC" to "datetime.timezone.utc" for retrocompatibility with python < 3.11
33
+ - checking if "grep" supports "--color=auto" to supports OpenBSD (reported by Dylan D’Silva)
34
+
3
35
  ## 2.4 - November 21st 2024
4
36
  NEW WEBSITE: Official homepage is now https://offpunk.net (or gemini://offpunk.net). Sources are in the /tutorial/ folder and contributions are welcome.
5
37
  NEW FEATURE: This release includes work by Bert Livens to add gemini client-side certificates (see "help certs"). This means you can browse gemini capsule while being identified (such as astrobotany)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: offpunk
3
- Version: 2.4
3
+ Version: 2.6
4
4
  Dynamic: Summary
5
5
  Project-URL: Homepage, https://offpunk.net/
6
6
  Project-URL: Source, https://git.sr.ht/~lioploum/offpunk
@@ -702,8 +702,8 @@ A command-line and offline-first smolnet browser/feed reader for Gemini, Gopher,
702
702
 
703
703
  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.
704
704
 
705
- Official page : https://offpunk.net
706
- Development (repository/mailing lists) : https://sr.ht/~lioploum/offpunk/
705
+ Official page : [Offpunk.net](https://offpunk.net)
706
+ Development (repository/mailing lists) : [sr.ht](https://sr.ht/~lioploum/offpunk/)
707
707
 
708
708
  ![Screenshot HTML page with picture](screenshots/1.png)
709
709
  ![Screenshot Gemini page](screenshots/2.png)
@@ -712,115 +712,88 @@ Offpunk is a fork of the original [AV-98](https://tildegit.org/solderpunk/AV-98)
712
712
 
713
713
  ## How to use
714
714
 
715
- Offpunk is a set of python files. Installation is optional, you can simply git clone the project and run "./offpunk.py" or "python3 offpunk.py" in a terminal.
715
+ Offpunk is a set of python files. Installation is optional, you can simply git clone the project and run "./offpunk.py" or "python3 offpunk.py" in a terminal. You can also a packaged version:
716
716
 
717
- 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. Default protocol is configurable).
717
+ - [List of existing Offpunk packages (Repology)](https://repology.org/project/offpunk/versions)
718
+ - Please contribute packages for other systems, there’s a [mailing-list dedicated to packaging](https://lists.sr.ht/~lioploum/offpunk-packagers).
718
719
 
719
- 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. 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. `v source` allows you to see the source code of a page and `v normal` to go back to normal view)
720
+ To get started, launch offpunk then type "tutorial".
720
721
 
721
- Use `add` to add a page 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`).
722
+ You can also consults it online: [Offpunk tutorial](https://offpunk.net/firststeps.html)
722
723
 
723
- 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.
724
-
725
- Use the `help` command to learn about additional commands. Some abreviations are available. See `abbrevs`.
726
-
727
- 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).
728
-
729
- 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.
730
-
731
- For example, running
732
-
733
- `offpunk --sync --cache-validity 43200`
734
-
735
- 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.
736
-
737
- Sync can be applied to only a subset of list.
738
-
739
- `offpunk --sync bookmarks tour to_fetch --cache-validity 3600`
740
-
741
- Offpunk can also be configured as a browser by other tool. If you want to use offpunk directly with a given URL, simply type:
742
-
743
- `offpunk URL`
744
-
745
- To have offpunk fetch the URL at next sync and close immediately, run:
746
-
747
- `offpunk --fetch-later URL`
724
+ At any point, you can use "help" to get the list of commands and "help command" to get a small help about "command".
748
725
 
749
726
  ## More
750
727
 
751
- Important news and releases will be announced on the offpunk-devel mailing list
752
- => https://lists.sr.ht/~lioploum/offpunk-devel
728
+ Important news and releases will be announced on the [offpunk-devel mailing list](https://lists.sr.ht/~lioploum/offpunk-devel)
753
729
 
754
- Questions can be asked on the users mailing list:
755
- => https://lists.sr.ht/~lioploum/offpunk-users
730
+ Questions can be asked on [the users mailing](list https://lists.sr.ht/~lioploum/offpunk-users)
756
731
 
757
732
  ## Dependencies
758
733
 
759
734
  Offpunk has few "strict dependencies", i.e. it should run and work without anything
760
- else beyond the Python standard library and the "less" pager. However, it will "opportunistically
761
- import" a few other libraries if they are available to offer an improved
762
- experience or some other features such as HTTP/HTML or image support.
735
+ 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
736
+ experience or some other features such as HTTP/HTML or image support.
763
737
 
764
738
  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.
765
739
 
766
- * [List of existing Offpunk packages (Repology)](https://repology.org/project/offpunk/versions)
767
- * PIP: [requirements file to install dependencies with pip](requirements.txt)
768
- * Ubuntu/Debian: [command to install dependencies on Ubuntu/Debian without pip](ubuntu_dependencies.txt)
769
- * Please contribute packages for other systems, there’s a [mailing-list dedicated to packaging](https://lists.sr.ht/~lioploum/offpunk-packagers).
740
+ - PIP: [requirements file to install dependencies with pip](requirements.txt)
741
+ - Ubuntu/Debian: [command to install dependencies on Ubuntu/Debian without pip](ubuntu_dependencies.txt)
770
742
 
771
743
  Run command `version` in offpunk to see if you are missing some dependencies.
772
744
 
773
745
  Mandatory or highly recommended (packagers should probably make those mandatory):
774
- * [less](http://www.greenwoodsoftware.com/less/): mandatory but is probably already on your system
775
- * [file](https://www.darwinsys.com/file/) is used to get the MIME type of cached objects. Should already be on your system.
776
- * [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.
777
- * 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).
746
+
747
+ - [less](http://www.greenwoodsoftware.com/less/): mandatory but is probably already on your system
748
+ - [file](https://www.darwinsys.com/file/) is used to get the MIME type of cached objects. Should already be on your system.
749
+ - [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.
750
+ - 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).
778
751
 
779
752
  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)
780
- * [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
781
- * [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)
782
- * [Python-feedparser](https://github.com/kurtmckee/feedparser) will allow parsing of RSS/Atom feeds and thus subscriptions to them. (apt-get install python3-feedparser)
783
- * [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.
753
+
754
+ - [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
755
+ - [BeautifulSoup4](https://www.crummy.com/software/BeautifulSoup) is needed to render HTML. Without it, HTML will not be rendered or be sent to an external parser like Lynx. (apt-get install python3-bs4)
756
+ - [Readability](https://github.com/buriy/python-readability) is highly suggested to trim useless part of most html pages (apt-get install python3-readability or pip3 install readability-lxml)
757
+ - [Python-feedparser](https://github.com/kurtmckee/feedparser) will allow parsing of RSS/Atom feeds and thus subscriptions to them. (apt-get install python3-feedparser)
758
+ - [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.
784
759
 
785
760
  Gopher dependencies:
786
- * [Python-chardet](https://github.com/chardet/chardet) is used to detect the character encoding on Gopher (and may be used more in the future)
787
761
 
788
- Older dependencies which are only needed on older systems (where chafa < 1.10)
789
- * [Timg](https://github.com/hzeller/timg) is a slower alternative to chafa for inline images. Might be deprecated in the future.
790
- * [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. Might be deprecated in the future.
762
+ - [Python-chardet](https://github.com/chardet/chardet) is used to detect the character encoding on Gopher (and may be used more in the future)
791
763
 
792
764
  Nice to have (packagers should may make those optional):
793
- * [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). Xclip can be used too.
794
- * [Wl-clipboard](https://github.com/bugaevc/wl-clipboard) allows the same feature than xsel but under Wayland
795
- * [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.
765
+
766
+ - [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). Xclip can be used too.
767
+ - [Wl-clipboard](https://github.com/bugaevc/wl-clipboard) allows the same feature than xsel but under Wayland
768
+ - [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.
796
769
 
797
770
  ## Features
798
771
 
799
- * Browse https/gemini/gopher without leaving your keyboard and without distractions
800
- * Customize your experience with the `theme` command.
801
- * Built-in documentation: type `help` to get the list of command or a specific help about a command.
802
- * Offline mode to browse cached content without a connection. Requested elements are automatically fetched during the next synchronization and are added to your tour.
803
- * HTML pages are prettified to focus on content. Read without being disturbed or see the full page with `view full`.
804
- * RSS/Atom feeds are automatically discovered by `subscribe` and rendered as gemlogs. They can be explored with `view feed` and `view feeds`.
805
- * Support "subscriptions" to a page. New content seen in subscribed pages are automatically added to your next tour.
806
- * Complex bookmarks management through multiple lists, built-in edition, subscribing/freezing lists and archiving content.
807
- * Advanced navigation tools like `tour` and `mark` (as per VF-1). Unlike AV-98, tour is saved on disk accross sessions.
808
- * Ability to specify external handler programs for different MIME types (use `handler`)
809
- * 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).
810
- * Non-interactive cache-building with configurable depth through the --sync command. The cache can easily be used by other software.
811
- * `netcache`, a standalone CLI tool to retrieve the cached version of a network ressource.
812
- * `ansicat`, a standalone CLI tool to render HTML/Gemtext/image in a terminal.
813
- * `opnk`, a standalone CLI tool to open any kind of ressources (local or network) and display it in your terminal or, if not possible, fallback to `xdg-open`.
772
+ - Browse https/gemini/gopher without leaving your keyboard and without distractions
773
+ - Customize your experience with the `theme` command.
774
+ - Built-in documentation: type `help` to get the list of command or a specific help about a command.
775
+ - Offline mode to browse cached content without a connection. Requested elements are automatically fetched during the next synchronization and are added to your tour.
776
+ - HTML pages are prettified to focus on content. Read without being disturbed or see the full page with `view full`.
777
+ - RSS/Atom feeds are automatically discovered by `subscribe` and rendered as gemlogs. They can be explored with `view feed` and `view feeds`.
778
+ - Support "subscriptions" to a page. New content seen in subscribed pages are automatically added to your next tour.
779
+ - Complex bookmarks management through multiple lists, built-in edition, subscribing/freezing lists and archiving content.
780
+ - Advanced navigation tools like `tour` and `mark` (as per VF-1). Unlike AV-98, tour is saved on disk accross sessions.
781
+ - Ability to specify external handler programs for different MIME types (use `handler`)
782
+ - 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).
783
+ - Non-interactive cache-building with configurable depth through the --sync command. The cache can easily be used by other software.
784
+ - `netcache`, a standalone CLI tool to retrieve the cached version of a network ressource.
785
+ - `ansicat`, a standalone CLI tool to render HTML/Gemtext/image in a terminal.
786
+ - `opnk`, a standalone CLI tool to open any kind of ressources (local or network) and display it in your terminal or, if not possible, fallback to `xdg-open`.
814
787
 
815
788
  ## RC files
816
789
 
817
790
  You can use an RC file to automatically run any sequence of valid Offpunk
818
- commands upon start up. This can be used to make settings controlled with the
819
- `set`, `handler` or `themes` commands persistent. You can also put a `go` command in
791
+ commands upon start up. This can be used to make settings controlled with the
792
+ `set`, `handler` or `themes` commands persistent. You can also put a `go` command in
820
793
  your RC file to visit a "homepage" automatically on startup, or to pre-prepare
821
794
  a `tour` of your favourite Gemini sites or `offline` to go offline by default.
822
795
 
823
- 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.
796
+ 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.
824
797
 
825
798
  ## Cache design
826
799
 
@@ -830,3 +803,10 @@ The cache can be accessed/built with the `netcache` tool. See `netcache -h` for
830
803
 
831
804
  There’s no feature to automatically trim the cache. But any part of the cache can safely be removed manually as there are no databases or complex synchronisation.
832
805
 
806
+ ## Tests
807
+
808
+ Be sure to install the dev requirements (`pytest` and `pytest-mock`) with:
809
+
810
+ pip install -r requirements-dev.txt
811
+
812
+ And then run the test suite using `pytest`.
offpunk-2.6/README.md ADDED
@@ -0,0 +1,114 @@
1
+ # OFFPUNK
2
+
3
+ A command-line and offline-first smolnet browser/feed reader for Gemini, Gopher, Spartan and Web by [Ploum](https://ploum.net).
4
+
5
+ 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.
6
+
7
+ Official page : [Offpunk.net](https://offpunk.net)
8
+ Development (repository/mailing lists) : [sr.ht](https://sr.ht/~lioploum/offpunk/)
9
+
10
+ ![Screenshot HTML page with picture](screenshots/1.png)
11
+ ![Screenshot Gemini page](screenshots/2.png)
12
+
13
+ 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.
14
+
15
+ ## How to use
16
+
17
+ Offpunk is a set of python files. Installation is optional, you can simply git clone the project and run "./offpunk.py" or "python3 offpunk.py" in a terminal. You can also a packaged version:
18
+
19
+ - [List of existing Offpunk packages (Repology)](https://repology.org/project/offpunk/versions)
20
+ - Please contribute packages for other systems, there’s a [mailing-list dedicated to packaging](https://lists.sr.ht/~lioploum/offpunk-packagers).
21
+
22
+ To get started, launch offpunk then type "tutorial".
23
+
24
+ You can also consults it online: [Offpunk tutorial](https://offpunk.net/firststeps.html)
25
+
26
+ At any point, you can use "help" to get the list of commands and "help command" to get a small help about "command".
27
+
28
+ ## More
29
+
30
+ Important news and releases will be announced on the [offpunk-devel mailing list](https://lists.sr.ht/~lioploum/offpunk-devel)
31
+
32
+ Questions can be asked on [the users mailing](list https://lists.sr.ht/~lioploum/offpunk-users)
33
+
34
+ ## Dependencies
35
+
36
+ Offpunk has few "strict dependencies", i.e. it should run and work without anything
37
+ 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
38
+ experience or some other features such as HTTP/HTML or image support.
39
+
40
+ 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.
41
+
42
+ - PIP: [requirements file to install dependencies with pip](requirements.txt)
43
+ - Ubuntu/Debian: [command to install dependencies on Ubuntu/Debian without pip](ubuntu_dependencies.txt)
44
+
45
+ Run command `version` in offpunk to see if you are missing some dependencies.
46
+
47
+ Mandatory or highly recommended (packagers should probably make those mandatory):
48
+
49
+ - [less](http://www.greenwoodsoftware.com/less/): mandatory but is probably already on your system
50
+ - [file](https://www.darwinsys.com/file/) is used to get the MIME type of cached objects. Should already be on your system.
51
+ - [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.
52
+ - 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).
53
+
54
+ 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)
55
+
56
+ - [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
57
+ - [BeautifulSoup4](https://www.crummy.com/software/BeautifulSoup) is needed to render HTML. Without it, HTML will not be rendered or be sent to an external parser like Lynx. (apt-get install python3-bs4)
58
+ - [Readability](https://github.com/buriy/python-readability) is highly suggested to trim useless part of most html pages (apt-get install python3-readability or pip3 install readability-lxml)
59
+ - [Python-feedparser](https://github.com/kurtmckee/feedparser) will allow parsing of RSS/Atom feeds and thus subscriptions to them. (apt-get install python3-feedparser)
60
+ - [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.
61
+
62
+ Gopher dependencies:
63
+
64
+ - [Python-chardet](https://github.com/chardet/chardet) is used to detect the character encoding on Gopher (and may be used more in the future)
65
+
66
+ Nice to have (packagers should may make those optional):
67
+
68
+ - [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). Xclip can be used too.
69
+ - [Wl-clipboard](https://github.com/bugaevc/wl-clipboard) allows the same feature than xsel but under Wayland
70
+ - [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.
71
+
72
+ ## Features
73
+
74
+ - Browse https/gemini/gopher without leaving your keyboard and without distractions
75
+ - Customize your experience with the `theme` command.
76
+ - Built-in documentation: type `help` to get the list of command or a specific help about a command.
77
+ - Offline mode to browse cached content without a connection. Requested elements are automatically fetched during the next synchronization and are added to your tour.
78
+ - HTML pages are prettified to focus on content. Read without being disturbed or see the full page with `view full`.
79
+ - RSS/Atom feeds are automatically discovered by `subscribe` and rendered as gemlogs. They can be explored with `view feed` and `view feeds`.
80
+ - Support "subscriptions" to a page. New content seen in subscribed pages are automatically added to your next tour.
81
+ - Complex bookmarks management through multiple lists, built-in edition, subscribing/freezing lists and archiving content.
82
+ - Advanced navigation tools like `tour` and `mark` (as per VF-1). Unlike AV-98, tour is saved on disk accross sessions.
83
+ - Ability to specify external handler programs for different MIME types (use `handler`)
84
+ - 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).
85
+ - Non-interactive cache-building with configurable depth through the --sync command. The cache can easily be used by other software.
86
+ - `netcache`, a standalone CLI tool to retrieve the cached version of a network ressource.
87
+ - `ansicat`, a standalone CLI tool to render HTML/Gemtext/image in a terminal.
88
+ - `opnk`, a standalone CLI tool to open any kind of ressources (local or network) and display it in your terminal or, if not possible, fallback to `xdg-open`.
89
+
90
+ ## RC files
91
+
92
+ You can use an RC file to automatically run any sequence of valid Offpunk
93
+ commands upon start up. This can be used to make settings controlled with the
94
+ `set`, `handler` or `themes` commands persistent. You can also put a `go` command in
95
+ your RC file to visit a "homepage" automatically on startup, or to pre-prepare
96
+ a `tour` of your favourite Gemini sites or `offline` to go offline by default.
97
+
98
+ 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.
99
+
100
+ ## Cache design
101
+
102
+ 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.
103
+
104
+ The cache can be accessed/built with the `netcache` tool. See `netcache -h` for more informations.
105
+
106
+ There’s no feature to automatically trim the cache. But any part of the cache can safely be removed manually as there are no databases or complex synchronisation.
107
+
108
+ ## Tests
109
+
110
+ Be sure to install the dev requirements (`pytest` and `pytest-mock`) with:
111
+
112
+ pip install -r requirements-dev.txt
113
+
114
+ And then run the test suite using `pytest`.
offpunk-2.6/TODO ADDED
@@ -0,0 +1,34 @@
1
+ TODO
2
+
3
+ ## Refactoring of redirections is needed
4
+
5
+ bug #34: redirections are not kept while offline
6
+ https://todo.sr.ht/~lioploum/offpunk/34
7
+ bug #41: Redirects should be handled in netcache, not offpunk
8
+ https://todo.sr.ht/~lioploum/offpunk/41
9
+
10
+ ## Refactoring of errors is needed
11
+
12
+ bug #30: Netcache: gemini status 4 and 5 should not emit a full traceback
13
+ https://todo.sr.ht/~lioploum/offpunk/30
14
+ bug #3: Error pages are stored in the cache
15
+ https://todo.sr.ht/~lioploum/offpunk/3
16
+
17
+
18
+ ## Cache Triming
19
+
20
+ We need work on a model that keep the cache within certain limit by removing older, inaccessed elements which are not linked to anything in lists.
21
+
22
+ ## HTML rendering
23
+
24
+ Better rendering of tables using ASCII tables
25
+
26
+
27
+ ## Misc:
28
+
29
+ bug #42: IDN handling
30
+ https://todo.sr.ht/~lioploum/offpunk/42
31
+
32
+
33
+
34
+