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

Site Registration: Recognise cloned or moved sites

    • MOODLE_404_STABLE, MOODLE_405_STABLE
    • MDL-83448-404
    • MDL-83448-405
    • MDL-83448-main
    • Hide

      Hub installation and setup

      1. Create new Moodle instance
      2. Install hub from here
      3. Add the following code in your hub config.php

        define('HUB_HUBDIRECTORYURL', $CFG->wwwroot);

      4. Go to Site admin > Development > Debugging and and change the "Debug messages" to "NORMAL: Show errors, warnings and notices"
      5. Install XMLPRC plugin from here
      6. Empty “curlsecurityblockedhosts” in Site admin > Security > HTTP security
      7. Uncheck “Password policy” in Site admin > Security > Site security settings
      8. Check “Allow extended characters in usernames” in Site admin > Security > Site security settings
      9. Enable “Web services” in Site admin > Advanced features
      10. Enable REST and XML-RPC protocols in Site admin > Server > Web services > Manage protocols
      11. Set outgoing mail configuration in Site admin > Server > Email > Outgoing mail configuration using preferred mail catcher
      12. Check “Enable” and put description in your hub site in Site admin > Hub > Settings and press “Update” to save the settings
      13. Go to file local/hub/lib.php and comment line “1995” which is “return false;” so we can test it locally.

      Normal Moodle site (site to be registered) setup

      1. Empty “curlsecurityblockedhosts” in Site admin > HTTP security
      2. Add the following code in your config.php

        define('HUB_MOODLEORGHUBURL', 'url/to/hubsite');

      3. Set outgoing mail configuration in Site admin > Server > Email > Outgoing mail configuration using preferred mail catcher

      Testing (You can test it before and after patch to see the difference)

      1. Go to Site admin > Registration in your site to be registered
      2. Fill out all the required inputs
      3. Check the "Privacy notice and data processing agreement"
      4. Click on "Register your site"
      5. Verify that you were taken to "Site registration confirmed" page
      6. Click on "Continue" button
      7. Verify that you have a notification alert saying your site has been registered.
      8. Go to the bottom page and
      9. Verify that now you see "Update registration" button and "Unregister" link underneath the "Required" label.
      10. Change your site url by using Virtual Host or tunneling
      11. Change the value of "$CFG->wwwroot" in your config.php based on the new url to access your site.
      12. Go back to Site admin > Registration in your site to be registered and refresh if it's not refreshed yet.
      13. Verify that you now see a red notification alert saying "Don't miss out on important updates and security alerts."
      14. Go to the bottom of the page and
      15. Verify that you now see "Register your site" and "Skip" link underneath "Required" label.
      16. Repeat steps from #2 - #9

      Testing on new install or site upgrade

      1. Uninstall then install your site
      2. Use a tunneling service like ngrok and update your "wwwroot" in your config.php once installed
      3. Please add the following code in your config.php

        $CFG->site_is_public = false;

      4. Visit your site using a url from ngrok
      5. Click on "Site administration" once you're redirected to your home page
      6. Verify that you were not taken to site registration page
      7. Verify that you are on /admin/search.php page and you don't see a prompt alert about site registration like the following SS
      Show
      Hub installation and setup Create new Moodle instance Install hub from here Add the following code in your hub config.php define( 'HUB_HUBDIRECTORYURL' , $CFG ->wwwroot); Go to Site admin > Development > Debugging and and change the "Debug messages" to "NORMAL: Show errors, warnings and notices" Install XMLPRC plugin from here Empty “curlsecurityblockedhosts” in Site admin > Security > HTTP security Uncheck “Password policy” in Site admin > Security > Site security settings Check “Allow extended characters in usernames” in Site admin > Security > Site security settings Enable “Web services” in Site admin > Advanced features Enable REST and XML-RPC protocols in Site admin > Server > Web services > Manage protocols Set outgoing mail configuration in Site admin > Server > Email > Outgoing mail configuration using preferred mail catcher Check “Enable” and put description in your hub site in Site admin > Hub > Settings and press “Update” to save the settings Go to file local/hub/lib.php and comment line “1995” which is “return false;” so we can test it locally. Normal Moodle site (site to be registered) setup Empty “curlsecurityblockedhosts” in Site admin > HTTP security Add the following code in your config.php define( 'HUB_MOODLEORGHUBURL' , 'url/to/hubsite' ); Set outgoing mail configuration in Site admin > Server > Email > Outgoing mail configuration using preferred mail catcher Testing (You can test it before and after patch to see the difference) Go to Site admin > Registration in your site to be registered Fill out all the required inputs Check the "Privacy notice and data processing agreement" Click on "Register your site" Verify that you were taken to "Site registration confirmed" page Click on "Continue" button Verify that you have a notification alert saying your site has been registered. Go to the bottom page and Verify that now you see "Update registration" button and "Unregister" link underneath the "Required" label. Change your site url by using Virtual Host or tunneling Change the value of "$CFG->wwwroot" in your config.php based on the new url to access your site. Go back to Site admin > Registration in your site to be registered and refresh if it's not refreshed yet. Verify that you now see a red notification alert saying "Don't miss out on important updates and security alerts." Go to the bottom of the page and Verify that you now see "Register your site" and "Skip" link underneath "Required" label. Repeat steps from #2 - #9 Testing on new install or site upgrade Uninstall then install your site Use a tunneling service like ngrok and update your "wwwroot" in your config.php once installed Please add the following code in your config.php $CFG ->site_is_public = false; Visit your site using a url from ngrok Click on "Site administration" once you're redirected to your home page Verify that you were not taken to site registration page Verify that you are on /admin/search.php page and you don't see a prompt alert about site registration like the following SS
    • Hide

      Code verified against automated checks.

      Checked MDL-83448 using repository: https://github.com/stevandoMoodle/moodle.git

      More information about this report

      Built on: Fri Feb 21 04:08:34 AM UTC 2025

      Show
      Code verified against automated checks. Checked MDL-83448 using repository: https://github.com/stevandoMoodle/moodle.git MOODLE_404_STABLE (0 errors / 0 warnings) [branch: MDL-83448-404 | CI Job ] MOODLE_405_STABLE (0 errors / 0 warnings) [branch: MDL-83448-405 | CI Job ] main (0 errors / 0 warnings) [branch: MDL-83448-main | CI Job ] More information about this report Built on: Fri Feb 21 04:08:34 AM UTC 2025
    • 2
    • Team Dragons 2025 Sprint 1.2, Team Dragons 2025 Sprint 1.3

      It is common practice to:

      • Clone/copy a production site to a staging or non-production site, for testing etc.
      • Promote by copy/clone a staging site to production

      In both cases these sites will have the same data (DB and filedir) but will have a different URL.  Also the production site could be registered.

      Currently, it appears that the registration process does not recognise the cloned site as being different from the original site. In cases where the original site is registered.

      This leads to a workflow where the options are to update the registration of the cloned site, or unregister the source site.

      Instead, the options should be to register the cloned site or skip registration. Which is the same workflow for a newly installed or unregistered upgraded site.

      In the less common case where a production site has changed URL's, it isn't necessary to explicitly accommodate this workflow. If the site is registered (as a new site) the admin still gets the benefit of registration. The registration database will mark the original URL as an unreachable site after a period of time and the new registration data from the site will be added to the database. So there is not net difference.

      In cases where a non production site is constantly/regularly updated from production. To save the non production site from displaying a registration prompt, admins have the existing option to set: `$CFG->site_is_public = false;` in the config.php file.

            stevani.andolo@moodle.com Stevani Andolo
            matt.porritt@moodle.com Matt Porritt
            Victor Déniz Falcón Victor Déniz Falcón
            Votes:
            2 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 days, 4 hours, 39 minutes
                2d 4h 39m

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