Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
374 changes: 200 additions & 174 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ generate-setup-file = false
python = "~3.9"

# [tool.poetry.group.django.dependencies]
django = "~2.2"
django = "~3.2"
django-oauth-toolkit = "*"
djangorestframework = "==3.13.1" # Last version to support Django 2.2 (up to 4.0)
django-pipeline = "*"
Expand Down
6 changes: 6 additions & 0 deletions src/rockstor/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,12 @@
OAUTH_INTERNAL_APP = "cliapp"
OAUTH2_PROVIDER_APPLICATION_MODEL = "oauth2_provider.Application"

# Django 3.2 onwards requires explicitly AutoField defined:
# The following is the prior default of 32bit for auto id fields, so no migrations.
# https://docs.djangoproject.com/en/3.2/releases/3.2/#customizing-type-of-auto-created-primary-keys
# if the new default of "django.db.models.BigAutoField" is configured, migrations are required.
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"

# Header string to separate auto config options from rest of config file.
# this could be generalized across all Rockstor config files, problems during
# upgrades though
Expand Down
26 changes: 13 additions & 13 deletions src/rockstor/smart_manager/urls/replicas.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""

from django.conf.urls import url
from django.urls import re_path
from django.conf import settings
from smart_manager.views import (
ReplicaTrailListView,
Expand All @@ -32,28 +32,28 @@
share_regex = settings.SHARE_REGEX

urlpatterns = [
url(r"^(?P<rid>[0-9]+)$", ReplicaDetailView.as_view(), name="replica-view"),
url(
re_path(r"^(?P<rid>[0-9]+)$", ReplicaDetailView.as_view(), name="replica-view"),
re_path(
r"^share/(?P<sname>%s)$" % share_regex,
ReplicaDetailView.as_view(),
name="replica-view",
),
url(r"^trail$", ReplicaTrailListView.as_view(), name="replica-view"),
url(
re_path(r"^trail$", ReplicaTrailListView.as_view(), name="replica-view"),
re_path(
r"^trail/replica/(?P<rid>[0-9]+)",
ReplicaTrailListView.as_view(),
name="replica-view",
),
url(
re_path(
r"^trail/(?P<rtid>[0-9]+)",
ReplicaTrailDetailView.as_view(),
name="replica-view",
),
url(r"^rshare$", ReplicaShareListView.as_view()),
url(r"^rshare/(?P<rid>[0-9]+)$", ReplicaShareDetailView.as_view()),
url(r"^rshare/(?P<sname>%s)$" % share_regex, ReplicaShareDetailView.as_view()),
url(r"^rtrail$", ReceiveTrailListView.as_view()),
url(r"^rtrail/rshare/(?P<rid>[0-9]+)$", ReceiveTrailListView.as_view()),
url(r"^rtrail/(?P<rtid>[0-9]+)", ReceiveTrailDetailView.as_view()),
url(r"^rpool/(?P<auuid>.*)$", ReceiverPoolListView.as_view()),
re_path(r"^rshare$", ReplicaShareListView.as_view()),
re_path(r"^rshare/(?P<rid>[0-9]+)$", ReplicaShareDetailView.as_view()),
re_path(r"^rshare/(?P<sname>%s)$" % share_regex, ReplicaShareDetailView.as_view()),
re_path(r"^rtrail$", ReceiveTrailListView.as_view()),
re_path(r"^rtrail/rshare/(?P<rid>[0-9]+)$", ReceiveTrailListView.as_view()),
re_path(r"^rtrail/(?P<rtid>[0-9]+)", ReceiveTrailDetailView.as_view()),
re_path(r"^rpool/(?P<auuid>.*)$", ReceiverPoolListView.as_view()),
]
84 changes: 42 additions & 42 deletions src/rockstor/smart_manager/urls/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""

from django.conf.urls import url
from django.urls import re_path
from smart_manager.views import (
ActiveDirectoryServiceView,
BootstrapServiceView,
Expand Down Expand Up @@ -45,70 +45,70 @@

urlpatterns = [
# Services
url(r"^nis$", NISServiceView.as_view()),
url(r"^nis/(?P<command>%s)$" % command_regex, NISServiceView.as_view()),
url(r"^smb$", SambaServiceView.as_view()),
url(r"^smb/(?P<command>%s)$" % command_regex, SambaServiceView.as_view()),
url(r"^nfs$", NFSServiceView.as_view()),
url(r"^nfs/(?P<command>%s)$" % command_regex, NFSServiceView.as_view()),
url(r"^ntpd$", NTPServiceView.as_view()),
url(r"^ntpd/(?P<command>%s)$" % command_regex, NTPServiceView.as_view()),
url(r"^active-directory$", ActiveDirectoryServiceView.as_view()),
url(
re_path(r"^nis$", NISServiceView.as_view()),
re_path(r"^nis/(?P<command>%s)$" % command_regex, NISServiceView.as_view()),
re_path(r"^smb$", SambaServiceView.as_view()),
re_path(r"^smb/(?P<command>%s)$" % command_regex, SambaServiceView.as_view()),
re_path(r"^nfs$", NFSServiceView.as_view()),
re_path(r"^nfs/(?P<command>%s)$" % command_regex, NFSServiceView.as_view()),
re_path(r"^ntpd$", NTPServiceView.as_view()),
re_path(r"^ntpd/(?P<command>%s)$" % command_regex, NTPServiceView.as_view()),
re_path(r"^active-directory$", ActiveDirectoryServiceView.as_view()),
re_path(
r"^active-directory/(?P<command>%s)$" % command_regex,
ActiveDirectoryServiceView.as_view(),
),
url(r"^ldap$", LdapServiceView.as_view()),
url(r"^ldap/(?P<command>%s)$" % command_regex, LdapServiceView.as_view()),
url(r"^sftp$", SFTPServiceView.as_view()),
url(r"^sftp/(?P<command>%s)$" % command_regex, SFTPServiceView.as_view()),
url(r"^replication$", ReplicationServiceView.as_view()),
url(
re_path(r"^ldap$", LdapServiceView.as_view()),
re_path(r"^ldap/(?P<command>%s)$" % command_regex, LdapServiceView.as_view()),
re_path(r"^sftp$", SFTPServiceView.as_view()),
re_path(r"^sftp/(?P<command>%s)$" % command_regex, SFTPServiceView.as_view()),
re_path(r"^replication$", ReplicationServiceView.as_view()),
re_path(
r"^replication/(?P<command>%s)$" % command_regex,
ReplicationServiceView.as_view(),
),
url(r"^task-scheduler$", TaskSchedulerServiceView.as_view()),
url(
re_path(r"^task-scheduler$", TaskSchedulerServiceView.as_view()),
re_path(
r"^task-scheduler/(?P<command>%s)$" % command_regex,
TaskSchedulerServiceView.as_view(),
),
url(r"^data-collector$", DataCollectorServiceView.as_view()),
url(
re_path(r"^data-collector$", DataCollectorServiceView.as_view()),
re_path(
r"^data-collector/(?P<command>%s)$" % command_regex,
DataCollectorServiceView.as_view(),
),
url(r"^service-monitor$", ServiceMonitorView.as_view()),
url(
re_path(r"^service-monitor$", ServiceMonitorView.as_view()),
re_path(
r"^service-monitor/(?P<command>%s)$" % command_regex,
ServiceMonitorView.as_view(),
),
url(r"^snmpd$", SNMPServiceView.as_view()),
url(r"^snmpd/(?P<command>%s)$" % command_regex, SNMPServiceView.as_view()),
url(r"^docker$", DockerServiceView.as_view()),
url(r"^docker/(?P<command>%s)$" % command_regex, DockerServiceView.as_view()),
url(r"^smartd$", SMARTDServiceView.as_view()),
url(r"^smartd/(?P<command>%s)$" % command_regex, SMARTDServiceView.as_view()),
url(r"^nut$", NUTServiceView.as_view()),
url(r"^nut/(?P<command>%s)$" % command_regex, NUTServiceView.as_view()),
url(r"^ztask-daemon$", ZTaskdServiceView.as_view()),
url(r"^ztask-daemon/(?P<command>%s)$" % command_regex, ZTaskdServiceView.as_view()),
url(r"^rockstor-bootstrap$", BootstrapServiceView.as_view()),
url(
re_path(r"^snmpd$", SNMPServiceView.as_view()),
re_path(r"^snmpd/(?P<command>%s)$" % command_regex, SNMPServiceView.as_view()),
re_path(r"^docker$", DockerServiceView.as_view()),
re_path(r"^docker/(?P<command>%s)$" % command_regex, DockerServiceView.as_view()),
re_path(r"^smartd$", SMARTDServiceView.as_view()),
re_path(r"^smartd/(?P<command>%s)$" % command_regex, SMARTDServiceView.as_view()),
re_path(r"^nut$", NUTServiceView.as_view()),
re_path(r"^nut/(?P<command>%s)$" % command_regex, NUTServiceView.as_view()),
re_path(r"^ztask-daemon$", ZTaskdServiceView.as_view()),
re_path(r"^ztask-daemon/(?P<command>%s)$" % command_regex, ZTaskdServiceView.as_view()),
re_path(r"^rockstor-bootstrap$", BootstrapServiceView.as_view()),
re_path(
r"^rockstor-bootstrap/(?P<command>%s)$" % command_regex,
BootstrapServiceView.as_view(),
),
url(r"^shellinaboxd$", ShellInABoxServiceView.as_view()),
url(
re_path(r"^shellinaboxd$", ShellInABoxServiceView.as_view()),
re_path(
r"^shellinaboxd/(?P<command>%s)$" % command_regex,
ShellInABoxServiceView.as_view(),
),
url(r"^rockstor$", RockstorServiceView.as_view()),
url(r"^rockstor/(?P<command>%s)$" % command_regex, RockstorServiceView.as_view()),
url(r"^tailscaled$", TailscaledServiceView.as_view()),
url(
re_path(r"^rockstor$", RockstorServiceView.as_view()),
re_path(r"^rockstor/(?P<command>%s)$" % command_regex, RockstorServiceView.as_view()),
re_path(r"^tailscaled$", TailscaledServiceView.as_view()),
re_path(
r"^tailscaled/(?P<command>%s)$" % command_regex, TailscaledServiceView.as_view()
),
url(
re_path(
r"^tailscaled/(?P<command>%s)/(?P<action>%s)$" % (command_regex, action_regex),
TailscaledServiceView.as_view(),
),
Expand Down
46 changes: 23 additions & 23 deletions src/rockstor/smart_manager/urls/sprobes.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""

from django.conf.urls import url
from django.urls import re_path
from smart_manager.views import (
MemInfoView,
NetStatView,
Expand All @@ -35,70 +35,70 @@

urlpatterns = [
# Smart probes
url(r"^metadata$", SProbeMetadataView.as_view(), name="probe-view"),
url(
re_path(r"^metadata$", SProbeMetadataView.as_view(), name="probe-view"),
re_path(
r"^metadata/(?P<pid>[0-9]+)$",
SProbeMetadataDetailView.as_view(),
name="probe-view",
),
# Generic smart probes
url(r"^diskstat/$", DiskStatView.as_view(), name="diskstat-view"),
url(r"^meminfo/$", MemInfoView.as_view(), name="meminfo-view"),
url(r"^netstat/$", NetStatView.as_view(), name="netstat-view"),
url(r"^cpumetric/$", CPUMetricView.as_view(), name="cpumetric-view"),
url(r"^loadavg$", LoadAvgView.as_view(), name="loadavg-view"),
re_path(r"^diskstat/$", DiskStatView.as_view(), name="diskstat-view"),
re_path(r"^meminfo/$", MemInfoView.as_view(), name="meminfo-view"),
re_path(r"^netstat/$", NetStatView.as_view(), name="netstat-view"),
re_path(r"^cpumetric/$", CPUMetricView.as_view(), name="cpumetric-view"),
re_path(r"^loadavg$", LoadAvgView.as_view(), name="loadavg-view"),
# Advanced smart probes
url(r"^nfs-1$", NFSDistribView.as_view(), name="nfsdistrib-view"),
url(r"^nfs-1/(?P<pid>[0-9]+)$", NFSDistribView.as_view(), name="nfsdistrib-view"),
url(
re_path(r"^nfs-1$", NFSDistribView.as_view(), name="nfsdistrib-view"),
re_path(r"^nfs-1/(?P<pid>[0-9]+)$", NFSDistribView.as_view(), name="nfsdistrib-view"),
re_path(
r"^nfs-1/(?P<pid>[0-9]+)/(?P<command>[a-z]+)$",
NFSDistribView.as_view(),
name="nfsdistrib-view",
),
url(r"^nfs-2$", NFSDClientDistribView.as_view(), name="nfsclientdistrib-view"),
url(
re_path(r"^nfs-2$", NFSDClientDistribView.as_view(), name="nfsclientdistrib-view"),
re_path(
r"^nfs-2/(?P<pid>[0-9]+)$",
NFSDClientDistribView.as_view(),
name="nfsclientdistrib-view",
),
url(
re_path(
r"^nfs-2/(?P<pid>[0-9]+)/(?P<command>[a-z]+)$",
NFSDClientDistribView.as_view(),
name="nfsclientdistrib-view",
),
url(r"^nfs-3$", NFSDShareDistribView.as_view(), name="nfssharedistrib-view"),
url(
re_path(r"^nfs-3$", NFSDShareDistribView.as_view(), name="nfssharedistrib-view"),
re_path(
r"^nfs-3/(?P<pid>[0-9]+)$",
NFSDShareDistribView.as_view(),
name="nfssharedistrib-view",
),
url(
re_path(
r"^nfs-3/(?P<pid>[0-9]+)/(?P<command>[a-z]+)$",
NFSDShareDistribView.as_view(),
name="nfssharedistrib-view",
),
url(
re_path(
r"^nfs-4$",
NFSDShareClientDistribView.as_view(),
name="nfsshareclientdistrib-view",
),
url(
re_path(
r"^nfs-4/(?P<pid>[0-9]+)$",
NFSDShareClientDistribView.as_view(),
name="nfsshareclientdistrib-view",
),
url(
re_path(
r"^nfs-4/(?P<pid>[0-9]+)/(?P<command>[a-z]+)$",
NFSDShareClientDistribView.as_view(),
name="nfsshareclientdistrib-view",
),
url(r"^nfs-5$", NFSDUidGidDistributionView.as_view(), name="nfsuidgid-view"),
url(
re_path(r"^nfs-5$", NFSDUidGidDistributionView.as_view(), name="nfsuidgid-view"),
re_path(
r"^nfs-5/(?P<pid>[0-9]+)$",
NFSDUidGidDistributionView.as_view(),
name="nfsuidgid-view",
),
url(
re_path(
r"^nfs-5/(?P<pid>[0-9]+)/(?P<command>[a-z]+)$",
NFSDUidGidDistributionView.as_view(),
name="nfsuidgid-view",
Expand Down
14 changes: 7 additions & 7 deletions src/rockstor/smart_manager/urls/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""

from django.conf.urls import url
from django.urls import re_path
from smart_manager.views import (
TaskLogView,
TaskTypeView,
TaskSchedulerDetailView,
)

urlpatterns = [
url(r"^(?P<tdid>\d+)$", TaskSchedulerDetailView.as_view(),),
url(r"^log$", TaskLogView.as_view(),),
url(r"^log/(?P<command>prune)$", TaskLogView.as_view(),),
url(r"^log/taskdef/(?P<tdid>\d+)", TaskLogView.as_view(),),
url(r"^log/(?P<tid>\d+)", TaskLogView.as_view(),),
url(r"^types$", TaskTypeView.as_view(),),
re_path(r"^(?P<tdid>\d+)$", TaskSchedulerDetailView.as_view(),),
re_path(r"^log$", TaskLogView.as_view(),),
re_path(r"^log/(?P<command>prune)$", TaskLogView.as_view(),),
re_path(r"^log/taskdef/(?P<tdid>\d+)", TaskLogView.as_view(),),
re_path(r"^log/(?P<tid>\d+)", TaskLogView.as_view(),),
re_path(r"^types$", TaskTypeView.as_view(),),
]
2 changes: 1 addition & 1 deletion src/rockstor/storageadmin/templates/storageadmin/base.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% load staticfiles %}
{% load static %}
<!DOCTYPE html>
<html>
<head>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% load staticfiles %}
{% load static %}
<!DOCTYPE html>
<html>
<head>
Expand Down
7 changes: 4 additions & 3 deletions src/rockstor/storageadmin/urls/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""

from django.conf.urls import url

from django.urls import re_path
from storageadmin.views import CommandView

valid_commands = (
Expand All @@ -28,8 +29,8 @@
)

urlpatterns =[
url(r"(?P<command>%s)$" % valid_commands, CommandView.as_view(), name="user-view"),
url(
re_path(r"(?P<command>%s)$" % valid_commands, CommandView.as_view(), name="user-view"),
re_path(
r"(?P<command>shutdown|suspend)/(?P<rtcepoch>\d+)$",
CommandView.as_view(),
name="user-view",
Expand Down
10 changes: 5 additions & 5 deletions src/rockstor/storageadmin/urls/disks.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""

from django.conf.urls import url
from django.urls import re_path
from storageadmin.views import DiskListView, DiskDetailView, DiskSMARTDetailView

disk_regex = "[A-Za-z0-9]+[A-Za-z0-9:_-]*"

urlpatterns = [
url(r"^smart/(?P<command>.+)/(?P<did>\d+)$", DiskSMARTDetailView.as_view()),
url(r"^(?P<command>scan)$", DiskListView.as_view()),
url(r"^(?P<did>\d+)$", DiskDetailView.as_view()),
url(r"^(?P<did>\d+)/(?P<command>.+)$", DiskDetailView.as_view()),
re_path(r"^smart/(?P<command>.+)/(?P<did>\d+)$", DiskSMARTDetailView.as_view()),
re_path(r"^(?P<command>scan)$", DiskListView.as_view()),
re_path(r"^(?P<did>\d+)$", DiskDetailView.as_view()),
re_path(r"^(?P<did>\d+)/(?P<command>.+)$", DiskDetailView.as_view()),
]
Loading