Compare commits
5
Commits
84ec13b1f9
...
v1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e22b466bb3 | ||
|
|
bd9146e641 | ||
|
|
9b0036b4da | ||
|
|
d26cec2a53 | ||
|
|
2e862c13a8 |
@@ -40,8 +40,7 @@ jobs:
|
|||||||
echo "KIOSK_ISO_FILENAME=${FILENAME}" >> "$GITHUB_ENV"
|
echo "KIOSK_ISO_FILENAME=${FILENAME}" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
- name: Move old dev images to archive
|
- name: Move old dev images to archive
|
||||||
run: |
|
run: tools/archive-images.sh nclack@157.245.124.103 /mnt/infrastructure_data/files/images /mnt/infrastructure_data/files/images/archives 'radiantwave-kiosk-dev*'
|
||||||
ssh nclack@157.245.124.103 'find /mnt/infrastructure_data/files/images -maxdepth 1 -name "radiantwave-kiosk-dev*" -exec mv {} /mnt/infrastructure_data/files/images/archives/ ;'
|
|
||||||
|
|
||||||
- name: Copy kiosk ISO to fileserver
|
- name: Copy kiosk ISO to fileserver
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -31,8 +31,7 @@ jobs:
|
|||||||
echo "RPI_IMAGE_FILENAME=${FILENAME}" >> "$GITHUB_ENV"
|
echo "RPI_IMAGE_FILENAME=${FILENAME}" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
- name: Move old Raspberry Pi images to archive
|
- name: Move old Raspberry Pi images to archive
|
||||||
run: |
|
run: tools/archive-images.sh nclack@157.245.124.103 /mnt/infrastructure_data/files/images /mnt/infrastructure_data/files/images/archives 'radiantwave-rpi*'
|
||||||
ssh nclack@157.245.124.103 'find /mnt/infrastructure_data/files/images -maxdepth 1 -name "radiantwave-rpi*" -exec mv {} /mnt/infrastructure_data/files/images/archives/ ;'
|
|
||||||
|
|
||||||
- name: Copy Raspberry Pi image to fileserver
|
- name: Copy Raspberry Pi image to fileserver
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
+16
-4
@@ -55,6 +55,22 @@ in
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# Let the kiosk app apply pending updates by restarting its own TTY
|
||||||
|
# session (re-autologin -> fresh cage + RadiantWave). Scoped to exactly
|
||||||
|
# one unit and verb; everything else keeps stock (denied) policy.
|
||||||
|
security.polkit.enable = true;
|
||||||
|
environment.etc."polkit-1/rules.d/10-kiosk-getty.rules".text = ''
|
||||||
|
polkit.addRule(function(action, subject) {
|
||||||
|
if (subject.user !== "kiosk") return null;
|
||||||
|
if (action.id !== "org.freedesktop.systemd1.manage-units") return null;
|
||||||
|
var unit = action.lookup("unit");
|
||||||
|
var verb = action.lookup("verb");
|
||||||
|
if ((unit === "getty@tty1.service" || unit === "getty@tty1") && verb === "restart") {
|
||||||
|
return polkit.Result.YES;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
'';
|
||||||
|
|
||||||
hardware.graphics.enable = true;
|
hardware.graphics.enable = true;
|
||||||
|
|
||||||
time.timeZone = "America/Chicago";
|
time.timeZone = "America/Chicago";
|
||||||
@@ -69,10 +85,6 @@ in
|
|||||||
operation = "switch";
|
operation = "switch";
|
||||||
};
|
};
|
||||||
|
|
||||||
system.activationScripts.cleanRadiantFiles = ''
|
|
||||||
rm -rf /home/kiosk/.local/radiantwave/audio
|
|
||||||
'';
|
|
||||||
|
|
||||||
# Virtual machine declaration
|
# Virtual machine declaration
|
||||||
virtualisation.vmVariant = {
|
virtualisation.vmVariant = {
|
||||||
boot.loader.systemd-boot.enable = pkgs.lib.mkForce false;
|
boot.loader.systemd-boot.enable = pkgs.lib.mkForce false;
|
||||||
|
|||||||
Generated
+8
-8
@@ -220,11 +220,11 @@
|
|||||||
"nixpkgs": "nixpkgs_3"
|
"nixpkgs": "nixpkgs_3"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1787341934,
|
"lastModified": 1787522765,
|
||||||
"narHash": "sha256-pWGpgM5acdCO02H8P3KKtdv09n9ucnI3cg8d3/tvwtk=",
|
"narHash": "sha256-D3KOrGcAH07lvKYgyiwejOQpDW91js7zI6l87WdabLk=",
|
||||||
"ref": "main",
|
"ref": "main",
|
||||||
"rev": "b96631c374682088088b3d679359d192a0ae74d6",
|
"rev": "63265cc22f3055a782a0114e92c57a36bef723b2",
|
||||||
"revCount": 35,
|
"revCount": 40,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://gitea.radiantwavetech.com/RadiantWaveTech/radiantwave.git"
|
"url": "https://gitea.radiantwavetech.com/RadiantWaveTech/radiantwave.git"
|
||||||
},
|
},
|
||||||
@@ -240,11 +240,11 @@
|
|||||||
"nixpkgs": "nixpkgs_4"
|
"nixpkgs": "nixpkgs_4"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1787507168,
|
"lastModified": 1787522765,
|
||||||
"narHash": "sha256-LeMd6lnfhnixC+e77yM5DG5gVYaEa+URfKD+yEmenJc=",
|
"narHash": "sha256-D3KOrGcAH07lvKYgyiwejOQpDW91js7zI6l87WdabLk=",
|
||||||
"ref": "dev",
|
"ref": "dev",
|
||||||
"rev": "f2a40cd0194fe920a0fc1062d57a93dfc6693b52",
|
"rev": "63265cc22f3055a782a0114e92c57a36bef723b2",
|
||||||
"revCount": 38,
|
"revCount": 40,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://gitea.radiantwavetech.com/RadiantWaveTech/radiantwave.git"
|
"url": "https://gitea.radiantwavetech.com/RadiantWaveTech/radiantwave.git"
|
||||||
},
|
},
|
||||||
|
|||||||
Executable
+56
@@ -0,0 +1,56 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Archive old build images on the fileserver before publishing new ones.
|
||||||
|
#
|
||||||
|
# Usage: tools/archive-images.sh <ssh-target> <images-dir> <archive-dir> <pattern>...
|
||||||
|
#
|
||||||
|
# Zero matching files is fine (nothing to archive yet); a missing directory
|
||||||
|
# or a failed move aborts non-zero so CI stops before publishing.
|
||||||
|
# The remote half is piped to `bash -s` over stdin so there is no nested
|
||||||
|
# shell quoting to get wrong.
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
die() { echo "error: $*" >&2; exit 1; }
|
||||||
|
|
||||||
|
(( $# >= 4 )) || die "usage: $0 <ssh-target> <images-dir> <archive-dir> <pattern>..."
|
||||||
|
|
||||||
|
target=$1 images_dir=$2 archive_dir=$3
|
||||||
|
shift 3
|
||||||
|
patterns=("$@")
|
||||||
|
|
||||||
|
for v in "$images_dir" "$archive_dir" "${patterns[@]}"; do
|
||||||
|
case $v in
|
||||||
|
*[[:space:]\'\"]*) die "unsafe argument (whitespace/quotes): $v" ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "Archiving previous images on $target:"
|
||||||
|
printf ' pattern: %s\n' "${patterns[@]}"
|
||||||
|
|
||||||
|
# Assignments prefixed to `bash -s` are parsed by the remote shell as
|
||||||
|
# environment variables for the script below; the quoted heredoc marker
|
||||||
|
# keeps every byte of the payload literal until bash executes it.
|
||||||
|
ssh "$target" "IMAGES_DIR=$images_dir ARCHIVE_DIR=$archive_dir bash -s" <<'REMOTE'
|
||||||
|
set -euo pipefail
|
||||||
|
shopt -s nullglob
|
||||||
|
|
||||||
|
if [ ! -d "$IMAGES_DIR" ]; then
|
||||||
|
echo "error: images dir not found: $IMAGES_DIR" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ ! -d "$ARCHIVE_DIR" ]; then
|
||||||
|
echo "error: archive dir not found: $ARCHIVE_DIR" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
moved=0
|
||||||
|
for pat in "${PATTERNS[@]}"; do
|
||||||
|
for f in "$IMAGES_DIR"/$pat; do
|
||||||
|
echo " archiving $(basename "$f")"
|
||||||
|
mv "$f" "$ARCHIVE_DIR/"
|
||||||
|
moved=$((moved + 1))
|
||||||
|
done
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "Archived $moved file(s)."
|
||||||
|
REMOTE
|
||||||
Reference in New Issue
Block a user