From ce775ed35ada7fb59a42084955c3dd76be851df8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaakko=20Kera=CC=88nen?= jaakko.keranen@iki.fi
Date: Sat, 17 Jun 2023 10:42:33 +0300
Subject: [PATCH 1/1] Updated docs
gmcapsule/init.py | 28 +++++++++++++++++++---------
gmcapsule/gemini.py | 6 ++++--
2 files changed, 23 insertions(+), 11 deletions(-)
diff --git a/gmcapsule/init.py b/gmcapsule/init.py
index 96ec7d8..9586881 100644
--- a/gmcapsule/init.py
+++ b/gmcapsule/init.py
@@ -102,6 +102,14 @@ modules : path [path...]
threads : int
Number of worker threads. At least 1 is required. Defaults to 5.
+processes : int
titan
@@ -370,7 +378,8 @@ contextual information:
SERVER_NAME
SERVER_PORT
AUTH_TYPE
-- REMOTE_IDENT
(when client certificate provided)
+- TLS_CLIENT_HASH
(when client certificate provided)
+- REMOTE_IDENT
(fingerprints of client certificate and public key)
REMOTE_USER
(when client certificate provided)CONTENT_LENGTH
(Titan only)CONTENT_TYPE
(Titan only)@@ -413,6 +422,10 @@ That is, the name of the extension ("extmod") is prefixed with two numbers
which modules are loaded. The ones loaded first have precedence over
registered URL entry points.
+If the server has been configured to use multiple processes, each process
+loads the extensions separately. This may require synchronizing access to
+external resources accessed by extensions.
Initialization
@@ -447,12 +460,11 @@ to the client:
The response body will be empty. This is useful for error messages and
redirects.
-- Returning a three-element tuple is interpreted as (status code, meta,
str
, it will be UTF-8 encoded before sending.bytes
orbytearray
, it is assumed to be a buffered file-like object. In thisclose()
will be+- Returning a three-element tuple is interpreted as (status, meta, body).
str
, it will be UTF-8 encoded before sending.pathlib.Path
, the referenced file is opened andbytes
or bytearray
.Future improvements
@@ -462,8 +474,6 @@ The following limitations could/should be lifted in the future:
configparser
, allowing access todefined values and environment variables.
-- Add Titan configuration option to not require a client certificate.
-- Extension modules should be reloadable. Add a deinit()
method.
gitview
should have a URL path prefix.be cacheable.
diff --git a/gmcapsule/gemini.py b/gmcapsule/gemini.py
index 163871b..e80183e 100644
--- a/gmcapsule/gemini.py
+++ b/gmcapsule/gemini.py
@@ -616,8 +616,10 @@ class Context:
request (Request): Request object.
Returns:
Tuple with (status, meta, body, cache). The body can be bytes/bytearray or
an I/O object. The cache is None if the data was not read from a cache.
tuple: (status, meta, body, cache). The type of body can be bytes,
bytearray, or pathlib.Path. Returning a pathlib.Path means that
the body will be read from the referenced file. The cache is None
if the data was not read from a cache.
"""
entrypoint = self.find_entrypoint(request.scheme, request.hostname, request.path)
--
2.25.1
text/plain
This content has been proxied by September (ba2dc).