Currently this module uses ftp to access the country lists. This is problematic, because you have to open up a lot of ports, since the server uses passive mode.
The ripe servers also provide http access to those files, the module should use those urls instead.

Issue fork ip2country-2571835

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

sepgil created an issue. See original summary.

sepgil’s picture

Issue summary: View changes
sepgil’s picture

Status: Active » Needs review
StatusFileSize
new4.45 KB

Here is my patch, which replaces the hard coded ftp urls with http urls.

tr’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev

Moving this to 8.x-1.x.

I'm generally opposed to making the Internet === HTTP, but I'm not against adding HTTP as an *option* for those of you who want or need it.

ApacheEx’s picture

StatusFileSize
new4.15 KB

I have added an option to use HTTP connection. Here is a patch

Status: Needs review » Needs work

The last submitted patch, 5: 2571835-5.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

ApacheEx’s picture

Status: Needs work » Needs review

not sure if related, need to check

tr’s picture

I re-ran the test and it worked the second time - the failure may have been a testbot problem.

jazzfiction’s picture

This proved really useful for me because my server's don't have access via FTP to the outside world. Once I implemented the patch, I was able to update the databases again. I implemented this patch against the latest dev version. Once I get back from Christmas vacation, I will try to update the patch so it is up to date with the current version.

tr’s picture

Issue tags: +Needs tests

I made minor changes to some comments / text strings in #5. I'm happy with this patch, but I think there needs to be at least one test of the downloading using HTTP (actually, the patch uses HTTPS if the option is set ...). That way we will know if this feature ever breaks because of the ARIN server or because of other alterations to the ip2country module.

tr’s picture

StatusFileSize
new4.19 KB

Forgot the patch ...

tr’s picture

StatusFileSize
new5.96 KB

Oh, and since we're adding a config variable we need a hook_update_N() to ensure existing sites get the new value, and we need a update test for this hook as well.

New patch attached with the hook and the update test. Still needs a download test like I mentioned in #10.

klausi’s picture

Splitting off the Drupal 7 issue into #3166385: Use HTTPS instead of FTP (D7 version) to not mix up patches here.

tr’s picture

Version: 8.x-1.x-dev » 2.0.x-dev

Moving to current development branch.

ressinel’s picture

StatusFileSize
new8.32 KB

Rerolled #12 for 2.0.x-dev

tr’s picture

Version: 2.0.x-dev » 2.1.x-dev
tr’s picture

Converted #16 to a MR so that the automated testing can test the changes.
I had to make quite a few changes to re-roll it for 2.1.x.

tr’s picture

andriy khomych’s picture

StatusFileSize
new14.53 KB

Attached patch from MR.

klausi’s picture

StatusFileSize
new11.92 KB

Merge request updated. Uploading stable patch file here for composer patches.

I think the tests are still missing here.

hoanns’s picture

This is obsolete now, since FTP access was discontinued. Should be closed as outdated

This patch fixes it: https://www.drupal.org/project/ip2country/issues/3532194