Munich, DE
https://sotiris.papatheodorou.xyz
PhD student at the Smart Robotics Lab in Imperial College London/Technical University of Munich.
From Sotiris Papatheodorou to ~lioploum/offpunk-devel
On 2023-08-29, Ploum wrote: >I’ve implemented that but with a simple integer as the cache version >which is independant from offpunk version. Even simpler, fine by me. On 2023-08-29, Ploum wrote: >Review of the code is welcome Had a quick look and all seems well! Best, Sotiris
From Sotiris Papatheodorou to ~lioploum/offpunk-devel
On 2023-08-27, Ploum wrote: >Also, regarding the migration script: I’ve come to the conclusion that >there should be a VERSION file in the root folder of the cache. This >file could be checked at launch and run the migration script if needed. > >Sotiris, what do you think? Sounds good to me! Maybe something like a .version file in the cache root containing an offpunk version number, e.g. 1.10.0. Offpunk attempts to read the file on startup: * If the file doesn't exist, offpunk creates it and runs all migration commands. * If the version in the file is smaller than the current offpunk
From Sotiris Papatheodorou to ~lioploum/offpunk-devel
On Jul 10, 2023 10:57, Ploum <sourcehut@ploum.eu> wrote: > My first question involves the option "tls_mode". By default, the > tls_mode is "tofu". It could also be set as "ca". If I’m right, the > tls_mode "ca" means that you would only accept communicating with Gemini > capsule you trust. > > Has anyone ever tried to set that option? > > Is there a single usecase in 2023 gemini that would require it? What it does is change the way TLS certificates are verified. The tofu mode is what is described in the Gemini spec, i.e. store the certificate (or its fingerprint) on the first connection and warm the user if it ever changes. The ca mode implements the classic certificate authority
From Sotiris Papatheodorou to ~lioploum/offpunk-devel
In European languages it's typically easy to infer a word even if all of its vowels have been removed so maybe this works as a human-centric way of URL shortening that mostly avoids ambiguity. File extensions and less unique parts of the URL could also be removed. For example: gemini://ploum.net/2023-06-15-merdification.gmi could become: gmn/plm.nt/20230615-mrdfctn A modified Levenshtein distance (i.e. with higher distance for letter changes and removals) could be used to get the URL in the cache that closest to the shorthand version.
From Sotiris Papatheodorou to ~lioploum/offpunk-devel
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"' \; --- CHANGELOG | 1 + migrate-offpunk-cache | 47 +++++++++++++++++++++++++++++++++++++++++++ offpunk.py | 4 +++- 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100755 migrate-offpunk-cache [message trimmed]
From Sotiris Papatheodorou to ~lioploum/offpunk-devel
This seems to be the most common convention among gopher servers (e.g. Gophernicus, go-gopher). The following command can be used to update the cache to the new format in a POSIX system: find ~/.cache/offpunk/gopher/ -type f -name 'index.txt' -exec sh -c 'mv {} "$(dirname {})/gophermap"' \; --- CHANGELOG | 1 + offpunk.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 3b54ff5..0a8f90e 100644 [message trimmed]
From Sotiris Papatheodorou to ~lioploum/offpunk-devel
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. --- CHANGELOG | 1 + offpunk.py | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 16a1c46..2b1a372 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,7 @@ [message trimmed]
From Sotiris Papatheodorou to ~lioploum/offpunk-devel
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 --- CHANGELOG | 3 +++ offpunk.py | 16 +++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 645d009..fb1e591 100644 --- a/CHANGELOG [message trimmed]
From Sotiris Papatheodorou to ~lioploum/offpunk-devel
Hello, On 2023-01-26, Ploum wrote: >As requested on offpunk-users, I’ve been toying with a custom cache >folder. I thought it would be trivial. I would argue it is and needs no changes to offpunk at all :). Moving the cache is as simple as: mv ~/.cache/offpunk /desired/path/ ln -s /desired/path/offpunk ~/.cache/offpunk In other words, just make ~/.cache/offpunk a symbolic link to wherever you want the cache to be. I think this is enough for pretty much all use
From Sotiris Papatheodorou to ~lioploum/offpunk-devel
Sorry for the previous garbage email. On 2023-01-20, Ploum wrote: >Now, before giving a detailed answer to your mail, just want to point >out that, yeah, I did some mistake as I didn't think of all the edge >cases. I didn't mean my email to be a criticism of the current cache. Knowing you're planning on implementing a separate netcache tool, I though it would be best to figure out the cache format sooner rather than later since it would potentially be a big breaking change. On 2023-01-20, Ploum wrote: