Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Digital Ocean API Change Breaking Pinger & Traffic #196

Closed
ibreakifix opened this issue Oct 2, 2020 · 8 comments
Closed

Digital Ocean API Change Breaking Pinger & Traffic #196

ibreakifix opened this issue Oct 2, 2020 · 8 comments
Labels
bug connectors all issue about connectors
Milestone

Comments

@ibreakifix
Copy link

ibreakifix commented Oct 2, 2020

Hello,

We noticed around 1PM today our Proxies for DigitalOcean started to fail to come online. Upon checking Scrapoxy, I noticed the control panel was reporting the local (private) IP address for all DO proxies. The pinger would then attempt to ping a private IP, which it obviously cannot reach, causing Scrapoxy to never properly see the online status of any DO instances.

Expected Behavior

Request is sent to digitalocean API to fetch a summary of all instance details. The Digital Ocean provider should then parse the API response and report the public IP to the Scrapoxy manager.

Actual Behavior

The API request is properly sent, but incorrectly parsed. The provider script is improperly hard-coded to recognize networks.v4[0].ip_address as the public ip address without checking the type. The causes the online status of DO instances to always be false. Digital Ocean began reporting private and public IPs, and the public IP was bumped to networks.v4[1].ip_address.

Fix

  1. Update the code to ensure the ip address type is public. Do this by changing /server/providers/digitalocean/index.js line 71 to:
    ip: _.get(_.find(_.get(droplet,'networks.v4'), _.matchesProperty('type', 'public')),'ip_address'),

Thanks

@ibreakifix ibreakifix changed the title Digital Ocean API Change Breaking Pinger/Control Digital Ocean API Change Breaking Pinger & Traffic Oct 2, 2020
R4ein added a commit to dysnix/scrapoxy that referenced this issue Oct 5, 2020
@MegaManSE
Copy link

I was going nuts trying to figure out why it wasn't working on DigitalOcean also. Proxies would start up then not register as alive even though they were running themselves. I'm surprised this fix hasn't been pushed into production for scrapoxy.

@clint74
Copy link

clint74 commented Jan 19, 2021

Maybe I could use private to connect over DigitalOcean VPC so,
would'n be better to have a type configuration?

{
    "commander": {
        "password": "****"
    },
    "instance": {
        "port": 3128,
        "scaling": {
            "min": 1,
            "max": 5
        }
    },
    "providers": [
        {
            "type": "digitalocean",
            "token": "your token",
            "region": "somewhere",
            "size": "s-1vcpu-1gb",
            "sshKeyName": "myKey",
            "imageName": "forward-proxy-for-the-win",
            "tags": "sometags",
            "ip_addr_type": "private"    // <=== could be private or public
        }
    ]
}
// and then on index
get ip_addr_type() {
        return this._config.ip_addr_type;
    }
get models() {
...

ip: _.get(_.find(_.get(droplet,'networks.v4'), _.matchesProperty('type', this.ip_addr_type)),'ip_address'),

@Tugrulvural89
Copy link

Hello,
Are you sure that update index.js line 71 is properly work? I still get checkalive =>false and droplets seems dead .
Thanks

@AhmedBytesBits
Copy link

@Tugrulvural89 matching using in check-alive is strict, so double check that you are using the right case in values e.g. region to be lon1 instead of LON1

@adamcable
Copy link

This fix really helps us, thanks

@daniel-chum
Copy link

@Tugrulvural89 If you used "sudo npm install -g scrapoxy" and installed scrapoxy again in your local module, make sure you change the settings in the global node module.
For reference: https://docs.npmjs.com/cli/v7/configuring-npm/folders

@fabienvauchelles
Copy link
Owner

it will be corrected in the 4.0.0 version

@fabienvauchelles fabienvauchelles added this to the 4.0.0 milestone Oct 4, 2023
@fabienvauchelles fabienvauchelles added bug connectors all issue about connectors labels Oct 4, 2023
@fabienvauchelles
Copy link
Owner

Hey there! 🌟 Exciting news! Scrapoxy 4 is ready to rock 🚀. Check it out at Scrapoxy.io (explore the "get started" guide, deployment documentation, and more 📚).
I can't wait to hear your feedback on this new version! Send me your coolest screenshots with as many proxies as possible! 📸💻
Join the Discord community if you have any questions or just want to chat. You can also open a GitHub issue for any bug or feature request 🐞✨.
See you soon! 😎
Fabien

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug connectors all issue about connectors
Projects
None yet
Development

No branches or pull requests

8 participants