Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maintenance Mode #72

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

ferishili
Copy link
Contributor

This PR
fixes #71
also fixes Opencast-Moodle/moodle-block_opencast#194

Description

Please refer to the issue.

How it works

  • In admin setting a section for Maintenance for each instance is introduced!
  • Admin can configure the maintenance with 3 options:
    • disable: completely off
    • Read-Only: only get requests to the opencast are possible
    • Enable: no call to opencast is allowed
  • Configuring a time range is also possible.
  • A HTML Editor is provided to add the maintenance message!
  • Admin can also regulated the level of notification message to be shown, red: error, yellow: warning etc.

Concept

  • A notification message will be printed whereever the api instance is initiated.
  • Decorate Proxies are now wrapping around the opencast api services in order to check and restrict the access to the resources.
  • To keep the notification message only printed once, we had to use javascript for that!
  • Time ranges rules are:
    • start date can be in the past, but not equal or greater than end date if enabled
    • end date cannot be in the past, not less than or equal to start date if enabled
    • if start date is enabled but end date is disabled, that means the time range starts at the time but have no end, until admin changes it.
    • if end date is enabled but start date is disabled, that means the maintenance statrt right after saved changes until the end time reaches.

How to test

  • Patch this PR
  • Make sure you have course that has block opencast with an uploaded video / filter opencast is set and working / mod opencast in use and working.
  • Go to admins setting of this plugin
  • Locate the Maintenace Section and configure it accordingly
  • save changes
  • Go to the course page mentioned above.
  • You need to see the Maintenance message as a notification only once with regard to the level you have set!
  • Based on the maintenance mode you have configured:
    • Enabled: you should be able to access to the plugins (there are some exceptions such as studio)
    • Read-Only: you should be able to access plugins but anything other than reading videos such as update metadata, upload video should be prevented during maintenance time!

@ferishili ferishili added the enhancement New feature or request label Dec 16, 2024
@ferishili ferishili requested a review from bluetom December 16, 2024 16:56
@ferishili ferishili self-assigned this Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Maintenance Mode Add support for Opencast maintenance periods
2 participants