Commit 0b82e121 authored by Pablo Viñals's avatar Pablo Viñals
Browse files

primer commit

parent 9a0e1ee8
{
"crossbar/pytester.py::test_bluetooth": true,
"testing/pytester.py::test_answer": true,
"unit_testing/test_bluetooth.py::test_AllOK": true,
"unit_testing/test_presence.py::test_AllOK2": true
}
\ No newline at end of file
[
"unit_testing/test_bluetooth.py::test_EventoMalEscrito",
"unit_testing/test_bluetooth.py::test_AllOK1",
"unit_testing/test_bluetooth.py::test_AllOK2",
"unit_testing/test_calendar.py::test_EventoMalEscrito",
"unit_testing/test_calendar.py::test_AllOK1",
"unit_testing/test_first.py::TestClass::()::test_one",
"unit_testing/test_first.py::TestClass::()::test_two",
"unit_testing/test_global.py::test_EventoMalEscrito1",
"unit_testing/test_global.py::test_EventoMalEscrito2",
"unit_testing/test_global.py::test_EventoMalEscrito3",
"unit_testing/test_global.py::test_BadURL",
"unit_testing/test_global.py::test_AllOK1",
"unit_testing/test_global.py::test_AllOK2",
"unit_testing/test_presence.py::test_EventoMalEscrito",
"unit_testing/test_presence.py::test_ParamsNotIntegers",
"unit_testing/test_presence.py::test_EventNotKnown",
"unit_testing/test_presence.py::test_AllOK1",
"unit_testing/test_wifi.py::test_EventoMalEscrito",
"unit_testing/test_wifi.py::test_EventNotKnown",
"unit_testing/test_wifi.py::test_AllOK1",
"unit_testing/test_wifi.py::test_AllOK2"
]
\ No newline at end of file
FROM crossbario/crossbar
# copy over our own node directory from the host into the image
# set user "root" before copy and change owner afterwards
USER root
COPY ./crossbar /crossbar
RUN chown -R crossbar:crossbar /crossbar
RUN pip install -U pytest
RUN pip install objectpath
RUN pip install voluptuous
RUN pip install elasticsearch
ENTRYPOINT ["crossbar", "start", "--cbdir", "/crossbar/.crossbar"]
{
"version": 2,
"workers": [
{
"type": "router",
"options": {
"pythonpath": [".."]
},
"realms": [
{
"name": "realm1",
"roles": [
{
"name": "anonymous",
"permissions": [
{
"uri": "com.",
"match": "prefix",
"allow": {
"call": true,
"register": true,
"publish": true,
"subscribe": true
},
"disclose": {
"caller": false,
"publisher": false
},
"cache": true
}
]
}
]
},
{
"name": "codec",
"roles": [
{
"name": "codec",
"permissions": [
{
"uri": "",
"match": "prefix",
"allow": {
"call": false,
"register": true,
"publish": false,
"subscribe": false
},
"disclose": {
"caller": false,
"publisher": false
},
"cache": true
}
]
}
]
}
],
"transports": [
{
"type": "mqtt",
"endpoint": {
"type": "tcp",
"port": 1883
},
"options": {
"realm": "realm1",
"role": "anonymous",
"payload_mapping": {
"": {
"type": "dynamic",
"realm": "codec",
"encoder": "com.example.mqtt.encode",
"decoder": "com.example.mqtt.decode"
}
}
}
},
{
"type": "universal",
"endpoint": {
"type": "tcp",
"port": 8080
},
"mqtt": {
"options": {
"realm": "realm1",
"role": "anonymous",
"payload_mapping": {
"": {
"type": "dynamic",
"realm": "codec",
"encoder": "com.example.mqtt.encode",
"decoder": "com.example.mqtt.decode"
}
}
}
}
},
{
"type": "web",
"endpoint": {
"type": "tcp",
"port": 8081
},
"paths": {
"/": {
"type": "static",
"directory": "../web"
},
"ws": {
"type": "websocket"
}
}
},
{
"type": "web",
"endpoint": {
"type": "tcp",
"port": 8082
},
"paths": {
"publish": {
"type": "publisher",
"realm": "realm1",
"role": "anonymous",
"options": {
"debug": true
}
},
"call":{
"type": "caller",
"realm": "realm1",
"role": "anonymous"
}
}
}
],
"components": [
{
"type": "class",
"classname": "codec.MyCodec",
"realm": "codec",
"role": "codec"
}
]
},
{
"type": "container",
"options": {
"pythonpath": [
".."
]
},
"components": [
{
"type": "class",
"classname": "crossbarHelper.AppSession",
"realm": "realm1",
"transport": {
"type": "websocket",
"endpoint": {
"type": "tcp",
"host": "127.0.0.1",
"port": 8081
},
"url": "ws://127.0.0.1:8081/ws"
}
}
]
}
]
}
Crossbar.io node private key - KEEP THIS SAFE!
creator: Pablo@Pablos-MacBook-Pro.local
created-at: 2018-03-12T13:54:10.784Z
machine-id: C02S60P9FVH5
public-key-ed25519: 4b401ec004900082be7408ea93673d200222f71d0078fe7e309d88a107eff73b
private-key-ed25519: 7c57ae315c2da6ade09907ecde76387aa27009a119b5cb3fda8795157b50c386
Crossbar.io node public key
creator: Pablo@Pablos-MacBook-Pro.local
created-at: 2018-03-12T13:54:10.784Z
machine-id: C02S60P9FVH5
public-key-ed25519: 4b401ec004900082be7408ea93673d200222f71d0078fe7e309d88a107eff73b
from os.path import dirname, basename, isfile
import glob
modules = glob.glob(dirname(__file__)+"/*.py")
__all__ = [ basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')]
\ No newline at end of file
import voluptuous
import objectpath, requests
import importlib
from voluptuous import Schema, Required, In, Object, Self, Exclusive, Inclusive
class Bluetooth:
validate = Schema({
Required('channel'): str,
Required('event'): str,
Required("user"): str,
Required('params'): {}
})
import voluptuous
import objectpath, requests
import importlib
from voluptuous import Schema, Required, In, Object, Self, Exclusive, Inclusive
class Calendar:
validate = Schema({
Required('channel'): str,
Required('event'): str,
Required("user"): str,
Required('params'): {
Required("eventTitle"): str
}
})
import voluptuous
import objectpath, requests
import importlib
from voluptuous import Schema, Required, In, Object, Self, Exclusive, Inclusive
class Presence:
validate = Schema({
Required('channel'): str,
Required('event'): str,
Required("user"): str,
Required('params'): {
Inclusive("sensorID", "grupo"): str,
Exclusive("distance", "grupo"): str,
Exclusive("time", "grupo"): str,
}
})
import voluptuous
import objectpath, requests
import importlib
from voluptuous import Schema, Required, In, Object, Self, Exclusive, Inclusive
class Telegram:
validate = Schema({
Required('channel'): str,
Required('event'): str,
Required("user"): str,
Required('params'): {
Required("text") : str
}
})
import voluptuous
import objectpath, requests
import importlib
from voluptuous import Schema, Required, In, Object, Self, Exclusive, Inclusive
class Wifi:
validate = Schema({
Required('channel'): str,
Required('event'): str,
Required("user"): str,
Required('params'): {}
})
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment