about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNguyễn Gia Phong <cnx@loang.net>2025-05-22 14:44:03 +0900
committerNguyễn Gia Phong <cnx@loang.net>2025-05-22 14:44:03 +0900
commit2cd501b224e1d00e4801ce0d562f39787390704b (patch)
tree11fe1d954cd670d302ea862bf02d3b3ee25fba76
parentf27df3fd951df3aa21a47c0208f79157ccc1676f (diff)
downloadscadere-2cd501b224e1d00e4801ce0d562f39787390704b.tar.gz
Draft packaging
-rw-r--r--README.md52
-rw-r--r--pyproject.toml25
-rw-r--r--src/scadere/listen.py5
3 files changed, 82 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..8f89b5e
--- /dev/null
+++ b/README.md
@@ -0,0 +1,52 @@
+# Scadere
+
+Scadere is a TLS certificate renewal remider.  It checks for certificates
+that are about to expire and provides an Atom feed for notification.
+
+## Usage
+
+```console
+$ scadere check --help
+Usage: scadere check [-h] [-d DAYS] [-o PATH] HOST[:PORT] [HOST[:PORT] ...]
+
+Check TLS certificate expiration of HOST, where PORT defaults to 443.
+
+Options:
+  -h, --help            show this help message and exit
+  -d DAYS, --days=DAYS  days before expiration (default to 7)
+  -o PATH, --output=PATH
+                        output file (default to stdout)
+```
+
+```console
+$ scadere listen --help
+Usage: scadere listen [-h] INPUT URL [[HOST][:PORT]]
+
+Serve the TLS certificate expiration feed from INPUT file
+for base URL at HOST:PORT, where HOST defaults to localhost
+and PORT is selected randomly if not specified.
+
+Options:
+  -h, --help  show this help message and exit
+```
+
+## Contributing
+
+Patches should be sent to [chung@loa.loang.net][loang mailing list]
+using [`git send-email`][git send-email], with the following configuration:
+
+    git config sendemail.to 'chung@loa.loang.net'
+    git config format.subjectPrefix 'PATCH scadere'
+
+## Copying
+
+![AGPLv3](https://www.gnu.org/graphics/agplv3-155x51.png)
+
+Scadere is free software: you can redistribute it and/or modify it
+under the terms of the GNU [Affero General Public License][agplv3] as
+published by the Free Software Foundation, either version 3 of the License,
+or (at your option) any later version.
+
+[loang mailing list]: https://loa.loang.net/chung
+[git send-email]: https://git-send-email.io
+[agplv3]: https://www.gnu.org/licenses/agpl-3.0.html
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..4a78d86
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,25 @@
+[build-system]
+requires = [ "flit_core >=3.2,<4" ]
+build-backend = "flit_core.buildapi"
+
+[project]
+name = "scadere"
+description = "TLS certificate renewal reminder"
+readme = "README.md"
+requires-python = ">=3.11"
+license = { file = "COPYING" }
+authors = [ { name = "Nguyễn Gia Phong", email = "cnx@loang.net" } ]
+maintainers = [ { name = "Nguyễn Gia Phong", email = "chung@loa.loang.net" } ]
+keywords = [ "atom", "tls", "ca" ]
+classifiers = [
+    "Development Status :: 4 - Beta",
+    "Environment :: Console",
+    "Environment :: Web Environment",
+    "Framework :: AsyncIO",
+    "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
+    "Operating System :: OS Independent",
+    "Programming Language :: Python",
+    "Topic :: Utilities" ]
+dynamic = [ "version" ]
+urls = { Source = "https://trong.loang.net/scadere" }
+scripts = { scadere = "scadere.__main__:main" }
diff --git a/src/scadere/listen.py b/src/scadere/listen.py
index 00bae15..c9df384 100644
--- a/src/scadere/listen.py
+++ b/src/scadere/listen.py
@@ -23,6 +23,8 @@ from xml.etree.ElementTree import (Element as xml_element,
                                    SubElement as xml_subelement,
                                    indent, tostring as xml_to_string)
 
+from . import __version__
+
 __all__ = ['listen']
 
 
@@ -104,6 +106,9 @@ async def handle(certs, base_url, reader, writer):
                     ('link', {'rel': 'self', 'href': base_url}),
                     ('title', certs.name),
                     ('updated', datetime.now().isoformat()),
+                    ('generator', {'uri': 'https://trong.loang.net/scadere/about',
+                                   'version': __version__},
+                     'Scadere'),
                     *(entry(base_url, cert)
                       for cert in summaries if cert[2].endswith(domains))))
         content = xml_to_string(feed, 'unicode', xml_declaration=True,