forked from Screenly/Anthias
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into production
- Loading branch information
Showing
17 changed files
with
480 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,22 @@ FROM debian:stretch | |
MAINTAINER Viktor Petersson <[email protected]> | ||
|
||
RUN apt-get update && \ | ||
apt-get -y install build-essential git-core net-tools python-netifaces python-simplejson python-imaging python-dev sqlite3 libffi-dev libssl-dev curl mplayer && \ | ||
apt-get -y install \ | ||
build-essential \ | ||
curl \ | ||
ffmpeg \ | ||
git-core \ | ||
libffi-dev \ | ||
libssl-dev \ | ||
mplayer \ | ||
net-tools \ | ||
procps \ | ||
python-dev \ | ||
python-imaging \ | ||
python-netifaces \ | ||
python-simplejson \ | ||
sqlite3 \ | ||
&& \ | ||
apt-get clean | ||
|
||
# Install Python requirements | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
FROM resin/%%RESIN_MACHINE_NAME%%-debian | ||
MAINTAINER Anton Molodykh <[email protected]> | ||
|
||
RUN apt-get update && \ | ||
apt-get -y install \ | ||
build-essential \ | ||
curl \ | ||
git-core \ | ||
libffi-dev \ | ||
libssl-dev \ | ||
matchbox \ | ||
net-tools \ | ||
nginx-light \ | ||
omxplayer \ | ||
psmisc \ | ||
python-dev \ | ||
python-imaging \ | ||
python-netifaces \ | ||
python-simplejson \ | ||
sqlite3 \ | ||
uzbl \ | ||
x11-xserver-utils \ | ||
xserver-xorg && \ | ||
apt-get clean | ||
|
||
RUN rm /etc/nginx/sites-enabled/default | ||
COPY ansible/roles/ssl/files/nginx_resin.conf /etc/nginx/sites-enabled/screenly.conf | ||
|
||
# Install Python requirements | ||
ADD requirements.txt /tmp/requirements.txt | ||
RUN curl -s https://bootstrap.pypa.io/get-pip.py | python && \ | ||
pip install --upgrade -r /tmp/requirements.txt | ||
|
||
# Screenly Websocker Server | ||
COPY ansible/roles/screenly/files/screenly-websocket_server_layer.service /etc/systemd/system/screenly-websocket_server_layer.service | ||
RUN sed -i '/\[Service\]/ a\Environment=HOME=/data' /etc/systemd/system/screenly-websocket_server_layer.service | ||
|
||
# Screenly Server | ||
COPY ansible/roles/screenly/files/screenly-web.service /etc/systemd/system/screenly-web.service | ||
RUN sed -i '/\[Service\]/ a\Environment=HOME=/data' /etc/systemd/system/screenly-web.service | ||
|
||
# X11 | ||
COPY ansible/roles/screenly/files/X.service /etc/systemd/system/X.service | ||
|
||
# Matchbox | ||
COPY ansible/roles/screenly/files/matchbox.service /etc/systemd/system/matchbox.service | ||
|
||
#Screenly Viewer | ||
COPY ansible/roles/screenly/files/screenly-viewer.service /etc/systemd/system/screenly-viewer.service | ||
RUN sed -i '/\[Service\]/ a\Environment=HOME=/data' /etc/systemd/system/screenly-viewer.service | ||
RUN sed -i '/\[Service\]/ a\Environment=DISABLE_UPDATE_CHECK=True' /etc/systemd/system/screenly-viewer.service | ||
|
||
# Enable container init system. | ||
ENV INITSYSTEM on | ||
|
||
# Create runtime user | ||
RUN useradd pi -d /home/pi \ | ||
&& /usr/sbin/usermod -a -G video pi | ||
|
||
# Install config file and file structure | ||
RUN mkdir -p /home/pi/screenly | ||
COPY ansible/roles/screenly/files/gtkrc-2.0 /home/pi/.gtkrc-2.0 | ||
|
||
# Copy in code base | ||
COPY . /home/pi/screenly | ||
|
||
RUN chown -R pi:pi /home/pi | ||
|
||
WORKDIR /home/pi/screenly | ||
|
||
CMD ["bash", "bin/start_resin.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
upstream ose { | ||
server 127.0.0.1:8080; | ||
} | ||
|
||
upstream websocket { | ||
server 127.0.0.1:9999; | ||
} | ||
|
||
server { | ||
server_tokens off; | ||
listen 80 default_server; | ||
|
||
location / { | ||
client_max_body_size 4G; | ||
proxy_pass http://ose; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header Host $http_host; | ||
proxy_set_header X-Forwarded-Protocol https; | ||
} | ||
|
||
location /ws/ { | ||
proxy_pass http://websocket; | ||
proxy_read_timeout 24d; | ||
chunked_transfer_encoding off; | ||
proxy_http_version 1.1; | ||
proxy_buffering off; | ||
|
||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection "Upgrade"; | ||
proxy_set_header Host $http_host; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/bash | ||
|
||
chown -R pi:pi /data | ||
|
||
mkdir -p \ | ||
/data/.config \ | ||
/data/.config/uzbl \ | ||
/data/.screenly \ | ||
/data/screenly \ | ||
/data/screenly_assets | ||
|
||
cp -n ansible/roles/screenly/files/screenly.conf /data/.screenly/screenly.conf | ||
cp -n ansible/roles/screenly/files/screenly.db /data/.screenly/screenly.db | ||
cp -n loading.png /data/screenly/loading.png | ||
cp -n ansible/roles/screenly/files/uzbl-config /data/.config/uzbl/config-screenly | ||
|
||
if [ -n "${OVERWRITE_CONFIG}" ]; then | ||
echo "Requested to overwrite Screenly config file." | ||
cp ansible/roles/screenly/files/screenly.conf "/data/.screenly/screenly.conf" | ||
fi | ||
|
||
# Set management page's user and password from environment variables, | ||
# but only if both of them are provided. Can have empty values provided. | ||
if [ -n "${MANAGEMENT_USER+x}" ] && [ -n "${MANAGEMENT_PASSWORD+x}" ]; then | ||
sed -i -e "s/^user=.*/user=${MANAGEMENT_USER}/" -e "s/^password=.*/password=${MANAGEMENT_PASSWORD}/" /data/.screenly/screenly.conf | ||
fi | ||
|
||
sed -i "/\[Service\]/ a\Environment=RESIN_UUID=${RESIN_DEVICE_UUID}" /etc/systemd/system/screenly-web.service | ||
|
||
systemctl start X.service | ||
systemctl start matchbox.service | ||
systemctl start screenly-viewer.service | ||
systemctl start screenly-web.service | ||
systemctl start screenly-websocket_server_layer.service | ||
|
||
journalctl -f -a | ||
|
||
# By default docker gives us 64MB of shared memory size but to display heavy | ||
# pages we need more. | ||
umount /dev/shm && mount -t tmpfs shm /dev/shm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Install Screenly OSE using Resin.io | ||
|
||
## tl;dr instructions | ||
|
||
* Create a [Resin.io](https://www.resin.io) account | ||
* [Create application](https://docs.resin.io/raspberrypi3/nodejs/getting-started/#create-an-application) | ||
* Download resinOS | ||
* Flash out the disk image | ||
* Boot the device | ||
* Clone the Screenly OSE repository: | ||
|
||
``` | ||
$ git clone https://github.com/Screenly/screenly-ose.git | ||
``` | ||
|
||
* Add the Resin git remote endpoint: | ||
|
||
``` | ||
$ git remote add resin <USERNAME>@git.resin.io:<USERNAME>/<APPNAME>.git | ||
``` | ||
|
||
* Push the code to Resin.io: | ||
|
||
``` | ||
$ git push resin master | ||
``` | ||
|
||
*(This will take some time, as all components are being installed)* | ||
|
||
* Navigate to "Fleet Configuration" in the web interface and create a new configuration with the key `RESIN_HOST_CONFIG_gpu_mem` and the value `64`. If you're having issues with video playback performance, you may need to increase this to 192, or sometimes even 256. | ||
|
||
## Longer instructions | ||
|
||
For more detailed instructions, including a screencast, check out the blog post [Deploy a digital signage application with Screenly OSE and resin.io](https://resin.io/blog/deploy-a-digital-signage-application-with-screenly-and-resin/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.