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

Improve detection of non-public sites for registration

    XMLWordPrintable

Details

    • MOODLE_37_STABLE, MOODLE_39_STABLE
    • MOODLE_39_STABLE
    • Hide

      Setup

      Local site address
      1. Edit your computer's "/etc/hosts" file and assign your local IP address with a hostname with a fully qualified domain name. For example if your local IP address is "192.168.1.10":

        192.168.1.10 tester.in.moodle.com
        

        Note: You'll need to edit it in privileged mode (e.g. if using xed, "sudo xed /etc/hosts")

      Public site address
      1. Set up and run ngrok

      Automatic detection - Local site

      1. Set $CFG->wwwroot to point to the local site address. e.g.

        $CFG->wwwroot = 'http://tester.in.moodle.com/integration_master';
        

      2. Login as admin
      3. Visit Site administration
      4. Confirm you don't see a warning with the message "Your site is not yet registered."
      5. Visit Site administration > Notifications
      6. Confirm you don't see a warning with the message "Your site is not yet registered."

      Forced config.php setting - Local site address

      1. Continuing from the previous section, add the following line to config.php:

        $CFG->site_is_public = false;

      2. Visit Site administration
      3. Confirm you don't see a warning with the message "Your site is not yet registered."

      Forced config.php setting - Local site address

      1. Set "$CFG->site_is_public" to true

        $CFG->site_is_public = true;

      2. Visit Site administration
      3. Confirm you do see a warning with the message "Your site is not yet registered."

      Automatic detection - Public site address

      1. Remove or comment out the line with the "$CFG->site_is_public" setting.
      2. Now set your $CFG->wwwroot to make your moodle instance available via the ngrok URL.

        $CFG->wwwroot = '  http://[SOMEHASH].ap.ngrok.io/integration_master';
        

      3. Login as admin
      4. Visit Site administration
      5. Confirm you see a warning with the message "Your site is not yet registered."
      6. Visit Site administration > Notifications
      7. Confirm you see a warning with the message "Your site is not yet registered."
      Show
      Setup Local site address Edit your computer's " /etc/hosts " file and assign your local IP address with a hostname with a fully qualified domain name. For example if your local IP address is " 192.168.1.10 ": 192.168.1.10 tester.in.moodle.com Note: You'll need to edit it in privileged mode (e.g. if using xed, " sudo xed /etc/hosts ") Public site address Set up and run ngrok Automatic detection - Local site Set $CFG->wwwroot to point to the local site address. e.g. $CFG->wwwroot = 'http://tester.in.moodle.com/integration_master'; Login as admin Visit Site administration Confirm you don't see a warning with the message "Your site is not yet registered." Visit Site administration > Notifications Confirm you don't see a warning with the message "Your site is not yet registered." Forced config.php setting - Local site address Continuing from the previous section, add the following line to config.php: $CFG->site_is_public = false; Visit Site administration Confirm you don't see a warning with the message "Your site is not yet registered." Forced config.php setting - Local site address Set " $CFG->site_is_public " to true $CFG->site_is_public = true; Visit Site administration Confirm you do see a warning with the message "Your site is not yet registered." Automatic detection - Public site address Remove or comment out the line with the " $CFG->site_is_public " setting. Now set your $CFG->wwwroot to make your moodle instance available via the ngrok URL. $CFG->wwwroot = ' http://[SOMEHASH].ap.ngrok.io/integration_master'; Login as admin Visit Site administration Confirm you see a warning with the message "Your site is not yet registered." Visit Site administration > Notifications Confirm you see a warning with the message "Your site is not yet registered."

    Description

      Follow on from MDL-65094 (prevent admins being prompted to register a local/non-routable site)

      The is_public_site check could be improved to resolve hostnames (i.e. intranet/dev sites) to determine whether they are public or not

      Attachments

        Issue Links

          Activity

            People

              pholden Paul Holden
              pholden Paul Holden
              Brendan Heywood Brendan Heywood
              Jun Pataleta Jun Pataleta
              Jun Pataleta Jun Pataleta
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                15/Jun/20

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour, 50 minutes
                  1h 50m