Skip to content

Commit

Permalink
Merge branch 'master' into production
Browse files Browse the repository at this point in the history
  • Loading branch information
vpetersson committed Jul 17, 2020
2 parents 6c2c2fd + b2205c1 commit d12df55
Show file tree
Hide file tree
Showing 25 changed files with 298 additions and 85 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
custom: https://github.com/sponsors/Screenly
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ Steps to reproduce this issue, eg:
### Environment

* Raspberry Pi Hardware Version:
* Raspberry Pi Network Setup: (ex. built-in WiFi, Ethernet, USB WiFi Adapter)
* Screenly OSE Version:
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ pip-log.txt
venv
node_modules
*.retry

.env
76 changes: 76 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at . All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

**PLEASE NOTE:** Screenly OSE and the commercial version of Screenly (formerly known as Screenly Pro) are **two completely separate products**. They **do not share any code base and behave very differently** both with regards to management and performance. Hence do not use one to evaluate the other.

Want to help OSE thrive? Support us using [GitHub Sponsor](https://github.com/sponsors/Screenly).

## Disk images

The recommended installation method is to grab the latest disk image from [here](https://github.com/Screenly/screenly-ose/releases).
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/network/vars/main.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
resin_wifi_connect_version: 4.2.5
resin_wifi_connect_version: 4.2.13
2 changes: 1 addition & 1 deletion ansible/roles/screenly/files/screenly-celery.service
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Unit]
Description=Screenly celery worker
After=rabbitmq-server.service
After=redis-server.service

[Service]
WorkingDirectory=/home/pi/screenly
Expand Down
14 changes: 13 additions & 1 deletion ansible/roles/system/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
- python-gobject
- python-netifaces
- python-simplejson
- rabbitmq-server
- redis-server
- rpi-update
- sqlite3
- systemd
Expand All @@ -174,6 +174,18 @@
- lightdm
- lightdm-gtk-greeter
- dphys-swapfile
- rabbitmq-server
state: absent

- name: Remove cups/printing related packages
apt:
name:
- cups
- cups-browsed
- cups-client
- cups-common
- cups-daemon
- cups-server-common
state: absent

- name: Perform system upgrade
Expand Down
62 changes: 37 additions & 25 deletions bin/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ BRANCH_VERSION=
MANAGE_NETWORK=
UPGRADE_SYSTEM=

if [ -f .env ]; then
source .env
fi

while getopts ":w:b:n:s:" arg; do
case "${arg}" in
w)
Expand Down Expand Up @@ -52,19 +56,21 @@ EOF
exit 1
fi

echo && read -p "Would you like to use the experimental branch? It contains the last major changes, such as the new browser and migrating to Docker (y/N)" -n 1 -r -s EXP && echo
if [ "$EXP" != 'y' ]; then
echo && read -p "Would you like to use the development branch? You will get the latest features, but things may break. (y/N)" -n 1 -r -s DEV && echo
if [ "$DEV" != 'y' ]; then
export DOCKER_TAG="production"
BRANCH="production"
if [ -z "${BRANCH}" ]; then
echo && read -p "Would you like to use the experimental branch? It contains the last major changes, such as the new browser and migrating to Docker (y/N)" -n 1 -r -s EXP && echo
if [ "$EXP" != 'y' ]; then
echo && read -p "Would you like to use the development (master) branch? You will get the latest features, but things may break. (y/N)" -n 1 -r -s DEV && echo
if [ "$DEV" != 'y' ]; then
export DOCKER_TAG="production"
BRANCH="production"
else
export DOCKER_TAG="latest"
BRANCH="master"
fi
else
export DOCKER_TAG="latest"
BRANCH="master"
export DOCKER_TAG="experimental"
BRANCH="experimental"
fi
else
export DOCKER_TAG="experimental"
BRANCH="experimental"
fi

echo && read -p "Would you like to install the WoTT agent to help you manage security of your Raspberry Pi? (y/N)" -n 1 -r -s WOTT && echo
Expand All @@ -83,13 +89,17 @@ EOF
fi

elif [ "$WEB_UPGRADE" = true ]; then

if [ "$BRANCH_VERSION" = "latest" ]; then
export DOCKER_TAG="latest"
BRANCH="master"
else
echo -e "Invalid -b parameter."
exit 1
if [ -z "${BRANCH}" ]; then
if [ "$BRANCH_VERSION" = "latest" ]; then
export DOCKER_TAG="latest"
BRANCH="master"
elif [ "$BRANCH_VERSION" = "production" ]; then
export DOCKER_TAG="production"
BRANCH="production"
else
echo -e "Invalid -b parameter."
exit 1
fi
fi

if [ "$MANAGE_NETWORK" = false ]; then
Expand Down Expand Up @@ -123,12 +133,14 @@ else
export DEVICE_TYPE="pi1"
fi

