Upload 4 files
Browse files- core/urls/api.py +22 -0
- core/urls/auth.py +28 -0
- core/urls/cpanel.py +232 -0
- core/urls/setup.py +14 -0
core/urls/api.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
URL patterns for the PyRunner REST API.
|
| 3 |
+
"""
|
| 4 |
+
|
| 5 |
+
from django.urls import path
|
| 6 |
+
|
| 7 |
+
from core.views.api import (
|
| 8 |
+
list_datastores,
|
| 9 |
+
get_datastore,
|
| 10 |
+
list_entries,
|
| 11 |
+
get_entry,
|
| 12 |
+
)
|
| 13 |
+
|
| 14 |
+
app_name = "api"
|
| 15 |
+
|
| 16 |
+
urlpatterns = [
|
| 17 |
+
# Datastore endpoints
|
| 18 |
+
path("datastores/", list_datastores, name="list_datastores"),
|
| 19 |
+
path("datastores/<str:name>/", get_datastore, name="get_datastore"),
|
| 20 |
+
path("datastores/<str:name>/entries/", list_entries, name="list_entries"),
|
| 21 |
+
path("datastores/<str:name>/entries/<str:key>/", get_entry, name="get_entry"),
|
| 22 |
+
]
|
core/urls/auth.py
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
URL patterns for authentication.
|
| 3 |
+
"""
|
| 4 |
+
from django.urls import path
|
| 5 |
+
from core.views.auth import (
|
| 6 |
+
login_view,
|
| 7 |
+
magic_link_sent_view,
|
| 8 |
+
verify_view,
|
| 9 |
+
logout_view,
|
| 10 |
+
accept_invite_view,
|
| 11 |
+
change_password_view,
|
| 12 |
+
forgot_password_view,
|
| 13 |
+
reset_password_view,
|
| 14 |
+
)
|
| 15 |
+
|
| 16 |
+
app_name = "auth"
|
| 17 |
+
|
| 18 |
+
urlpatterns = [
|
| 19 |
+
path("login/", login_view, name="login"),
|
| 20 |
+
path("magic-link-sent/", magic_link_sent_view, name="magic_link_sent"),
|
| 21 |
+
path("verify/<str:token>/", verify_view, name="verify"),
|
| 22 |
+
path("logout/", logout_view, name="logout"),
|
| 23 |
+
path("invite/<str:token>/", accept_invite_view, name="accept_invite"),
|
| 24 |
+
# Password management
|
| 25 |
+
path("change-password/", change_password_view, name="change_password"),
|
| 26 |
+
path("forgot-password/", forgot_password_view, name="forgot_password"),
|
| 27 |
+
path("reset-password/<str:token>/", reset_password_view, name="reset_password"),
|
| 28 |
+
]
|
core/urls/cpanel.py
ADDED
|
@@ -0,0 +1,232 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
URL patterns for control panel.
|
| 3 |
+
"""
|
| 4 |
+
from django.urls import path
|
| 5 |
+
from core.views.dashboard import dashboard_view, system_resources_api
|
| 6 |
+
from core.views.scripts import (
|
| 7 |
+
script_list_view,
|
| 8 |
+
script_create_view,
|
| 9 |
+
script_detail_view,
|
| 10 |
+
script_edit_view,
|
| 11 |
+
script_run_view,
|
| 12 |
+
script_toggle_view,
|
| 13 |
+
script_archive_view,
|
| 14 |
+
script_restore_view,
|
| 15 |
+
script_delete_view,
|
| 16 |
+
schedule_toggle_view,
|
| 17 |
+
schedule_history_view,
|
| 18 |
+
webhook_enable_view,
|
| 19 |
+
webhook_disable_view,
|
| 20 |
+
webhook_regenerate_view,
|
| 21 |
+
)
|
| 22 |
+
from core.views.runs import run_list_view, run_detail_view
|
| 23 |
+
from core.views.environments import (
|
| 24 |
+
environment_list_view,
|
| 25 |
+
environment_detail_view,
|
| 26 |
+
environment_create_view,
|
| 27 |
+
environment_edit_view,
|
| 28 |
+
environment_delete_view,
|
| 29 |
+
environment_set_default_view,
|
| 30 |
+
environment_packages_view,
|
| 31 |
+
package_install_view,
|
| 32 |
+
package_uninstall_view,
|
| 33 |
+
bulk_install_view,
|
| 34 |
+
export_requirements_view,
|
| 35 |
+
package_operation_status_view,
|
| 36 |
+
)
|
| 37 |
+
from core.views.settings import (
|
| 38 |
+
settings_view,
|
| 39 |
+
toggle_global_pause_view,
|
| 40 |
+
notification_settings_view,
|
| 41 |
+
test_email_view,
|
| 42 |
+
general_settings_view,
|
| 43 |
+
retention_settings_view,
|
| 44 |
+
worker_settings_view,
|
| 45 |
+
restart_workers_view,
|
| 46 |
+
manual_cleanup_view,
|
| 47 |
+
cleanup_preview_view,
|
| 48 |
+
system_info_view,
|
| 49 |
+
)
|
| 50 |
+
from core.views.secrets import (
|
| 51 |
+
secret_list_view,
|
| 52 |
+
secret_create_view,
|
| 53 |
+
secret_edit_view,
|
| 54 |
+
secret_delete_view,
|
| 55 |
+
)
|
| 56 |
+
from core.views.tags import (
|
| 57 |
+
tag_list_view,
|
| 58 |
+
tag_create_view,
|
| 59 |
+
tag_edit_view,
|
| 60 |
+
tag_delete_view,
|
| 61 |
+
)
|
| 62 |
+
from core.views.datastores import (
|
| 63 |
+
datastore_list_view,
|
| 64 |
+
datastore_create_view,
|
| 65 |
+
datastore_detail_view,
|
| 66 |
+
datastore_edit_view,
|
| 67 |
+
datastore_delete_view,
|
| 68 |
+
datastore_clear_view,
|
| 69 |
+
datastore_entry_create_view,
|
| 70 |
+
datastore_entry_edit_view,
|
| 71 |
+
datastore_entry_delete_view,
|
| 72 |
+
)
|
| 73 |
+
from core.views.backup import (
|
| 74 |
+
backup_create_view,
|
| 75 |
+
backup_upload_view,
|
| 76 |
+
backup_preview_view,
|
| 77 |
+
backup_restore_view,
|
| 78 |
+
backup_schedule_settings_view,
|
| 79 |
+
backup_schedule_status_view,
|
| 80 |
+
backup_run_now_view,
|
| 81 |
+
)
|
| 82 |
+
from core.views.users import (
|
| 83 |
+
user_list_view,
|
| 84 |
+
invite_user_view,
|
| 85 |
+
revoke_invite_view,
|
| 86 |
+
toggle_registration_view,
|
| 87 |
+
delete_user_view,
|
| 88 |
+
)
|
| 89 |
+
from core.views.logs import (
|
| 90 |
+
logs_view,
|
| 91 |
+
logs_api_view,
|
| 92 |
+
logs_clear_view,
|
| 93 |
+
)
|
| 94 |
+
from core.views.api_tokens import (
|
| 95 |
+
api_token_list_view,
|
| 96 |
+
api_token_create_view,
|
| 97 |
+
api_token_created_view,
|
| 98 |
+
api_token_revoke_view,
|
| 99 |
+
api_token_toggle_view,
|
| 100 |
+
)
|
| 101 |
+
from core.views.tasks import (
|
| 102 |
+
tasks_view,
|
| 103 |
+
tasks_api_view,
|
| 104 |
+
task_cancel_view,
|
| 105 |
+
task_force_stop_view,
|
| 106 |
+
)
|
| 107 |
+
from core.views.services import (
|
| 108 |
+
services_view,
|
| 109 |
+
s3_settings_view,
|
| 110 |
+
s3_test_connection_view,
|
| 111 |
+
)
|
| 112 |
+
|
| 113 |
+
app_name = "cpanel"
|
| 114 |
+
|
| 115 |
+
urlpatterns = [
|
| 116 |
+
# Dashboard
|
| 117 |
+
path("", dashboard_view, name="dashboard"),
|
| 118 |
+
path("api/system-resources/", system_resources_api, name="system_resources_api"),
|
| 119 |
+
|
| 120 |
+
# Scripts
|
| 121 |
+
path("scripts/", script_list_view, name="script_list"),
|
| 122 |
+
path("scripts/create/", script_create_view, name="script_create"),
|
| 123 |
+
path("scripts/<uuid:pk>/", script_detail_view, name="script_detail"),
|
| 124 |
+
path("scripts/<uuid:pk>/edit/", script_edit_view, name="script_edit"),
|
| 125 |
+
path("scripts/<uuid:pk>/run/", script_run_view, name="script_run"),
|
| 126 |
+
path("scripts/<uuid:pk>/toggle/", script_toggle_view, name="script_toggle"),
|
| 127 |
+
path("scripts/<uuid:pk>/schedule/toggle/", schedule_toggle_view, name="schedule_toggle"),
|
| 128 |
+
path("scripts/<uuid:pk>/schedule/history/", schedule_history_view, name="schedule_history"),
|
| 129 |
+
# Script archive/restore/delete
|
| 130 |
+
path("scripts/<uuid:pk>/archive/", script_archive_view, name="script_archive"),
|
| 131 |
+
path("scripts/<uuid:pk>/restore/", script_restore_view, name="script_restore"),
|
| 132 |
+
path("scripts/<uuid:pk>/delete/", script_delete_view, name="script_delete"),
|
| 133 |
+
# Webhooks
|
| 134 |
+
path("scripts/<uuid:pk>/webhook/enable/", webhook_enable_view, name="webhook_enable"),
|
| 135 |
+
path("scripts/<uuid:pk>/webhook/disable/", webhook_disable_view, name="webhook_disable"),
|
| 136 |
+
path("scripts/<uuid:pk>/webhook/regenerate/", webhook_regenerate_view, name="webhook_regenerate"),
|
| 137 |
+
|
| 138 |
+
# Runs
|
| 139 |
+
path("runs/", run_list_view, name="run_list"),
|
| 140 |
+
path("runs/<uuid:pk>/", run_detail_view, name="run_detail"),
|
| 141 |
+
|
| 142 |
+
# Tasks
|
| 143 |
+
path("tasks/", tasks_view, name="tasks"),
|
| 144 |
+
path("api/tasks/", tasks_api_view, name="tasks_api"),
|
| 145 |
+
path("tasks/<str:task_id>/cancel/", task_cancel_view, name="task_cancel"),
|
| 146 |
+
path("tasks/<str:task_id>/force-stop/", task_force_stop_view, name="task_force_stop"),
|
| 147 |
+
|
| 148 |
+
# Environments
|
| 149 |
+
path("environments/", environment_list_view, name="environment_list"),
|
| 150 |
+
path("environments/create/", environment_create_view, name="environment_create"),
|
| 151 |
+
path("environments/<uuid:pk>/", environment_detail_view, name="environment_detail"),
|
| 152 |
+
path("environments/<uuid:pk>/edit/", environment_edit_view, name="environment_edit"),
|
| 153 |
+
path("environments/<uuid:pk>/delete/", environment_delete_view, name="environment_delete"),
|
| 154 |
+
path("environments/<uuid:pk>/set-default/", environment_set_default_view, name="environment_set_default"),
|
| 155 |
+
# Package Management
|
| 156 |
+
path("environments/<uuid:pk>/packages/", environment_packages_view, name="environment_packages"),
|
| 157 |
+
path("environments/<uuid:pk>/packages/install/", package_install_view, name="package_install"),
|
| 158 |
+
path("environments/<uuid:pk>/packages/uninstall/", package_uninstall_view, name="package_uninstall"),
|
| 159 |
+
path("environments/<uuid:pk>/packages/bulk-install/", bulk_install_view, name="bulk_install"),
|
| 160 |
+
path("environments/<uuid:pk>/packages/export/", export_requirements_view, name="export_requirements"),
|
| 161 |
+
# AJAX endpoint
|
| 162 |
+
path("api/package-operation/<uuid:operation_id>/status/", package_operation_status_view, name="package_operation_status"),
|
| 163 |
+
|
| 164 |
+
# Secrets
|
| 165 |
+
path("secrets/", secret_list_view, name="secret_list"),
|
| 166 |
+
path("secrets/create/", secret_create_view, name="secret_create"),
|
| 167 |
+
path("secrets/<uuid:pk>/edit/", secret_edit_view, name="secret_edit"),
|
| 168 |
+
path("secrets/<uuid:pk>/delete/", secret_delete_view, name="secret_delete"),
|
| 169 |
+
|
| 170 |
+
# Tags
|
| 171 |
+
path("tags/", tag_list_view, name="tag_list"),
|
| 172 |
+
path("tags/create/", tag_create_view, name="tag_create"),
|
| 173 |
+
path("tags/<uuid:pk>/edit/", tag_edit_view, name="tag_edit"),
|
| 174 |
+
path("tags/<uuid:pk>/delete/", tag_delete_view, name="tag_delete"),
|
| 175 |
+
|
| 176 |
+
# Data Stores
|
| 177 |
+
path("datastores/", datastore_list_view, name="datastore_list"),
|
| 178 |
+
path("datastores/create/", datastore_create_view, name="datastore_create"),
|
| 179 |
+
path("datastores/<uuid:pk>/", datastore_detail_view, name="datastore_detail"),
|
| 180 |
+
path("datastores/<uuid:pk>/edit/", datastore_edit_view, name="datastore_edit"),
|
| 181 |
+
path("datastores/<uuid:pk>/delete/", datastore_delete_view, name="datastore_delete"),
|
| 182 |
+
path("datastores/<uuid:pk>/clear/", datastore_clear_view, name="datastore_clear"),
|
| 183 |
+
path("datastores/<uuid:pk>/entries/create/", datastore_entry_create_view, name="datastore_entry_create"),
|
| 184 |
+
path("datastores/<uuid:pk>/entries/<uuid:entry_pk>/edit/", datastore_entry_edit_view, name="datastore_entry_edit"),
|
| 185 |
+
path("datastores/<uuid:pk>/entries/<uuid:entry_pk>/delete/", datastore_entry_delete_view, name="datastore_entry_delete"),
|
| 186 |
+
|
| 187 |
+
# Settings
|
| 188 |
+
path("settings/", settings_view, name="settings"),
|
| 189 |
+
path("settings/toggle-pause/", toggle_global_pause_view, name="toggle_global_pause"),
|
| 190 |
+
path("settings/notifications/", notification_settings_view, name="notification_settings"),
|
| 191 |
+
path("settings/test-email/", test_email_view, name="test_email"),
|
| 192 |
+
path("settings/general/", general_settings_view, name="general_settings"),
|
| 193 |
+
path("settings/retention/", retention_settings_view, name="retention_settings"),
|
| 194 |
+
path("settings/workers/", worker_settings_view, name="worker_settings"),
|
| 195 |
+
path("settings/restart-workers/", restart_workers_view, name="restart_workers"),
|
| 196 |
+
path("settings/cleanup/", manual_cleanup_view, name="manual_cleanup"),
|
| 197 |
+
path("settings/cleanup-preview/", cleanup_preview_view, name="cleanup_preview"),
|
| 198 |
+
path("settings/system-info/", system_info_view, name="system_info"),
|
| 199 |
+
|
| 200 |
+
# Backup & Restore
|
| 201 |
+
path("settings/backup/create/", backup_create_view, name="backup_create"),
|
| 202 |
+
path("settings/backup/upload/", backup_upload_view, name="backup_upload"),
|
| 203 |
+
path("settings/backup/preview/", backup_preview_view, name="backup_preview"),
|
| 204 |
+
path("settings/backup/restore/", backup_restore_view, name="backup_restore"),
|
| 205 |
+
path("settings/backup/schedule/", backup_schedule_settings_view, name="backup_schedule_settings"),
|
| 206 |
+
path("settings/backup/schedule/status/", backup_schedule_status_view, name="backup_schedule_status"),
|
| 207 |
+
path("settings/backup/run-now/", backup_run_now_view, name="backup_run_now"),
|
| 208 |
+
|
| 209 |
+
# User Management
|
| 210 |
+
path("users/", user_list_view, name="user_list"),
|
| 211 |
+
path("users/invite/", invite_user_view, name="invite_user"),
|
| 212 |
+
path("users/invite/<int:pk>/revoke/", revoke_invite_view, name="revoke_invite"),
|
| 213 |
+
path("users/<int:pk>/delete/", delete_user_view, name="delete_user"),
|
| 214 |
+
path("users/toggle-registration/", toggle_registration_view, name="toggle_registration"),
|
| 215 |
+
|
| 216 |
+
# Logs
|
| 217 |
+
path("logs/", logs_view, name="logs"),
|
| 218 |
+
path("api/logs/", logs_api_view, name="logs_api"),
|
| 219 |
+
path("api/logs/clear/", logs_clear_view, name="logs_clear"),
|
| 220 |
+
|
| 221 |
+
# API Tokens
|
| 222 |
+
path("settings/api-tokens/", api_token_list_view, name="api_token_list"),
|
| 223 |
+
path("settings/api-tokens/create/", api_token_create_view, name="api_token_create"),
|
| 224 |
+
path("settings/api-tokens/<uuid:pk>/created/", api_token_created_view, name="api_token_created"),
|
| 225 |
+
path("settings/api-tokens/<uuid:pk>/revoke/", api_token_revoke_view, name="api_token_revoke"),
|
| 226 |
+
path("settings/api-tokens/<uuid:pk>/toggle/", api_token_toggle_view, name="api_token_toggle"),
|
| 227 |
+
|
| 228 |
+
# Services
|
| 229 |
+
path("services/", services_view, name="services"),
|
| 230 |
+
path("services/s3/", s3_settings_view, name="s3_settings"),
|
| 231 |
+
path("services/s3/test/", s3_test_connection_view, name="s3_test_connection"),
|
| 232 |
+
]
|
core/urls/setup.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
URL patterns for initial setup wizard.
|
| 3 |
+
"""
|
| 4 |
+
|
| 5 |
+
from django.urls import path
|
| 6 |
+
|
| 7 |
+
from core.views.setup import setup_view, admin_setup_view
|
| 8 |
+
|
| 9 |
+
app_name = "setup"
|
| 10 |
+
|
| 11 |
+
urlpatterns = [
|
| 12 |
+
path("", setup_view, name="setup"),
|
| 13 |
+
path("admin/", admin_setup_view, name="admin_setup"),
|
| 14 |
+
]
|