-
Notifications
You must be signed in to change notification settings - Fork 14
Segmentation Fault #16
Comments
OK, it seems like the segfault happens somewhat randomly. the following also caused it to happen. Ran it again and it's working, but segfaults once in a while.
|
@andresdouglas which golang version do you use to compile |
|
@andresdouglas are you using go compiler from golang.org? My version string looks totally different.
I didn't know there is a v4.9.3... |
OK, did some updating of packages and re-installing of go. Now on
It seems like it's still a bit wonky. The service seems to continue to run, but on the client side I'm getting a
In /var/log/cuttle.err I only get info logs like:
Should it work with go1.2.1 or do I need to update to go1.6? Thanks! |
Just installed go 1.6. I re-compiled cuttle with go 1.6. Should running the new ./bin/cuttle be sufficient or do I also have to add the 1.6 go binary to the path when running it? |
Update: no longer segfaults after compiling with 1.6 but after a few Tens of API calls routed through it, it returns a Bad Status Line "" (error in Django) |
Found something rather interesting when running the proxy manually (only way it seems to print full logging). Seems like a bunch of people - and by this I mean thousands of requests per minute - found and have been using the proxy! This is what my cuttle.yml file looks like atm:
Is there a way to limit who can route requests through the proxy (whitelisting?), or limit requests to be routed to the shopify domain only? I tried setting the rate:0 for the wildcard, but get:
|
Oops... You're exposing the proxy over the Internet and thus you will be found by port scanner :) Anyway, i'm thinking if cuttle should handle whitelisting / blacklisting client. The design of request per second is not compatible with A workaround is to use firewall for client whitelist or setup a upstream proxy for out-going traffic whitelisting. |
Also, you may consider setting up a secure channel (e.g. VPN / SSH tunnel / sshuttle) to prevent exposing cuttle on to the Internet. |
Ha, yes. I think it eventually fails because of this
|
What would be the simplest thing to set up to prevent exposing it to the world? I'm running our application server on heroku, and cuttle on digital ocean. It may be hard to do an ssh tunnel from heroku. On the other hand I would also need to connect to cuttle from a couple dev laptops that likely change IPs frequently. |
Since you're on Heroku, you cannot have a secure channel afaik. Would you consider having a upstream proxy that blocks by URL as a workaround? You may try https://steelmon.wordpress.com/2009/11/22/setting-up-a-strict-whitelist-proxy-server-using-squid/ |
Ah, yes I setup a firewall no problem, but was disappointed when I tried to figure out how to get my heroku instance's static IP. Yes, I'll try setting up squid. Will that prevent the issue I show above where it seems like we run out of file descriptors? Second question: how do I point cuttle to the upstream squid proxy? It seems like cuttle would make for a good heroku add-on. I'd pay for it. Have you thought about that? thanks @mrkschan |
OK, squid set up, but not sure how to route requests from cuttle to squid, or should the requests go from squid to cuttle? |
run cuttle with environment variable ...
On Wed, Jun 22, 2016 at 5:43 PM, Andres Douglas [email protected]
[image: KS Chan on about.me] KS Chan |
Thanks for the reply @mrkschan I just ran it as
Would it make sense to run squid in front of cuttle? |
Oh, you're right. Though, I don't know how to run Squid in front of Cuttle. On Wed, Jun 22, 2016 at 6:05 PM, Andres Douglas [email protected]
[image: KS Chan on about.me] KS Chan |
Seems like cache_peer should do the trick. Will try it in the morning I think I'll need to combine the above with a firewall that allows incoming on :3128, and then move cuttle to listen to :3129, which is blocked by the firewall, otherwise portscanner will still discover cuttle. Am I correct in thinking this, or is there a better way of making cuttle only listen for internal connections? |
you can ask cuttle to listen to 127.0.0.1:3129 (accepting request from On Wed, Jun 22, 2016 at 6:49 PM, Andres Douglas [email protected]
[image: KS Chan on about.me] KS Chan |
I think I almost got it... I've gotten squid running, and I think forwarding requests to cuttle. Config file has this added to it:
And although the requests get fulfilled, I'm not sure cuttle is getting them, so they may just be "allowed" and not forwarded. . Finally, I'll have to get the SSL cacert to be used by squid instead of cuttle as that will be the part communicating with the client, correct? |
I'm not sure. Since Squid should not terminate SSL, your API client should be receiving the SSL cert from Cuttle. |
FYI, @andresdouglas, I just bang together something in #17 and it may resolve your issue. I didn't spend time test it yet though. |
It seems like it segfaulted with the following conf file
The text was updated successfully, but these errors were encountered: