Skip to content

Commit

Permalink
Merge pull request #9 from xibosignage/develop
Browse files Browse the repository at this point in the history
Release 0.4
  • Loading branch information
dasgarner authored Jan 8, 2018
2 parents 175a02b + 4073118 commit d9b2180
Show file tree
Hide file tree
Showing 14 changed files with 344 additions and 108 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
vendor/
.project/
.vagrant/
.idea/
config.json
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM alpine:3.6
MAINTAINER Spring Signage Ltd <[email protected]>

ENV XMR_DEBUG false
ENV XMR_QUEUE_POLL 5
ENV XMR_QUEUE_SIZE 10
ENV XMR_IPV6RESPSUPPORT false
ENV XMR_IPV6PUBSUPPORT false

RUN apk update && apk upgrade && apk add tar php7 curl php7-zmq php7-phar php7-json php7-openssl && rm -rf /var/cache/apk/*

EXPOSE 9505 50001

COPY ./entrypoint.sh /entrypoint.sh
COPY . /opt/xmr

RUN chown -R nobody /opt/xmr && chmod 755 /entrypoint.sh

# Start XMR
USER nobody

CMD ["/entrypoint.sh"]
81 changes: 63 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,77 @@
# Introduction
Xibo - Digital Signage - http://www.xibo.org.uk
Copyright (C) 2006-2015 Daniel Garner and Contributors.
Copyright (C) 2006-2018 Spring Signage Ltd and Contributors.

This is the Xibo Message Relay (XMR) repository.

XMR is a php application built on ReactPHP which acts as a ZeroMQ message exchange between the Xibo CMS and connected
Xibo Players. It doesn't do anything beyond forward messages from the CMS to a pub/sub socket.
XMR is a php application built on ReactPHP which acts as a ZeroMQ message exchange between the Xibo CMS and connected Xibo Players. It doesn't do anything beyond forward messages from the CMS to a pub/sub socket.

It is packaged into a PHAR file which is included in the [Xibo CMS](https://github.com/xibosignage/xibo-cms) release files.

**If you are here for anything other than software development purposes, it is unlikely you are in the right place. XMR is shipped with the Xibo CMS installation and you would usually install it from there.**


It is packaged into a PHAR file which is included in the [Xibo CMS](https://github.com/xibosignage/xibo-cms) release
files.

## Installation
The install, use composer:
XMR can be run using Docker and Compose, for example:

```yaml
version: "3"

services:
xmr:
image: xibosignage/xibo-xmr:latest
ports:
- "9505:9505"
- "50001:50001"
```
You may also build this library from source code:
1. Clone this repository
2. Run `./build.sh`
3. Run `docker-compose up --build`



You may also reference this code in your own projects via Composer:

```bash
composer require xibosignage/xibo-xmr
```



### Ports

XMR requires a listen address and a publish address and therefore needs 2 ports. The listen address is used for communication with the CMS (incoming comms) and the publish address is used for outgoing messages.

When running in Docker, you will want to expose these ports to your machine OR connect your container to a Docker network which will facilitate communication with these ports.

An example ports directive would be:

``` yaml
ports:
- "9505:9505" #Publish
- "50001:50001" #Listen
```





## Licence
Xibo is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
any later version.

Xibo is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with Xibo. If not, see <http://www.gnu.org/licenses/>.

Xibo is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

Xibo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with Xibo. If not, see <http://www.gnu.org/licenses/>.



#### 3rd Party

We use BOX to package the PHAR file - see https://github.com/box-project/box2
19 changes: 0 additions & 19 deletions Vagrantfile

This file was deleted.

Binary file modified bin/xmr.phar
Binary file not shown.
2 changes: 1 addition & 1 deletion box.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
}
],
"main": "index.php",
"output": "/home/vagrant/xmr.phar",
"output": "bin/xmr.phar",
"stub": true
}
12 changes: 12 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
docker run --rm \
--volume $PWD:/app \
composer install --ignore-platform-reqs --optimize-autoloader

docker run --rm --name xmr-build \
-v "$PWD":/usr/src/myapp \
-w /usr/src/myapp php:7.0-cli \
/bin/bash -c "echo 'phar.readonly = Off' > /usr/local/etc/php/php.ini; curl -LSs https://box-project.github.io/box2/installer.php | php; php box.phar build; rm box.phar"

#docker rmi composer
#docker rmi php:7.0-cli
77 changes: 43 additions & 34 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions config.json

This file was deleted.

7 changes: 7 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: "3"

services:
xmr:
build: .
environment:
XMR_DEBUG: "true"
Loading

0 comments on commit d9b2180

Please sign in to comment.