Merge claude/1
This commit is contained in:
commit
55ca1b4270
@ -1,11 +1,14 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# CFG↔docker subnet adoption: if the docker network already exists with a
|
# CFG↔docker subnet adoption: if the docker network already exists with a
|
||||||
# different /24 than CFG, treat docker's value as the truth and update CFG.
|
# different subnet than CFG, treat docker's value as the truth and update CFG.
|
||||||
# Apps' allocated IPs are still inside docker's subnet, so nothing else needs
|
# This realigns CFG ONLY — it does NOT touch already-allocated per-app IPs.
|
||||||
# re-IPing. (A genuine user-initiated subnet change is a `libreportal app
|
# Because IPs are pinned to the first three octets of the old subnet
|
||||||
# install <name> --reset-network` per app — fresh compose + fresh IPs from
|
# (ipFindAvailable), adopting a different /24 base strands every existing app
|
||||||
# the new subnet via the standard idempotent install path.)
|
# IP outside docker's real subnet. Those apps need re-IPing from the corrected
|
||||||
|
# subnet: automatically via the network-drift detector + `libreportal system
|
||||||
|
# network heal`, or manually per app via `libreportal app install <name>
|
||||||
|
# --reset-network` (fresh compose + fresh IPs through the idempotent install).
|
||||||
adoptDockerSubnet()
|
adoptDockerSubnet()
|
||||||
{
|
{
|
||||||
local current_subnet="$1"
|
local current_subnet="$1"
|
||||||
|
|||||||
@ -23,6 +23,7 @@ ipAllocation()
|
|||||||
if [[ -z "$available_ip" ]]; then
|
if [[ -z "$available_ip" ]]; then
|
||||||
isError "No available IP addresses in pool"
|
isError "No available IP addresses in pool"
|
||||||
allocated_ip="$existing_ip"
|
allocated_ip="$existing_ip"
|
||||||
|
return 1
|
||||||
fi
|
fi
|
||||||
sqlite3 "$docker_dir/$db_file" \
|
sqlite3 "$docker_dir/$db_file" \
|
||||||
"UPDATE network_resources \
|
"UPDATE network_resources \
|
||||||
@ -33,6 +34,10 @@ ipAllocation()
|
|||||||
else
|
else
|
||||||
allocated_ip="$existing_ip"
|
allocated_ip="$existing_ip"
|
||||||
fi
|
fi
|
||||||
|
# An active row already exists for this app+service — reused or reset in
|
||||||
|
# place above. Don't fall through to the INSERT below: that second write
|
||||||
|
# would violate UNIQUE(app_name,resource_type,service_name).
|
||||||
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ipFindAvailable
|
ipFindAvailable
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user