From 2ae389f6b99a272e6af663906adedc2f330c91c7 Mon Sep 17 00:00:00 2001 From: AnthorNet Date: Thu, 29 Jun 2017 09:38:54 +0200 Subject: [PATCH 01/20] Update README.md --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ccb2b89..08c69ad 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,11 @@ 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/) From f172b54954880d2ba49950ba2bfc9e6ead40807f Mon Sep 17 00:00:00 2001 From: AnthorNet Date: Thu, 29 Jun 2017 10:35:32 +0200 Subject: [PATCH 02/20] Add nginx monitor configuration --- contrib/nginx-eddn.conf | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 contrib/nginx-eddn.conf diff --git a/contrib/nginx-eddn.conf b/contrib/nginx-eddn.conf new file mode 100644 index 0000000..16e52cf --- /dev/null +++ b/contrib/nginx-eddn.conf @@ -0,0 +1,22 @@ +# /etc/nginx/sites-enabled + +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; +} \ No newline at end of file From 31baab4ae58010ac1883bdee23d8131b22fe97ea Mon Sep 17 00:00:00 2001 From: AnthorNet Date: Thu, 29 Jun 2017 11:36:24 +0200 Subject: [PATCH 03/20] Add init.d scripts --- contrib/{ => init.d}/eddn-gateway | 14 +++--- contrib/init.d/eddn-monitor | 77 +++++++++++++++++++++++++++++++ contrib/init.d/eddn-relay | 77 +++++++++++++++++++++++++++++++ 3 files changed, 161 insertions(+), 7 deletions(-) rename contrib/{ => init.d}/eddn-gateway (88%) create mode 100644 contrib/init.d/eddn-monitor create mode 100644 contrib/init.d/eddn-relay diff --git a/contrib/eddn-gateway b/contrib/init.d/eddn-gateway similarity index 88% rename from contrib/eddn-gateway rename to contrib/init.d/eddn-gateway index 4706942..e33c916 100644 --- a/contrib/eddn-gateway +++ b/contrib/init.d/eddn-gateway @@ -27,10 +27,10 @@ # ------------------------------------------------------------------------- -MESSAGEDIR=/var/log/eddn-gateway -MESSAGELOG=/var/log/eddn-gateway/gateway.log +MESSAGEDIR=/var/log/eddn +MESSAGELOG=/var/log/eddn/gateway.log PID=/var/run/eddn-gateway.pid -EXECUTABLE=/path/to/eddn-gateway +EXECUTABLE=/usr/local/bin/eddn-gateway CMDLINE="" @@ -48,23 +48,23 @@ case "$1" in # create the log directory if not exist [ ! -d "$MESSAGEDIR" ] && mkdir -p "$MESSAGEDIR" - echo "Starting EDDN gateway" + echo "Starting $EXECUTABLE" # 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" + echo "$EXECUTABLE already running" fi ;; stop) - echo "Stopping EDDN gateway" + echo "Stopping $EXECUTABLE" # test if running if [ -f "/proc/$(cat $PID)/exe" ]; then kill -9 "$(cat $PID)" rm -rf "$PID" else - echo "EDDN gateway already stopped" + echo "$EXECUTABLE already stopped" fi ;; restart) diff --git a/contrib/init.d/eddn-monitor b/contrib/init.d/eddn-monitor new file mode 100644 index 0000000..e567d9c --- /dev/null +++ b/contrib/init.d/eddn-monitor @@ -0,0 +1,77 @@ +#!/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 + +# ------------------------------------------------------------------------- +#    Based on: +#    Copyright (C) <2011>  - 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 . +# ------------------------------------------------------------------------- + + +MESSAGEDIR=/var/log/eddn +MESSAGELOG=/var/log/eddn/monitor.log +PID=/var/run/eddn-monitor.pid +EXECUTABLE=/usr/local/bin/eddn-monitor +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 $EXECUTABLE" + # test if not already running + if [ ! -f "/proc/$(cat $PID)/exe" ]; then + $EXECUTABLE "$CMDLINE" > "$MESSAGELOG" 2>&1 & + echo $!>"$PID" + else + echo "$EXECUTABLE already running" + fi + ;; + stop) + echo "Stopping $EXECUTABLE" + # test if running + if [ -f "/proc/$(cat $PID)/exe" ]; then + kill -9 "$(cat $PID)" + rm -rf "$PID" + else + echo "$EXECUTABLE already stopped" + fi + ;; + restart) + $0 stop + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac +exit 0 diff --git a/contrib/init.d/eddn-relay b/contrib/init.d/eddn-relay new file mode 100644 index 0000000..c573210 --- /dev/null +++ b/contrib/init.d/eddn-relay @@ -0,0 +1,77 @@ +#!/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 + +# ------------------------------------------------------------------------- +#    Based on: +#    Copyright (C) <2011>  - 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 . +# ------------------------------------------------------------------------- + + +MESSAGEDIR=/var/log/eddn +MESSAGELOG=/var/log/eddn/relay.log +PID=/var/run/eddn-relay.pid +EXECUTABLE=/usr/local/bin/eddn-relay +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 $EXECUTABLE" + # test if not already running + if [ ! -f "/proc/$(cat $PID)/exe" ]; then + $EXECUTABLE "$CMDLINE" > "$MESSAGELOG" 2>&1 & + echo $!>"$PID" + else + echo "$EXECUTABLE already running" + fi + ;; + stop) + echo "Stopping $EXECUTABLE" + # test if running + if [ -f "/proc/$(cat $PID)/exe" ]; then + kill -9 "$(cat $PID)" + rm -rf "$PID" + else + echo "$EXECUTABLE already stopped" + fi + ;; + restart) + $0 stop + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac +exit 0 From 5e841fb9c883f42092326731c261d22b829b1d2c Mon Sep 17 00:00:00 2001 From: AnthorNet Date: Thu, 29 Jun 2017 12:04:03 +0200 Subject: [PATCH 04/20] Switch monitor response to HTTPS --- contrib/monitor/index.html | 4 ++-- contrib/monitor/js/eddn.js | 2 +- contrib/monitor/schemas.html | 4 ++-- src/eddn/Monitor.py | 8 +++++++- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/contrib/monitor/index.html b/contrib/monitor/index.html index 7673e50..3a195a2 100644 --- a/contrib/monitor/index.html +++ b/contrib/monitor/index.html @@ -403,8 +403,8 @@ - - + + diff --git a/contrib/monitor/js/eddn.js b/contrib/monitor/js/eddn.js index b8edc64..69b3676 100644 --- a/contrib/monitor/js/eddn.js +++ b/contrib/monitor/js/eddn.js @@ -1,6 +1,6 @@ var updateInterval = 60000, - monitorEndPoint = 'http://eddn-gateway.elite-markets.net:9091/', + monitorEndPoint = 'https://eddn.edcd.io:9091/', gatewayBottlePort = 8080, relayBottlePort = 9090, diff --git a/contrib/monitor/schemas.html b/contrib/monitor/schemas.html index 94227b0..2a3e86f 100644 --- a/contrib/monitor/schemas.html +++ b/contrib/monitor/schemas.html @@ -108,7 +108,7 @@ - +