{"id":19591914,"url":"https://github.com/catalyst/moodle-local_envbar","last_synced_at":"2025-04-27T14:33:31.170Z","repository":{"id":5655319,"uuid":"53455662","full_name":"catalyst/moodle-local_envbar","owner":"catalyst","description":"Environment bar, never forget what server you're on again.","archived":false,"fork":false,"pushed_at":"2025-03-31T05:17:43.000Z","size":358,"stargazers_count":7,"open_issues_count":33,"forks_count":6,"subscribers_count":24,"default_branch":"MOODLE_405_STABLE","last_synced_at":"2025-04-05T00:51:10.274Z","etag":null,"topics":["environments","moodle","moodle-plugin","php"],"latest_commit_sha":null,"homepage":"https://moodle.org/plugins/local_envbar","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/catalyst.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-09T00:33:58.000Z","updated_at":"2025-03-31T05:06:51.000Z","dependencies_parsed_at":"2024-11-11T08:33:38.242Z","dependency_job_id":"41f4abe1-6be5-4f12-8891-14c075b40398","html_url":"https://github.com/catalyst/moodle-local_envbar","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catalyst%2Fmoodle-local_envbar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catalyst%2Fmoodle-local_envbar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catalyst%2Fmoodle-local_envbar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catalyst%2Fmoodle-local_envbar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/catalyst","download_url":"https://codeload.github.com/catalyst/moodle-local_envbar/tar.gz/refs/heads/MOODLE_405_STABLE","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251154608,"owners_count":21544527,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["environments","moodle","moodle-plugin","php"],"created_at":"2024-11-11T08:31:44.423Z","updated_at":"2025-04-27T14:33:31.161Z","avatar_url":"https://github.com/catalyst.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![ci](https://github.com/catalyst/moodle-local_envbar/actions/workflows/ci.yml/badge.svg?branch=MOODLE_405_STABLE)](https://github.com/catalyst/moodle-local_envbar/actions/workflows/ci.yml?branch=MOODLE_405_STABLE)\n\nEnvironment bar - Moodle local plugin\n====================\n\n![image](https://user-images.githubusercontent.com/187449/105100285-32c81380-5b01-11eb-9e12-30d1ae312b77.png)\n\nThis displays a prominment header across across the top of your NON PROD Moodle\nenvironments which can be configured to have different colors and messages for\neach environent, and also automatically detects and show you when the DB was\nlast refreshed.\n\nIt's very useful when working with lots of different environments to avoid\nconfusion around where you are, especially when env's can contain hard coded\nlinks and you accidentally jump between environments.\n\nPrincipals\n----------\n\nShowing what environment you are in needs to be reliable and fail safe.\n\nIf it doesn't work for any reason then you may as well not have it. The way\nthis plugin works is that in your production system you specify what your\ndifferent environments are. Then after a refresh of production data back to a\nstaging environment it can auto detect that it is no longer in production and\nwarn the end user. Further more if there isn't any config at all, then it will\nassume you are in a fresh development environment that hasn't been refreshed\nand show a default fail safe warning.\n\nIt will also automatically detect and show you when the environment was last\nrefreshed from production, which is a common question testers ask.\n\nBranches\n--------\n| Moodle version     | Totara version   | Branch            | PHP  |\n|--------------------|------------------|-------------------|------|\n| Moodle 4.5+        |                  | MOODLE_405_STABLE | 8.1+ |\n| Moodle 3.10 to 4.4 | Totara 13 to 17  | VERSION3          | 7.3+ |\n| Moodle 3.3 to 3.9  | Totara 12        | VERSION2          | 7.0+ |\n| Moodle 2.7 to 3.2  | Totara 2.7 to 11 | VERSION1          | 5.5+ |\n\n\nInstallation\n------------\n\nAdd the plugin to /local/envbar/\n\nRun the Moodle upgrade.\n\n# Configuration\n\nUpon first installation you will see a notification across the screen that prodwwwroot has not been set. There is a convenient link in the bar to:\n\n Site administration \u003e Plugins \u003e Local Plugins \u003e Environment bar\n\nPlease set this value to be exactly what your production ```$CFG-\u003ewwwroot``` is.  If you are on the production box then you can click on the 'autofill' button.\n\nOr you can define the environments and prodwwwroot in config.php:\n\n```php\n$CFG-\u003elocal_envbar_prodwwwroot = 'http://moodle.prod';\n$CFG-\u003elocal_envbar_items = array(\n    array(\n        'matchpattern' =\u003e 'https://staging.moodle.edu',\n        'showtext'     =\u003e 'Staging environment',\n        'colourbg'     =\u003e 'orange',\n        'colourtext'   =\u003e 'white',\n        'refreshschedule' =\u003e 'third sunday of this month 12 pm',\n    ),\n    array(\n        'matchpattern' =\u003e 'https://qa.moodle.edu',\n        'showtext'     =\u003e 'QA environment',\n        'colourbg'     =\u003e 'purple',\n        'colourtext'   =\u003e 'white',\n        'refreshschedule' =\u003e '2025-03-16 12:00pm',\n    ),\n    array(\n        'matchpattern' =\u003e 'http://moodle.local',\n        'showtext'     =\u003e 'Localhost environment',\n        'colourbg'     =\u003e 'black',\n        'colourtext'   =\u003e 'white',\n        'refreshschedule' =\u003e 1742090400,\n    ),\n);\n```\n\nThe colours available are,\n\n    black\n    white\n    red\n    green\n    seagreen\n    yellow\n    brown\n    blue\n    slateblue\n    chocolate\n    crimson\n    orange\n    darkorange\n\nPlease configure a secret key which is needed to let the environments talk to each other. If no secret key is set,\nthe non production environments won't be able to detect their last reset time. Please set it to some random alphanumeric string\nof your choice or press the 'Generate' button.\nOr you can define the secret key in config.php:\n\n```php\n$CFG-\u003elocal_envbar_secretkey = 'SomeRandomAlphanumericalString';\n```\n\nIn your non production environments it is also useful to inform your users when the\nnext refresh will be. This time can be set via the environment refresh schedule.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatalyst%2Fmoodle-local_envbar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcatalyst%2Fmoodle-local_envbar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatalyst%2Fmoodle-local_envbar/lists"}