mirror of
https://github.com/karl0ss/AnotterKiosk.git
synced 2025-09-08 04:03:16 +01:00
Compare commits
12 Commits
beab8e7727
...
5e767d99f8
Author | SHA1 | Date | |
---|---|---|---|
5e767d99f8 | |||
b4acb6e7b4 | |||
52423fcc9a | |||
3f6dfb9017 | |||
1c1ba35577 | |||
466668553d | |||
d9d8fb3d5a | |||
249327a8cc | |||
ca7a2b615f | |||
c133508f3c | |||
b82615813d | |||
2acec6eca9 |
20
kiosk_skeleton/boot/custom.toml
Normal file
20
kiosk_skeleton/boot/custom.toml
Normal file
@ -0,0 +1,20 @@
|
||||
# ==============================================================================
|
||||
# == Raspberry Pi OS - First-Boot Wi-Fi Configuration
|
||||
# ==============================================================================
|
||||
#
|
||||
# This file is used ONLY to get the device onto a Wi-Fi network on its
|
||||
# very first boot. The filename "custom.toml" is required by the OS.
|
||||
#
|
||||
# -> Edit the "ssid" and "password" values below with your network details.
|
||||
#
|
||||
# All other kiosk-specific configuration (hostname, SSH keys, etc.) is
|
||||
# handled by the "kioskbrowser.ini" file after this initial boot.
|
||||
#
|
||||
|
||||
config_version = 1
|
||||
|
||||
[wlan]
|
||||
ssid = "YOUR_WIFI_SSID"
|
||||
password = "YOUR_WIFI_PASSWORD"
|
||||
password_encrypted = false
|
||||
country = "GB"
|
@ -24,14 +24,6 @@ reboot_time = 04:00
|
||||
; apikey to be sent with commands to /api.php
|
||||
key = "MyKey"
|
||||
|
||||
[wifi]
|
||||
; If you need more complex WiFi settings (like WPA2-Enterprise, hidden SSIDs, etc.)
|
||||
; create a file called wpa_supplicant.conf on this partition.
|
||||
country=DE
|
||||
; Leave SSID empty to disable WiFi
|
||||
ssid="My WiFi"
|
||||
; Leave PSK empty (or comment) to use an open network
|
||||
psk="My Passphrase"
|
||||
|
||||
[browser]
|
||||
url="https://kittenlabs.de/"
|
||||
|
@ -2,9 +2,11 @@
|
||||
# This script is being run on the target debian platform
|
||||
|
||||
apt update
|
||||
DEBIAN_FRONTEND=noninteractive apt install -y lightdm openbox nginx php-fpm php-cli chromium autossh unclutter x11-xserver-utils xdotool htop nano openssh-server rsync x11vnc lm-sensors ntpdate scrot wireless-regdb fontconfig
|
||||
DEBIAN_FRONTEND=noninteractive apt install -y lightdm openbox nginx php-fpm php-cli chromium autossh unclutter x11-xserver-utils xdotool htop nano openssh-server rsync x11vnc lm-sensors ntpdate scrot wireless-regdb fontconfig php-cli
|
||||
|
||||
rsync -a --chown=root:root "/kiosk_skeleton/." "/"
|
||||
# Ensure all our custom scripts are executable
|
||||
chmod +x /usr/bin/kiosk-* /usr/bin/get-ini /usr/bin/refresh-screen /usr/bin/schedule-* /usr/bin/setup-refresh-timer
|
||||
|
||||
# Add emoji support
|
||||
mkdir -p /home/pi/.fonts
|
||||
@ -53,11 +55,11 @@ echo "tmpfs /home/pi/.ssh/ tmpfs mode=0700,nosuid,nodev,uid=1000,gid=1000 0
|
||||
echo "tmpfs /root/.ssh/ tmpfs mode=0700,nosuid,nodev,uid=0,gid=0 0 0" >> /etc/fstab
|
||||
|
||||
# Create symlinks for configuration files which will later get created at runtime (in /tmp)
|
||||
rm /etc/hosts
|
||||
rm /etc/hostname
|
||||
mkdir -p /etc/wpa_supplicant/
|
||||
ln -sf /tmp/hosts /etc/hosts
|
||||
touch /etc/hostname
|
||||
touch /etc/hosts
|
||||
ln -sf /tmp/hostname /etc/hostname
|
||||
ln -sf /tmp/hosts /etc/hosts
|
||||
ln -sf /tmp/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant.conf
|
||||
|
||||
systemctl daemon-reload
|
||||
@ -69,10 +71,10 @@ systemctl disable avahi-daemon || true
|
||||
systemctl disable bluetooth || true
|
||||
|
||||
systemctl enable kiosk-ssh-keys
|
||||
systemctl enable kiosk-wifi
|
||||
systemctl enable NetworkManager
|
||||
systemctl enable kiosk-set-hostname
|
||||
systemctl enable kiosk-autossh
|
||||
systemctl enable kiosk-watchdog
|
||||
systemctl enable kiosk-set-hostname
|
||||
systemctl enable ntpdate
|
||||
systemctl enable lightdm
|
||||
systemctl enable nginx
|
||||
|
@ -0,0 +1,21 @@
|
||||
[connection]
|
||||
id=kiosk
|
||||
uuid=a2a5c7d8-2e2b-4b2a-9c1d-3e4e5e6a7b8c
|
||||
type=wifi
|
||||
autoconnect=true
|
||||
interface-name=wlan0
|
||||
|
||||
[wifi]
|
||||
mode=infrastructure
|
||||
ssid=YOUR_WIFI_SSID
|
||||
|
||||
[wifi-security]
|
||||
auth-alg=open
|
||||
key-mgmt=wpa-psk
|
||||
psk=YOUR_WIFI_PASSWORD
|
||||
|
||||
[ipv4]
|
||||
method=auto
|
||||
|
||||
[ipv6]
|
||||
method=auto
|
@ -1,10 +0,0 @@
|
||||
[Unit]
|
||||
Description=Generate wpa_supplicant.conf from kioskbrowser.ini
|
||||
Before=wpa_supplicant.service dhcpcd.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/kiosk-wifi
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -1,22 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
if ($argc != 4 && $argc != 5)
|
||||
{
|
||||
error_log("Usage: get-ini FILE SECTION NAME [DEFAULT]");
|
||||
error_log("Fetches a single configuration item from an ini file");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$config = parse_ini_file($argv[1], true, INI_SCANNER_NORMAL);
|
||||
|
||||
if (isset($config[$argv[2]]))
|
||||
{
|
||||
if (isset($config[$argv[2]][$argv[3]]))
|
||||
{
|
||||
echo $config[$argv[2]][$argv[3]];
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
echo $argv[4] ?? "";
|
||||
exit(1);
|
@ -1,27 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -f "/boot/wpa_supplicant.conf" ]; then
|
||||
ln -s /boot/wpa_supplicant.conf /tmp/wpa_supplicant.conf
|
||||
exit
|
||||
fi
|
||||
|
||||
WIFI_SSID=$(get-ini /boot/kioskbrowser.ini wifi ssid)
|
||||
WIFI_PSK=$(get-ini /boot/kioskbrowser.ini wifi psk)
|
||||
WIFI_COUNTRY=$(get-ini /boot/kioskbrowser.ini wifi country)
|
||||
|
||||
if [ -n "${WIFI_SSID}" ]
|
||||
then
|
||||
echo "country=${WIFI_COUNTRY}" > /tmp/wpa_supplicant.conf
|
||||
echo "ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev" >> /tmp/wpa_supplicant.conf
|
||||
echo "update_config=1" >> /tmp/wpa_supplicant.conf
|
||||
echo "network={" >> /tmp/wpa_supplicant.conf
|
||||
echo " ssid=\"${WIFI_SSID}\"" >> /tmp/wpa_supplicant.conf
|
||||
if [ -n "${WIFI_PSK}" ]
|
||||
then
|
||||
echo " psk=\"${WIFI_PSK}\"" >> /tmp/wpa_supplicant.conf
|
||||
else
|
||||
echo " key_mgmt=NONE" >> /tmp/wpa_supplicant.conf
|
||||
fi
|
||||
echo "}" >> /tmp/wpa_supplicant.conf
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user