From 4ea53e5a35c6c3d90d1eebda05058bab105c7de4 Mon Sep 17 00:00:00 2001 From: Pranav Jerry Date: Wed, 25 Aug 2021 15:52:46 +0530 Subject: [PATCH 1/8] implemented logging - New dependency -- python-systemd for logging to journal - Changed service file to start after networkd - New submodule which contains "logger" for use by all other submodules - Removed bus argument from Device and Adapter classes --- .gitignore | 151 ++++++++++++++++++++++++++++++++++++++++--- naxalnet.service | 13 ++-- naxalnet/__init__.py | 2 +- naxalnet/iwd.py | 15 +++-- naxalnet/log.py | 16 +++++ naxalnet/scripts.py | 27 ++++---- setup.cfg | 1 + 7 files changed, 192 insertions(+), 33 deletions(-) create mode 100644 naxalnet/log.py diff --git a/.gitignore b/.gitignore index 3f339ae..4906f4c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,145 @@ -.DS_Store -.idea -*.log -tmp/ +# Created by https://www.toptal.com/developers/gitignore/api/python +# Edit at https://www.toptal.com/developers/gitignore?templates=python + +### Python ### +# Byte-compiled / optimized / DLL files +__pycache__/ *.py[cod] -*.egg* -build -htmlcov -__pycache__ +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# End of https://www.toptal.com/developers/gitignore/api/python diff --git a/naxalnet.service b/naxalnet.service index 2691a31..d3ba53d 100644 --- a/naxalnet.service +++ b/naxalnet.service @@ -7,6 +7,8 @@ Requires=systemd-networkd.service Requires=iwd.service Wants=systemd-resolved.service After=iwd.service +After=systemd-networkd.service +After=systemd-resolved.service # Stops NetworkManager and wpa_supplicant if already running Conflicts=NetworkManager.service Conflicts=wpa_supplicant.service @@ -15,6 +17,7 @@ After=NetworkManager.service After=wpa_supplicant.service [Service] +# TODO: change to notify when naxalnet becomes a daemon Type=oneshot RemainAfterExit=yes Restart=on-failure @@ -33,14 +36,8 @@ ExecStop=/usr/bin/find /run/systemd/network -type f -delete ExecStopPost=/usr/bin/networkctl delete bridge0 bat0 # ... and reload the configuration files. ExecStopPost=/usr/bin/networkctl reload -# Make python flush messages instead of buffering. -# When reading the systemd journal, we need to see the messages -# in the exact order. There will suddenly be a lot of messages -# from naxalnet, networkd, iwd and resolved. When buffering is on, -# we won't see the messages from naxalnet in the order they were -# printed. This, among other problems, make it hard while debugging. -# This will no longer be needed when naxalnet sends its messages -# directly to the systtemd journal instead of stdout. + +# Disable python buffering Environment=PYTHONUNBUFFERED=1 [Install] diff --git a/naxalnet/__init__.py b/naxalnet/__init__.py index 0e5a7d2..c2e97a2 100644 --- a/naxalnet/__init__.py +++ b/naxalnet/__init__.py @@ -36,4 +36,4 @@ See README.md for documentation. # # In case you forgot to change the version, skip the number # and put the next number in the next commit. -__version__ = "0.3.0" +__version__ = "0.3.0a1.dev1" diff --git a/naxalnet/iwd.py b/naxalnet/iwd.py index 30cb9f9..257adce 100644 --- a/naxalnet/iwd.py +++ b/naxalnet/iwd.py @@ -58,8 +58,8 @@ and what they mean: - node: a machine that runs naxalnet and is therefore connected to the mesh. """ - from dasbus.connection import SystemMessageBus +from naxalnet.log import logger IWD_BUS = "net.connman.iwd" IWD_ROOT_PATH = "/" @@ -165,8 +165,8 @@ class Device: adapter: name of adapter (str) """ - def __init__(self, name: str, bus=SystemMessageBus()): - self._iwd = IWD(bus) + def __init__(self, name: str): + self._iwd = IWD() self._bus = self._iwd._bus self._path = self._iwd.get_device_path_from_name(name) self.reload() @@ -181,11 +181,13 @@ class Device: def power_on(self): """Turn on the device and reload the proxy""" self._proxy.Powered = True + logger.debug("Powered on %s", self.name) self.reload() def power_off(self): """Turn off the device and reload the proxy""" self._proxy.Powered = False + logger.debug("Powered off %s", self.name) self.reload() def reload(self): @@ -225,6 +227,7 @@ class Device: def set_mode(self, mode: str): """change the device mode to mode""" self._proxy.Mode = mode + logger.debug("Set mode on %s to %s", self.name, mode) self.reload() def start_adhoc_open(self, name: str): @@ -242,11 +245,13 @@ class Device: # Stop adhoc if already started self.stop_adhoc() + logger.debug("Starting ad-hoc on %s", self.name) self._proxy.StartOpen(name) def stop_adhoc(self): """stop adhoc if adhoc is started""" if self.is_adhoc_started(): + logger.debug("Stopping ad-hoc on %s", self.name) self._proxy.Stop() self.reload() @@ -277,8 +282,8 @@ class Device: class Adapter: """represents an adapter as a python object""" - def __init__(self, name: str, bus=SystemMessageBus()): - self._iwd = IWD(bus) + def __init__(self, name: str): + self._iwd = IWD() self._bus = self._iwd._bus self._path = self._iwd.get_adapter_path_from_name(name) # Initialise self._proxy diff --git a/naxalnet/log.py b/naxalnet/log.py new file mode 100644 index 0000000..75c2a9c --- /dev/null +++ b/naxalnet/log.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python3 + +""" +log.py +------ + +This file contains the logger object, which is required for logging +to the systemd journal +""" + +import logging +from systemd import journal + +logger = logging.getLogger(__name__) +logger.setLevel(logging.DEBUG) +logger.addHandler(journal.JournalHandler()) diff --git a/naxalnet/scripts.py b/naxalnet/scripts.py index 5e70883..11e0de9 100644 --- a/naxalnet/scripts.py +++ b/naxalnet/scripts.py @@ -34,6 +34,7 @@ from dasbus.error import DBusError from naxalnet import __version__ from naxalnet.iwd import Adapter, Device, IWD from naxalnet.config import parse_args +from naxalnet.log import logger def copy_files(args): @@ -44,7 +45,7 @@ def copy_files(args): See man:systemd.network(5) """ - print("Copying network config files") + logger.info("Copying network config files") dest = Path(args.networkd_runtime_dir) src = Path(args.networkd_config_dir) @@ -74,10 +75,13 @@ def setup_devices(args): # ad-hoc or ap. Many adapters will support both, # so we will prioritise ad-hoc over ap. device = Device(i) + logger.debug("Found device %s", device.name) adapter = Adapter(device.adapter) if adapter.supports_mode("ad-hoc"): + logger.debug("The device %s can be used for ad-hoc", device.name) adhoc_devices.append(i) if adapter.supports_mode("ap"): + logger.debug("The device %s can be used for ap", device.name) ap_devices.append(i) if len(adhoc_devices) != 0: @@ -88,11 +92,12 @@ def setup_devices(args): # So we will remove adhoc_device from ap_devices if it exists there if adhoc_device.name in ap_devices: ap_devices.remove(adhoc_device.name) - print("Starting mesh on", adhoc_device.name) + logger.info("Starting mesh on %s", adhoc_device.name) # Turn on adapter if it is off # See issue #9 adhoc_adapter = Adapter(adhoc_device.adapter) if not adhoc_adapter.is_powered_on(): + logger.debug("Adapter %s is off. Turning on", adhoc_adapter.name) adhoc_adapter.power_on() adhoc_device.reload() adhoc_device.start_adhoc_open(args.adhoc_name) @@ -100,12 +105,13 @@ def setup_devices(args): # ie, we have more devices if len(ap_devices) != 0: ap_device = Device(ap_devices.pop()) - print("Starting WiFi Access point on", ap_device.name) - print('Use "naxalnet --print-wifi" to get password') + logger.info("Starting WiFi Access Point on %s", ap_device.name) + logger.info("Use naxalnet --print-wifi to get password") # Turn on adapter if it is off # See issue #9 ap_adapter = Adapter(ap_device.adapter) if not ap_adapter.is_powered_on(): + logger.debug("Adapter %s is off. Turning on", ap_adapter.name) ap_adapter.power_on() ap_adapter.reload() ap_device.start_ap(args.ap_ssid, args.ap_passwd) @@ -144,14 +150,13 @@ def here_be_dragons(): try: copy_files(args) except PermissionError as error: - print(error) - sys.exit("Make sure you are root") + logger.error("Cannot copy file: %s", error) + sys.exit(3) try: setup_devices(args) - except DBusError as error: - print(error) - sys.exit("An error occured while communicating with iwd") + except DBusError: + logger.exception("Error while communicating with iwd") + sys.exit(4) - # naxalnet will print Bye if no errors occured - print("Bye") + logger.debug("Finished.") diff --git a/setup.cfg b/setup.cfg index e03bdf4..badf0bc 100644 --- a/setup.cfg +++ b/setup.cfg @@ -22,6 +22,7 @@ install_requires = configparser pathlib argparse + systemd [options.entry_points] console_scripts = From 4db6d9457fcf2db2495013cf7183cb1ffc8f8cf8 Mon Sep 17 00:00:00 2001 From: Pranav Jerry Date: Sat, 4 Sep 2021 11:53:08 +0530 Subject: [PATCH 2/8] improved README, more logging --- README.md | 49 +++++++++++++++++++++++++++++----------------- naxalnet/config.py | 5 +++++ 2 files changed, 36 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 1fd5765..a70635d 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ network. + ### Internet shutdown -You can communicate with neighbouring devices running naxalnet, -using services like [IPFS][], [Jami][], [Secure Scuttlebutt][ssb] -and others which can work on an intranet. -They should be installed on your machine _before_ your friendly -democratic government announces an [internet shutdown][], since you -cannot download and install them during a shutdown. -When a shutdown occurs, [enable naxalnet][enablenx] +You can communicate with neighbouring devices running naxalnet, using +services like [IPFS][], [Jami][], [Secure Scuttlebutt][ssb] and others +which can work on an intranet. They should be installed on your +machine _before_ your friendly democratic government announces an +[internet shutdown][], since you cannot download and install them +during a shutdown. When a shutdown occurs, [enable naxalnet][enablenx]. ## Uninstalling @@ -273,10 +280,16 @@ See [HACKING.md](HACKING.md) ## Similar projects -The following projects are similar to naxalnet, but are not designed -to be used in a machine with WiFi adapter. If you live in -an area where the materials required for any of them are easily -available, consider using them instead of naxalnet. +Many projects make setting up B.A.T.M.A.N. Advanced mesh networks with +WiFi routers easier. They are easier to setup and are more +configurable. But naxalnet is different from them. It simplifies +setting up mesh networks with _laptops or computers_, and is not +designed to work with routers. + +The following projects does something similar to naxalnet, but +requires special devices or routers to work. If you live in an area +where the materials required for any of them are easily available, +consider using them instead of naxalnet. - [LibreMesh][]: framework for OpenWrt-based firmwares - [disaster.radio][]: solar-powered communications network diff --git a/naxalnet/config.py b/naxalnet/config.py index 69991ec..38a7a16 100644 --- a/naxalnet/config.py +++ b/naxalnet/config.py @@ -46,6 +46,7 @@ from pathlib import Path from configparser import ConfigParser from argparse import ArgumentParser, Namespace from naxalnet.default import CONFIG, CONFIG_FILES, CONFIG_DIRS +from naxalnet.log import logger def get_config_files(): @@ -54,6 +55,7 @@ def get_config_files(): of files that exists as pathlib.Path objects """ config_files = [] + for directory in CONFIG_DIRS: path = Path(directory) if path.exists(): @@ -68,12 +70,14 @@ def parse_config(): Parse all configuration files, with the values in default.py as fallback """ + logger.debug("Parsing config files") parser = ConfigParser() # encoded defaults parser.read_dict(CONFIG) # read config files files = get_config_files() for i in files: + logger.debug("Reading config file %s", str(i)) parser.read_file(i.open()) return parser @@ -141,4 +145,5 @@ def parse_args() -> Namespace: help="prints the version and exit", ) + logger.debug("Parsing arguments") return parser.parse_args() From e4a7fa5d3f6ded7817d076029624848aed4c550e Mon Sep 17 00:00:00 2001 From: Pranav Jerry Date: Sat, 4 Sep 2021 12:59:26 +0530 Subject: [PATCH 3/8] renamed systemd-networkd config files --- naxalnet.service | 4 ++-- naxalnet/__init__.py | 2 +- setup.cfg | 15 ++++++++------- .../{01-batman.netdev => mesh.01-batman.netdev} | 0 .../{02-bridge.netdev => mesh.02-bridge.netdev} | 0 ...oc.network => mesh.03-wireless-ad-hoc.network} | 0 .../{04-batman.network => mesh.04-batman.network} | 0 ...ess-ap.network => mesh.05-wireless-ap.network} | 0 .../{06-eth.network => mesh.06-eth.network} | 0 .../{07-bridge.network => mesh.07-bridge.network} | 0 10 files changed, 11 insertions(+), 10 deletions(-) rename systemd-networkd/{01-batman.netdev => mesh.01-batman.netdev} (100%) rename systemd-networkd/{02-bridge.netdev => mesh.02-bridge.netdev} (100%) rename systemd-networkd/{03-wireless-ad-hoc.network => mesh.03-wireless-ad-hoc.network} (100%) rename systemd-networkd/{04-batman.network => mesh.04-batman.network} (100%) rename systemd-networkd/{05-wireless-ap.network => mesh.05-wireless-ap.network} (100%) rename systemd-networkd/{06-eth.network => mesh.06-eth.network} (100%) rename systemd-networkd/{07-bridge.network => mesh.07-bridge.network} (100%) diff --git a/naxalnet.service b/naxalnet.service index d3ba53d..4280cfd 100644 --- a/naxalnet.service +++ b/naxalnet.service @@ -30,8 +30,8 @@ ExecStartPre=/usr/bin/sleep 2 ExecStart=/usr/bin/naxalnet # Reload systemd-networkd after naxalnet exits ExecStartPost=/usr/bin/networkctl reload -# Delete all files in /run/systemd/network -ExecStop=/usr/bin/find /run/systemd/network -type f -delete +# Delete all files starting with mesh.* in /run/systemd/network +ExecStop=/usr/bin/find /run/systemd/network -type f -delete -name "mesh.*" # Delete the interfaces created... ExecStopPost=/usr/bin/networkctl delete bridge0 bat0 # ... and reload the configuration files. diff --git a/naxalnet/__init__.py b/naxalnet/__init__.py index c2e97a2..cc4b311 100644 --- a/naxalnet/__init__.py +++ b/naxalnet/__init__.py @@ -36,4 +36,4 @@ See README.md for documentation. # # In case you forgot to change the version, skip the number # and put the next number in the next commit. -__version__ = "0.3.0a1.dev1" +__version__ = "0.3.0a1.dev3" diff --git a/setup.cfg b/setup.cfg index badf0bc..df3c1e4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -19,6 +19,7 @@ packages = find: python_requires = >=3.6 install_requires = dasbus + # pathlib, configparser and argparse are in the standard library configparser pathlib argparse @@ -34,10 +35,10 @@ lib/systemd/system = /etc/naxalnet = naxalnet.conf.example share/naxalnet/networkd = - systemd-networkd/01-batman.netdev - systemd-networkd/02-bridge.netdev - systemd-networkd/03-wireless-ad-hoc.network - systemd-networkd/04-batman.network - systemd-networkd/05-wireless-ap.network - systemd-networkd/06-eth.network - systemd-networkd/07-bridge.network + systemd-networkd/mesh.01-batman.netdev + systemd-networkd/mesh.02-bridge.netdev + systemd-networkd/mesh.03-wireless-ad-hoc.network + systemd-networkd/mesh.04-batman.network + systemd-networkd/mesh.05-wireless-ap.network + systemd-networkd/mesh.06-eth.network + systemd-networkd/mesh.07-bridge.network diff --git a/systemd-networkd/01-batman.netdev b/systemd-networkd/mesh.01-batman.netdev similarity index 100% rename from systemd-networkd/01-batman.netdev rename to systemd-networkd/mesh.01-batman.netdev diff --git a/systemd-networkd/02-bridge.netdev b/systemd-networkd/mesh.02-bridge.netdev similarity index 100% rename from systemd-networkd/02-bridge.netdev rename to systemd-networkd/mesh.02-bridge.netdev diff --git a/systemd-networkd/03-wireless-ad-hoc.network b/systemd-networkd/mesh.03-wireless-ad-hoc.network similarity index 100% rename from systemd-networkd/03-wireless-ad-hoc.network rename to systemd-networkd/mesh.03-wireless-ad-hoc.network diff --git a/systemd-networkd/04-batman.network b/systemd-networkd/mesh.04-batman.network similarity index 100% rename from systemd-networkd/04-batman.network rename to systemd-networkd/mesh.04-batman.network diff --git a/systemd-networkd/05-wireless-ap.network b/systemd-networkd/mesh.05-wireless-ap.network similarity index 100% rename from systemd-networkd/05-wireless-ap.network rename to systemd-networkd/mesh.05-wireless-ap.network diff --git a/systemd-networkd/06-eth.network b/systemd-networkd/mesh.06-eth.network similarity index 100% rename from systemd-networkd/06-eth.network rename to systemd-networkd/mesh.06-eth.network diff --git a/systemd-networkd/07-bridge.network b/systemd-networkd/mesh.07-bridge.network similarity index 100% rename from systemd-networkd/07-bridge.network rename to systemd-networkd/mesh.07-bridge.network From 87c5d4814463353b5d039fa8108fb6f9fb9a3d75 Mon Sep 17 00:00:00 2001 From: Pranav Jerry Date: Sat, 4 Sep 2021 14:24:53 +0530 Subject: [PATCH 4/8] added more logging info --- naxalnet/__init__.py | 2 +- naxalnet/iwd.py | 6 ++++++ naxalnet/scripts.py | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/naxalnet/__init__.py b/naxalnet/__init__.py index cc4b311..8e71a68 100644 --- a/naxalnet/__init__.py +++ b/naxalnet/__init__.py @@ -36,4 +36,4 @@ See README.md for documentation. # # In case you forgot to change the version, skip the number # and put the next number in the next commit. -__version__ = "0.3.0a1.dev3" +__version__ = "0.3.0a1.dev4" diff --git a/naxalnet/iwd.py b/naxalnet/iwd.py index 257adce..b9eb90c 100644 --- a/naxalnet/iwd.py +++ b/naxalnet/iwd.py @@ -270,11 +270,15 @@ class Device: # Stop ap if already started self.stop_ap() + logger.debug( + "Starting ap on %s with ssid %s and password %s", self.name, ssid, passwd + ) self._proxy.Start(ssid, passwd) def stop_ap(self): """stop ap if an ap is started""" if self.is_ap_started(): + logger.debug("Stopping ap on %s", self.name) self._proxy.Stop() self.reload() @@ -305,10 +309,12 @@ class Adapter: def power_on(self): """power on the adapter""" self._proxy.Powered = True + logger.debug("Powered on adapter %s", self.name) def power_off(self): """power off the adapter""" self._proxy.Powered = False + logger.debug("Powered off adapter %s", self.name) def supports_mode(self, mode: str) -> bool: """ diff --git a/naxalnet/scripts.py b/naxalnet/scripts.py index 11e0de9..ce2d268 100644 --- a/naxalnet/scripts.py +++ b/naxalnet/scripts.py @@ -116,6 +116,9 @@ def setup_devices(args): ap_adapter.reload() ap_device.start_ap(args.ap_ssid, args.ap_passwd) + # naxalnet prints Bye if no errors occured + logger.info("Bye") + def print_wifi(args): """ From 3774076e0348eba1aaea5fa5d600d49fc20dc8e7 Mon Sep 17 00:00:00 2001 From: Pranav Jerry Date: Sat, 4 Sep 2021 18:37:30 +0530 Subject: [PATCH 5/8] updated README Added new dependency python-systemd --- README.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index a70635d..f3ef8c7 100644 --- a/README.md +++ b/README.md @@ -41,14 +41,15 @@ with anyone currently at risk of death in overcrowded prisons. ## Requirements -- [systemd v248 or more][batman-systemd] +- [systemd-networkd v248 or more][batman-systemd] - Linux kernel with batman-adv module - [iwd][] -- python -- python-setuptools (for building and installing) -- [dasbus][] -- WiFi adapter with ad-hoc support -- two or more computers, or laptops with WiFi adapter, called nodes +- python3 +- python3-setuptools (for building and installing) +- python3-systemd (for logging to systemd journal) +- [python3-dasbus][] +- two or more machines with WiFi adapter having ad-hoc support, called + nodes - batctl (optional, for debugging) - python pip (optional, for uninstalling) @@ -74,17 +75,17 @@ you need it. naxalnet is not packaged for Ubuntu, so you will have to build and install it manually. -Currently, only the [unreleased 21.10][ubuntu-systemd] comes with the -required version of systemd. Therefore, naxalnet won't work on Ubuntu -21.04 or older. +Currently, only the **unreleased 21.10** comes with the +required version of systemd. Therefore, naxalnet **won't work on Ubuntu +21.04 or older**. - + Install the requirements from the Ubuntu repositories: ```sh # batctl is optional -sudo apt install systemd python3-pip iwd batctl build-essential +sudo apt install python3-pip python3-systemd iwd batctl build-essential # Now, install dasbus with pip sudo pip3 install dasbus ``` @@ -96,11 +97,11 @@ Now follow the instructions in the naxalnet is not packaged for Fedora, so it should be installed manually. naxalnet requires atleast systemd v248 which is only -available on Fedora 34 and above. Install the dependencies: +available on **Fedora 34 and above**. Install the dependencies: ```sh # systemd-resolved may be required for rawhide -sudo dnf install systemd-networkd iwd python3-dasbus python3-setuptools +sudo dnf install systemd-networkd iwd python3-dasbus python3-setuptools python3-systemd ``` Now head over to the [next section][install-manual] to install naxalnet. @@ -319,6 +320,5 @@ See [LICENSE](LICENSE) for the complete version of the license. [iwd]: https://iwd.wiki.kernel.org "WiFi daemon" [free-sw]: https://gnu.org/philosophy/free-sw.html "What is free software?" [enablenx]: #running-at-boot -[ubuntu-systemd]: https://packages.ubuntu.com/impish/systemd [requirements]: #requirements [install-manual]: #manually From ee341d696770e59be4daf46677602b57606a5f57 Mon Sep 17 00:00:00 2001 From: Pranav Jerry Date: Sat, 4 Sep 2021 20:00:00 +0530 Subject: [PATCH 6/8] updated README.md Made the requirements more clear --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index f3ef8c7..07151d4 100644 --- a/README.md +++ b/README.md @@ -43,15 +43,15 @@ with anyone currently at risk of death in overcrowded prisons. - [systemd-networkd v248 or more][batman-systemd] - Linux kernel with batman-adv module -- [iwd][] +- [iwd][] for controlling the WiFi adapter - python3 -- python3-setuptools (for building and installing) -- python3-systemd (for logging to systemd journal) -- [python3-dasbus][] -- two or more machines with WiFi adapter having ad-hoc support, called - nodes +- python3-setuptools, for building and installing naxalnet +- python3-systemd, for logging to systemd journal +- [dasbus][], for communicating with iwd +- two or more machines with a WiFi adapter having ad-hoc support, called + nodes or peers - batctl (optional, for debugging) -- python pip (optional, for uninstalling) +- python3-pip (optional, for `make uninstall` to work) ## Installing From 97b1f46535aedc87c8263a1c767a7b6f0c94a0fd Mon Sep 17 00:00:00 2001 From: Pranav Jerry Date: Sun, 5 Sep 2021 13:47:54 +0530 Subject: [PATCH 7/8] updated CHANGELOG and version in __init__.py Ready for merge --- CHANGELOG.md | 4 ++++ naxalnet/__init__.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d4d7fe..d739791 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [Unreleased][] - 2021-09-05 + +- Now logs to systemd journal. New dependency - `python3-systemd` + ## [v0.3.0][] - 2021-08-19 - Support for arguments diff --git a/naxalnet/__init__.py b/naxalnet/__init__.py index 8e71a68..27c93ba 100644 --- a/naxalnet/__init__.py +++ b/naxalnet/__init__.py @@ -36,4 +36,4 @@ See README.md for documentation. # # In case you forgot to change the version, skip the number # and put the next number in the next commit. -__version__ = "0.3.0a1.dev4" +__version__ = "0.3.0a2" From 4d9de4d3c3d42c9d1cf8bec72a347891ff49799c Mon Sep 17 00:00:00 2001 From: Pranav Jerry Date: Sun, 5 Sep 2021 14:00:11 +0530 Subject: [PATCH 8/8] updated changelog again --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d739791..8c418eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## [Unreleased][] - 2021-09-05 - Now logs to systemd journal. New dependency - `python3-systemd` +- Fixed dependency order in systemd service ## [v0.3.0][] - 2021-08-19