Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mdk/enhance wlan support #64

Draft
wants to merge 47 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
66fe38f
start of runcommand refactor
Oct 25, 2024
1f82960
Refactored run_command usage and added tests
MichaelKetchel Oct 25, 2024
ea17a88
Refactored runcommand_error.py to use standard values
MichaelKetchel Oct 25, 2024
9845c78
Fix tests
MichaelKetchel Oct 25, 2024
b11e18a
Improve command parsing using shlex and add docblocks
MichaelKetchel Oct 25, 2024
e578a77
Start a constants file
MichaelKetchel Oct 26, 2024
6cecf23
Add more util methods from other repos, and tests
MichaelKetchel Oct 26, 2024
3f28a72
Refactor util api to use runcommand
MichaelKetchel Oct 26, 2024
b514219
Refactor subprocess usage out of utils service
MichaelKetchel Oct 26, 2024
6e8395c
Refactor subprocess usage out of network service
MichaelKetchel Oct 26, 2024
d46ea8c
heavy-handed pass at consolidating all our global constants into cons…
MichaelKetchel Oct 26, 2024
1f08bd5
API port hardening release v1.0.5-1 (#52)
joshschmelzle Oct 27, 2024
7232d0c
Convert bluetooth_service.py
Oct 28, 2024
d0f0756
Complete refactoring out of helpers.py
Oct 28, 2024
5c76ac2
Completed refactoring of subprocess usage
Oct 29, 2024
c6a5b30
Merge branch 'WLAN-Pi:dev' into dev
MichaelKetchel Oct 29, 2024
fb57c2a
Refactor unittests to pytest
Oct 29, 2024
e393087
Merge remote-tracking branch 'origin/dev' into dev
Oct 29, 2024
ecf9aa1
Format Cleanups
Oct 29, 2024
0254570
Remove todo item
Oct 30, 2024
ccfbc71
Major refactor of wireless control
Nov 4, 2024
bf84f1f
Multiple adapter control should work now.
Nov 5, 2024
8cc892b
More improvements
Nov 5, 2024
89ae0a4
Formatted and linted
Nov 5, 2024
f017c8c
Merge branch 'main' into mdk/enhance_wlan_support
MichaelKetchel Nov 5, 2024
00cdf8a
Formatted and linted again
Nov 5, 2024
439fcbc
Merge branch 'dev' into mdk/enhance_wlan_support
Nov 5, 2024
1b80d9b
Formatted and linted again
Nov 5, 2024
a91f081
fixes https://github.com/WLAN-Pi/wlanpi-core/issues/14
Nov 5, 2024
92f7882
Fix remnant of wlan0 service
Nov 5, 2024
bdb4410
Improve error response of wlan endpoints when a non-existent interfac…
Nov 5, 2024
9308302
Fixed formatting
Nov 5, 2024
cc45c05
Draft of ap radio info stuff
Nov 6, 2024
7958b67
fixed a tyoi
Nov 6, 2024
5767c3b
Cleanup commit, plus more data!
Nov 7, 2024
d984279
bump changelog
Nov 7, 2024
24a47cd
fix imports and duplicate defs
Nov 7, 2024
24a1997
Fix formatting
Nov 7, 2024
abbf8e2
More cleanup, and armored up the network API against command injectio…
Nov 7, 2024
a7dc3ca
Version bump
Nov 7, 2024
f220072
Version bump and format
Nov 11, 2024
d71c40d
Version bump and format
Nov 13, 2024
406d885
Fix some auto gateway config quirks
Nov 13, 2024
e1cbb91
Add iw link endpoint
Nov 14, 2024
bcb6630
Relocate iw link endpoint code
Nov 14, 2024
21506aa
Merge branch 'dev' into mdk/enhance_wlan_support
Feb 14, 2025
865921b
Merge branch 'dev' into mdk/enhance_wlan_support
Feb 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ wlanpi-core (2.0.0~dev20250214.2) unstable; urgency=high

-- Josh Schmelzle <[email protected]> Fri, 14 Jan 2025 00:00:00 -0400

wlanpi-core (2.0.0~dev20250214.1) UNRELEASED; urgency=medium

[ Michael Ketchel ]
* Draft build of new wlan control features
* Fixed an api definition typo
* More tweaks, and a version bump to fire dev package deploy
* Increased resistance to injection attacks
* Version bump for build
* Add automatic default gateway configuration for wlan api
* Fix some auto gateway config quirks

-- Michael Ketchel <[email protected]> Wed, 13 Nov 2024 21:22:34 +0000

wlanpi-core (1.0.5-1) unstable; urgency=high

* API hardening by blocking iptables rule added by pi-gen
Expand Down
1 change: 0 additions & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ SDIST_DIR=debian/$(PACKAGE)-$(VERSION)

# ensure that the systemd services are handled by systemd.
override_dh_installsystemd:
dh_installsystemd --name=wpa_supplicant@wlan0 [email protected]
dh_installsystemd wlanpi-core.service
dh_installsystemd wlanpi-core.socket
dh_installsystemd var-log-wlanpi_core-debug.mount
Expand Down
1 change: 0 additions & 1 deletion debian/wlanpi-core.install
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@
/install/etc/wlanpi-core/ufw/wlanpi-core.rules /etc/wlanpi-core/ufw
/install/lib/systemd/system/wlanpi-core-ufw-first-boot.service /lib/systemd/system
/install/etc/wlanpi-core/ufw/current-rules-version /etc/wlanpi-core/ufw
/install/etc/wpa_supplicant/wpa_supplicant-wlan0.conf /etc/wpa_supplicant
/install/usr/bin/getjwt /usr/bin
/install/usr/bin/lhapitest /usr/bin
20 changes: 0 additions & 20 deletions debian/[email protected]
Original file line number Diff line number Diff line change
@@ -1,20 +0,0 @@
# DBUS managed wpa_supplicant service on wlan0

[Unit]
Description=WPA supplicant daemon (interface-specific version)
Requires=sys-subsystem-net-devices-%i.device
After=sys-subsystem-net-devices-%i.device
Before=network.target
Wants=network.target

# NetworkManager users will probably want the dbus version instead.

[Service]
Type=simple
#ExecStart=/sbin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-%I.conf -i%I
ExecStart=/sbin/wpa_supplicant -u -s -O /run/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-%I.conf -i%I
ExecReload=/bin/kill -HUP \$MAINPID

[Install]
WantedBy=multi-user.target
Alias=dbus-fi.w1.wpa_supplicant1.service
64 changes: 0 additions & 64 deletions install/etc/wpa_supplicant/wpa_supplicant-wlan0.conf

This file was deleted.

8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@


def parse_requires(_list):
requires = list()
require_list = list()
trims = ["#", "piwheels.org"]
for require in _list:
if any(match in require for match in trims):
continue
requires.append(require)
requires = list(filter(None, requires)) # remove "" from list
return requires
require_list.append(require)
require_list = list(filter(None, require_list)) # remove "" from list
return require_list


# important to collect various modules in the package directory
Expand Down
11 changes: 8 additions & 3 deletions wlanpi_core/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import os
import platform
import sys
from typing import Union

# third party imports
import uvicorn
Expand All @@ -26,7 +27,7 @@
from .__version__ import __version__


def port(port) -> int:
def check_port(port: Union[int, str]) -> int:
"""Check if the provided port is valid"""
try:
# make sure port is an int
Expand Down Expand Up @@ -60,7 +61,7 @@ def setup_parser() -> argparse.ArgumentParser:
"--port",
"-p",
dest="port",
type=port,
type=check_port,
default=8000,
help="Port number to run the server on",
)
Expand All @@ -73,7 +74,11 @@ def setup_parser() -> argparse.ArgumentParser:
help="Enable debug mode with verbose logging",
)
parser.add_argument(
"--version", "-V", "-v", action="version", version=f"{__version__}"
"--version",
"-V",
"-v",
action="version",
version=f"{__version__}"
)
return parser

Expand Down
Loading
Loading