if [ "$WEB_UPGRADE" = false ]; then
set -x
REPOSITORY=${1:-https://github.com/screenly/screenly-ose.git}
else
set -e
REPOSITORY=https://github.com/screenly/screenly-ose.git
if [ -z "${REPOSITORY}" ]; then
if [ "$WEB_UPGRADE" = false ]; then
set -x
REPOSITORY=${1:-https://github.com/screenly/screenly-ose.git}
else
set -e
REPOSITORY=https://github.com/screenly/screenly-ose.git
fi
fi

sudo mkdir -p /etc/ansible
Expand All @@ -141,7 +153,7 @@ if [ ! -f /etc/locale.gen ]; then
fi

sudo sed -i 's/apt.screenlyapp.com/archive.raspbian.org/g' /etc/apt/sources.list
sudo apt-get update
sudo apt update -y
sudo apt-get purge -y python-setuptools python-pip python-pyasn1
sudo apt-get install -y python-dev git-core libffi-dev libssl-dev
curl -s https://bootstrap.pypa.io/get-pip.py | sudo python
Expand Down
2 changes: 1 addition & 1 deletion bin/start_balena.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ run_viewer () {

while true; do

error=$(curl 127.0.0.1:8080 2>&1 | grep -c "Failed to connect")
error=$(curl screenly-server:80 2>&1 | grep -c "Failed to connect")
if [[ "$error" -eq 0 ]]; then
break
fi
Expand Down
20 changes: 20 additions & 0 deletions docker-compose.demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: "2"
services:
screenly-server:
environment:
- LISTEN=0.0.0.0
- IS_DEMO_NODE=1
- SWAGGER_HOST=ose.demo.screenlyapp.com
image: screenly/ose-dev-server:latest
ports:
- 80:8080
restart: always
mem_limit: 300M
volumes:
- ./:/home/pi/screenly:ro
- screenly-assets-volume:/home/pi/screenly_assets
- screenly-volume:/home/pi/.screenly

volumes:
screenly-assets-volume:
screenly-volume:
27 changes: 15 additions & 12 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ services:
environment:
- PYTHONUNBUFFERED=1
- LISTEN=0.0.0.0
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0
image: screenly-ose-server
network_mode: "host"
ports:
- "8080:8080"
- 8080:8080
volumes:
- ./:/home/pi/screenly:ro
- screenly-volume:/home/pi/.screenly
Expand All @@ -23,33 +24,35 @@ services:
depends_on:
- screenly-server
image: screenly-ose-websocket
network_mode: "host"
ports:
- 9999:9999
volumes:
- ./:/home/pi/screenly:ro
- screenly-volume:/home/pi/.screenly
- screenly-assets-volume:/home/pi/screenly_assets
- screenly-volume:/home/pi/.screenly

screenly-celery:
build:
context: .
dockerfile: docker/Dockerfile.celery.dev
depends_on:
- rabbitmq
- redis
- screenly-server
environment:
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0
image: screenly-ose-celery
network_mode: "host"
volumes:
- ./:/home/pi/screenly:ro
- screenly-volume:/home/pi/.screenly
- screenly-assets-volume:/home/pi/screenly_assets
- screenly-volume:/home/pi/.screenly

rabbitmq:
image: rabbitmq
command: rabbitmq-server
network_mode: "host"
redis:
image: redis:alpine
logging:
driver: none
restart: always

volumes:
screenly-volume:
screenly-assets-volume:
screenly-volume:
32 changes: 21 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ services:
- LISTEN=0.0.0.0
- PYTHONPATH=/data/screenly
- SCREENLYSERVICE=server
network_mode: "host"
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0
ports:
- 80:8080
privileged: true
restart: always
volumes:
- resin-data:/data

Expand All @@ -26,8 +30,10 @@ services:
- NOREFRESH=1
- PYTHONPATH=/data/screenly
- SCREENLYSERVICE=viewer
network_mode: "host"
- LISTEN=screenly-server
- PORT=80
privileged: true
restart: always
volumes:
- resin-data:/data

Expand All @@ -41,8 +47,11 @@ services:
- HOME=/data
- PYTHONPATH=/data/screenly
- SCREENLYSERVICE=websocket
network_mode: "host"
- LISTEN=screenly-server
ports:
- 9999:9999
privileged: true
restart: always
volumes:
- resin-data:/data

Expand All @@ -52,22 +61,23 @@ services:
dockerfile: docker/Dockerfile.celery.template
depends_on:
- screenly-server
- rabbitmq
- redis
environment:
- HOME=/data
- PYTHONPATH=/data/screenly
- SCREENLYSERVICE=celery
network_mode: "host"
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0
privileged: true
restart: always
volumes:
- resin-data:/data

rabbitmq:
image: arm32v7/rabbitmq
command: rabbitmq-server
ports:
- 5672:5672
- 15672:15672
redis:
build:
context: .
dockerfile: docker/Dockerfile.redis.template
restart: always

volumes:
resin-data:
Loading

0 comments on commit d12df55

Please sign in to comment.