Author SHA1 Message Date
Christian Manivong f68c758338 fix: opt out of the SSH hardening inherited from napalm-linux
CI / test (3.10) (pull_request) Failing after 20s
CI / test (3.11) (pull_request) Failing after 18s
CI / test (3.12) (pull_request) Failing after 19s
CI / test (3.10) (push) Successful in 28s
CI / test (3.11) (push) Successful in 27s
CI / test (3.12) (push) Successful in 29s
OpenMediaVault generates sshd_config from its own database; a drop-in
netOrk wrote would be dropped by the next apply of the SSH settings
without a word. harden_ssh_server = None makes netOrk's capability probe
answer no.

Requires napalm-linux 0.5.0; bumps to 0.1.1. NetOrk/netork#1027
2026-10-11 23:12:34 +02:00
christianmanivong 5742349742 Merge pull request 'ci: run the tests and build the package on every push and pull request' (#2) from ci/workflow into master
CI / test (3.10) (push) Successful in 29s
CI / test (3.11) (push) Successful in 27s
CI / test (3.12) (push) Successful in 29s
2026-10-07 06:29:44 +00:00
Christian Manivong ca03b6dd99 ci: run the tests and build the package on every push and pull request
CI / test (3.10) (push) Successful in 28s
CI / test (3.11) (push) Successful in 27s
CI / test (3.12) (push) Successful in 29s
CI / test (3.10) (pull_request) Successful in 28s
CI / test (3.11) (pull_request) Successful in 27s
CI / test (3.12) (pull_request) Successful in 29s
The same job as napalm-fritzbox and napalm-opnsense: Python 3.10, 3.11 and
3.12, pytest, then wheel and sdist. napalm-device-types comes from
git.netork.io first, because PyPI has an unrelated package of that name.

pyproject gains a dev extra with pytest, which the job installs.

napalm-linux, which this driver builds on, is installed from git as well:
it is not on PyPI either.
2026-10-07 07:52:44 +02:00
christianmanivong cfe730ccea Merge pull request 'feat: declare that upgrading everything must be a full upgrade on OpenMediaVault' (#1) from feat/full-upgrade into master 2026-10-06 10:27:22 +00:00
4 changed files with 76 additions and 2 deletions

No files matched your search

+50
View File
@@ -0,0 +1,50 @@
name: CI
on:
push:
branches: ["**"]
pull_request:
branches: ["**"]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install package with dev extras
run: |
python -m pip install --upgrade pip
# napalm-device-types lives in git.netork.io/NAPALM, not on PyPI: without this
# pip looks there, finds an unrelated 0.1.0 and the job dies before any test.
python -m pip install "napalm-device-types @ git+https://git.netork.io/NAPALM/napalm-device-types.git"
# napalm-linux, which this driver builds on, is not on PyPI either.
python -m pip install "napalm-linux @ git+https://git.netork.io/NAPALM/napalm-linux.git"
python -m pip install -e ".[dev]"
- name: Run unit tests
run: |
python -m pytest -q --tb=short
- name: Build wheel and sdist
run: |
python -m pip install build
python -m build
- name: Upload dist artifacts
# v4 refuses to run on Gitea ("not currently supported on GHES").
uses: actions/upload-artifact@v3
with:
name: dist-${{ matrix.python-version }}
path: dist/*
+5
View File
@@ -65,6 +65,11 @@ class OpenMediaVaultDriver(StorageDriver, LinuxDriver):
FingerprintRule("openmediavault", weight=9.0, mandatory=True), FingerprintRule("openmediavault", weight=9.0, mandatory=True),
] ]
#: OMV generates sshd_config from its own database; a drop-in netOrk wrote
#: would be dropped on the next apply of the SSH settings. Inherited from
#: napalm-linux, so opted out here (NetOrk/netork#1027).
harden_ssh_server = None # type: ignore[assignment]
# ── Facts override ───────────────────────────────────────────────────────── # ── Facts override ─────────────────────────────────────────────────────────
def get_facts(self) -> dict[str, Any]: def get_facts(self) -> dict[str, Any]:
+5 -2
View File
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project] [project]
name = "napalm-openmediavault" name = "napalm-openmediavault"
version = "0.1.0" version = "0.1.1"
description = "NAPALM driver for OpenMediaVault NAS (SSH)" description = "NAPALM driver for OpenMediaVault NAS (SSH)"
readme = "README.md" readme = "README.md"
requires-python = ">=3.9" requires-python = ">=3.9"
@@ -25,9 +25,12 @@ classifiers = [
dependencies = [ dependencies = [
"napalm>=4.0", "napalm>=4.0",
"napalm-device-types>=0.3.0", "napalm-device-types>=0.3.0",
"napalm-linux>=0.1.0", "napalm-linux>=0.5.0",
] ]
[project.optional-dependencies]
dev = ["pytest"]
[project.entry-points."napalm.drivers"] [project.entry-points."napalm.drivers"]
openmediavault = "napalm_openmediavault:OpenMediaVaultDriver" openmediavault = "napalm_openmediavault:OpenMediaVaultDriver"
+16
View File
@@ -0,0 +1,16 @@
"""OpenMediaVault writes sshd_config itself, from its own database.
The Linux driver offers to harden the SSH server by writing a drop-in under
/etc/ssh/sshd_config.d (NetOrk/netork#1027). On OMV the next apply of the SSH
settings (``omv-salt deploy run ssh``) would regenerate the configuration and
take the change back without a word, so this driver opts out: netOrk's
capability probe asks ``callable(harden_ssh_server)``.
"""
from __future__ import annotations
from napalm_openmediavault.openmediavault import OpenMediaVaultDriver
def test_does_not_offer_ssh_hardening():
assert not callable(getattr(OpenMediaVaultDriver, "harden_ssh_server", None))