From 39927082486084d5aef44d4691c6985b78d78c81 Mon Sep 17 00:00:00 2001 From: taniman Date: Tue, 18 Jul 2017 10:39:53 +0200 Subject: [PATCH 1/3] Update README.md --- README.md | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8a4f90f..266f9bf 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,10 @@ Free Proxy for Gunbot on Poloniex # Join the telegram group If you have questions after reading the readme https://t.me/joinchat/FWYlMkKK-mkrSuj836ehug -
+ +# Another guide +Diesel's Guide + # How to run Download the latest released jar file or compile your own using the source code https://github.com/taniman/gunbotproxycommunity/releases @@ -20,8 +23,14 @@ java -jar GunbotProxyCommunity-x.x.x.jar (replace x.x.x with your actual versio On OSX or some linux versions you might need to sudo su and then run the java -jar command.

If you did everything correctly the application will start without giving you any error messages.
+ +### On windows Open a web browser and go to
http://localhost:8081/checkSetup/
+
+### On a Linux VPS +curl http://localhost:8081/checkSetupLinux/
+
All rows except hostfile should say 'Looking good!'
If this is not the case, than you have an error in your application.properties
So everything is up and running.
@@ -39,8 +48,16 @@ Open a web browser again and again go to :
http://localhost:8081/checkSetup/
All rows should say 'Looking good!'
If this is not the case, than you have an error in your application.properties
+ +# Running in the background +Use the provided pm2 json file.
+If you have pm2 installed just use this command.
+pm2 start pm2-GunbotProxyCommunity.json
+pm2 save
+This will make sure that pm2 will automatically starts the proxy when pm2 reloads.

-
+To see the proxy log you could do.
+pm2 log 'id' <-- this is the id pm2 gave your proxy # Warning Please use the proxy on a VPS or machine that you do not use normally.
From 0ef0f46e7b23a23639b9db3b20daeda942daebfe Mon Sep 17 00:00:00 2001 From: taniman Date: Tue, 18 Jul 2017 11:05:37 +0200 Subject: [PATCH 2/3] Update README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 266f9bf..3353067 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,8 @@ https://t.me/joinchat/FWYlMkKK-mkrSuj836ehug Diesel's Guide # How to run -Download the latest released jar file or compile your own using the source code -https://github.com/taniman/gunbotproxycommunity/releases +Download the latest released jar file or compile your own using the source code
+https://github.com/taniman/gunbotproxycommunity/releases

Put the jar file in a directory
Put application.properties in the same directory and fill in your apiKeys and secrets
@@ -22,12 +22,12 @@ Open a terminal or command prompt and type
java -jar GunbotProxyCommunity-x.x.x.jar (replace x.x.x with your actual version number)
On OSX or some linux versions you might need to sudo su and then run the java -jar command.

-If you did everything correctly the application will start without giving you any error messages.
+If you did everything correctly the application will start without giving you any error messages. ### On windows Open a web browser and go to
-http://localhost:8081/checkSetup/
-
+http://localhost:8081/checkSetup/ + ### On a Linux VPS curl http://localhost:8081/checkSetupLinux/

@@ -54,7 +54,7 @@ Use the provided pm2 json file.
If you have pm2 installed just use this command.
pm2 start pm2-GunbotProxyCommunity.json
pm2 save
-This will make sure that pm2 will automatically starts the proxy when pm2 reloads.
+This will make sure that pm2 will automatically start the proxy when pm2 reloads.

To see the proxy log you could do.
pm2 log 'id' <-- this is the id pm2 gave your proxy From 4d4e684bb2c2e0c1b26a793d655fe9ee4bb9d95e Mon Sep 17 00:00:00 2001 From: Richard Graver Date: Thu, 20 Jul 2017 14:21:45 -0400 Subject: [PATCH 3/3] Control / Init Script (#20) sysvinit file --- gproxy | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 gproxy diff --git a/gproxy b/gproxy new file mode 100644 index 0000000..5f5d8f5 --- /dev/null +++ b/gproxy @@ -0,0 +1,93 @@ +#!/bin/sh +# /etc/init.d/gproxy +### BEGIN INIT INFO +# Provides: gproxy +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Start gproxy at boot time +# Description: Gunbot Community Proxy {start|stop|status|restart} init.d script. +### END INIT INFO + +# EDIT THESE VARIABLES IF NEEDED +GPROXY_PATH=/opt/gunbot +GPROXY_JAR=GunbotProxy.jar + +# You can use this script to start and stop the Gunbot Community Proxy +# If you would like the proxy to start and stop automatically when rebooting +# place this file in the '/etc/init.d' folder and execute the command +# update-rc.d gproxy defaults + +SERVICE_NAME=GunbotProxy +PID_PATH_NAME="/tmp/GunbotProxy-pid" + + +status() { + if [ -f $PID_PATH_NAME ]; then + PID=$(cat $PID_PATH_NAME); + printf "$SERVICE_NAME PID:$PID " + else + printf "$SERVICE_NAME " + fi + if ps ax | grep -v grep | grep $GPROXY_JAR > /dev/null; then + echo " (Active)" + else + echo " (Inactive)" + [ -f $PID_PATH_NAME ] && { + printf "\n" + tail /var/log/gproxy.log | grep INFO: + echo "Problem Detected:" + echo "It appears as though the proxy started but did not remain active." + printf "\n" + } + fi +} + +start() { + if ! ps ax | grep -v grep | grep $GPROXY_JAR > /dev/null ; then + rm -f $PID_PATH_NAME + echo "Starting $SERVICE_NAME ..." + cd $GPROXY_PATH + [ -f /var/log/gproxy.log ] && rm /var/log/gproxy.log + nohup java -Xmx256m -jar $GPROXY_JAR /tmp 2>> /var/log/gproxy.log >> /dev/null & + echo $! > $PID_PATH_NAME + (tail -f /var/log/gproxy.log & P=$! ; sleep 10; kill -9 $P) | grep INFO: + else + status + fi +} + +stop() { + if [ -f $PID_PATH_NAME ]; then + PID=$(cat $PID_PATH_NAME); + echo "$SERVICE_NAME stopping ..." + kill $PID; + rm -f $PID_PATH_NAME + sleep 10 + status + else + echo "$SERVICE_NAME is not running ..." + fi +} + + +case $1 in + start) + start + ;; + stop) + stop + ;; + status) + status + ;; + restart) + stop + start + ;; + *) + echo "Usage: gproxy {start|stop|status|restart}" + exit 1 + ;; +esac