Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-81807

Implement automatic download and update of GeoIP database via scheduled task

XMLWordPrintable

    • MOODLE_405_STABLE
    • MOODLE_405_STABLE
    • MDL-81807-main
    • Hide

      Note: You need a MaxMind account ID and license, which you can obtain by signing up at https://dev.maxmind.com/geoip/geolite2-free-geolocation-data.

      Verify that the scheduled task successfully downloads and updates GeoIP database.

      1. Go to Site administration > Server > Scheduled tasks
      2. Confirm that there is an "Update GeoIP file" scheduled task
      3. Open a terminal and run the Update GeoIP file (core\task\update_geoip2file_task) scheduled task.

        php admin/cli/scheduled_task.php --execute="core\task\update_geoip2file_task"
        

        • Or if you have set up $CFG->pathtophp, you'll see a "Run now" link on the scheduled task. Click on the link and run the scheduled task.
      4. Confirm that you see the message "MaxMind account information is incomplete. Please configure the account ID and license key."
      5. Go to Site administration > General > Location > Location settings. 
      6. Choose the GeoIP database edition you want to download.
      7. Configure the MaxMind account ID and license key.
      8. Save the changes
      9. Run the Update GeoIP file (core\task\update_geoip2file_task) scheduled task again.
      10. Ensure there are no errors in the output.
      11. Check the file location where the GeoIP database should be updated to confirm that the new file is present.
      12. Run the Update GeoIP file (core\task\update_geoip2file_task) scheduled task again.
      13. Confirm that you see the message "No update needed. The GeoIP database is up to date."
      14. Delete the downloaded GeoIP database file.
      15. Run the Update GeoIP file (core\task\update_geoip2file_task) scheduled task again.
      16. Confirm that the GeoIP database file gets downloaded again.
      Show
      Note: You need a MaxMind account ID and license, which you can obtain by signing up at https://dev.maxmind.com/geoip/geolite2-free-geolocation-data . Verify that the scheduled task successfully downloads and updates GeoIP database. Go to Site administration > Server > Scheduled tasks Confirm that there is an " Update GeoIP file " scheduled task Open a terminal and run the Update GeoIP file (core\task\update_geoip2file_task) scheduled task. php admin/cli/scheduled_task.php --execute="core\task\update_geoip2file_task" Or if you have set up $CFG->pathtophp , you'll see a "Run now" link on the scheduled task. Click on the link and run the scheduled task. Confirm that you see the message " MaxMind account information is incomplete. Please configure the account ID and license key. " Go to Site administration > General > Location > Location settings.  Choose the GeoIP database edition you want to download. Configure the MaxMind account ID and license key. Save the changes Run the Update GeoIP file (core\task\update_geoip2file_task) scheduled task again. Ensure there are no errors in the output. Check the file location where the GeoIP database should be updated to confirm that the new file is present. Run the Update GeoIP file (core\task\update_geoip2file_task) scheduled task again. Confirm that you see the message " No update needed. The GeoIP database is up to date. " Delete the downloaded GeoIP database file. Run the Update GeoIP file (core\task\update_geoip2file_task) scheduled task again. Confirm that the GeoIP database file gets downloaded again.

      To enhance Moodle's location-based services and ensure they rely on the most current data, we propose adding a feature that automatically downloads the GeoIP database file through a scheduled task. This task will ensure that the GeoIP database is updated at regular intervals set by the site administrator.

            trishamilan Trisha Milan
            trishamilan Trisha Milan
            cameron1729 cameron1729
            Jun Pataleta Jun Pataleta
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            1 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 35 minutes
                35m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.