Closed jdhadwin closed 6 years ago
in
~/gekko/web/vue/UIconfig.js
where you have host: '127.0.0.1',
should be
host: '0.0.0.0',
Thank you jellicoe...
The installation guide says to use 127.0.0.1 for Configuring Gekko to Run in the Cloud
Nevertheless, I tried it, and 0.0.0.0 doesn't render any different results... I got the exact same results.
Hi All
I face the exact same issue !
Try to get my pi to host the gekko and I like the dhcp option for my pi; so is there a way to define the host without using the specific ip ?
UPDATE: Found the static way to get my GEKKO up running ! But still, if there is a dynamic way.. please let me know , Thx :)
Below the fix:
const CONFIG = { headless: false, api: { host: '10.170.0.159', port: 3000, timeout: 120000 // 2 minutes }, ui: { ssl: false, host: '10.170.0.159', port: 3000, path: '/' }, adapter: 'sqlite' }
I can gain access to gekko via an unsecured workaround, by changing step 9b as follows
const CONFIG = { // headless: true, api: { host: '159.89.85.80, port: 3000 }, ui: { //ssl: true, host: '159.89.85.80', port: 3000, path: '/' // change this if you are serving from$ }, adapter: 'sqlite' }
and thereby bypassing the security by visiting http://159.89.85.80:3000 (with no htpassword or ssl) instead of https://159.89.85.80 (with htpassword and ssl), which is obviously an unacceptable workaround, but I thought it'd be useful to post here the results of my experimentation here.
I can't figure this one out... please help :)
@jdhadwin @janushansen if you see the message:
"Disconnected - Something happened" to either Gekko or the connection" that means the following:
Your browser WAS able to talk directly to Gekko (which is why you see the UI in the background) however your browser WAS NOT able to set up a websocket connection with the gekko process. If you are running Gekko in the cloud and you use reverse proxy (like nginx) this means one of the following:
node gekko --ui
and you close your SSH session for example).Based on these errors you can fix it. I'll try to write a guide here soon to go into the kind of errors and what they mean.
@askmike Hey mike, thanks a million for helping with this.
Using a normal internet connection not 3g. I'm also keeping my ssh session alive throughout these tests, so those aren't the problem. Running nginx 1.12.1, which fully supports websockets
My server log has no relevant problems :/
After doing a lot of learning about nginx, websockets, and so on, I tried lots of things that didn't work, and then I found this comment by netcoding at https://github.com/askmike/gekko/issues/967#issuecomment-367980686 which sent me on a rabbit trail with my sshd_config. After seeing there was no solution there, I put everything back the way it was and fired up gekko... I again checked in safari browser and found the websocket to be disconnected still... but this time, firefox and chrome were working perfectly! Yes, that's right, gekko is working.
I think that I must have had some stray characters floating around my nginx config file that were causing the problem... and at some point I must have written over them (fixing the problem) and since I wasn't constantly checking firefox and chrome but was mainly testing in safari I didn't notice, and still don't know what happened... but what (and still is) going on with gekko on safari? I only have a theory. I think that safari is not capable of dealing with self-signed wss calls, thus the 401.
So, for now (for me), case closed :)
I just did an upgrade to current develop branch from a version 2 month back and I'm now also facing this issue. Do I need to change something in nginx settings? So it says Gekko Version 0.6.0 and UI 0.2.2 is that the current release? I fetched the v0.6.1 tag
I don't know but after quit from ssh it's working now...
Note: for support questions, please join our Discord server
I'm submitting a ... [X] bug report [ ] feature request [ ] question about the decisions made in the repository
Action taken (what you did) Steps I have taken to create a cloud server and install gekko: 1) Created cloud-based a $10/mo Ubuntu 17 x64 server, and spun it up with ssh key (both on Digital Ocean and on Vultr and got same results). 2) Accessed server's root user via Mac Terminal, secured server. 2a) Changed root password, created new user and assigned root privileges in visudo, closed root ssh session 2b) scp my public ssh key from my Mac to the new server user's ~/.ssh folder 2c) log into my user and tweak ssh 2ci) change sshd_config to an uncommon and random port 2cii) change sshd_config to PermitRootLogin no 2ciii) change sshd_config to PasswordAuthentication no 2civ) change sshd_config to UseDNS no 2cv) change sshd_config to AllowUsers [my username here] 2cvi) run service ssh restart, exit, and use my username to connect to server via ssh tunnel 2d) Now, only my user can login to the server and only via ssh on a device with my private key 3) Ran apt-get update and apt-get upgrade 4) Installed nodejs 9.7.1 4a) curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash - 4b) sudo apt-get install -y nodejs 5) Installed NginX 1.12.1 by typing sudo apt-get install nginx 6) Setup NginX as a reverse proxy by replacing the contents of /etc/nginx/sites-enabled/default with the config contents found at https://gekko.wizb.it/docs/installation/installing_gekko_on_a_server.html 6a) In the config file, I replaced "gekko.example.com" with my server's IP address 7) Created a self-signed SSL at /etc/nginx/ssl/ by typing sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/ssl/nginx.key -out /etc/nginx/ssl/nginx.crt 8) Created an htpassword for accessing the UI by typing printf "username:
openssl passwd -apr1
\n" >> /etc/nginx/.htpasswd 9) Installed Gekko via git clone git://github.com/askmike/gekko.git -b stable (also tried without the "-b stable" on 2nd server) 9a) Installed Gekko dependencies by typing npm install --only=production 9b) Altered the contents of ~/gekko/web/vue/UIconfig.js as followsconst CONFIG = { headless: true, //false api: { host: '127.0.0.1', port: 3000 //timeout: 120000 // 2 minutes }, ui: { ssl: true, //false, host: '159.89.85.80', port: 443, path: '/' }, adapter: 'sqlite' }
if(typeof window === 'undefined') module.exports = CONFIG; else window.CONFIG = CONFIG;
10) ran apt-get update and apt-get upgrade one more time just for kicks, then rebooted the server and logged back in via ssh 11) fired up Gekko by typing node ~/gekko/gekko --ui. (everything looks normal in the Terminal window at this point) 11a) opened Mac's Safari browser and navigated to my server's IP address, clicked through the annoying self-signed certificate warnings and came to htpassword login 11b) Login via htpassword is successful, UI page is served in the browser, and everything looks good in the terminal too 11c) The UI page loaded in the browser immediately produces a "Disconnected" message in a modal lightbox, which says, "Disconnected Something happened to either Gekko or the connection. Please check the terminal where Gekko is running or your network connection." 11d) The server terminal window shows nothing but 200s. 11e) The web browser console shows repetitive errors of "WebSocket connection to 'wss://159.89.85.80/api/' failed: Unexpected response code: 401" 11f) The web browser console shows a log which says "You are running Vue in development mode. Make sure to turn on production mode when deploying for production. See more tips at https://vuejs.org/guide/deployment.html" 12) Repeated stop 11a-c in alternate web browsers, including Firefox, Chrome, and Brave, with the same results in the browser, but different results from the Terminal window, as follows. 12a) /api/404 1ms - 12b) Web browser's console says "reconnecting-websocket.min.js:2 WebSocket connection to 'wss://159.89.85.80/api/' failed: Error during WebSocket handshake: Unexpected response code: 404"
Expected result (what you hoped would happen) Expected steps 11 and 12 to produce a functioning UI with no errors or "Disconnected" messages
Actual result (unexpected outcome) Described in steps 11 and 12 above
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc)
Unfortunately, #1528 other articles with similar problems were not able to help me resolve my problem, including #934
Posted problem in Discord #help-1 channel... without successful resolution... however I did manage to pick up a brute force attack on my htpassword while I was in there posting screenshots that contained my IP address, lol. In keeping with that spirit, I'll keep the IP address going for this posting too. It should only take about half a millennium or two to brute-force their way into my UI and enjoy the spoils of my zero balance and non-existent exchange API keys.
I've provided screenshots as visual references for various steps listed above.
(see #11b)
(see #11c-f)
(see #12)
Thanks for the help. Looking forward to getting gekko going.