Skip to content

Commit 30cccab

Browse files
committed
feat: update to 0.4.0
1 parent 3fd2099 commit 30cccab

19 files changed

Lines changed: 343 additions & 914 deletions

.gitignore

Lines changed: 13 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,14 @@
1-
*.py[cod]
2-
__pycache__
3-
.pytest_cache
4-
5-
# C extensions
6-
*.so
7-
8-
# Packages
9-
*.egg
10-
*.egg-info
11-
/dist
12-
/build
13-
/eggs
14-
/parts
15-
/bin
16-
/var
17-
/sdist
18-
/develop-eggs
19-
/.installed.cfg
20-
/lib
21-
/lib64
22-
23-
# Installer logs
24-
pip-log.txt
25-
26-
# Unit test / coverage reports
27-
.cache/
28-
.pytest_cache/
29-
.coverage
30-
.coverage.*
31-
.tox
32-
coverage.xml
33-
htmlcov/
34-
35-
36-
37-
# The Silver Searcher
38-
.agignore
39-
40-
# OS X artifacts
1+
# Build artifacts
2+
/dist/
3+
/.pids
4+
# Python files
5+
/.venv/
6+
/.idea/
7+
__pycache__/
8+
*.egg-info/
419
*.DS_Store
42-
43-
# Logging
44-
log/
45-
logs/
46-
chromedriver.log
47-
ghostdriver.log
48-
49-
# Complexity
50-
output/*.html
51-
output/*/index.html
52-
53-
# Sphinx
54-
docs/_build
55-
docs/modules.rst
56-
docs/edx_sysadmin.rst
57-
docs/edx_sysadmin.*.rst
58-
59-
# Private requirements
60-
requirements/private.in
61-
requirements/private.txt
62-
63-
# IDE related
64-
.idea/
65-
.vscode/
10+
# Test Runtime
11+
ol_test_requirements.txt
12+
**/.coverage
13+
**/test_root
14+
coverage.xml

LICENSE.txt

Lines changed: 28 additions & 674 deletions
Large diffs are not rendered by default.

PKG-INFO

Lines changed: 82 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,85 @@
1-
Metadata-Version: 2.1
1+
Metadata-Version: 2.4
22
Name: edx-sysadmin
3-
Version: 0.3.0
3+
Version: 0.4.0
44
Summary: An Open edX plugin to enable SysAdmin panel
55
Author: MIT Office of Digital Learning
6-
License: BSD-3-Clause
7-
Keywords: Python edx
8-
Requires-Python: >=3.8
6+
License-Expression: BSD-3-Clause
7+
License-File: LICENSE.txt
8+
Keywords: Python,edx
9+
Requires-Python: >=3.11
10+
Requires-Dist: django>=4.0
11+
Requires-Dist: djangorestframework>=3.14.0
12+
Requires-Dist: edx-django-utils>4.0.0
13+
Requires-Dist: edx-drf-extensions>=10.0.0
14+
Requires-Dist: edx-opaque-keys
15+
Description-Content-Type: text/x-rst
16+
17+
edX Sysadmin
18+
=============================
19+
20+
This is a django app plugin extracted from `edx-platform <https://github.com/edx/edx-platform>`_ which enables certian users to perform some specific operations in Open edX environment (which are described under ``Features`` section below).
21+
Earlier, ``Sysadmin Dashboard`` was a part of ``edx-platform``, however starting from `lilac release <https://github.com/edx/edx-platform/tree/open-release/lilac.master>`_ of Open edX the sysadmin panel has been removed
22+
and transitioned to as separate plugin.
23+
24+
Note that the initial independent repository for this plugin was https://github.com/mitodl/edx-sysadmin. Now it has been migrated to open-edx-plugins.
25+
26+
27+
NOTE:
28+
It is recommended that you use edx-sysadmin plugin with Open edX's `lilac <https://github.com/edx/edx-platform/tree/open-release/lilac.master>`_ release and successors.
29+
If you wish to use the ``Sysadmin Dashboard`` with Open edX releases before ``lilac`` you don't have to install this plugin and can simply enable ``ENABLE_SYSADMIN_DASHBOARD`` feature flag in environment files (e.g ``lms.yml`` or ``lms.env.json``) to access sysadmin dashboard features.
30+
31+
Version Compatibility
32+
---------------------
33+
**For "Lilac" or more recent release of edX platform**
34+
35+
Use any version of edx-sysadmin plugin.
36+
37+
38+
**For releases prior to "Lilac"**
39+
40+
You do not need edx-sysadmin plugin. Just enable ``ENABLE_SYSADMIN_DASHBOARD`` feature flag in environment files (e.g ``lms.yml`` or ``lms.env.json``) to access sysadmin dashboard features.
41+
42+
43+
Installing The Plugin
44+
---------------------
45+
46+
For detailed installation instructions, please refer to the `plugin installation guide <../../docs#installation-guide>`_.
47+
48+
Installation required in:
49+
50+
* LMS
51+
* CMS
52+
53+
Upon installation you need to create ``/openedx/course_repos`` directory within the LMS service:
54+
55+
.. code-block::
56+
57+
tutor dev exec lms bash
58+
mkdir /openedx/course_repos
59+
60+
After this, you can visit ``<EDX_BASE_URL>/sysadmin`` to access the plugin features.
61+
62+
Configurations
63+
--------------
64+
The plugin offers multiple settings for customization that can be set using the config file in Open edX. For any release after Juniper, that config file is ``/edx/etc/lms.yml``. If you're using ``private.py``, add these values to ``lms/envs/private.py``.
65+
66+
* **GIT_REPO_DIR:** This path defines where the imported repositories will be placed in storage. Default value is ``/openedx/course_repos``. For Devstack, set this value to ``/edx/var/edxapp/course_repos``.
67+
* **GIT_IMPORT_STATIC:** This is a boolean that tells the plugin to either load the static content from the course repo or not. Default value is ``True``
68+
* **SYSADMIN_GITHUB_WEBHOOK_KEY:** This value is used to save either of ``sha256 or sha1`` hashes. (This key is only used for Github Webhooks). Default value is ``None``.
69+
* **SYSADMIN_DEFAULT_BRANCH:** This value is used to specify environment specific branch name to be used for course reload/import through Github Webhooks. (This key is only used for Github Webhooks). Default value is ``None``
70+
71+
Features
72+
--------
73+
74+
edx-sysadmin provides different features such as:
75+
76+
* Register Users:
77+
* You can ``register new user accounts`` with an easy to use form via ``Users`` tab.
78+
* Delete Courses:
79+
* You can ``delete any course by using a course ID or directory`` via ``Courses`` tab.
80+
* Git Import:
81+
* You can ``import any course maintained through a git repository`` via ``Git Import`` tab.
82+
* Git Logs
83+
* You can ``check the logs for all imported courses`` through git via ``Git Logs`` tab.
84+
* Git Reload (Not directly visible)
85+
* You can configure Github webhooks with this plugin to ensure reload/import of your courses on new commits

README.rst

Lines changed: 40 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,124 +1,69 @@
1-
⛔️ DEPRECATION WARNING
2-
======================
3-
This repository is deprecated. Please see `open-edx-plugins <https://github.com/mitodl/open-edx-plugins>`__ for all the future updates and development.
4-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5-
6-
7-
edx-sysadmin
1+
edX Sysadmin
82
=============================
93

10-
This is a django app plugin extracted from `edx-platform <https://github.com/edx/edx-platform>`_ which enables certain users to perform some specific operations in Open edX environment (which are described under ``Features`` section below).
4+
This is a django app plugin extracted from `edx-platform <https://github.com/edx/edx-platform>`_ which enables certian users to perform some specific operations in Open edX environment (which are described under ``Features`` section below).
115
Earlier, ``Sysadmin Dashboard`` was a part of ``edx-platform``, however starting from `lilac release <https://github.com/edx/edx-platform/tree/open-release/lilac.master>`_ of Open edX the sysadmin panel has been removed
126
and transitioned to as separate plugin.
137

8+
Note that the initial independent repository for this plugin was https://github.com/mitodl/edx-sysadmin. Now it has been migrated to open-edx-plugins.
9+
10+
1411
NOTE:
1512
It is recommended that you use edx-sysadmin plugin with Open edX's `lilac <https://github.com/edx/edx-platform/tree/open-release/lilac.master>`_ release and successors.
1613
If you wish to use the ``Sysadmin Dashboard`` with Open edX releases before ``lilac`` you don't have to install this plugin and can simply enable ``ENABLE_SYSADMIN_DASHBOARD`` feature flag in environment files (e.g ``lms.yml`` or ``lms.env.json``) to access sysadmin dashboard features.
1714

18-
Features
19-
~~~~~~~~
20-
21-
edx-sysadmin provides different features such as:
15+
Version Compatibility
16+
---------------------
17+
**For "Lilac" or more recent release of edX platform**
2218

23-
* Register Users:
24-
* You can ``register new user accounts`` with an easy to use form via ``Users`` tab.
25-
* Delete Courses:
26-
* You can ``delete any course by using a course ID or directory`` via ``Courses`` tab.
27-
* Git Import:
28-
* You can ``import any course maintained through a git repository`` via ``Git Import`` tab.
29-
* Git Logs
30-
* You can ``check the logs for all imported courses`` through git via ``Git Logs`` tab.
31-
* Git Reload (Not directly visible)
32-
* You can configure Github webhooks with this plugin to ensure reload/import of your courses on new commits
19+
Use any version of edx-sysadmin plugin.
3320

3421

35-
Configurations
36-
--------------
37-
You have the following configuration properties to customize your plugin behavior:
22+
**For releases prior to "Lilac"**
3823

39-
* **GIT_REPO_DIR:** This path defines where the imported repositories will be places in storage. Default value is ``/edx/var/edxapp/course_repos``.
40-
* **GIT_IMPORT_STATIC:** This is a boolean that tells the plugin to either load the static content from the course repo or not. Default value is ``True``
41-
* **SYSADMIN_GITHUB_WEBHOOK_KEY:** This value is used to save either of ``sha256 or sha1`` hashes. (This key is only used for Github Webhooks). Default value is ``None``.
42-
* **SYSADMIN_DEFAULT_BRANCH:** This value is used to specify environment specific branch name to be used for course reload/import through Github Webhooks. (This key is only used for Github Webhooks). Default value is ``None``
24+
You do not need edx-sysadmin plugin. Just enable ``ENABLE_SYSADMIN_DASHBOARD`` feature flag in environment files (e.g ``lms.yml`` or ``lms.env.json``) to access sysadmin dashboard features.
4325

4426

4527
Installing The Plugin
46-
~~~~~~~~~~~~~~~~~~~~~
47-
48-
* You can install the plugin into your Open edX environment using PyPI e.g. ``pip install edx-sysadmin`` or directly from github e.g. ``pip install https://github.com/mitodl/edx-sysadmin.git``
49-
* Once you have installed the plugin you can visit ``<EDX_BASE_URL>/sysadmin`` to access the plugin features.
50-
* If you decide to make your own changes in the plugin you can go to ``Development Workflow`` section below.
28+
---------------------
5129

52-
``Note``: In some cases you might need to restart edx-platform after installing the plugin to reflect the changes.
30+
For detailed installation instructions, please refer to the `plugin installation guide <../../docs#installation-guide>`_.
5331

32+
Installation required in:
5433

55-
Development Workflow
56-
--------------------
34+
* LMS
35+
* CMS
5736

58-
For development you need to install this plugin into your Open edX instance.
37+
Upon installation you need to create ``/openedx/course_repos`` directory within the LMS service:
5938

6039
.. code-block::
6140
62-
# Clone edx-sysadmin to a directory which can be accessed from inside lms container i.e. ``src`` folder of
63-
# Open edX devstack setup, which is present under root directory (sibling directory of edx-platform directory)
64-
# and mapped at ``/edx/src`` inside edx-platform's lms container.
65-
cd src
66-
git clone git@github.com:mitodl/edx-sysadmin.git
67-
68-
# Open LMS shell
69-
cd ../devstack
70-
make lms-shell
71-
72-
# Remove edx-sysadmin plugin if already installed
73-
pip uninstall edx-sysadmin
74-
75-
# Install plugin in editable mode
76-
pip install -e /edx/src/edx-sysadmin
77-
78-
# If edx-sysadmin plugin doesn't reflect anything you can simply restart lms container (optional)
79-
make lms-restart
80-
81-
After installation the plugin should be directly getting served through your edx-sysadmin cloned repo (present at src folder) and you can do live changes to the plugin and they will be reflected in your Open edX instance.
41+
tutor dev exec lms bash
42+
mkdir /openedx/course_repos
8243
83-
Testing
84-
~~~~~~~
85-
86-
edx-sysadmin tests are dependent on edx-platform that's why they can only be run from inside of lms shell
87-
88-
.. code-block::
89-
90-
# Enter LMS shell
91-
cd devstack
92-
make lms-shell
93-
94-
# Go to the directory where edx-sysadmin is mapped inside container i.e. ``/edx/src/edx-sysadmin``
95-
cd /edx/src/edx-sysadmin
96-
97-
# Install requirements for running tests (you can also install requirements inside a virtual environment)
98-
pip install -r ./requirements/quality.txt
99-
100-
# Run Pytest
101-
pytest .
102-
103-
# Run black formatter
104-
black --check .
105-
106-
# Run Pycodestyle
107-
pycodestyle edx_sysadmin tests
108-
109-
# Run Pylint
110-
pylint ./edx_sysadmin
44+
After this, you can visit ``<EDX_BASE_URL>/sysadmin`` to access the plugin features.
11145

46+
Configurations
47+
--------------
48+
The plugin offers multiple settings for customization that can be set using the config file in Open edX. For any release after Juniper, that config file is ``/edx/etc/lms.yml``. If you're using ``private.py``, add these values to ``lms/envs/private.py``.
11249

113-
License
114-
-------
50+
* **GIT_REPO_DIR:** This path defines where the imported repositories will be placed in storage. Default value is ``/openedx/course_repos``. For Devstack, set this value to ``/edx/var/edxapp/course_repos``.
51+
* **GIT_IMPORT_STATIC:** This is a boolean that tells the plugin to either load the static content from the course repo or not. Default value is ``True``
52+
* **SYSADMIN_GITHUB_WEBHOOK_KEY:** This value is used to save either of ``sha256 or sha1`` hashes. (This key is only used for Github Webhooks). Default value is ``None``.
53+
* **SYSADMIN_DEFAULT_BRANCH:** This value is used to specify environment specific branch name to be used for course reload/import through Github Webhooks. (This key is only used for Github Webhooks). Default value is ``None``
11554

116-
The code in this repository is licensed under the AGPL 3.0 unless
117-
otherwise noted.
118-
Please see `LICENSE.txt <LICENSE.txt>`_ for details.
55+
Features
56+
--------
11957

120-
How To Contribute
121-
-----------------
58+
edx-sysadmin provides different features such as:
12259

123-
Contributions are very welcome.
124-
Even though they were written with ``edx-platform`` in mind, the guidelines should be followed in all Open edX projects including this plugin.
60+
* Register Users:
61+
* You can ``register new user accounts`` with an easy to use form via ``Users`` tab.
62+
* Delete Courses:
63+
* You can ``delete any course by using a course ID or directory`` via ``Courses`` tab.
64+
* Git Import:
65+
* You can ``import any course maintained through a git repository`` via ``Git Import`` tab.
66+
* Git Logs
67+
* You can ``check the logs for all imported courses`` through git via ``Git Logs`` tab.
68+
* Git Reload (Not directly visible)
69+
* You can configure Github webhooks with this plugin to ensure reload/import of your courses on new commits

edx_sysadmin/__init__.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1 @@
1-
# pylint: disable=invalid-name
2-
"""
3-
An Open edX plugin to enable SysAdmin panel.
4-
"""
5-
6-
__version__ = "0.2.2"
7-
8-
default_app_config = "edx_sysadmin.apps.EdxSysAdminConfig"
1+
"""An Open edX plugin to enable SysAdmin panel."""

edx_sysadmin/api/urls.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
"""
22
URLs for edx_sysadmin.
33
"""
4-
from django.urls import re_path
4+
5+
from django.urls import path
6+
57
from edx_sysadmin.api.views import (
68
GitCourseDetailsAPIView,
79
GitReloadAPIView,
@@ -10,9 +12,9 @@
1012
app_name = "api"
1113

1214
urlpatterns = [
13-
re_path("^gitreload/$", GitReloadAPIView.as_view(), name="git-reload"),
14-
re_path(
15-
"^gitcoursedetails/$",
15+
path("gitreload/", GitReloadAPIView.as_view(), name="git-reload"),
16+
path(
17+
"gitcoursedetails/",
1618
GitCourseDetailsAPIView.as_view(),
1719
name="git-course-details",
1820
),

0 commit comments

Comments
 (0)