aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Touhey <thomas@touhey.fr>2021-12-26 11:41:08 +0100
committerThomas Touhey <thomas@touhey.fr>2021-12-26 11:43:30 +0100
commitf8c01d0a9ad62aa17d31d70350d1de6e72b5ebbb (patch)
treee8ea15f57daf132c1f6aa847b290ed980e4d14aa
parent06a5ddbbb86ef544b55e663b5ea2c8e488dc83cc (diff)
Rebranded to pyfingerd, ready for 0.4 release.0.4
-rw-r--r--.plan17
-rwxr-xr-xMakefile2
-rw-r--r--README.rst4
-rw-r--r--docs/Makefile4
-rw-r--r--docs/api/core.rst4
-rw-r--r--docs/api/fiction.rst2
-rw-r--r--docs/api/native.rst8
-rw-r--r--docs/cli.rst6
-rw-r--r--docs/conf.py14
-rw-r--r--docs/config/pyfingerd.service12
-rw-r--r--docs/discuss.rst2
-rw-r--r--docs/discuss/fictional-interfaces.rst12
-rw-r--r--docs/discuss/fingerd-structure.rst57
-rw-r--r--docs/discuss/pyfingerd-structure.rst57
-rw-r--r--docs/discuss/scenarios.rst14
-rw-r--r--docs/guides/writing-scenarios.rst17
-rw-r--r--docs/index.rst12
-rw-r--r--docs/onboarding/installing.rst20
-rw-r--r--docs/onboarding/running.rst39
-rw-r--r--docs/onboarding/tweaking.rst8
-rwxr-xr-xpyfingerd/__init__.py (renamed from fingerd/__init__.py)2
-rwxr-xr-xpyfingerd/__main__.py (renamed from fingerd/__main__.py)2
-rwxr-xr-xpyfingerd/cli.py (renamed from fingerd/cli.py)8
-rwxr-xr-xpyfingerd/core.py (renamed from fingerd/core.py)18
-rwxr-xr-xpyfingerd/errors.py (renamed from fingerd/errors.py)2
-rwxr-xr-xpyfingerd/fiction.py (renamed from fingerd/fiction.py)6
-rwxr-xr-xpyfingerd/native.py (renamed from fingerd/native.py)2
-rwxr-xr-xpyfingerd/posix.py (renamed from fingerd/posix.py)2
-rw-r--r--pyfingerd/utils.py (renamed from fingerd/utils.py)10
-rwxr-xr-xpyfingerd/version.py (renamed from fingerd/version.py)4
-rwxr-xr-xscripts/pyfingerd (renamed from scripts/fingerd)6
-rw-r--r--setup.cfg10
-rwxr-xr-xsetup.py4
-rwxr-xr-xtests/__init__.py4
-rw-r--r--tests/test_scenarios.py6
-rw-r--r--tests/test_server.py (renamed from tests/test_fingerd.py)8
36 files changed, 209 insertions, 196 deletions
diff --git a/.plan b/.plan
index b98b699..aeb5ee9 100644
--- a/.plan
+++ b/.plan
@@ -1,10 +1,9 @@
- __ _ _
- / _(_)_ __ __ _ ___ _ __ __| |
- | |_| | '_ \ / _` |/ _ \ '__/ _` |
- | _| | | | | (_| | __/ | | (_| |
- |_| |_|_| |_|\__, |\___|_| \__,_|
- yet another |___/ finger daemon
-
- Find out more about the project on
- https://fingerd.touhey.pro/
+ __ _ _
+ _ __ _ _ / _(_)_ __ __ _ ___ _ __ __| |
+ | '_ \| | | | |_| | '_ \ / _` |/ _ \ '__/ _` |
+ | |_) | |_| | _| | | | | (_| | __/ | | (_| |
+ | .__/ \__, |_| |_|_| |_|\__, |\___|_| \__,_|
+ |_| |___/ yet another |___/ finger daemon
+ Find out more about the project on
+ https://pyfingerd.touhey.pro/
diff --git a/Makefile b/Makefile
index 28c8989..7845a1b 100755
--- a/Makefile
+++ b/Makefile
@@ -10,7 +10,7 @@ checkdocs:
@./setup.py checkdocs
run:
- @python -m fingerd -b 'localhost:3999'
+ @python -m pyfingerd -b 'localhost:3999'
redirect-localhost-ports:
iptables -t nat -A OUTPUT -p tcp -s 127.0.0.1 -d 127.0.0.1 \
--dport 79 -j DNAT --to 127.0.0.1:3999
diff --git a/README.rst b/README.rst
index b24d60e..a838560 100644
--- a/README.rst
+++ b/README.rst
@@ -11,8 +11,8 @@ real information about the users on my server, so I made this to present
some fictional information in order to be able to tell a story through
finger.
-You can find more information on `the fingerd homepage
-<https://fingerd.touhey.pro/>`_.
+You can find more information on `the pyfingerd homepage
+<https://pyfingerd.touhey.pro/>`_.
What is left to do
------------------
diff --git a/docs/Makefile b/docs/Makefile
index fc54ccb..788ca10 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -10,7 +10,7 @@ SPHINXWATCH = $(PE) sphinx-autobuild
SPHINXPROJ = textoutpc
SOURCEDIR = .
BUILDDIR = _build
-WEBROOT = hercule:fingerd/docs
+WEBROOT = hercule:pyfingerd/docs
# Put it first so that "make" without argument is like "make help".
help:
@@ -28,7 +28,7 @@ help:
# Livehtml build.
livehtml:
$(SPHINXWATCH) $(SPHINXOPTS) . $(BUILDDIR)/html \
- --ignore "**/.*.kate-swp" --watch ../fingerd
+ --ignore "**/.*.kate-swp" --watch ../pyfingerd
.PHONY: livehtml
diff --git a/docs/api/core.rst b/docs/api/core.rst
index c547a09..aee0bbf 100644
--- a/docs/api/core.rst
+++ b/docs/api/core.rst
@@ -1,9 +1,9 @@
Core API
========
-.. py:module:: fingerd.core
+.. py:module:: pyfingerd.core
-These classes constitute the core of the fingerd module.
+These classes constitute the core of the pyfingerd module.
Base representations
--------------------
diff --git a/docs/api/fiction.rst b/docs/api/fiction.rst
index 144a385..cefd359 100644
--- a/docs/api/fiction.rst
+++ b/docs/api/fiction.rst
@@ -1,7 +1,7 @@
Fictional interfaces API
========================
-.. py:module:: fingerd.fiction
+.. py:module:: pyfingerd.fiction
For more information about this section, consult :ref:`fictional-interfaces`.
diff --git a/docs/api/native.rst b/docs/api/native.rst
index 2566599..7068d3d 100644
--- a/docs/api/native.rst
+++ b/docs/api/native.rst
@@ -1,14 +1,14 @@
Native API
==========
-For native integration of fingerd, the project provides interfaces for reading
-system information in order to expose it through the server.
+For native integration of pyfingerd, the project provides interfaces for
+reading system information in order to expose it through the server.
Note that the relevant native interface for the host system (or the dummy
interface if none are relevant) is accessible through
-:py:class:`fingerd.native.FingerNativeInterface`.
+:py:class:`pyfingerd.native.FingerNativeInterface`.
-.. py:module:: fingerd.posix
+.. py:module:: pyfingerd.posix
.. autoclass:: FingerPOSIXInterface
:members: search_users
diff --git a/docs/cli.rst b/docs/cli.rst
index 9bd696e..3bd3e67 100644
--- a/docs/cli.rst
+++ b/docs/cli.rst
@@ -3,7 +3,7 @@
Configuration options
=====================
-When run through CLI, fingerd exposes a number of configuration options using
+When run through CLI, pyfingerd exposes a number of configuration options using
its own code. Each configuration option is configurable through three
cumulative means:
@@ -17,7 +17,7 @@ order of such the value is the one given above.
Binding
-------
-As for all network servers, fingerd will bind one or more network ports and
+As for all network servers, pyfingerd will bind one or more network ports and
answer to queries from all of the bound ports. These network ports are
defined through the following option:
@@ -63,7 +63,7 @@ Here are some examples:
Setting the hostname
--------------------
-The fingerd server answers queries with a given hostname to identify itself.
+The pyfingerd server answers queries with a given hostname to identify itself.
This hostname can be configured through the following option:
* The ``-H`` or ``--hostname`` CLI option.
diff --git a/docs/conf.py b/docs/conf.py
index 3c67b66..cea6783 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -20,7 +20,7 @@ sys.path.insert(0, os.path.abspath('..'))
# -- Project information -----------------------------------------------------
-project = 'fingerd'
+project = 'pyfingerd'
copyright = '2019-2021, Thomas Touhey'
author = 'Thomas Touhey'
@@ -28,7 +28,7 @@ author = 'Thomas Touhey'
def _get_release():
- from fingerd.version import version
+ from pyfingerd.version import version
return version
@@ -117,7 +117,7 @@ html_static_path = ['_static']
# -- Options for HTMLHelp output ---------------------------------------------
# Output file base name for HTML help builder.
-htmlhelp_basename = 'fingerddoc'
+htmlhelp_basename = 'pyfingerddoc'
# -- Options for LaTeX output ------------------------------------------------
@@ -145,7 +145,7 @@ latex_elements = {
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(
- master_doc, 'fingerd.tex', 'fingerd Documentation',
+ master_doc, 'pyfingerd.tex', 'pyfingerd documentation',
'Thomas Touhey', 'manual'
),
]
@@ -157,7 +157,7 @@ latex_documents = [
# (source start file, name, description, authors, manual section).
man_pages = [
(
- master_doc, 'fingerd', 'fingerd Documentation',
+ master_doc, 'pyfingerd', 'pyfingerd documentation',
[author], 1
),
]
@@ -170,8 +170,8 @@ man_pages = [
# dir menu entry, description, category)
texinfo_documents = [
(
- master_doc, 'fingerd', 'fingerd Documentation',
- author, 'fingerd', 'A modern finger (RFC 1288) server.',
+ master_doc, 'pyfingerd', 'pyfingerd documentation',
+ author, 'pyfingerd', 'A modern finger (RFC 1288) server.',
'Miscellaneous'
),
]
diff --git a/docs/config/pyfingerd.service b/docs/config/pyfingerd.service
new file mode 100644
index 0000000..035a49c
--- /dev/null
+++ b/docs/config/pyfingerd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=pyfingerd
+After=network.target
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/pyfingerd
+ExecStop=/bin/kill -s TERM $MAINPID
+TimeoutSec=15
+
+[Install]
+WantedBy=multi-user.target
diff --git a/docs/discuss.rst b/docs/discuss.rst
index 6294789..041608f 100644
--- a/docs/discuss.rst
+++ b/docs/discuss.rst
@@ -7,6 +7,6 @@ discussion topics in the following sections.
.. toctree::
- discuss/fingerd-structure
+ discuss/pyfingerd-structure
discuss/fictional-interfaces
discuss/scenarios
diff --git a/docs/discuss/fictional-interfaces.rst b/docs/discuss/fictional-interfaces.rst
index 2dce78c..d7ec1bf 100644
--- a/docs/discuss/fictional-interfaces.rst
+++ b/docs/discuss/fictional-interfaces.rst
@@ -3,24 +3,24 @@
Fictional interfaces
====================
-One of the goals of fingerd was to be able to play a fiction and present
+One of the goals of pyfingerd was to be able to play a fiction and present
scripted fake data.
Imagine a scene in a theater. On this scene, you can distinctly see actions
happening, making the scene go from one state to the other. Fictional
-interfaces in fingerd function the same way.
+interfaces in pyfingerd function the same way.
The interface managing the scene is the
-:py:class:`fingerd.fiction.FingerFictionInterface`.
+:py:class:`pyfingerd.fiction.FingerFictionInterface`.
It starts with an empty scene, i.e. no users and no sessions.
From there, two things can happen:
* One or more actions can be applied to the scene to make it evolve,
- using :py:meth:`fingerd.fiction.FingerFictionInterface.apply`.
+ using :py:meth:`pyfingerd.fiction.FingerFictionInterface.apply`.
* The scene can be reset to the initial state (no users, no sessions);
for example, this can happen when a scene repeats itself or starts
a completely different story. This is accomplished by using
- :py:meth:`fingerd.fiction.FingerFictionInterface.reset`.
+ :py:meth:`pyfingerd.fiction.FingerFictionInterface.reset`.
This base class doesn't do anything by itself, it is a canvas which
other classes can subclass to manage the scene by calling these two
@@ -41,7 +41,7 @@ The idea is to make use of a scenario, i.e. a set of actions accompanied by
the ending type and time.
This application is implemented using the
-:py:class:`fingerd.fiction.FingerScenarioInterface` class.
+:py:class:`pyfingerd.fiction.FingerScenarioInterface` class.
This function has a function that gets executed every second that
updates the scene according to the scenario.
diff --git a/docs/discuss/fingerd-structure.rst b/docs/discuss/fingerd-structure.rst
deleted file mode 100644
index 60118fb..0000000
--- a/docs/discuss/fingerd-structure.rst
+++ /dev/null
@@ -1,57 +0,0 @@
-fingerd structure
-=================
-
-fingerd's conception is centered around the server class,
-:py:class:`fingerd.core.FingerServer`, which itself makes use of
-two other objects: an interface and a formatter.
-
-.. _discuss-interfaces:
-
-Interfaces
-----------
-
-An interface provides the data presented by the server to the client.
-
-Interfaces in fingerd are subclasses of
-:py:class:`fingerd.core.FingerInterface`. Interfaces must override
-the methods from this class, mostly the one to search for users, in
-order to provide data from their source.
-
-Usable interfaces throughout fingerd are the following:
-
-:py:class:`fingerd.core.FingerInterface`
-
- Base class and dummy interface, doesn't transmit nor yield any user
- results.
-
-:py:class:`fingerd.fiction.FingerScenarioInterface`
-
- Interface following a scenario; see :ref:`fictional-interfaces` for
- more information.
-
-:py:class:`fingerd.posix.FingerPOSIXInterface`
-
- Interface using the POSIX user accounting databases.
-
-:py:class:`fingerd.native.FingerNativeInterface`
-
- Interface bound to the one using native system interface:
-
- * :py:class:`fingerd.posix.FingerPOSIXInterface` if on Linux or \*BSD.
- * :py:class:`fingerd.core.FingerInterface` by default.
-
-.. _discuss-formatters:
-
-Formatters
-----------
-
-A formatter takes data obtained by the server for a given request through
-its interface, and presents it using text.
-
-Formatters in fingerd are subclasses of
-:py:class:`fingerd.core.FingerFormatter`. Existing formatters
-throughout fingerd are the following:
-
-:py:class:`fingerd.core.FingerFormatter`
-
- Base class, outputs similarly to RFC 1288.
diff --git a/docs/discuss/pyfingerd-structure.rst b/docs/discuss/pyfingerd-structure.rst
new file mode 100644
index 0000000..4af10e9
--- /dev/null
+++ b/docs/discuss/pyfingerd-structure.rst
@@ -0,0 +1,57 @@
+pyfingerd structure
+===================
+
+pyfingerd's conception is centered around the server class,
+:py:class:`pyfingerd.core.FingerServer`, which itself makes use of
+two other objects: an interface and a formatter.
+
+.. _discuss-interfaces:
+
+Interfaces
+----------
+
+An interface provides the data presented by the server to the client.
+
+Interfaces in pyfingerd are subclasses of
+:py:class:`pyfingerd.core.FingerInterface`. Interfaces must override
+the methods from this class, mostly the one to search for users, in
+order to provide data from their source.
+
+Usable interfaces throughout pyfingerd are the following:
+
+:py:class:`pyfingerd.core.FingerInterface`
+
+ Base class and dummy interface, doesn't transmit nor yield any user
+ results.
+
+:py:class:`pyfingerd.fiction.FingerScenarioInterface`
+
+ Interface following a scenario; see :ref:`fictional-interfaces` for
+ more information.
+
+:py:class:`pyfingerd.posix.FingerPOSIXInterface`
+
+ Interface using the POSIX user accounting databases.
+
+:py:class:`pyfingerd.native.FingerNativeInterface`
+
+ Interface bound to the one using native system interface:
+
+ * :py:class:`pyfingerd.posix.FingerPOSIXInterface` if on Linux or \*BSD.
+ * :py:class:`pyfingerd.core.FingerInterface` by default.
+
+.. _discuss-formatters:
+
+Formatters
+----------
+
+A formatter takes data obtained by the server for a given request through
+its interface, and presents it using text.
+
+Formatters in pyfingerd are subclasses of
+:py:class:`pyfingerd.core.FingerFormatter`. Existing formatters
+throughout pyfingerd are the following:
+
+:py:class:`pyfingerd.core.FingerFormatter`
+
+ Base class, outputs similarly to RFC 1288.
diff --git a/docs/discuss/scenarios.rst b/docs/discuss/scenarios.rst
index 80b43d2..59775d6 100644
--- a/docs/discuss/scenarios.rst
+++ b/docs/discuss/scenarios.rst
@@ -14,7 +14,7 @@ In order to achieve this goal, it is composed of three elements:
of the play.
In the scope of this project, such a scenario is represented using
-the :py:class:`fingerd.fiction.FingerScenario` class. This class can load
+the :py:class:`pyfingerd.fiction.FingerScenario` class. This class can load
its data using two methods: programatically, or using a scenario file.
Note that this section doesn't cover how to write scenarios, only a definition
@@ -24,17 +24,17 @@ Loading a scenario programatically
----------------------------------
For defining a scenario using code, you are to use the
-:py:meth:`fingerd.fiction.FingerScenario.add` method with actions
+:py:meth:`pyfingerd.fiction.FingerScenario.add` method with actions
as defined in :ref:`actions-api`, and define both the
-:py:meth:`fingerd.fiction.FingerScenario.ending_type` and
-:py:meth:`fingerd.fiction.FingerScenario.duration` properties.
+:py:meth:`pyfingerd.fiction.FingerScenario.ending_type` and
+:py:meth:`pyfingerd.fiction.FingerScenario.duration` properties.
For example:
.. code-block:: python
from datetime import timedelta
- from fingerd.fiction import *
+ from pyfingerd.fiction import *
scenario = FingerScenario()
scenario.ending_type = FingerScenario.EndingType.FREEZE
@@ -61,8 +61,8 @@ Scenario files
--------------
Scenarios can also be defined as TOML files, loaded using the
-:py:meth:`fingerd.fiction.FingerScenario.load` static method which
-produce :py:class:`fingerd.fiction.FingerScenario` instances.
+:py:meth:`pyfingerd.fiction.FingerScenario.load` static method which
+produce :py:class:`pyfingerd.fiction.FingerScenario` instances.
These files describe actions as point in times where something happen.
Every action has a time offset, using a TOML array section (``[[something]]``),
diff --git a/docs/guides/writing-scenarios.rst b/docs/guides/writing-scenarios.rst
index 7731d6a..9f2d641 100644
--- a/docs/guides/writing-scenarios.rst
+++ b/docs/guides/writing-scenarios.rst
@@ -1,9 +1,9 @@
.. _writing-scenarios:
-Writing a scenario for fingerd
-==============================
+Writing a scenario for pyfingerd
+================================
-So you want to narrate a story using fingerd! But how does one do that?
+So you want to narrate a story using pyfingerd! But how does one do that?
This guide will take you step by step into making a simple story, so as
to allow you to build your own.
@@ -50,7 +50,7 @@ following:
::
- python -m fingerd -b 'localhost:3999' -t scenario -s story/script.toml \
+ python -m pyfingerd -b 'localhost:3999' -t scenario -s story/script.toml \
-S 2021-12-26 -H 'EXAMPLE.ORG'
A quick test reveals that everything works perfectly!
@@ -112,11 +112,12 @@ to having logged out at around 18.05 PM:
login = 'thomas'
However, that means that we have a 'logout' event without a 'login' event!
-When loading the script, fingerd tells us exactly that:
+When loading the script, pyfingerd tells us exactly that:
::
- $ python -m fingerd -t scenario -s story/script.toml -S 2021-12-26T00:00:00 -b 'localhost:3999'
+ $ python -m pyfingerd -t scenario -s story/script.toml \
+ -S 2021-12-26T00:00:00 -b 'localhost:3999'
ERROR Error loading the scenario:
ERROR At action #3 at -5h54m2s: trying to delete non existing session of user 'thomas'.
@@ -303,10 +304,10 @@ Note that any event after that won't be run, regardless of the ending type.
And that's it, the story will play during the day and the server will stop
at 4:17 PM; be careful not to have enabled auto-restart if you manage the
service through your init daemon (e.g. systemd), although if the
-arguments don't change, all fingerd is going to do is shut itself down
+arguments don't change, all pyfingerd is going to do is shut itself down
immediately!
-The result is available in ``examples/pir4te`` on the fingerd repository.
+The result is available in ``examples/pir4te`` on the pyfingerd repository.
For more event types, you can consult :ref:`scenarios`.
.. _log4shell: https://en.wikipedia.org/wiki/Log4Shell
diff --git a/docs/index.rst b/docs/index.rst
index 8abdf18..1339ea2 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -1,11 +1,11 @@
-Welcome to fingerd's documentation!
+Welcome to pyfingerd's documentation!
===================================
finger is both a protocol and a utility to get the information and status
from a user on a distant machine. It was standardized in `RFC 742`_
in 1977, then in `RFC 1288`_ in 1991, and has been abandoned since.
-fingerd is an implementation for this protocol, which allows you to:
+pyfingerd is an implementation for this protocol, which allows you to:
* Run a finger server using system information on Linux and \*BSD systems.
* Run a finger server using a scenario for animating alternate reality games
@@ -14,7 +14,7 @@ fingerd is an implementation for this protocol, which allows you to:
For more information, you can consult:
-* The project homepage at `fingerd.touhey.pro`_.
+* The project homepage at `pyfingerd.touhey.pro`_.
* The PyPI project page at `pypi.org`_.
* The source at `forge.touhey.org`_.
@@ -31,6 +31,6 @@ The documentation contents is the following:
.. _RFC 742: https://tools.ietf.org/html/rfc742
.. _RFC 1288: https://tools.ietf.org/html/rfc1288
-.. _`fingerd.touhey.pro`: https://fingerd.touhey.pro/
-.. _`pypi.org`: https://pypi.org/project/fingerd/
-.. _`forge.touhey.org`: https://forge.touhey.org/fingerd.git/
+.. _`pyfingerd.touhey.pro`: https://pyfingerd.touhey.pro/
+.. _`pypi.org`: https://pypi.org/project/pyfingerd/
+.. _`forge.touhey.org`: https://forge.touhey.org/pyfingerd.git/
diff --git a/docs/onboarding/installing.rst b/docs/onboarding/installing.rst
index b5c6f61..cc99d86 100644
--- a/docs/onboarding/installing.rst
+++ b/docs/onboarding/installing.rst
@@ -1,17 +1,17 @@
-Installing fingerd
-==================
+Installing pyfingerd
+====================
-In order to run and tweak fingerd, you must first install it; this section
+In order to run and tweak pyfingerd, you must first install it; this section
will cover the need.
-Installing fingerd using pip
-----------------------------
+Installing pyfingerd using pip
+------------------------------
-To install fingerd, you can use pip with the following command:
+To install pyfingerd, you can use pip with the following command:
.. code-block:: sh
- python -m pip install fingerd
+ python -m pip install pyfingerd
Some notes on this command:
@@ -24,10 +24,10 @@ Some notes on this command:
* On Microsoft Windows, the Python executable, when added to the PATH,
goes by the name ``py`` instead of ``python``.
-Installing fingerd from source
-------------------------------
+Installing pyfingerd from source
+--------------------------------
-To install fingerd from source, you can use the following commands:
+To install pyfingerd from source, you can use the following commands:
.. code-block:: sh
diff --git a/docs/onboarding/running.rst b/docs/onboarding/running.rst
index f56bfd6..4ef885d 100644
--- a/docs/onboarding/running.rst
+++ b/docs/onboarding/running.rst
@@ -1,12 +1,12 @@
-Running fingerd
-===============
+Running pyfingerd
+=================
-Once installed, you can directly run fingerd with its default options
+Once installed, you can directly run pyfingerd with its default options
through the following command, **as root**:
.. code-block:: sh
- python3 -m fingerd
+ python3 -m pyfingerd
By default, this will run a finger server on TCP port 79 for both Internet
protocols (IPv4 and IPv6) if available, returning native information if
@@ -81,19 +81,20 @@ practice. Usually, application servers are run on a custom unprivileged port
Apache or nginx for HTTP and HTTPS services, redirects traffic to that custom
port.
-Although fingerd seems harmless, it is recommended to run it as an unprivileged
-user that only can access the required data, usually session information from
-the host in its default configuration. In order for it to still be able to
-listen to requests and answer on TCP port 79, one possibility is to attribute
-a custom port to it, such as 3999, and redirect all inbound traffic on port 79
-to that custom port using iptables. This can be done by appending a rule to
-the NAT table using a command such as the following:
+Although pyfingerd seems harmless, it is recommended to run it as an
+unprivileged user that only can access the required data,
+usually session information from the host in its default configuration.
+In order for it to still be able to listen to requests and answer on TCP
+port 79, one possibility is to attribute a custom port to it, such as 3999,
+and redirect all inbound traffic on port 79 to that custom port using
+iptables. This can be done by appending a rule to the NAT table using a
+command such as the following:
.. code-block:: sh
iptables -t nat -A OUTPUT -p tcp [-s <source ip>] [-d <destination ip>] --dport 79 -j DNAT --to '<ip:port>'
-For example, if the fingerd server is running on port 3999, we can use both
+For example, if the pyfingerd server is running on port 3999, we can use both
these commands to redirect traffic to that server:
.. code-block:: sh
@@ -114,24 +115,24 @@ using the following command-line option:
.. code-block:: sh
- python3 -m fingerd -b localhost:3999
+ python3 -m pyfingerd -b localhost:3999
# OR
- BIND=localhost:3999 python3 -m fingerd
+ BIND=localhost:3999 python3 -m pyfingerd
See :ref:`cli` for more information.
Setting the hostname
--------------------
-By default, fingerd uses the hostname ``localhost`` when answering to requests.
-Say you want the server to answer with the ``EXAMPLE.ORG`` hostname. You can
-do so using the following command-line option:
+By default, pyfingerd uses the hostname ``localhost`` when answering to
+requests. Say you want the server to answer with the ``EXAMPLE.ORG``
+hostname. You can do so using the following command-line option:
.. code-block:: sh
- python3 -m fingerd -H example.org
+ python3 -m pyfingerd -H example.org
# OR
- FINGER_HOST=example.org python3 -m fingerd
+ FINGER_HOST=example.org python3 -m pyfingerd
.. _Castor: https://sr.ht/~julienxx/Castor/
.. _finger URLs: http://tools.ietf.org/html/draft-ietf-uri-url-finger
diff --git a/docs/onboarding/tweaking.rst b/docs/onboarding/tweaking.rst
index cab8e12..cc0fd32 100644
--- a/docs/onboarding/tweaking.rst
+++ b/docs/onboarding/tweaking.rst
@@ -1,13 +1,13 @@
-Tweaking fingerd
-================
+Tweaking pyfingerd
+==================
-In order to start tweaking fingerd using Python instead of the CLI, you
+In order to start tweaking pyfingerd using Python instead of the CLI, you
can import utilities from the module. The minimal code for running the
server is the following:
.. code-block:: python
- from fingerd import FingerServer
+ from pyfingerd import FingerServer
server = FingerServer()
server.serve_forever()
diff --git a/fingerd/__init__.py b/pyfingerd/__init__.py
index 90cae1c..aad1d8a 100755
--- a/fingerd/__init__.py
+++ b/pyfingerd/__init__.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# *****************************************************************************
# Copyright (C) 2017-2021 Thomas Touhey <thomas@touhey.fr>
-# This file is part of the fingerd project, which is MIT-licensed.
+# This file is part of the pyfingerd project, which is MIT-licensed.
# *****************************************************************************
""" Pure Python finger protocol implementation.
diff --git a/fingerd/__main__.py b/pyfingerd/__main__.py
index b01e5b2..d8e58e2 100755
--- a/fingerd/__main__.py
+++ b/pyfingerd/__main__.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# *****************************************************************************
# Copyright (C) 2017-2021 Thomas Touhey <thomas@touhey.fr>
-# This file is part of the fingerd project, which is MIT-licensed.
+# This file is part of the pyfingerd project, which is MIT-licensed.
# *****************************************************************************
""" Main script of the module. """
diff --git a/fingerd/cli.py b/pyfingerd/cli.py
index e01113d..e184c0c 100755
--- a/fingerd/cli.py
+++ b/pyfingerd/cli.py
@@ -1,9 +1,9 @@
#!/usr/bin/env python3
# *****************************************************************************
# Copyright (C) 2021 Thomas Touhey <thomas@touhey.fr>
-# This file is part of the fingerd project, which is MIT-licensed.
+# This file is part of the pyfingerd project, which is MIT-licensed.
# *****************************************************************************
-""" fingerd CLI interface. """
+""" pyfingerd CLI interface. """
from datetime import datetime as _datetime
from platform import (
@@ -38,7 +38,7 @@ __all__ = ['cli']
@_click.version_option(
version=_version,
message=(
- f'fingerd version {_version}, '
+ f'pyfingerd version {_version}, '
f'running on {_python_impl()} {_python_version()}'
),
)
@@ -84,7 +84,7 @@ __all__ = ['cli']
def cli(binds, hostname, type_, scenario, scenario_start, log_level):
""" Start a finger (RFC 1288) server.
- Find out more at <https://fingerd.touhey.pro/>.
+ Find out more at <https://pyfingerd.touhey.pro/>.
"""
# Set the log level.
diff --git a/fingerd/core.py b/pyfingerd/core.py
index f8efa1e..b9e8b57 100755
--- a/fingerd/core.py
+++ b/pyfingerd/core.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# *****************************************************************************
# Copyright (C) 2017-2021 Thomas Touhey <thomas@touhey.fr>
-# This file is part of the fingerd project, which is MIT-licensed.
+# This file is part of the pyfingerd project, which is MIT-licensed.
# *****************************************************************************
""" Main classes for the finger server, interfaces and formatters.
@@ -762,7 +762,7 @@ class FingerInterface:
class _BindAddress:
- """ Bind address for fingerd. """
+ """ Bind address for pyfingerd. """
class Type(_Enum):
""" Bind address type. """
@@ -834,11 +834,11 @@ class _TCP6Address(_BindAddress):
class _BindsDecoder:
- """ Binds decoder for fingerd.
+ """ Binds decoder for pyfingerd.
Takes a raw string and the protocol name, either 'finger' (the base
- protocol managed by the class) or 'fingerd-control' (the protocol
- used for controlling the live fingerd interface).
+ protocol managed by the class) or 'pyfingerd-control' (the protocol
+ used for controlling the live pyfingerd interface).
"""
def __init__(self, raw, proto='finger'):
@@ -1100,13 +1100,13 @@ class FingerServer:
if not isinstance(interface, FingerInterface):
raise TypeError(
'Please base your interface '
- 'on the base class provided by the fingerd module',
+ 'on the base class provided by the pyfingerd module',
)
if not isinstance(formatter, FingerFormatter):
raise TypeError(
'Please base your formatter '
- 'on the base class provided by the fingerd module',
+ 'on the base class provided by the pyfingerd module',
)
# Keep the parameters.
@@ -1260,7 +1260,7 @@ class FingerServer:
raise
else:
_logger.info(
- f'Starting fingerd on [{host}]:{port}.',
+ f'Starting pyfingerd on [{host}]:{port}.',
)
try:
@@ -1269,7 +1269,7 @@ class FingerServer:
pass
_logger.info(
- f'Stopping fingerd on [{host}]:{port}.',
+ f'Stopping pyfingerd on [{host}]:{port}.',
)
async def cron_call(func, spec):
diff --git a/fingerd/errors.py b/pyfingerd/errors.py
index 791c971..f5ae0f6 100755
--- a/fingerd/errors.py
+++ b/pyfingerd/errors.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# *****************************************************************************
# Copyright (C) 2017-2021 Thomas Touhey <thomas@touhey.fr>
-# This file is part of the fingerd project, which is MIT-licensed.
+# This file is part of the pyfingerd project, which is MIT-licensed.
# *****************************************************************************
""" This file defines the exceptions used throughout the module. """
diff --git a/fingerd/fiction.py b/pyfingerd/fiction.py
index f317ae9..7130845 100755
--- a/fingerd/fiction.py
+++ b/pyfingerd/fiction.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# *****************************************************************************
# Copyright (C) 2017-2021 Thomas Touhey <thomas@touhey.fr>
-# This file is part of the fingerd project, which is MIT-licensed.
+# This file is part of the pyfingerd project, which is MIT-licensed.
# *****************************************************************************
""" Definitions for the finger server fiction interface.
@@ -51,7 +51,7 @@ _toml = None
class FictionalFingerUser(_FingerUser):
""" Representation of a user on the fictional system.
- Behaves like a :py:class:`fingerd.core.FingerUser`.
+ Behaves like a :py:class:`pyfingerd.core.FingerUser`.
For now, there are no modifications from the base class.
"""
@@ -61,7 +61,7 @@ class FictionalFingerUser(_FingerUser):
class FictionalFingerSession(_FingerSession):
""" Representation of an active session for a given user.
- Behaves like a :py:class:`fingerd.core.FingerSession`.
+ Behaves like a :py:class:`pyfingerd.core.FingerSession`.
The two main modifications from the base class are the following:
* Each session has a name, which identifies it. It can be used
diff --git a/fingerd/native.py b/pyfingerd/native.py
index 11d981c..b1be94c 100755
--- a/fingerd/native.py
+++ b/pyfingerd/native.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# *****************************************************************************
# Copyright (C) 2017-2021 Thomas Touhey <thomas@touhey.fr>
-# This file is part of the fingerd project, which is MIT-licensed.
+# This file is part of the pyfingerd project, which is MIT-licensed.
# *****************************************************************************
""" Defining the native interface. """
diff --git a/fingerd/posix.py b/pyfingerd/posix.py
index 995a3a8..3ca1849 100755
--- a/fingerd/posix.py
+++ b/pyfingerd/posix.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# *****************************************************************************
# Copyright (C) 2017-2021 Thomas "Cakeisalie5" Touhey <thomas@touhey.fr>
-# This file is part of the fingerd Python 3.x module, which is MIT-licensed.
+# This file is part of the pyfingerd Python 3.x module, which is MIT-licensed.
# *****************************************************************************
""" Make use of the utmp/x file to read the user data.
diff --git a/fingerd/utils.py b/pyfingerd/utils.py
index 4f3ff10..c96412a 100644
--- a/fingerd/utils.py
+++ b/pyfingerd/utils.py
@@ -1,9 +1,9 @@
#!/usr/bin/env python3
# *****************************************************************************
# Copyright (C) 2021 Thomas "Cakeisalie5" Touhey <thomas@touhey.fr>
-# This file is part of the fingerd Python 3.x module, which is MIT-licensed.
+# This file is part of the pyfingerd Python 3.x module, which is MIT-licensed.
# *****************************************************************************
-""" Utilities for the fingerd module. """
+""" Utilities for the pyfingerd module. """
import logging as _logging
import re as _re
@@ -18,9 +18,9 @@ __all__ = [
__delta0_re = _re.compile(r'(-?)(([0-9]+[a-z]+)+)')
__delta1_re = _re.compile(r'([0-9]+)([a-z]+)')
-logger = _logging.getLogger('fingerd')
-access_logger = _logging.getLogger('fingerd.access')
-error_logger = _logging.getLogger('fingerd.error')
+logger = _logging.getLogger('pyfingerd')
+access_logger = _logging.getLogger('pyfingerd.access')
+error_logger = _logging.getLogger('pyfingerd.error')
def parse_delta(raw: str) -> _td:
diff --git a/fingerd/version.py b/pyfingerd/version.py
index aafb700..85b5555 100755
--- a/fingerd/version.py
+++ b/pyfingerd/version.py
@@ -1,9 +1,9 @@
#!/usr/bin/env python3
# *****************************************************************************
# Copyright (C) 2021 Thomas Touhey <thomas@touhey.fr>
-# This file is part of the fingerd project, which is MIT-licensed.
+# This file is part of the pyfingerd project, which is MIT-licensed.
# *****************************************************************************
-""" fingerd version definition. """
+""" pyfingerd version definition. """
version = '0.4'
diff --git a/scripts/fingerd b/scripts/pyfingerd
index 0e5ce52..f8c6df8 100755
--- a/scripts/fingerd
+++ b/scripts/pyfingerd
@@ -1,11 +1,11 @@
#!/usr/bin/env python3
#**************************************************************************
# Copyright (C) 2017-2021 Thomas Touhey <thomas@touhey.fr>
-# This file is part of the fingerd project, which is MIT-licensed.
+# This file is part of the pyfingerd project, which is MIT-licensed.
#**************************************************************************
-""" Run fingerd without calling the `fingerd` module directly. """
+""" Run pyfingerd without calling the `pyfingerd` module directly. """
-from fingerd.cli import cli as _cli
+from pyfingerd.cli import cli as _cli
__all__ = []
diff --git a/setup.cfg b/setup.cfg
index 2270f69..4ca9831 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,7 +1,7 @@
[metadata]
-name = fingerd
-version = attr: fingerd.version.version
-url = https://fingerd.touhey.pro/
+name = pyfingerd
+version = attr: pyfingerd.version.version
+url = https://pyfingerd.touhey.pro/
author = Thomas Touhey
author_email = thomas@touhey.fr
description = finger (RFC 1288) server-side daemon.
@@ -20,9 +20,9 @@ classifiers =
[options]
zip_safe = False
include_package_data = True
-packages = fingerd
+packages = find:
scripts =
- scripts/fingerd
+ scripts/pyfingerd
[options.package_data]
* = *.txt, *.rst
diff --git a/setup.py b/setup.py
index 7813e23..3061d54 100755
--- a/setup.py
+++ b/setup.py
@@ -1,9 +1,9 @@
#!/usr/bin/env python3
# *****************************************************************************
# Copyright (C) 2018-2021 Thomas Touhey <thomas@touhey.fr>
-# This file is part of the fingerd project, which is MIT-licensed.
+# This file is part of the pyfingerd project, which is MIT-licensed.
# *****************************************************************************
-""" Setup script for the fingerd Python package. """
+""" Setup script for the pyfingerd Python package. """
import os.path as _path
from setuptools import setup as _setup
diff --git a/tests/__init__.py b/tests/__init__.py
index c5a4391..a744c3e 100755
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -1,9 +1,9 @@
#!/usr/bin/env python3
# *****************************************************************************
# Copyright (C) 2021 Thomas Touhey <thomas@touhey.fr>
-# This file is part of the fingerd project, which is MIT-licensed.
+# This file is part of the pyfingerd project, which is MIT-licensed.
# *****************************************************************************
-""" Unit tests for the `fingerd` Python module. """
+""" Unit tests for the `pyfingerd` Python module. """
# This file is only there to indicate that the folder is a module.
# It doesn't actually contain code.
diff --git a/tests/test_scenarios.py b/tests/test_scenarios.py
index f4fb8d3..1cd9db3 100644
--- a/tests/test_scenarios.py
+++ b/tests/test_scenarios.py
@@ -1,11 +1,11 @@
#!/usr/bin/env python3
# *****************************************************************************
# Copyright (C) 2021 Thomas Touhey <thomas@touhey.fr>
-# This file is part of the fingerd project, which is MIT-licensed.
+# This file is part of the pyfingerd project, which is MIT-licensed.
# *****************************************************************************
-""" Tests for the fingerd server. """
+""" Tests for the pyfingerd server. """
-from fingerd.fiction import (
+from pyfingerd.fiction import (
FingerScenario, FingerUserCreationAction, FingerUserDeletionAction,
FingerUserEditionAction, FingerUserLoginAction, FingerUserLogoutAction,
)
diff --git a/tests/test_fingerd.py b/tests/test_server.py
index 848e0d5..180c643 100644
--- a/tests/test_fingerd.py
+++ b/tests/test_server.py
@@ -1,17 +1,17 @@
#!/usr/bin/env python3
# *****************************************************************************
# Copyright (C) 2021 Thomas Touhey <thomas@touhey.fr>
-# This file is part of the fingerd project, which is MIT-licensed.
+# This file is part of the pyfingerd project, which is MIT-licensed.
# *****************************************************************************
-""" Tests for the fingerd server. """
+""" Tests for the pyfingerd server. """
import socket
from datetime import timedelta
from time import sleep
-from fingerd.core import FingerServer
-from fingerd.fiction import (
+from pyfingerd.core import FingerServer
+from pyfingerd.fiction import (
FingerScenario, FingerScenarioInterface,
FingerUserCreationAction, FingerUserLoginAction, FingerUserLogoutAction,
)