gmcapsule


Namegmcapsule JSON
Version 0.7.0 PyPI version JSON
download
home_pageNone
SummaryExtensible Gemini/Titan server
upload_time2024-04-13 12:22:35
maintainerNone
docs_urlNone
authorNone
requires_python>=3.6
licenseNone
keywords gemini internet server titan
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            GmCapsule is an extensible server for [Gemini](https://gemini.circumlunar.space/) and [Titan](https://transjovian.org/titan/).

See the [User manual](https://geminispace.org/gmcapsule/gmcapsule.html) for configuration and usage instructions.

## Installation

Install "gmcapsule" via `pip`:

    pip install gmcapsule

Then run the server daemon:

    gmcapsuled

## Running via systemd

Create the following service file and save it as _~/.config/systemd/user/gmcapsule.service_:

    [Unit]
    Description=GmCapsule: extensible Gemini/Titan server
    After=network.target
    
    [Service]
    Type=simple
    ExecStart=<YOUR-INSTALL-PATH>/gmcapsuled
    ExecReload=/bin/kill -HUP $MAINPID
    Restart=always
    Environment="PYTHONUNBUFFERED=1"
    StandardOutput=syslog
    StandardError=syslog
    SyslogIdentifier=gmcapsule
    
    [Install]
    WantedBy=default.target

Replace `<YOUR-INSTALL-PATH>` with the actual path of `gmcapsuled`. `pip` will install it in a directory on your PATH.

Then you can do the usual:

    systemctl --user daemon-reload
    systemctl --user enable gmcapsule
    systemctl --user start gmcapsule

The log can be viewed via journalctl (or syslog):

    journalctl -xe --user-unit=gmcapsule

## Change log

### v0.7

* CGI: Fixed contents of `PATH_INFO`: it is now URL-decoded and the script path is removed so only the part following the script path is included in the environment variable (RFC 3875, section 4.1.5).
* CGI: `bin_root` applies a wildcard to all found CGI executables so `PATH_INFO` can be used.
* CGI: `bin_root` looks for executable "index.gmi" files in requested directories to provide the directory index.
* Skip the TLS SNI check when request hostname has a literal IP address. (SNI is not supposed to be used with literal addresses.)
* Respond with status 53 if an unknown hostname is requested. This helps reveal configuration errors where the correct hostnames are not specified.

### v0.6

* Added `stream` to the `[cgi.*]` section to enable streaming output mode where the output of the CGI child process is immediately sent to the client without any buffering. Streaming is not supported if the server is using multiple processes.
* Markdown: Fixed handling of alt text in preformatted blocks (patch by Mike Cifelli).

v0.6.1:

* Static: Fixed unquoting URL paths when looking up files.
* Added example of printing Gemini meta line in CGI documentation.

### v0.5

* Added `processes` to the `[server]` section to configure how many request handler processes are started.
* Extension modules can register new protocols in addition to the built-in Gemini and Titan.
* SIGHUP causes the configuration file to be reloaded and workers to be restarted. The listening socket remains open, so the socket and TLS parameters cannot be changed.
* API change: Extension modules get initialized separately in each worker thread. Instead of a `Capsule`, the extension module `init` method is passed a `Context`. `Capsule` is no longer available as global state.
* API change: `Identity` no longer contains OpenSSL objects for the certificate and public key. Instead, they are provided as serialized in DER format.

v0.5.1:

* `Identity` class is available when importing the `gmcapsule` module.

v0.5.2:

* Fixed error in the "rewrite" module (Codeberg PR #1).

v0.5.3:

* Enable address reuse on the server socket for unimpeded restarting (Codeberg PR #3).

### v0.4

* Added built-in module "rewrite" that matches regular expressions against the request path and can rewrite the path or return a custom status for redirection, "Gone" messages, or other exceptional situations.
* Extension module load order is determined after locating all modules from all directories. Previously, the order was local to each directory.
* Added a new configuration section `[priority]` for overriding default module priorities determined from file names. This is useful for changing the priority of the built-in modules.

v0.4.1:

* Rewrite: Request query string can be included in a `status` using the `${QUERY_STRING}` variable.

### v0.3

* Added a shutdown event for custom background workers.
* `Request.query` is None if there is no query string present. Previously, the query string was an empty string in this case. This allows making a distinction between empty and absent query strings.

v0.3.1:

* CGI: Fixed handling of a missing query string.

v0.3.2:

* GitView: Fixed processing of Git commit history when a message contains backslashes.

### v0.2

* Added `[cgi] bin_root` configuration option for automatically and dynamically mapping all executables in a directory tree to URL entry points.
* Minor documentation updates.
* Published on PyPi as "gmcapsule".

v0.2.1:

* Fixed error handling. Exceptions are now caught and the error message is printed.

v0.2.2:

* Reduced required Python version to 3.6 (f-strings).
* Added systemd instructions.

v0.2.3:

* Requests exceeding 1024 bytes should result in an error code and not just be ignored.
* Respond with an error code to malformed UTF-8 in the request.
* Verify that the port number in the request URI matches the server's port.

v0.2.4:

* Fixed an error in the Markdown parser.

v0.2.5:

* Fixed handling of exceptions from request handler, and print a traceback.
* Fixed `importlib` error with Python 3.11.

### v0.1

* Initial public release.
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "gmcapsule",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "gemini, internet, server, titan",
    "author": null,
    "author_email": "Jaakko Kera\u0308nen <jaakko.keranen@iki.fi>",
    "download_url": "https://files.pythonhosted.org/packages/a7/b1/02e92bc62299ecc58079cd22b98ed40f7f68a5374a9b7dc259b07f6f43a2/gmcapsule-0.7.0.tar.gz",
    "platform": null,
    "description": "GmCapsule is an extensible server for [Gemini](https://gemini.circumlunar.space/) and [Titan](https://transjovian.org/titan/).\n\nSee the [User manual](https://geminispace.org/gmcapsule/gmcapsule.html) for configuration and usage instructions.\n\n## Installation\n\nInstall \"gmcapsule\" via `pip`:\n\n    pip install gmcapsule\n\nThen run the server daemon:\n\n    gmcapsuled\n\n## Running via systemd\n\nCreate the following service file and save it as _~/.config/systemd/user/gmcapsule.service_:\n\n    [Unit]\n    Description=GmCapsule: extensible Gemini/Titan server\n    After=network.target\n    \n    [Service]\n    Type=simple\n    ExecStart=<YOUR-INSTALL-PATH>/gmcapsuled\n    ExecReload=/bin/kill -HUP $MAINPID\n    Restart=always\n    Environment=\"PYTHONUNBUFFERED=1\"\n    StandardOutput=syslog\n    StandardError=syslog\n    SyslogIdentifier=gmcapsule\n    \n    [Install]\n    WantedBy=default.target\n\nReplace `<YOUR-INSTALL-PATH>` with the actual path of `gmcapsuled`. `pip` will install it in a directory on your PATH.\n\nThen you can do the usual:\n\n    systemctl --user daemon-reload\n    systemctl --user enable gmcapsule\n    systemctl --user start gmcapsule\n\nThe log can be viewed via journalctl (or syslog):\n\n    journalctl -xe --user-unit=gmcapsule\n\n## Change log\n\n### v0.7\n\n* CGI: Fixed contents of `PATH_INFO`: it is now URL-decoded and the script path is removed so only the part following the script path is included in the environment variable (RFC 3875, section 4.1.5).\n* CGI: `bin_root` applies a wildcard to all found CGI executables so `PATH_INFO` can be used.\n* CGI: `bin_root` looks for executable \"index.gmi\" files in requested directories to provide the directory index.\n* Skip the TLS SNI check when request hostname has a literal IP address. (SNI is not supposed to be used with literal addresses.)\n* Respond with status 53 if an unknown hostname is requested. This helps reveal configuration errors where the correct hostnames are not specified.\n\n### v0.6\n\n* Added `stream` to the `[cgi.*]` section to enable streaming output mode where the output of the CGI child process is immediately sent to the client without any buffering. Streaming is not supported if the server is using multiple processes.\n* Markdown: Fixed handling of alt text in preformatted blocks (patch by Mike Cifelli).\n\nv0.6.1:\n\n* Static: Fixed unquoting URL paths when looking up files.\n* Added example of printing Gemini meta line in CGI documentation.\n\n### v0.5\n\n* Added `processes` to the `[server]` section to configure how many request handler processes are started.\n* Extension modules can register new protocols in addition to the built-in Gemini and Titan.\n* SIGHUP causes the configuration file to be reloaded and workers to be restarted. The listening socket remains open, so the socket and TLS parameters cannot be changed.\n* API change: Extension modules get initialized separately in each worker thread. Instead of a `Capsule`, the extension module `init` method is passed a `Context`. `Capsule` is no longer available as global state.\n* API change: `Identity` no longer contains OpenSSL objects for the certificate and public key. Instead, they are provided as serialized in DER format.\n\nv0.5.1:\n\n* `Identity` class is available when importing the `gmcapsule` module.\n\nv0.5.2:\n\n* Fixed error in the \"rewrite\" module (Codeberg PR #1).\n\nv0.5.3:\n\n* Enable address reuse on the server socket for unimpeded restarting (Codeberg PR #3).\n\n### v0.4\n\n* Added built-in module \"rewrite\" that matches regular expressions against the request path and can rewrite the path or return a custom status for redirection, \"Gone\" messages, or other exceptional situations.\n* Extension module load order is determined after locating all modules from all directories. Previously, the order was local to each directory.\n* Added a new configuration section `[priority]` for overriding default module priorities determined from file names. This is useful for changing the priority of the built-in modules.\n\nv0.4.1:\n\n* Rewrite: Request query string can be included in a `status` using the `${QUERY_STRING}` variable.\n\n### v0.3\n\n* Added a shutdown event for custom background workers.\n* `Request.query` is None if there is no query string present. Previously, the query string was an empty string in this case. This allows making a distinction between empty and absent query strings.\n\nv0.3.1:\n\n* CGI: Fixed handling of a missing query string.\n\nv0.3.2:\n\n* GitView: Fixed processing of Git commit history when a message contains backslashes.\n\n### v0.2\n\n* Added `[cgi] bin_root` configuration option for automatically and dynamically mapping all executables in a directory tree to URL entry points.\n* Minor documentation updates.\n* Published on PyPi as \"gmcapsule\".\n\nv0.2.1:\n\n* Fixed error handling. Exceptions are now caught and the error message is printed.\n\nv0.2.2:\n\n* Reduced required Python version to 3.6 (f-strings).\n* Added systemd instructions.\n\nv0.2.3:\n\n* Requests exceeding 1024 bytes should result in an error code and not just be ignored.\n* Respond with an error code to malformed UTF-8 in the request.\n* Verify that the port number in the request URI matches the server's port.\n\nv0.2.4:\n\n* Fixed an error in the Markdown parser.\n\nv0.2.5:\n\n* Fixed handling of exceptions from request handler, and print a traceback.\n* Fixed `importlib` error with Python 3.11.\n\n### v0.1\n\n* Initial public release.",
    "bugtrack_url": null,
    "license": null,
    "summary": "Extensible Gemini/Titan server",
    "version": "0.7.0",
    "project_urls": {
        "Documentation": "https://geminispace.org/gmcapsule/gmcapsule.html",
        "Home-page": "https://geminispace.org/gmcapsule/",
        "Issues": "https://codeberg.org/skyjake/gmcapsule/issues",
        "Source": "https://codeberg.org/skyjake/gmcapsule"
    },
    "split_keywords": [
        "gemini",
        " internet",
        " server",
        " titan"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "505baea301ace649f726a22b0c76c6a6744b8d4e6e8611b9bed0df347372f7a2",
                "md5": "7387a58b18df643ffa72120fa928b176",
                "sha256": "cdaf5cbb4ee4671b58802f929c63969fa54ac6c5521ffbf4be26fbb2e81864c8"
            },
            "downloads": -1,
            "filename": "gmcapsule-0.7.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7387a58b18df643ffa72120fa928b176",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 33537,
            "upload_time": "2024-04-13T12:22:33",
            "upload_time_iso_8601": "2024-04-13T12:22:33.424630Z",
            "url": "https://files.pythonhosted.org/packages/50/5b/aea301ace649f726a22b0c76c6a6744b8d4e6e8611b9bed0df347372f7a2/gmcapsule-0.7.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "a7b102e92bc62299ecc58079cd22b98ed40f7f68a5374a9b7dc259b07f6f43a2",
                "md5": "841c9f30a853cf9cd3688bb2c63b04ed",
                "sha256": "cdd2ff85933f628c48b98fe870b893adeed9e523b034eaaa2f051c688805c57d"
            },
            "downloads": -1,
            "filename": "gmcapsule-0.7.0.tar.gz",
            "has_sig": false,
            "md5_digest": "841c9f30a853cf9cd3688bb2c63b04ed",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 29510,
            "upload_time": "2024-04-13T12:22:35",
            "upload_time_iso_8601": "2024-04-13T12:22:35.149621Z",
            "url": "https://files.pythonhosted.org/packages/a7/b1/02e92bc62299ecc58079cd22b98ed40f7f68a5374a9b7dc259b07f6f43a2/gmcapsule-0.7.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-13 12:22:35",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": true,
    "codeberg_user": "skyjake",
    "codeberg_project": "gmcapsule",
    "lcname": "gmcapsule"
}
        
Elapsed time: 0.22900s