-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbrowser.sh
More file actions
executable file
·63 lines (58 loc) · 1.86 KB
/
browser.sh
File metadata and controls
executable file
·63 lines (58 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#! /usr/bin/env bash
# Author: Sotirios Roussis <[email protected]>
# Wait for Docker containers to have "healthy" status
# We'll poll until `docker compose ps` shows "healthy" for the service named "frontend".
echo "Waiting for Docker container 'frontend' to be healthy .."
while /usr/bin/true; do
if /usr/bin/docker compose -f /home/coolblock/panel/docker-compose.yml ps \
| /usr/bin/grep -i frontend \
| /usr/bin/grep -iv database \
| /usr/bin/grep -iq "(healthy)"; then
break
fi
sleep 5
done
echo "Docker container 'frontend' is healthy"
# Copy the CA cert if needed
echo "Copying CA certificate .."
/usr/bin/sudo /usr/bin/cp -pv /home/coolblock/panel/certs/localhost.ca.crt /usr/local/share/ca-certificates/
# Update system CA certificates
echo "Updating CA certificates .."
/usr/bin/sudo /usr/sbin/update-ca-certificates
# Finally, launch selected browser in kiosk mode
case "${1:-unknown}" in
firefox)
echo "Launching Mozilla Firefox kiosk .."
exec /usr/bin/firefox \
--kiosk \
--no-remote \
--disable-sync \
--disable-crash-reporter \
--disable-pinch \
--disable-session-crashed-bubble \
--url "https://localhost"
;;
chromium)
echo "Launching Chromium kiosk .."
/usr/bin/chromium-browser \
--no-proxy-server \
--password-store=basic \
--no-first-run \
--disable-translate \
--disable-sync \
--disable-extensions \
--disable-infobars \
--disable-features=TranslateUI \
--no-default-browser-check \
--touch-events=enabled \
--disable-pinch \
--disable-breakpad \
--kiosk "https://localhost"
;;
*)
echo "ERROR: Missing argument: firefox|chromium" 1>&2
exit 1
;;
esac
# The "exec" ensures that once the script finishes these steps,
# the firefox process takes over PID 1 in the service.