Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on:
pull_request:
types: [opened, synchronize, closed]
branches:
- master

jobs:
balena_cloud_build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: balena-io/deploy-to-balena-action@master
id: build
with:
balena_token: ${{ secrets.BALENA_API_KEY }}
fleet: techops_balena1/octo-browser
- name: Log release ID built
run: echo "Built release ID ${{ steps.build.outputs.release_id }}"
29 changes: 0 additions & 29 deletions .github/workflows/flowzone.yml

This file was deleted.

5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
sha256bca9ad158da383a9af76908776cf6cd8b06359a8a1529c4862fd17fd3f2fc7b3
Dockerfile.raspberrypi3
Dockerfile.raspberrypi4-64

.DS_Store
7 changes: 6 additions & 1 deletion Dockerfile.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20.19.2-bookworm
FROM node:20.19.4-trixie

ENV DEBIAN_FRONTEND=noninteractive

Expand All @@ -14,6 +14,7 @@ COPY ./package.json /usr/src/app/package.json
RUN JOBS=MAX npm install --unsafe-perm --production && npm cache clean --force

COPY ./src /usr/src/app/
COPY ./extensions /usr/share/chromium/extensions/

RUN chmod +x ./*.sh

Expand All @@ -27,10 +28,14 @@ COPY ./policy.json /etc/chromium/policies/recommended/my_policy.json
RUN useradd chromium -m -s /bin/bash -G root || true && \
groupadd -r -f chromium && id -u chromium || true \
&& chown -R chromium:chromium /home/chromium || true

RUN chown chromium:root /usr/share/chromium/extensions/cosd_cat/config.json && \
chmod 660 /usr/share/chromium/extensions/cosd_cat/config.json

COPY ./public-html /home/chromium

# udev rule to set specific permissions
RUN mkdir -p /etc/udev/rules.d
RUN echo 'SUBSYSTEM=="vchiq",GROUP="video",MODE="0660"' > /etc/udev/rules.d/10-vchiq-permissions.rules
RUN usermod -a -G audio,video,tty chromium

Expand Down
8 changes: 3 additions & 5 deletions balena.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
name: browser
name: octo-browser
description: >-
a hardware accelerated web browser to present internal and external URLs on a
connected display

post-provisioning: >-
[![balena](https://github.com/balena-labs-projects/browser/actions/workflows/balena.yml/badge.svg)](https://github.com/balena-labs-projects/browser/actions/workflows/balena.yml)

## Usage instructions

Include this snippet in your docker-compose.yml file under 'services':
Expand Down Expand Up @@ -38,11 +36,11 @@ assets:
repository:
type: blob.asset
data:
url: 'https://github.com/balena-labs-projects/browser'
url: 'https://github.com/octopus-energy/balena-browser'
logo:
type: blob.asset
data:
url: 'https://raw.githubusercontent.com/balena-labs-projects/browser/master/logo.png'
url: 'https://raw.githubusercontent.com/octopus-energy/balena-browser/master/logo.png'
data:
defaultDeviceType: raspberrypi3
supportedDeviceTypes:
Expand Down
27 changes: 10 additions & 17 deletions build/install_chromium
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,22 @@ then

cp -a "${BASE_DIR}/rpi/raspi.list" "/etc/apt/sources.list.d/"
cp -a "${BASE_DIR}/rpi/raspberrypi-archive-stable.gpg" "/etc/apt/trusted.gpg.d/"

# The RPi-patched chromium package is called chromium-browser
CHROMIUM_PACKAGE="chromium-browser"
else
echo "Defaulting to vanilla chromium"
# The node library launches /usr/bin/chromium-browser
# which is not provided by the upstream package
ln -s /usr/bin/chromium /usr/bin/chromium-browser
fi

# mimic previous balenalib "install_packages" behavior:
apt-get update && apt-get install -y --no-install-recommends \
${CHROMIUM_PACKAGE} \
chromium-common \
libgles2-mesa \
lsb-release \
mesa-vdpau-drivers \
scrot \
x11-xserver-utils \
xserver-xorg-input-evdev \
xserver-xorg-legacy \
xserver-xorg-video-fbdev \
xserver-xorg xinit \
xinput \
xterm && \
grim \
fonts-noto \
fonts-noto-color-emoji \
cage \
mpv \
seatd \
udev \
initscripts \
jq \
wlr-randr && \
rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/*
4 changes: 2 additions & 2 deletions build/rpi/raspi.list
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
deb http://archive.raspberrypi.com/debian/ bookworm main
deb http://archive.raspberrypi.com/debian/ trixie main
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspberrypi.com/debian/ bookworm main
#deb-src http://archive.raspberrypi.com/debian/ trixie main
236 changes: 236 additions & 0 deletions extensions/chrome-simple-keyboard/contentScript.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,236 @@
/*!
*
* simple-keyboard v3.4.91
* https://github.com/hodgef/simple-keyboard
*
* Copyright (c) Francisco Hodge (https://github.com/hodgef) and project contributors.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
.hg-theme-default {
background-color: #ececec;
border-radius: 5px;
box-sizing: border-box;
font-family: HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;
overflow: hidden;
padding: 5px;
touch-action: manipulation;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
width: 100%
}

.hg-theme-default .hg-button span {
pointer-events: none
}

.hg-theme-default button.hg-button {
border-width: 0;
font-size: inherit;
outline: 0
}

.hg-theme-default .hg-button {
display: inline-block;
flex-grow: 1
}

.hg-theme-default .hg-row {
display: flex
}

.hg-theme-default .hg-row:not(:last-child) {
margin-bottom: 5px
}

.hg-theme-default .hg-row .hg-button:not(:last-child) {
margin-right: 5px
}

.hg-theme-default .hg-row .hg-button-container {
margin-right: 5px
}

.hg-theme-default .hg-row > div:last-child {
margin-right: 0
}

.hg-theme-default .hg-row .hg-button-container {
display: flex
}

.hg-theme-default .hg-button {
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
align-items: center;
background: #fff;
border-bottom: 1px solid #b5b5b5;
border-radius: 5px;
box-shadow: 0 0 3px -1px rgba(0, 0, 0, .3);
box-sizing: border-box;
cursor: pointer;
display: flex;
height: 40px;
justify-content: center;
padding: 5px
}

.hg-theme-default .hg-button.hg-standardBtn {
width: 20px
}

.hg-theme-default .hg-button.hg-activeButton {
background: #efefef
}

.hg-theme-default.hg-layout-numeric .hg-button {
align-items: center;
display: flex;
height: 60px;
justify-content: center;
width: 33.3%
}

.hg-theme-default .hg-button.hg-button-numpadadd, .hg-theme-default .hg-button.hg-button-numpadenter {
height: 85px
}

.hg-theme-default .hg-button.hg-button-numpad0 {
width: 105px
}

.hg-theme-default .hg-button.hg-button-com {
max-width: 85px
}

.hg-theme-default .hg-button.hg-standardBtn.hg-button-at {
max-width: 45px
}

.hg-theme-default .hg-button.hg-selectedButton {
background: rgba(5, 25, 70, .53);
color: #fff
}

.hg-theme-default .hg-button.hg-standardBtn[data-skbtn=".com"] {
max-width: 82px
}

.hg-theme-default .hg-button.hg-standardBtn[data-skbtn="@"] {
max-width: 60px
}

.hg-candidate-box {
background: #ececec;
border-bottom: 2px solid #b5b5b5;
border-radius: 5px;
display: inline-flex;
margin-top: -10px;
max-width: 272px;
position: absolute;
transform: translateY(-100%);
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none
}

ul.hg-candidate-box-list {
display: flex;
flex: 1;
list-style: none;
margin: 0;
padding: 0
}

li.hg-candidate-box-list-item {
align-items: center;
display: flex;
height: 40px;
justify-content: center;
width: 40px
}

li.hg-candidate-box-list-item:hover {
background: rgba(0, 0, 0, .03);
cursor: pointer
}

li.hg-candidate-box-list-item:active {
background: rgba(0, 0, 0, .1)
}

.hg-candidate-box-prev:before {
content: "◄"
}

.hg-candidate-box-next:before {
content: "►"
}

.hg-candidate-box-next, .hg-candidate-box-prev {
align-items: center;
background: #d0d0d0;
color: #969696;
cursor: pointer;
display: flex;
padding: 0 10px
}

.hg-candidate-box-next {
border-bottom-right-radius: 5px;
border-top-right-radius: 5px
}

.hg-candidate-box-prev {
border-bottom-left-radius: 5px;
border-top-left-radius: 5px
}

.hg-candidate-box-btn-active {
color: #444
}

#virtual-keyboard {
top: unset;
bottom: 0;
border-radius: 10px 10px 0 0;

box-sizing: border-box !important;
position: fixed;
z-index: 20000;
width: 100%;
max-width: 1440px;
background: #e3e3e3;
background: linear-gradient(to right bottom,#eee,#ebebeb,#e8e8e8,#e6e6e6,#e3e3e3);
-webkit-box-shadow: inset 1px 1px 0 rgba(255,255,255,.25),0 0 20px -8px rgba(0,0,0,.15);
box-shadow: inset 1px 1px 0 rgba(255,255,255,.25),0 0 20px -8px rgba(0,0,0,.15);
padding: 25px 20px 20px;
left: 0;
right: 0;
margin: auto;
}

#virtual-keyboard .keyboard-wrapper {
position: relative;
background: inherit;
width: 100%;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;

box-sizing: border-box !important;
}

Loading
Loading