Discover Edge registration in userdata

This commit is contained in:
Andrei Smaliak 2026-09-05 13:21:10 +02:00
parent 015c3c3384
commit 92d25b9439
2 changed files with 2 additions and 0 deletions

View File

@ -115,6 +115,7 @@ discover_registration_server() {
local candidate value local candidate value
[[ -n "$REGISTRATION_SERVER" ]] && { normalize_host "$REGISTRATION_SERVER"; return; } [[ -n "$REGISTRATION_SERVER" ]] && { normalize_host "$REGISTRATION_SERVER"; return; }
for candidate in \ for candidate in \
"/userdata/itscreen/data/it-screen/it-screen/registration.ini" \
"/home/${EDGE_USER}/.local/share/it-screen/it-screen/registration.ini" \ "/home/${EDGE_USER}/.local/share/it-screen/it-screen/registration.ini" \
"/home/${EDGE_USER}/.local/share/it-screen/registration.ini"; do "/home/${EDGE_USER}/.local/share/it-screen/registration.ini"; do
[[ -f "$candidate" ]] || continue [[ -f "$candidate" ]] || continue

View File

@ -12,6 +12,7 @@ class DynamicEnvironmentContractTest(unittest.TestCase):
self.assertIn('CONFIG_DIR="/etc/iomatex"', source) self.assertIn('CONFIG_DIR="/etc/iomatex"', source)
self.assertIn('reverse-tunnel.env', source) self.assertIn('reverse-tunnel.env', source)
self.assertIn("discover_registration_server", source) self.assertIn("discover_registration_server", source)
self.assertIn("/userdata/itscreen/data/it-screen/it-screen/registration.ini", source)
self.assertIn("EnvironmentFile=${CONFIG_FILE}", source) self.assertIn("EnvironmentFile=${CONFIG_FILE}", source)
def test_operator_helper_requires_environment_host(self): def test_operator_helper_requires_environment_host(self):