mirror of
https://github.com/karl0ss/AnotterKiosk.git
synced 2025-09-09 04:23:16 +01:00
Compare commits
No commits in common. "5e767d99f819ea14dc8ca2f0417793df5bf50444" and "beab8e772787f8926009c62d23e97b49ffa4cda1" have entirely different histories.
5e767d99f8
...
beab8e7727
@ -1,20 +0,0 @@
|
||||
# ==============================================================================
|
||||
# == 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,6 +24,14 @@ 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,11 +2,9 @@
|
||||
# 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 php-cli
|
||||
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
|
||||
|
||||
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
|
||||
@ -55,11 +53,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/
|
||||
touch /etc/hostname
|
||||
touch /etc/hosts
|
||||
ln -sf /tmp/hostname /etc/hostname
|
||||
ln -sf /tmp/hosts /etc/hosts
|
||||
ln -sf /tmp/hostname /etc/hostname
|
||||
ln -sf /tmp/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant.conf
|
||||
|
||||
systemctl daemon-reload
|
||||
@ -71,10 +69,10 @@ systemctl disable avahi-daemon || true
|
||||
systemctl disable bluetooth || true
|
||||
|
||||
systemctl enable kiosk-ssh-keys
|
||||
systemctl enable NetworkManager
|
||||
systemctl enable kiosk-set-hostname
|
||||
systemctl enable kiosk-wifi
|
||||
systemctl enable kiosk-autossh
|
||||
systemctl enable kiosk-watchdog
|
||||
systemctl enable kiosk-set-hostname
|
||||
systemctl enable ntpdate
|
||||
systemctl enable lightdm
|
||||
systemctl enable nginx
|
||||
|
@ -1,21 +0,0 @@
|
||||
[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
|
10
kiosk_skeleton/etc/systemd/system/kiosk-wifi.service
Normal file
10
kiosk_skeleton/etc/systemd/system/kiosk-wifi.service
Normal file
@ -0,0 +1,10 @@
|
||||
[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
|
22
kiosk_skeleton/usr/bin/get-ini
Executable file
22
kiosk_skeleton/usr/bin/get-ini
Executable file
@ -0,0 +1,22 @@
|
||||
#!/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);
|
27
kiosk_skeleton/usr/bin/kiosk-wifi
Executable file
27
kiosk_skeleton/usr/bin/kiosk-wifi
Executable file
@ -0,0 +1,27 @@
|
||||
#!/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