mirror of
https://github.com/EDCD/EDDN.git
synced 2026-11-20 01:42:25 +03:00
commit
dedbc76a26
29 files changed
+334
-139
No files matched your search
@@ -1,9 +1,13 @@
|
||||
## EDDN - Elite: Dangerous Data Network
|
||||
|
||||
The **Elite: Dangerous Data Network** is a system for willing Commanders to share dynamic data about the galaxy with others. By pooling data in a common format, tools and analyses can be produced that add an even greater depth and vibrancy to the in-game universe.
|
||||
The **Elite: Dangerous Data Network** is a system for willing Commanders to share dynamic data about the galaxy with others.
|
||||
By pooling data in a common format, tools and analyses can be produced that add an even greater depth and vibrancy to the in-game universe.
|
||||
|
||||
EDDN is not run by or affiliated with [Frontier Developments](http://www.frontier.co.uk/). Hosting has been very generously provided by [Vivio Technologies](https://www.viviotech.net/).
|
||||
EDDN is not run by or affiliated with [Frontier Developments](http://www.frontier.co.uk/).
|
||||
|
||||
### [Using EDDN](https://github.com/jamesremuscat/EDDN/wiki)
|
||||
Hosting has been very generously provided by [Vivio Technologies](https://www.viviotech.net/), until 2017.
|
||||
Hosting is now provided by the [EDCD community](https://edcd.github.io/).
|
||||
|
||||
### [EDDN Status](http://eddn-gateway.elite-markets.net/)
|
||||
### [Using EDDN](https://github.com/EDSM-NET/EDDN/wiki)
|
||||
|
||||
### [EDDN Status](https://eddn.edcd.io/)
|
||||
@@ -1,77 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: eddn-gateway
|
||||
# Required-Start: $network
|
||||
# Required-Stop:
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
### END INIT INFO
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Based on: <Pyro4 NameServer Script>
|
||||
# Copyright (C) <2011> <Pierre PACORY> - ppacory-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
|
||||
# Modified by James Muscat
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
# This program 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 General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
|
||||
MESSAGEDIR=/var/log/eddn-gateway
|
||||
MESSAGELOG=/var/log/eddn-gateway/gateway.log
|
||||
PID=/var/run/eddn-gateway.pid
|
||||
EXECUTABLE=/path/to/eddn-gateway
|
||||
CMDLINE=""
|
||||
|
||||
|
||||
# Check the script is being run by root user
|
||||
if [ "$(id -u)" != "0" ]; then
|
||||
echo 1>&2 "ERROR: The $0 script must be run as root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Create the PID File
|
||||
touch $PID
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
# create the log directory if not exist
|
||||
[ ! -d "$MESSAGEDIR" ] && mkdir -p "$MESSAGEDIR"
|
||||
|
||||
echo "Starting EDDN gateway"
|
||||
# test if not already running
|
||||
if [ ! -f "/proc/$(cat $PID)/exe" ]; then
|
||||
$EXECUTABLE "$CMDLINE" > "$MESSAGELOG" 2>&1 &
|
||||
echo $!>"$PID"
|
||||
else
|
||||
echo "EDDN gateway already running"
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
echo "Stopping EDDN gateway"
|
||||
# test if running
|
||||
if [ -f "/proc/$(cat $PID)/exe" ]; then
|
||||
kill -9 "$(cat $PID)"
|
||||
rm -rf "$PID"
|
||||
else
|
||||
echo "EDDN gateway already stopped"
|
||||
fi
|
||||
;;
|
||||
restart)
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
*)
|
||||
echo "usage: $0 {start|stop|restart}"
|
||||
esac
|
||||
exit 0
|
||||
@@ -0,0 +1,53 @@
|
||||
#!/bin/sh
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: eddn-gateway
|
||||
# Required-Start: $network
|
||||
# Required-Stop:
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
### END INIT INFO
|
||||
|
||||
NAME=eddn-gateway
|
||||
DESC="eddn-gateway"
|
||||
PIDFILE="/var/run/${NAME}.pid"
|
||||
LOGFILE="/var/log/eddn/${NAME}.log"
|
||||
|
||||
DAEMON="/usr/local/bin/${NAME}"
|
||||
|
||||
EXEC_AS_USER="root"
|
||||
|
||||
START_OPTS="--start --background --make-pidfile --pidfile ${PIDFILE} --chuid ${EXEC_AS_USER} --exec ${DAEMON}"
|
||||
STOP_OPTS="--stop --pidfile ${PIDFILE}"
|
||||
|
||||
test -x $DAEMON || exit 0
|
||||
|
||||
set -e
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting ${DESC}: "
|
||||
start-stop-daemon $START_OPTS >> $LOGFILE
|
||||
echo "$NAME."
|
||||
;;
|
||||
stop)
|
||||
echo -n "Stopping $DESC: "
|
||||
start-stop-daemon $STOP_OPTS
|
||||
echo "$NAME."
|
||||
rm -f $PIDFILE
|
||||
;;
|
||||
restart|force-reload)
|
||||
echo -n "Restarting $DESC: "
|
||||
start-stop-daemon $STOP_OPTS
|
||||
sleep 1
|
||||
start-stop-daemon $START_OPTS >> $LOGFILE
|
||||
echo "$NAME."
|
||||
;;
|
||||
*)
|
||||
N=/etc/init.d/$NAME
|
||||
echo "Usage: $N {start|stop|restart|force-reload}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,53 @@
|
||||
#!/bin/sh
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: eddn-monitor
|
||||
# Required-Start: $network
|
||||
# Required-Stop:
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
### END INIT INFO
|
||||
|
||||
NAME=eddn-monitor
|
||||
DESC="eddn-monitor"
|
||||
PIDFILE="/var/run/${NAME}.pid"
|
||||
LOGFILE="/var/log/eddn/${NAME}.log"
|
||||
|
||||
DAEMON="/usr/local/bin/${NAME}"
|
||||
|
||||
EXEC_AS_USER="root"
|
||||
|
||||
START_OPTS="--start --background --make-pidfile --pidfile ${PIDFILE} --chuid ${EXEC_AS_USER} --exec ${DAEMON}"
|
||||
STOP_OPTS="--stop --pidfile ${PIDFILE}"
|
||||
|
||||
test -x $DAEMON || exit 0
|
||||
|
||||
set -e
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting ${DESC}: "
|
||||
start-stop-daemon $START_OPTS >> $LOGFILE
|
||||
echo "$NAME."
|
||||
;;
|
||||
stop)
|
||||
echo -n "Stopping $DESC: "
|
||||
start-stop-daemon $STOP_OPTS
|
||||
echo "$NAME."
|
||||
rm -f $PIDFILE
|
||||
;;
|
||||
restart|force-reload)
|
||||
echo -n "Restarting $DESC: "
|
||||
start-stop-daemon $STOP_OPTS
|
||||
sleep 1
|
||||
start-stop-daemon $START_OPTS >> $LOGFILE
|
||||
echo "$NAME."
|
||||
;;
|
||||
*)
|
||||
N=/etc/init.d/$NAME
|
||||
echo "Usage: $N {start|stop|restart|force-reload}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,53 @@
|
||||
#!/bin/sh
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: eddn-relay
|
||||
# Required-Start: $network
|
||||
# Required-Stop:
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
### END INIT INFO
|
||||
|
||||
NAME=eddn-relay
|
||||
DESC="eddn-relay"
|
||||
PIDFILE="/var/run/${NAME}.pid"
|
||||
LOGFILE="/var/log/eddn/${NAME}.log"
|
||||
|
||||
DAEMON="/usr/local/bin/${NAME}"
|
||||
|
||||
EXEC_AS_USER="root"
|
||||
|
||||
START_OPTS="--start --background --make-pidfile --pidfile ${PIDFILE} --chuid ${EXEC_AS_USER} --exec ${DAEMON}"
|
||||
STOP_OPTS="--stop --pidfile ${PIDFILE}"
|
||||
|
||||
test -x $DAEMON || exit 0
|
||||
|
||||
set -e
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting ${DESC}: "
|
||||
start-stop-daemon $START_OPTS >> $LOGFILE
|
||||
echo "$NAME."
|
||||
;;
|
||||
stop)
|
||||
echo -n "Stopping $DESC: "
|
||||
start-stop-daemon $STOP_OPTS
|
||||
echo "$NAME."
|
||||
rm -f $PIDFILE
|
||||
;;
|
||||
restart|force-reload)
|
||||
echo -n "Restarting $DESC: "
|
||||
start-stop-daemon $STOP_OPTS
|
||||
sleep 1
|
||||
start-stop-daemon $START_OPTS >> $LOGFILE
|
||||
echo "$NAME."
|
||||
;;
|
||||
*)
|
||||
N=/etc/init.d/$NAME
|
||||
echo "Usage: $N {start|stop|restart|force-reload}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
@@ -403,8 +403,8 @@
|
||||
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
|
||||
<!-- Include all compiled plugins (below), or include individual files as needed -->
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
|
||||
<script src="http://code.highcharts.com/4.1.5/highcharts.js"></script>
|
||||
<script src="http://code.highcharts.com/4.1.5/modules/drilldown.js"></script>
|
||||
<script src="https://code.highcharts.com/5.0.12/highcharts.js"></script>
|
||||
<script src="https://code.highcharts.com/5.0.12/modules/drilldown.js"></script>
|
||||
<script src="./js/eddn.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,16 +1,19 @@
|
||||
var updateInterval = 60000,
|
||||
|
||||
monitorEndPoint = 'http://eddn-gateway.elite-markets.net:9091/',
|
||||
monitorEndPoint = 'https://eddn.edcd.io:9091/',
|
||||
|
||||
gatewayBottlePort = 8080,
|
||||
//gatewayBottlePort = 8080,
|
||||
gatewayBottlePort = 4430,
|
||||
relayBottlePort = 9090,
|
||||
|
||||
gateways = [
|
||||
'eddn-gateway.elite-markets.net'
|
||||
'eddn.edcd.io',
|
||||
//'eddn-gateway.elite-markets.net'
|
||||
], // Must find a way to bind them to monitor
|
||||
|
||||
relays = [
|
||||
'eddn-relay.elite-markets.net'
|
||||
'eddn.edcd.io',
|
||||
//'eddn-relay.elite-markets.net'
|
||||
]; // Must find a way to bind them to monitor
|
||||
|
||||
var stats = {
|
||||
@@ -539,7 +542,7 @@ var start = function(){
|
||||
gateway = gateway.replace(':8500', '');
|
||||
|
||||
$("select[name=gateways]").append($('<option>', {
|
||||
value: 'http://' + gateway + ':' + gatewayBottlePort + '/stats/',
|
||||
value: 'https://' + gateway + ':' + gatewayBottlePort + '/stats/',
|
||||
text : gateway
|
||||
}));
|
||||
|
||||
@@ -586,7 +589,7 @@ var start = function(){
|
||||
//relays = relays.sort();
|
||||
$.each(relays, function(k, relay){
|
||||
$("select[name=relays]").append($('<option>', {
|
||||
value: 'http://' + relay + ':' + relayBottlePort + '/stats/',
|
||||
value: 'https://' + relay + ':' + relayBottlePort + '/stats/',
|
||||
text : relay
|
||||
}));
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
|
||||
<!-- Include all compiled plugins (below), or include individual files as needed -->
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
|
||||
<script src="http://code.highcharts.com/4.1.5/highcharts.js"></script>
|
||||
<script src="https://code.highcharts.com/5.0.12/highcharts.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var makeSlug = function(str) {
|
||||
@@ -135,7 +135,7 @@
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
var monitorEndPoint = 'http://eddn-gateway.elite-markets.net:9091/';
|
||||
var monitorEndPoint = 'https://eddn.edcd.io:9091/';
|
||||
|
||||
var chartContainer = $('#schemas .charts');
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
# /etc/nginx/sites-enabled
|
||||
|
||||
# Redirect MONITOR to HTTPS
|
||||
server {
|
||||
listen 80;
|
||||
server_name eddn.edcd.io eddn-status.elite-markets.net eddn-gateway.elite-markets.net;
|
||||
|
||||
return 301 https://eddn.edcd.io$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl default_server;
|
||||
server_name eddn.edcd.io;
|
||||
|
||||
charset utf8;
|
||||
gzip on;
|
||||
|
||||
root /home/EDDN/contrib/monitor;
|
||||
index index.html;
|
||||
|
||||
ssl_certificate /etc/letsencrypt/live/eddn.edcd.io/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/eddn.edcd.io/privkey.pem;
|
||||
|
||||
location ~ "^/schemas/(.*)/([\d]{1})(/test)?$" {
|
||||
add_header Content-Type application/json;
|
||||
alias /home/EDDN/schemas/$1-v$2.0.json;
|
||||
}
|
||||
}
|
||||
|
||||
# GATEWAY UPSTREAM
|
||||
upstream gateway {
|
||||
server 127.0.0.1:8081 fail_timeout=0;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 4430 ssl;
|
||||
server_name eddn.edcd.io eddn-gateway.elite-markets.net;
|
||||
|
||||
location / {
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_redirect off;
|
||||
|
||||
proxy_pass https://gateway;
|
||||
}
|
||||
|
||||
ssl_certificate /etc/letsencrypt/live/eddn.edcd.io/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/eddn.edcd.io/privkey.pem;
|
||||
}
|
||||
@@ -18,7 +18,7 @@ namespace ConsoleApp
|
||||
using (var client = new SubscriberSocket())
|
||||
{
|
||||
client.Options.ReceiveHighWatermark = 1000;
|
||||
client.Connect("tcp://eddn-relay.elite-markets.net:9500");
|
||||
client.Connect("tcp://eddn.edcd.io:9500");
|
||||
client.SubscribeToAnyTopic();
|
||||
while (true)
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.util.zip.Inflater;
|
||||
public class EddnPump extends Thread {
|
||||
|
||||
public static final String SCHEMA_KEY = "$schemaRef";
|
||||
public static final String RELAY = "tcp://eddn-relay.elite-markets.net:9500";
|
||||
public static final String RELAY = "tcp://eddn.edcd.io:9500";
|
||||
|
||||
public void msg(String msg) {
|
||||
System.out.println(msg);
|
||||
|
||||
@@ -2,7 +2,7 @@ const zlib = require('zlib');
|
||||
const zmq = require('zeromq');
|
||||
const sock = zmq.socket('sub');
|
||||
|
||||
sock.connect('tcp://eddn-relay.elite-markets.net:9500');
|
||||
sock.connect('tcp://eddn.edcd.io:9500');
|
||||
console.log('Worker connected to port 9500');
|
||||
|
||||
sock.subscribe('');
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/**
|
||||
* Configuration
|
||||
*/
|
||||
$relayEDDN = 'tcp://eddn-relay.elite-markets.net:9500';
|
||||
$relayEDDN = 'tcp://eddn.edcd.io:9500';
|
||||
$timeoutEDDN = 600000;
|
||||
|
||||
// Set false to listen to production stream
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/**
|
||||
* Configuration
|
||||
*/
|
||||
$relayEDDN = 'tcp://eddn-relay.elite-markets.net:9500';
|
||||
$relayEDDN = 'tcp://eddn.edcd.io:9500';
|
||||
$timeoutEDDN = 600000;
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import sys, os, datetime, time
|
||||
"""
|
||||
" Configuration
|
||||
"""
|
||||
__relayEDDN = 'tcp://eddn-relay.elite-markets.net:9500'
|
||||
__relayEDDN = 'tcp://eddn.edcd.io:9500'
|
||||
#__timeoutEDDN = 600000 # 10 minuts
|
||||
__timeoutEDDN = 60000 # 1 minut
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import time
|
||||
"""
|
||||
" Configuration
|
||||
"""
|
||||
__relayEDDN = 'tcp://eddn-relay.elite-markets.net:9500'
|
||||
__relayEDDN = 'tcp://eddn.edcd.io:9500'
|
||||
#__timeoutEDDN = 600000 # 10 minuts
|
||||
__timeoutEDDN = 60000 # 1 minut
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import sys, os, datetime, time
|
||||
"""
|
||||
" Configuration
|
||||
"""
|
||||
__relayEDDN = 'tcp://eddn-relay.elite-markets.net:9500'
|
||||
__relayEDDN = 'tcp://eddn.edcd.io:9500'
|
||||
__timeoutEDDN = 600000
|
||||
|
||||
# Set False to listen to production stream
|
||||
|
||||
@@ -7,7 +7,7 @@ import time
|
||||
"""
|
||||
" Configuration
|
||||
"""
|
||||
__relayEDDN = 'tcp://eddn-relay.elite-markets.net:9500'
|
||||
__relayEDDN = 'tcp://eddn.edcd.io:9500'
|
||||
__timeoutEDDN = 600000
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"$schema" : "http://json-schema.org/draft-04/schema#",
|
||||
"id" : "http://schemas.elite-markets.net/eddn/blackmarket/1#",
|
||||
"id" : "https://eddn.edcd.io/schemas/blackmarket/1#",
|
||||
"type" : "object",
|
||||
"additionalProperties" : false,
|
||||
"required": [ "$schemaRef", "header", "message" ],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"$schema" : "http://json-schema.org/draft-04/schema#",
|
||||
"id" : "http://schemas.elite-markets.net/eddn/commodity/3#",
|
||||
"id" : "https://eddn.edcd.io/schemas/commodity/3#",
|
||||
"type" : "object",
|
||||
"additionalProperties" : false,
|
||||
"required": [ "$schemaRef", "header", "message" ],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"$schema" : "http://json-schema.org/draft-04/schema#",
|
||||
"id" : "http://schemas.elite-markets.net/eddn/journal/1#",
|
||||
"id" : "https://eddn.edcd.io/schemas/journal/1#",
|
||||
"type" : "object",
|
||||
"additionalProperties" : false,
|
||||
"required": [ "$schemaRef", "header", "message" ],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"$schema" : "http://json-schema.org/draft-04/schema#",
|
||||
"id" : "http://schemas.elite-markets.net/eddn/outfitting/2#",
|
||||
"id" : "https://eddn.edcd.io/schemas/outfitting/2#",
|
||||
"type" : "object",
|
||||
"additionalProperties" : false,
|
||||
"required" : [ "$schemaRef", "header", "message" ],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"$schema" : "http://json-schema.org/draft-04/schema#",
|
||||
"id" : "http://schemas.elite-markets.net/eddn/shipyard/2#",
|
||||
"id" : "https://eddn.edcd.io/schemas/shipyard/2#",
|
||||
"type" : "object",
|
||||
"additionalProperties" : false,
|
||||
"required" : [ "$schemaRef", "header", "message" ],
|
||||
|
||||
+24
-5
@@ -37,6 +37,11 @@ statsCollector = StatsCollector()
|
||||
statsCollector.start()
|
||||
|
||||
|
||||
# Migration from schemas.elite-markets.net to eddn.edcd.io - Remove after transition complete!
|
||||
import re
|
||||
TRANSITION_RE = re.compile('^https://eddn.edcd.io/schemas/(.+)')
|
||||
|
||||
|
||||
def configure():
|
||||
# Get the list of transports to bind from settings. This allows us to PUB
|
||||
# messages to multiple announcers over a variety of socket types
|
||||
@@ -48,17 +53,21 @@ def configure():
|
||||
validator.addSchemaResource(schemaRef, resource_string('eddn.Gateway', schemaFile))
|
||||
|
||||
|
||||
def push_message(string_message, topic):
|
||||
def push_message(parsed_message, topic):
|
||||
"""
|
||||
Spawned as a greenlet to push messages (strings) through ZeroMQ.
|
||||
This is a dumb method that just pushes strings; it assumes you've already validated
|
||||
and serialised as you want to.
|
||||
"""
|
||||
string_message = simplejson.dumps(parsed_message, ensure_ascii=False).encode('utf-8')
|
||||
|
||||
# Push a zlib compressed JSON representation of the message to
|
||||
# announcers with schema as topic
|
||||
compressed_msg = zlib.compress(string_message)
|
||||
sender.send("%s |-| %s" % (topic, compressed_msg))
|
||||
|
||||
send_message = "%s |-| %s" % (str(topic), compressed_msg)
|
||||
|
||||
sender.send(send_message)
|
||||
statsCollector.tally("outbound")
|
||||
|
||||
|
||||
@@ -141,6 +150,11 @@ def parse_and_error_handle(data):
|
||||
if validationResults.severity <= ValidationSeverity.WARN:
|
||||
parsed_message['header']['gatewayTimestamp'] = datetime.utcnow().isoformat() + 'Z'
|
||||
|
||||
# Migration from schemas.elite-markets.net to eddn.edcd.io - Remove after transition complete!
|
||||
match = TRANSITION_RE.match(parsed_message['$schemaRef'])
|
||||
if match and match.group(1):
|
||||
parsed_message['$schemaRef'] = 'http://schemas.elite-markets.net/eddn/%s' % match.group(1)
|
||||
|
||||
ip_hash_salt = Settings.GATEWAY_IP_KEY_SALT
|
||||
if ip_hash_salt:
|
||||
# If an IP hash is set, salt+hash the uploader's IP address and set
|
||||
@@ -150,7 +164,7 @@ def parse_and_error_handle(data):
|
||||
|
||||
# Sends the parsed MarketOrderList or MarketHistoryList to the Announcers
|
||||
# as compressed JSON.
|
||||
gevent.spawn(push_message, simplejson.dumps(parsed_message, ensure_ascii=False).encode('utf-8'), parsed_message['$schemaRef'])
|
||||
gevent.spawn(push_message, parsed_message, parsed_message['$schemaRef'])
|
||||
logger.info("Accepted %s upload from %s" % (
|
||||
parsed_message, get_remote_address()
|
||||
))
|
||||
@@ -213,8 +227,13 @@ class MalformedUploadError(Exception):
|
||||
def main():
|
||||
loadConfig()
|
||||
configure()
|
||||
run(host=Settings.GATEWAY_HTTP_BIND_ADDRESS, port=Settings.GATEWAY_HTTP_PORT, server='gevent')
|
||||
|
||||
run(
|
||||
host=Settings.GATEWAY_HTTP_BIND_ADDRESS,
|
||||
port=Settings.GATEWAY_HTTP_PORT,
|
||||
server='gevent',
|
||||
certfile=Settings.CERT_FILE,
|
||||
keyfile=Settings.KEY_FILE
|
||||
)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
+7
-1
@@ -254,7 +254,13 @@ def main():
|
||||
loadConfig()
|
||||
m = Monitor()
|
||||
m.start()
|
||||
bottle_run(host='0.0.0.0', port=9091, server='gevent')
|
||||
bottle_run(
|
||||
host='0.0.0.0',
|
||||
port=9091,
|
||||
server='gevent',
|
||||
certfile=Settings.CERT_FILE,
|
||||
keyfile=Settings.KEY_FILE
|
||||
)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
+7
-1
@@ -111,7 +111,13 @@ def main():
|
||||
loadConfig()
|
||||
r = Relay()
|
||||
r.start()
|
||||
bottle_run(host='0.0.0.0', port=9090, server='gevent')
|
||||
bottle_run(
|
||||
host=Settings.RELAY_HTTP_BIND_ADDRESS,
|
||||
port=Settings.RELAY_HTTP_PORT,
|
||||
server='gevent',
|
||||
certfile=Settings.CERT_FILE,
|
||||
keyfile=Settings.KEY_FILE
|
||||
)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
+51
-25
@@ -9,53 +9,73 @@ class _Settings(object):
|
||||
|
||||
EDDN_VERSION = version
|
||||
|
||||
###############################################################################
|
||||
# Local installation settings
|
||||
###############################################################################
|
||||
|
||||
CERT_FILE = '/etc/letsencrypt/live/eddn.edcd.io/fullchain.pem'
|
||||
KEY_FILE = '/etc/letsencrypt/live/eddn.edcd.io/privkey.pem'
|
||||
|
||||
###############################################################################
|
||||
# Relay settings
|
||||
###############################################################################
|
||||
|
||||
RELAY_RECEIVER_BINDINGS = ["tcp://eddn-gateway.elite-markets.net:8500", "tcp://eddn.edcd.io:8500"]
|
||||
RELAY_HTTP_BIND_ADDRESS = "0.0.0.0"
|
||||
RELAY_HTTP_PORT = 9090
|
||||
|
||||
RELAY_SENDER_BINDINGS = ["tcp://*:9500"]
|
||||
RELAY_RECEIVER_BINDINGS = ["tcp://eddn.edcd.io:8500", "tcp://eddn-gateway.elite-markets.net:8500"]
|
||||
|
||||
RELAY_DECOMPRESS_MESSAGES = False
|
||||
RELAY_SENDER_BINDINGS = ["tcp://*:9500"]
|
||||
|
||||
RELAY_DECOMPRESS_MESSAGES = False
|
||||
|
||||
# If set to False, no deduplicate is made
|
||||
RELAY_DUPLICATE_MAX_MINUTES = 15
|
||||
RELAY_DUPLICATE_MAX_MINUTES = 15
|
||||
|
||||
# If set to false, don't listen to topic and accept all incoming messages
|
||||
RELAY_RECEIVE_ONLY_GATEWAY_EXTRA_JSON = True
|
||||
RELAY_RECEIVE_ONLY_GATEWAY_EXTRA_JSON = True
|
||||
|
||||
RELAY_EXTRA_JSON_SCHEMAS = {}
|
||||
RELAY_EXTRA_JSON_SCHEMAS = {}
|
||||
|
||||
###############################################################################
|
||||
# Gateway settings
|
||||
###############################################################################
|
||||
|
||||
GATEWAY_HTTP_BIND_ADDRESS = "127.0.0.1"
|
||||
GATEWAY_HTTP_PORT = 8081
|
||||
GATEWAY_HTTP_BIND_ADDRESS = "127.0.0.1"
|
||||
GATEWAY_HTTP_PORT = 8081
|
||||
|
||||
GATEWAY_SENDER_BINDINGS = ["tcp://*:8500"]
|
||||
GATEWAY_SENDER_BINDINGS = ["tcp://*:8500"]
|
||||
|
||||
GATEWAY_IP_KEY_SALT = None
|
||||
GATEWAY_IP_KEY_SALT = None
|
||||
|
||||
GATEWAY_JSON_SCHEMAS = {
|
||||
"http://schemas.elite-markets.net/eddn/commodity/3": "schemas/commodity-v3.0.json",
|
||||
"http://schemas.elite-markets.net/eddn/commodity/3/test": "schemas/commodity-v3.0.json",
|
||||
GATEWAY_JSON_SCHEMAS = {
|
||||
"http://schemas.elite-markets.net/eddn/commodity/3" : "schemas/commodity-v3.0.json",
|
||||
"http://schemas.elite-markets.net/eddn/commodity/3/test" : "schemas/commodity-v3.0.json",
|
||||
"https://eddn.edcd.io/schemas/commodity/3" : "schemas/commodity-v3.0.json",
|
||||
"https://eddn.edcd.io/schemas/commodity/3/test" : "schemas/commodity-v3.0.json",
|
||||
|
||||
"http://schemas.elite-markets.net/eddn/shipyard/2": "schemas/shipyard-v2.0.json",
|
||||
"http://schemas.elite-markets.net/eddn/shipyard/2/test": "schemas/shipyard-v2.0.json",
|
||||
"http://schemas.elite-markets.net/eddn/shipyard/2" : "schemas/shipyard-v2.0.json",
|
||||
"http://schemas.elite-markets.net/eddn/shipyard/2/test" : "schemas/shipyard-v2.0.json",
|
||||
"https://eddn.edcd.io/schemas/shipyard/2" : "schemas/shipyard-v2.0.json",
|
||||
"https://eddn.edcd.io/schemas/shipyard/2/test" : "schemas/shipyard-v2.0.json",
|
||||
|
||||
"http://schemas.elite-markets.net/eddn/outfitting/2": "schemas/outfitting-v2.0.json",
|
||||
"http://schemas.elite-markets.net/eddn/outfitting/2/test": "schemas/outfitting-v2.0.json",
|
||||
"http://schemas.elite-markets.net/eddn/outfitting/2" : "schemas/outfitting-v2.0.json",
|
||||
"http://schemas.elite-markets.net/eddn/outfitting/2/test" : "schemas/outfitting-v2.0.json",
|
||||
"https://eddn.edcd.io/schemas/outfitting/2" : "schemas/outfitting-v2.0.json",
|
||||
"https://eddn.edcd.io/schemas/outfitting/2/test" : "schemas/outfitting-v2.0.json",
|
||||
|
||||
"http://schemas.elite-markets.net/eddn/blackmarket/1": "schemas/blackmarket-v1.0.json",
|
||||
"http://schemas.elite-markets.net/eddn/blackmarket/1/test": "schemas/blackmarket-v1.0.json",
|
||||
"http://schemas.elite-markets.net/eddn/blackmarket/1" : "schemas/blackmarket-v1.0.json",
|
||||
"http://schemas.elite-markets.net/eddn/blackmarket/1/test" : "schemas/blackmarket-v1.0.json",
|
||||
"https://eddn.edcd.io/schemas/blackmarket/1" : "schemas/blackmarket-v1.0.json",
|
||||
"https://eddn.edcd.io/schemas/blackmarket/1/test" : "schemas/blackmarket-v1.0.json",
|
||||
|
||||
"http://schemas.elite-markets.net/eddn/journal/1": "schemas/journal-v1.0.json",
|
||||
"http://schemas.elite-markets.net/eddn/journal/1/test": "schemas/journal-v1.0.json",
|
||||
"http://schemas.elite-markets.net/eddn/journal/1" : "schemas/journal-v1.0.json",
|
||||
"http://schemas.elite-markets.net/eddn/journal/1/test" : "schemas/journal-v1.0.json",
|
||||
"https://eddn.edcd.io/schemas/journal/1" : "schemas/journal-v1.0.json",
|
||||
"https://eddn.edcd.io/schemas/journal/1/test" : "schemas/journal-v1.0.json",
|
||||
}
|
||||
|
||||
GATEWAY_OUTDATED_SCHEMAS = [
|
||||
GATEWAY_OUTDATED_SCHEMAS = [
|
||||
"http://schemas.elite-markets.net/eddn/commodity/1",
|
||||
"http://schemas.elite-markets.net/eddn/commodity/1/test",
|
||||
"http://schemas.elite-markets.net/eddn/commodity/2",
|
||||
@@ -70,11 +90,17 @@ class _Settings(object):
|
||||
# Monitor settings
|
||||
###############################################################################
|
||||
|
||||
MONITOR_RECEIVER_BINDINGS = ["tcp://eddn-gateway.elite-markets.net:8500"]
|
||||
MONITOR_RECEIVER_BINDINGS = [
|
||||
"tcp://eddn.edcd.io:8500",
|
||||
"tcp://eddn-gateway.elite-markets.net:8500"
|
||||
]
|
||||
|
||||
MONITOR_DB = "/home/EDDN_Monitor.s3db"
|
||||
|
||||
MONITOR_DECOMPRESS_MESSAGES = True
|
||||
|
||||
|
||||
MONITOR_DB = "/opt/eddn/EDDN_Monitor.s3db"
|
||||
|
||||
MONITOR_DECOMPRESS_MESSAGES = True
|
||||
|
||||
def loadFrom(self, fileName):
|
||||
f = open(fileName, 'r')
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
# This should be a version number as understood by setuptools
|
||||
__version__ = "0.8"
|
||||
__version__ = "1.0"
|
||||
@@ -31,7 +31,7 @@ class Validator(object):
|
||||
|
||||
schema = self.schemas[schemaRef]
|
||||
try:
|
||||
jsValidate(json_object, schema, format_checker=jsonschema.FormatChecker())
|
||||
jsValidate(json_object, schema, format_checker=FormatChecker())
|
||||
except ValidationError as e:
|
||||
results.add(ValidationSeverity.ERROR, e)
|
||||
|
||||
|
||||
Reference in new issue
Block a user