diff --git a/docs/releases/stage-itscreen-1.0.33.md b/docs/releases/stage-itscreen-1.0.33.md new file mode 100644 index 0000000..9ecc912 --- /dev/null +++ b/docs/releases/stage-itscreen-1.0.33.md @@ -0,0 +1,16 @@ +# stage_itscreen 1.0.33 — EVAx10 Client 5.1.42 + +- Update Debian ARM64 client from the common iomatex_dev release source recorded + in stage_itscreen/release-provenance.json. The client version is shared with + Android and Windows; the OS stage revision is an independent installer version. +- Install the restricted YF MCU wake adapter and sudo rule with the client. +- Install Debian password-protected LightDM maintenance entry and return launcher + on systems with LightDM. System PAM requires a nonempty Unix password; guest + and autologin are disabled. The app never reads/stores the OS password. +- Permit the client to enable/disable only its own OS autostart service. +- Keep updater URLs, registration, media and existing desktop runtime intact. + This stage does not publish changes from other OS stage work in progress. + +Validation: stage version tests and display/fullscreen contracts pass. Previous +bench validation includes MCU timed wake, reboot, mandatory-password XFCE login +and return to client. Android automatic wake is not implied by this Debian test. diff --git a/stage-releases.json b/stage-releases.json index 051b1e9..9fa9931 100644 --- a/stage-releases.json +++ b/stage-releases.json @@ -23,7 +23,7 @@ "version": "1.0.0" }, "stage_itscreen": { - "version": "1.0.32" + "version": "1.0.33" }, "stage_reverse_tunnels": { "version": "1.0.2" diff --git a/stage_itscreen/desktop/99-evax10-password-login.conf b/stage_itscreen/desktop/99-evax10-password-login.conf new file mode 100644 index 0000000..7079b83 --- /dev/null +++ b/stage_itscreen/desktop/99-evax10-password-login.conf @@ -0,0 +1,7 @@ +[Seat:*] +pam-service=evax10-desktop +autologin-user= +autologin-guest=false +allow-guest=false +greeter-allow-guest=false +greeter-show-manual-login=true diff --git a/stage_itscreen/desktop/evax10-desktop.pam b/stage_itscreen/desktop/evax10-desktop.pam new file mode 100644 index 0000000..916dee7 --- /dev/null +++ b/stage_itscreen/desktop/evax10-desktop.pam @@ -0,0 +1,6 @@ +# Local maintenance requires an actual Unix password; no blank-password login. +auth requisite pam_nologin.so +auth required pam_unix.so +account include common-account +session required pam_limits.so +session include common-session diff --git a/stage_itscreen/desktop/evax10-return.desktop b/stage_itscreen/desktop/evax10-return.desktop new file mode 100644 index 0000000..039eff0 --- /dev/null +++ b/stage_itscreen/desktop/evax10-return.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Type=Application +Name=Return to EVAx10 +Name[ru]=Вернуться в EVAx10 +Name[pl]=Powrót do EVAx10 +Comment=Close the maintenance desktop and resume the EVAx10 client +Exec=/usr/bin/sudo -n /usr/local/sbin/iomatex-desktop return +Icon=video-display +Terminal=false diff --git a/stage_itscreen/desktop/install.sh b/stage_itscreen/desktop/install.sh new file mode 100755 index 0000000..464c5fb --- /dev/null +++ b/stage_itscreen/desktop/install.sh @@ -0,0 +1,27 @@ +#!/bin/bash +set -euo pipefail +[[ $EUID == 0 ]] || exit 1 +cd "$(dirname "$0")" +test -x /usr/sbin/lightdm +install -o root -g root -m 644 evax10-desktop.pam /etc/pam.d/evax10-desktop +install -d /etc/lightdm/lightdm.conf.d +install -o root -g root -m 644 99-evax10-password-login.conf /etc/lightdm/lightdm.conf.d/ +install -o root -g root -m 755 iomatex-desktop /usr/local/sbin/iomatex-desktop +/usr/local/sbin/iomatex-desktop check +rule=$(mktemp) +trap 'rm -f "$rule"' EXIT +printf '%s\n' 'itscreen ALL=(root) NOPASSWD: /usr/local/sbin/iomatex-desktop open' 'iomatex ALL=(root) NOPASSWD: /usr/local/sbin/iomatex-desktop return' > "$rule" +visudo -cf "$rule" +install -o root -g root -m 440 "$rule" /etc/sudoers.d/itscreen-desktop +install -o root -g root -m 644 evax10-return.desktop /usr/share/applications/ +# Desktop directory follows the system user's existing XDG configuration. +home_dir=$(getent passwd iomatex | cut -d: -f6) +if [[ -n $home_dir ]]; then + desktop="$home_dir/Desktop" + if command -v xdg-user-dir >/dev/null; then + desktop=$(sudo -u iomatex env HOME="$home_dir" xdg-user-dir DESKTOP) + fi + [[ $desktop == "$home_dir/"* ]] || exit 1 + install -d -o iomatex -g iomatex "$desktop" + install -o root -g root -m 755 evax10-return.desktop "$desktop/evax10-return.desktop" +fi diff --git a/stage_itscreen/desktop/iomatex-desktop b/stage_itscreen/desktop/iomatex-desktop new file mode 100755 index 0000000..e83f02d --- /dev/null +++ b/stage_itscreen/desktop/iomatex-desktop @@ -0,0 +1,24 @@ +#!/bin/bash +set -euo pipefail +export PATH=/usr/sbin:/usr/bin:/sbin:/bin +[[ $EUID == 0 && $# == 1 ]] || exit 64 +case "$1" in + check|open) + test -x /usr/sbin/lightdm + # Fail closed if another configuration reintroduces passwordless login. + config=$(/usr/sbin/lightdm --show-config 2>&1) + if printf '%s\n' "$config" | grep -Eq 'autologin-user=.+|autologin-guest=true|allow-guest=true'; then + echo 'Passwordless desktop login is configured; refusing transition.' >&2 + exit 1 + fi + printf '%s\n' "$config" | grep -q 'allow-guest=false' + printf '%s\n' "$config" | grep -q 'pam-service=evax10-desktop' + test -f /etc/pam.d/evax10-desktop + if [[ $1 == open ]]; then + # Survives termination of the client X11 service. Does not change boot mode. + systemctl --no-block start lightdm.service + fi + ;; + return) systemctl --no-block start itscreen-x11.service ;; + *) exit 64 ;; +esac diff --git a/stage_itscreen/iomatex-power-wake b/stage_itscreen/iomatex-power-wake new file mode 100755 index 0000000..3f6032f --- /dev/null +++ b/stage_itscreen/iomatex-power-wake @@ -0,0 +1,30 @@ +#!/bin/sh +# Root-owned narrow adapter for the existing YF MCU; input is epoch seconds or 0. +set -eu +[ "$#" -eq 1 ] || exit 64 +case "$1" in ''|*[!0-9]*) exit 64 ;; esac +[ "${#1}" -le 10 ] || exit 64 +[ -c /dev/McuDemo2 ] || exit 69 +run_vendor() { + status=0 + /usr/bin/yf_Interface "$@" || status=$? + # This vendor binary returns 1 on successful Set_Rtc_OnOffTime, -1 on + # invalid input/open failure. Verified by its symbols/disassembly and a + # real off/on cycle. Do not reinterpret generic exit=1 for unknown builds. + if [ "$status" = 1 ]; then + vendor_hash=$(sha256sum /usr/bin/yf_Interface) + case "$vendor_hash" in + 3f07ae57d3cd86485fdd48323d1292ab06dd8706d26fe0e81c52a58f107e0c86\ *) status=0 ;; + esac + fi + return "$status" +} +if [ "$1" = 0 ]; then + run_vendor set_onoff_time 0 0 0 0 0 0 0 0 0 + exit $? +fi +now=$(date +%s) +[ "$1" -gt "$now" ] && [ "$1" -le "$((now + 691200))" ] || exit 65 +# Vendor accepts local civil time (month/day/hour/minute), not UTC. +set -- $(date -d "@$1" '+%m %d %H %M') +run_vendor set_onoff_time "$1" "$2" "$3" "$4" 0 0 0 0 1 diff --git a/stage_itscreen/itscreen b/stage_itscreen/itscreen index 4325218..fd730bd 100755 Binary files a/stage_itscreen/itscreen and b/stage_itscreen/itscreen differ diff --git a/stage_itscreen/itscreen.sha256 b/stage_itscreen/itscreen.sha256 index 8e2db6b..0a853a3 100644 --- a/stage_itscreen/itscreen.sha256 +++ b/stage_itscreen/itscreen.sha256 @@ -1 +1 @@ -71896107fc3932a7f69edd02dfe784ea6a8198a7edac2fb56e05f22819ecb59f itscreen +52d018fe3580f903d7b46fd94bb22d8c88aa321156107eb66998926a218ffcc1 itscreen diff --git a/stage_itscreen/itscreen.version b/stage_itscreen/itscreen.version index 8471d96..581c9b9 100644 --- a/stage_itscreen/itscreen.version +++ b/stage_itscreen/itscreen.version @@ -1 +1 @@ -5.1.37 +5.1.42 diff --git a/stage_itscreen/release-provenance.json b/stage_itscreen/release-provenance.json index b0b56fb..b1c43c9 100644 --- a/stage_itscreen/release-provenance.json +++ b/stage_itscreen/release-provenance.json @@ -1,14 +1,14 @@ { "schema_version": 1, - "client_version": "5.1.37", - "stage_version": "1.0.32", + "client_version": "5.1.42", + "stage_version": "1.0.33", "platform": "linux", "architecture": "arm64", "source_repository": "https://git.it-screen.com/Development/It-screenClient.git", "source_branch": "iomatex_dev", - "source_commit": "37d311c4fa67bcfbf5df7acb8573fb092963abc2", + "source_commit": "c75170b64ccff88b0a80edf9e21d1382960c9834", "binary": "itscreen", - "sha256": "71896107fc3932a7f69edd02dfe784ea6a8198a7edac2fb56e05f22819ecb59f", - "assembly_method": "Native qmake/make release build on Debian 11 ARM64, Qt 5.15.2; native window controller tests passed; no production playback replacement performed", - "native_version_code": 5010037 + "sha256": "52d018fe3580f903d7b46fd94bb22d8c88aa321156107eb66998926a218ffcc1", + "assembly_method": "Clean release cross-build from git archive; Debian 11 ARM64 Qt 5.15.2 sysroot; ldd and executable version verified on ARM64 bench", + "native_version_code": 5010042 } diff --git a/stage_itscreen/stage_itscreen_install.sh b/stage_itscreen/stage_itscreen_install.sh index a721c7b..fe24006 100755 --- a/stage_itscreen/stage_itscreen_install.sh +++ b/stage_itscreen/stage_itscreen_install.sh @@ -524,6 +524,7 @@ install_sudoers() { step "Grant power actions (reboot/shutdown) to itscreen (sudoers)" write_file "$SUDOERS_FILE" 0440 root root <<'EOF' Defaults:itscreen !requiretty +itscreen ALL=(root) NOPASSWD: /bin/systemctl enable itscreen-x11.service, /usr/bin/systemctl enable itscreen-x11.service, /bin/systemctl disable itscreen-x11.service, /usr/bin/systemctl disable itscreen-x11.service itscreen ALL=(root) NOPASSWD: /sbin/reboot, /usr/sbin/reboot, /bin/systemctl reboot, /usr/bin/systemctl reboot itscreen ALL=(root) NOPASSWD: /sbin/poweroff, /usr/sbin/poweroff, /bin/systemctl poweroff, /usr/bin/systemctl poweroff itscreen ALL=(root) NOPASSWD: /sbin/shutdown, /usr/sbin/shutdown, /bin/systemctl halt, /usr/bin/systemctl halt @@ -1546,6 +1547,18 @@ main() { install_itscreen_binary install_itscreen_config install_sudoers + if [ -c /dev/McuDemo2 ] && [ -x /usr/bin/yf_Interface ]; then + install -o root -g root -m 755 "$SCRIPT_DIR/iomatex-power-wake" /usr/local/sbin/iomatex-power-wake + write_file /etc/sudoers.d/itscreen-power-wake 0440 root root <<'POWER_WAKE' +itscreen ALL=(root) NOPASSWD: /usr/local/sbin/iomatex-power-wake +POWER_WAKE + visudo -cf /etc/sudoers.d/itscreen-power-wake + fi + if [ -x /usr/sbin/lightdm ]; then + bash "$SCRIPT_DIR/desktop/install.sh" + else + warn "LightDM is not installed; maintenance desktop remains unavailable" + fi install_wrapper install_audio_route_state install_pulseaudio_assets diff --git a/stage_itscreen/version.json b/stage_itscreen/version.json index 2555b05..c13a102 100644 --- a/stage_itscreen/version.json +++ b/stage_itscreen/version.json @@ -1,3 +1,3 @@ { - "version": "1.0.32" + "version": "1.0.33" }