From e96936230d8116700121e16c93523a590b51d952 Mon Sep 17 00:00:00 2001 From: josh Date: Thu, 18 Apr 2024 13:20:47 -0400 Subject: [PATCH 1/8] Ignore .envrc and .direnv/ --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 47657f4..b257f2a 100644 --- a/.gitignore +++ b/.gitignore @@ -114,6 +114,10 @@ ENV/ env.bak/ venv.bak/ +# direnv +.envrc +.direnv/ + # Spyder project settings .spyderproject .spyproject From fdde55e5eb19b4c2775ddec3d4ddae0bfd12d07e Mon Sep 17 00:00:00 2001 From: josh Date: Thu, 18 Apr 2024 13:40:09 -0400 Subject: [PATCH 2/8] Add support for TLDR_CERT environmental variable Setting TLDR_CERT will use that as the certificate bundle for updates --- tldr.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tldr.py b/tldr.py index 3de8220..0068588 100755 --- a/tldr.py +++ b/tldr.py @@ -34,12 +34,15 @@ USE_NETWORK = int(os.environ.get('TLDR_NETWORK_ENABLED', '1')) > 0 USE_CACHE = int(os.environ.get('TLDR_CACHE_ENABLED', '1')) > 0 MAX_CACHE_AGE = int(os.environ.get('TLDR_CACHE_MAX_AGE', 24*7)) +CAFILE = os.path.expanduser(os.environ.get('TLDR_CERT', None)) URLOPEN_CONTEXT = None if int(os.environ.get('TLDR_ALLOW_INSECURE', '0')) == 1: URLOPEN_CONTEXT = ssl.create_default_context() URLOPEN_CONTEXT.check_hostname = False URLOPEN_CONTEXT.verify_mode = ssl.CERT_NONE +elif CAFILE: + URLOPEN_CONTEXT = ssl.create_default_context(cafile=CAFILE) OS_DIRECTORIES = { "linux": "linux", From 2511aebe474e796452edc5a99b8cb8785a9067c0 Mon Sep 17 00:00:00 2001 From: josh Date: Thu, 18 Apr 2024 13:46:59 -0400 Subject: [PATCH 3/8] Document TLDR_CERT in README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 8853d63..bd45360 100644 --- a/README.md +++ b/README.md @@ -125,6 +125,10 @@ For networks that sit behind a proxy, it may be necessary to disable SSL verific will disable SSL certificate inspection. This __should be avoided__ unless absolutely necessary. +It is possible to use a different certificate store/bundle by setting: + +* `TLDR_CERT=/path/to/certificates.crt` + ### Colors Values of the `TLDR_COLOR_x` variables may consist of three parts: From c7cd9f3b5075d7a0ecdc6a17c297da1ee8b7ffb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20Brul=C3=A9?= Date: Tue, 6 Aug 2024 22:52:53 -0400 Subject: [PATCH 4/8] Update tldr.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use pathlib instead of os.path Co-authored-by: VĂ­tor Henrique <87824454+vitorhcl@users.noreply.github.com> --- tldr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tldr.py b/tldr.py index 0068588..48c34f7 100755 --- a/tldr.py +++ b/tldr.py @@ -34,7 +34,7 @@ USE_NETWORK = int(os.environ.get('TLDR_NETWORK_ENABLED', '1')) > 0 USE_CACHE = int(os.environ.get('TLDR_CACHE_ENABLED', '1')) > 0 MAX_CACHE_AGE = int(os.environ.get('TLDR_CACHE_MAX_AGE', 24*7)) -CAFILE = os.path.expanduser(os.environ.get('TLDR_CERT', None)) +CAFILE = None if os.environ.get('TLDR_CERT', None) is None else Path(os.environ.get('TLDR_CERT')).expanduser() URLOPEN_CONTEXT = None if int(os.environ.get('TLDR_ALLOW_INSECURE', '0')) == 1: From 46dc21536679d9cf9a4cba42823ddaaf1a3c4537 Mon Sep 17 00:00:00 2001 From: CleanMachine1 <78213164+CleanMachine1@users.noreply.github.com> Date: Sun, 9 Feb 2025 13:51:29 +0000 Subject: [PATCH 5/8] temp commit --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index b257f2a..3a32220 100644 --- a/.gitignore +++ b/.gitignore @@ -117,7 +117,6 @@ venv.bak/ # direnv .envrc .direnv/ - # Spyder project settings .spyderproject .spyproject From b902228e70a39ed74032f6b2e1129565c3f4e75b Mon Sep 17 00:00:00 2001 From: CleanMachine1 <78213164+CleanMachine1@users.noreply.github.com> Date: Sun, 9 Feb 2025 13:51:47 +0000 Subject: [PATCH 6/8] revert --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 3a32220..b257f2a 100644 --- a/.gitignore +++ b/.gitignore @@ -117,6 +117,7 @@ venv.bak/ # direnv .envrc .direnv/ + # Spyder project settings .spyderproject .spyproject From 6a3bbfbafed4d6017846fcf72807cd15678b09e0 Mon Sep 17 00:00:00 2001 From: "K.B.Dharun Krishna" Date: Thu, 27 Mar 2025 17:01:03 +0530 Subject: [PATCH 7/8] Update tldr.py Co-authored-by: CleanMachine1 <78213164+CleanMachine1@users.noreply.github.com> --- tldr.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tldr.py b/tldr.py index 48c34f7..92cd2ab 100755 --- a/tldr.py +++ b/tldr.py @@ -34,7 +34,8 @@ USE_NETWORK = int(os.environ.get('TLDR_NETWORK_ENABLED', '1')) > 0 USE_CACHE = int(os.environ.get('TLDR_CACHE_ENABLED', '1')) > 0 MAX_CACHE_AGE = int(os.environ.get('TLDR_CACHE_MAX_AGE', 24*7)) -CAFILE = None if os.environ.get('TLDR_CERT', None) is None else Path(os.environ.get('TLDR_CERT')).expanduser() +CAFILE = None if os.environ.get('TLDR_CERT', None) is None else \ + Path(os.environ.get('TLDR_CERT')).expanduser() URLOPEN_CONTEXT = None if int(os.environ.get('TLDR_ALLOW_INSECURE', '0')) == 1: From 761df79b80d07c9bbda9ee4e9ca9b9c4b34b9ed4 Mon Sep 17 00:00:00 2001 From: "K.B.Dharun Krishna" Date: Thu, 27 Mar 2025 17:04:53 +0530 Subject: [PATCH 8/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2febe55..99f804a 100644 --- a/README.md +++ b/README.md @@ -137,7 +137,7 @@ For networks that sit behind a proxy, it may be necessary to disable SSL verific will disable SSL certificate inspection. This __should be avoided__ unless absolutely necessary. -It is possible to use a different certificate store/bundle by setting: +Alternatively, It is possible to use a different certificate store/bundle by setting: * `TLDR_CERT=/path/to/certificates.crt`