1
0
Fork 0

Compare commits

...

3 Commits

Author SHA1 Message Date
Massaki Archambault aebf8d7676 add lockdown mode 2023-11-07 00:52:51 -05:00
Massaki Archambault b03d756c46 attempt to make chromium work 2023-11-06 23:36:48 -05:00
Massaki Archambault 45bddcac3d add proxy support 2023-11-06 22:39:24 -05:00
5 changed files with 55 additions and 12 deletions

2
hosts
View File

@ -1,2 +1,2 @@
[raspberrypi-kiosk] [raspberrypi_kiosk]
raspberrypi.local ansible_user=pi ansible_password=raspberry ansible_become_method=sudo ansible_become_user=root raspberrypi.local ansible_user=pi ansible_password=raspberry ansible_become_method=sudo ansible_become_user=root

View File

@ -1 +1,6 @@
kiosk_url: https://floatingqrcode.com/ kiosk_url: https://floatingqrcode.com/
lockdown: false
proxy:
http_proxy: ""
https_proxy: ""
no_proxy: ""

View File

@ -1,3 +1,15 @@
- name: Perform system upgrades
apt:
update_cache: true
upgrade: dist
environment:
http_proxy: "{{ proxy.http_proxy }}"
HTTP_PROXY: "{{ proxy.http_proxy }}"
https_proxy: "{{ proxy.https_proxy }}"
HTTPS_PROXY: "{{ proxy.https_proxy }}"
no_proxy: "{{ proxy.no_proxy }}"
NO_PROXY: "{{ proxy.no_proxy }}"
- name: Install Cage window manager and Midori browser - name: Install Cage window manager and Midori browser
apt: apt:
update_cache: yes update_cache: yes
@ -6,8 +18,28 @@
- xwayland - xwayland
- gtk3-nocsd - gtk3-nocsd
- midori - midori
- chromium-browser
environment:
http_proxy: "{{ proxy.http_proxy }}"
HTTP_PROXY: "{{ proxy.http_proxy }}"
https_proxy: "{{ proxy.https_proxy }}"
HTTPS_PROXY: "{{ proxy.https_proxy }}"
no_proxy: "{{ proxy.no_proxy }}"
NO_PROXY: "{{ proxy.no_proxy }}"
- name: Configure autologin - name: Configure proxy
blockinfile:
path: /etc/environment
block: |
http_proxy="{{ proxy.http_proxy }}"
HTTP_PROXY="{{ proxy.http_proxy }}"
https_proxy="{{ proxy.https_proxy }}"
HTTPS_PROXY="{{ proxy.https_proxy }}"
no_proxy="{{ proxy.no_proxy }}"
NO_PROXY="{{ proxy.no_proxy }}"
notify: Reboot
- name: Enable autologin
command: raspi-config nonint do_boot_behaviour B2 command: raspi-config nonint do_boot_behaviour B2
- name: Install kiosk script - name: Install kiosk script
@ -15,3 +47,16 @@
src: kiosk.sh.j2 src: kiosk.sh.j2
dest: /etc/profile.d/kiosk.sh dest: /etc/profile.d/kiosk.sh
notify: Reboot notify: Reboot
# This help prevent sd card corruption over time
- name: Enable overlayfs
command: raspi-config nonint do_overlayfs 0
when: lockdown
notify: Reboot
- name: Turn off ssh server
service:
name: ssh
enabled: false
when: lockdown
notify: Reboot

View File

@ -3,6 +3,7 @@
if [ "$(tty)" = "/dev/tty1" ]; then if [ "$(tty)" = "/dev/tty1" ]; then
while true; do while true; do
GTK_CSD=0 cage -d -s -- midori -e fullscreen -a {{ kiosk_url }} GTK_CSD=0 cage -d -s -- midori -e fullscreen -a {{ kiosk_url }}
#cage -d -s -- chromium-browser --noerrdialogs --disable-infobars --kiosk {{ kiosk_url }}
sleep 1 sleep 1
done done
fi fi

View File

@ -1,11 +1,3 @@
- hosts: all
become: true
tasks:
- name: Perform system update
apt:
update_cache: true
upgrade: dist
- hosts: all - hosts: all
become: true become: true
roles: roles: