mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-11-28 22:29:11 +01:00
Compare commits
2 Commits
20e05f021f
...
b8d0b215e1
| Author | SHA1 | Date | |
|---|---|---|---|
| b8d0b215e1 | |||
| 46d07f6b75 |
@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"intent": "main goes green again: 'Pre-commit checks' and 'dependency freshness' failed on 2026-10-09 only because pins fell behind new upstream releases.",
|
||||||
|
"scope": [
|
||||||
|
"meta/requirements.txt, meta/requirements-test.txt",
|
||||||
|
"Non-goal: pre-commit hook revs (not checked by the freshness gate)"
|
||||||
|
],
|
||||||
|
"changes": [
|
||||||
|
"anthropic 1.12.1 -> 1.13.0 (both files), pyupgrade 3.21.2 -> 3.22.0, reorder-python-imports 3.17.0 -> 3.18.0",
|
||||||
|
"black 26.10.0 -> 26.10.1, pipdeptree 4.2.5 -> 4.2.6, ruff 0.16.10 -> 0.17.0, selenium 4.50.0 -> 4.51.0 (went stale since the red run)"
|
||||||
|
],
|
||||||
|
"verification": [
|
||||||
|
{
|
||||||
|
"command": "scripts/check_dependency_freshness.sh meta/requirements.txt meta/requirements-test.txt",
|
||||||
|
"result": "pass",
|
||||||
|
"evidence": "exit 0 (only the existing typescript transitive exception listed)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "pip install --dry-run -r meta/requirements.txt -r meta/requirements-test.txt",
|
||||||
|
"result": "pass",
|
||||||
|
"evidence": "resolves, exit 0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "pytest python_pkg/code_tutor (fresh venv from meta/requirements-test.txt, anthropic 1.13.0)",
|
||||||
|
"result": "pass",
|
||||||
|
"evidence": "217 passed"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"risks": [
|
||||||
|
"ruff 0.17.0 from requirements.txt may flag new rules when run outside pre-commit (pre-commit pins its own ruff rev)"
|
||||||
|
],
|
||||||
|
"rollback": [
|
||||||
|
"git revert this commit",
|
||||||
|
"Re-run scripts/check_dependency_freshness.sh: it will report the old pins as behind again"
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
{
|
||||||
|
"intent": "The phone's instant workout poke reaches screen-locker on tcp/8774; tcp/8773 is left to book-guard's desktop wrapper (loopback), whose window the poke server had been answering.",
|
||||||
|
"scope": [
|
||||||
|
"linux_configuration/features/lib/wg_firewall.sh, wg_sshd.sh, tests/test_wg_firewall.sh",
|
||||||
|
"Non-goal: any other firewall rule; the poke stays LAN-only with no wg0 rule"
|
||||||
|
],
|
||||||
|
"changes": [
|
||||||
|
"LAN-only poke rule renders 'ip saddr <LAN> tcp dport 8774 accept' instead of 8773",
|
||||||
|
"allow-workout-poke help and confirmation text name tcp/8774"
|
||||||
|
],
|
||||||
|
"verification": [
|
||||||
|
{
|
||||||
|
"command": "bash linux_configuration/features/lib/tests/test_wg_firewall.sh",
|
||||||
|
"result": "pass",
|
||||||
|
"evidence": "18 passed, 0 failed (nft -c skipped: not permitted unprivileged)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "vm run pokefw 'echo y | sudo bash ~/lc/features/setup_wireguard_ssh.sh allow-workout-poke'",
|
||||||
|
"result": "pass",
|
||||||
|
"evidence": "vmbox: exit 0, live ruleset has 'ip saddr 192.168.1.0/24 tcp dport 8774 accept', no 8773 rule, sshd active, second ssh session connects. Not verified on the host at commit time."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"risks": [
|
||||||
|
"Until the host re-applies, the live ruleset still opens 8773 (nothing listens on the LAN there) and blocks 8774, so the poke fails fast and the regular sync credits workouts",
|
||||||
|
"nftables-drift reports drift until the host re-applies"
|
||||||
|
],
|
||||||
|
"rollback": [
|
||||||
|
"git revert, then sudo bash linux_configuration/features/setup_wireguard_ssh.sh allow-workout-poke",
|
||||||
|
"Check: sudo nft list ruleset | grep 877 shows the restored port"
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -64,23 +64,23 @@ else
|
|||||||
_t_pass "ALLOW_DOT=false renders no 853 rule"
|
_t_pass "ALLOW_DOT=false renders no 853 rule"
|
||||||
fi
|
fi
|
||||||
printf '\n-- the workout poke is LAN-only --\n'
|
printf '\n-- the workout poke is LAN-only --\n'
|
||||||
if grep -q 'dport 8773' "$RULES"; then
|
if grep -q 'dport 8774' "$RULES"; then
|
||||||
_t_fail "ALLOW_WORKOUT_POKE unset renders no 8773 rule"
|
_t_fail "ALLOW_WORKOUT_POKE unset renders no 8774 rule"
|
||||||
else
|
else
|
||||||
_t_pass "ALLOW_WORKOUT_POKE unset renders no 8773 rule"
|
_t_pass "ALLOW_WORKOUT_POKE unset renders no 8774 rule"
|
||||||
fi
|
fi
|
||||||
ALLOW_WORKOUT_POKE="true"
|
ALLOW_WORKOUT_POKE="true"
|
||||||
render_nftables_ruleset "$RULES"
|
render_nftables_ruleset "$RULES"
|
||||||
_t_file_has "$RULES" 'ip saddr 192.168.1.0/24 tcp dport 8773 accept' \
|
_t_file_has "$RULES" 'ip saddr 192.168.1.0/24 tcp dport 8774 accept' \
|
||||||
"ALLOW_WORKOUT_POKE opens 8773 to the LAN subnet"
|
"ALLOW_WORKOUT_POKE opens 8774 to the LAN subnet"
|
||||||
_t_eq "1" "$(grep -c 'dport 8773' "$RULES")" \
|
_t_eq "1" "$(grep -c 'dport 8774' "$RULES")" \
|
||||||
"exactly one 8773 rule: no wg0 rule, the poke never rides WireGuard"
|
"exactly one 8774 rule: no wg0 rule, the poke never rides WireGuard"
|
||||||
ALLOW_WORKOUT_POKE="false"
|
ALLOW_WORKOUT_POKE="false"
|
||||||
render_nftables_ruleset "$RULES"
|
render_nftables_ruleset "$RULES"
|
||||||
if grep -q 'dport 8773' "$RULES"; then
|
if grep -q 'dport 8774' "$RULES"; then
|
||||||
_t_fail "ALLOW_WORKOUT_POKE=false renders no 8773 rule"
|
_t_fail "ALLOW_WORKOUT_POKE=false renders no 8774 rule"
|
||||||
else
|
else
|
||||||
_t_pass "ALLOW_WORKOUT_POKE=false renders no 8773 rule"
|
_t_pass "ALLOW_WORKOUT_POKE=false renders no 8774 rule"
|
||||||
fi
|
fi
|
||||||
if command -v nft >/dev/null 2>&1; then
|
if command -v nft >/dev/null 2>&1; then
|
||||||
ALLOW_DOT="true"
|
ALLOW_DOT="true"
|
||||||
@ -134,8 +134,8 @@ out="$(allow_workout_poke 2>&1)"
|
|||||||
mapfile -t calls <"$TEST_TMPDIR/calls.log"
|
mapfile -t calls <"$TEST_TMPDIR/calls.log"
|
||||||
_t_eq "save_config ALLOW_WORKOUT_POKE=true|apply" "$(IFS='|' && printf '%s' "${calls[*]}")" \
|
_t_eq "save_config ALLOW_WORKOUT_POKE=true|apply" "$(IFS='|' && printf '%s' "${calls[*]}")" \
|
||||||
"the flag is saved as true before the ruleset is applied"
|
"the flag is saved as true before the ruleset is applied"
|
||||||
_t_file_has "${NFT_CONF}.new" 'ip saddr 192.168.1.0/24 tcp dport 8773 accept' \
|
_t_file_has "${NFT_CONF}.new" 'ip saddr 192.168.1.0/24 tcp dport 8774 accept' \
|
||||||
"the applied ruleset carries the LAN-only 8773 rule"
|
"the applied ruleset carries the LAN-only 8774 rule"
|
||||||
_t_has "$out" 'not wg0' "the confirmation says the port stays off WireGuard"
|
_t_has "$out" 'not wg0' "the confirmation says the port stays off WireGuard"
|
||||||
|
|
||||||
_t_report "test_wg_firewall.sh"
|
_t_report "test_wg_firewall.sh"
|
||||||
|
|||||||
@ -36,12 +36,12 @@ render_nftables_ruleset() {
|
|||||||
ha_rule+=$'\n\t\tiifname "'"${WG_IFACE}"$'" tcp dport 8123 accept'
|
ha_rule+=$'\n\t\tiifname "'"${WG_IFACE}"$'" tcp dport 8123 accept'
|
||||||
fi
|
fi
|
||||||
# Workout poke (screen-locker workout-poke.service): the phone POSTs a
|
# Workout poke (screen-locker workout-poke.service): the phone POSTs a
|
||||||
# finished workout to tcp/8773 the moment it ends. LAN only, deliberately
|
# finished workout to tcp/8774 the moment it ends. LAN only, deliberately
|
||||||
# NO wg0 rule: off the home LAN the poke fails fast and the normal sync
|
# NO wg0 rule: off the home LAN the poke fails fast and the normal sync
|
||||||
# credits the workout instead.
|
# credits the workout instead.
|
||||||
local poke_rule=""
|
local poke_rule=""
|
||||||
if [[ ${ALLOW_WORKOUT_POKE:-false} == "true" ]]; then
|
if [[ ${ALLOW_WORKOUT_POKE:-false} == "true" ]]; then
|
||||||
poke_rule=$'\n\t\tip saddr '"${LAN_SUBNET}"$' tcp dport 8773 accept'
|
poke_rule=$'\n\t\tip saddr '"${LAN_SUBNET}"$' tcp dport 8774 accept'
|
||||||
fi
|
fi
|
||||||
# DNS-over-TLS (setup_dot_resolver.sh, bound to the WireGuard address):
|
# DNS-over-TLS (setup_dot_resolver.sh, bound to the WireGuard address):
|
||||||
# rendered here so a re-apply keeps it -- a runtime 'nft add rule' did not.
|
# rendered here so a re-apply keeps it -- a runtime 'nft add rule' did not.
|
||||||
@ -185,5 +185,5 @@ allow_workout_poke() {
|
|||||||
save_config
|
save_config
|
||||||
write_nftables_ruleset
|
write_nftables_ruleset
|
||||||
verify_nftables_then_apply
|
verify_nftables_then_apply
|
||||||
log_ok "Opened tcp/8773 from ${LAN_SUBNET:-the LAN} only, not ${WG_IFACE} (persisted)."
|
log_ok "Opened tcp/8774 from ${LAN_SUBNET:-the LAN} only, not ${WG_IFACE} (persisted)."
|
||||||
}
|
}
|
||||||
|
|||||||
@ -236,7 +236,7 @@ Commands:
|
|||||||
allow-web Open tcp/80 and tcp/443 in the firewall (for a web server on this host).
|
allow-web Open tcp/80 and tcp/443 in the firewall (for a web server on this host).
|
||||||
allow-dns Open udp/tcp 53 from the LAN in the firewall (for the DNS blocker on this host).
|
allow-dns Open udp/tcp 53 from the LAN in the firewall (for the DNS blocker on this host).
|
||||||
allow-dot Open tcp/853 on wg0 in the firewall (for the DoT resolver on this host).
|
allow-dot Open tcp/853 on wg0 in the firewall (for the DoT resolver on this host).
|
||||||
allow-workout-poke Open tcp/8773 from the LAN only (screen-locker's workout poke).
|
allow-workout-poke Open tcp/8774 from the LAN only (screen-locker's workout poke).
|
||||||
verify Check /etc/nftables.conf matches this script and that
|
verify Check /etc/nftables.conf matches this script and that
|
||||||
the live forward chain still lets Docker through.
|
the live forward chain still lets Docker through.
|
||||||
install-verify Install the units that run 'verify' at every boot, so
|
install-verify Install the units that run 'verify' at every boot, so
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
# suite itself fails loudly here on a missing import.
|
# suite itself fails loudly here on a missing import.
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
|
|
||||||
anthropic==1.12.1
|
anthropic==1.13.0
|
||||||
beautifulsoup4==4.15.0
|
beautifulsoup4==4.15.0
|
||||||
coverage==7.16.2
|
coverage==7.16.2
|
||||||
defusedxml==0.7.1
|
defusedxml==0.7.1
|
||||||
|
|||||||
@ -6,13 +6,13 @@
|
|||||||
|
|
||||||
add-trailing-comma==4.0.0
|
add-trailing-comma==4.0.0
|
||||||
aiohttp==3.14.4
|
aiohttp==3.14.4
|
||||||
anthropic==1.12.1
|
anthropic==1.13.0
|
||||||
autoflake==2.4.0
|
autoflake==2.4.0
|
||||||
autopep8==2.3.2
|
autopep8==2.3.2
|
||||||
bandit==1.9.4
|
bandit==1.9.4
|
||||||
beautifulsoup4==4.15.0
|
beautifulsoup4==4.15.0
|
||||||
berserk==0.14.0
|
berserk==0.14.0
|
||||||
black==26.10.0
|
black==26.10.1
|
||||||
bottle==0.13.4
|
bottle==0.13.4
|
||||||
codespell==2.4.3
|
codespell==2.4.3
|
||||||
coverage==7.16.2
|
coverage==7.16.2
|
||||||
@ -55,7 +55,7 @@ numpy==2.5.3
|
|||||||
opencv-python==5.0.0.93
|
opencv-python==5.0.0.93
|
||||||
pillow==12.3.0
|
pillow==12.3.0
|
||||||
pip-audit==2.10.1
|
pip-audit==2.10.1
|
||||||
pipdeptree==4.2.5
|
pipdeptree==4.2.6
|
||||||
pre-commit==4.6.2
|
pre-commit==4.6.2
|
||||||
prospector==1.19.1
|
prospector==1.19.1
|
||||||
pycodestyle==2.15.0
|
pycodestyle==2.15.0
|
||||||
@ -72,17 +72,17 @@ pytest-timeout==2.4.0
|
|||||||
pytest-xdist==3.8.0
|
pytest-xdist==3.8.0
|
||||||
python-chess==1.999
|
python-chess==1.999
|
||||||
python-kasa==0.11.0.1
|
python-kasa==0.11.0.1
|
||||||
pyupgrade==3.21.2
|
pyupgrade==3.22.0
|
||||||
radon==6.0.1
|
radon==6.0.1
|
||||||
reorder-python-imports==3.17.0
|
reorder-python-imports==3.18.0
|
||||||
requests==2.34.2
|
requests==2.34.2
|
||||||
rich==15.0.0
|
rich==15.0.0
|
||||||
ruff==0.16.10
|
ruff==0.17.0
|
||||||
# safety is deliberately not pinned: its only reference in this repo is a
|
# safety is deliberately not pinned: its only reference in this repo is a
|
||||||
# commented-out pre-commit hook, and safety 3.8.1 declares `typer<0.26`,
|
# commented-out pre-commit hook, and safety 3.8.1 declares `typer<0.26`,
|
||||||
# which would hold the typer this repo actually imports below latest.
|
# which would hold the typer this repo actually imports below latest.
|
||||||
secretstorage==3.5.0
|
secretstorage==3.5.0
|
||||||
selenium==4.50.0
|
selenium==4.51.0
|
||||||
typer==0.27.3
|
typer==0.27.3
|
||||||
types-python-dateutil==2.9.0.20260807
|
types-python-dateutil==2.9.0.20260807
|
||||||
types-PyYAML==6.0.12.20260906
|
types-PyYAML==6.0.12.20260906
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user