Compare commits

...

11 Commits

Author SHA1 Message Date
wh1te909
400b1a9e17 Release 0.20.1 2025-02-04 17:53:48 +00:00
wh1te909
0669a126ed bump version 2025-02-04 17:52:01 +00:00
wh1te909
d5fc77e70a update jinja 2025-02-03 21:59:30 +00:00
wh1te909
079c987c44 bump webver 2025-02-03 21:58:02 +00:00
wh1te909
e4fb4ac28a update reqs 2025-02-03 05:14:39 +00:00
wh1te909
10fd07577f fix for celery workers stop consuming tasks when connection to redis lost 2025-02-01 20:51:59 +00:00
wh1te909
83b4d8c686 fix tests 2025-01-21 21:02:59 +00:00
wh1te909
0a2547d65c fix cors error 2025-01-21 18:52:35 +00:00
wh1te909
5ee2a3cb54 update readme 2024-11-28 19:56:19 +00:00
wh1te909
e505d0768c add server maintenance mode mgmt command 2024-11-22 19:14:55 +00:00
wh1te909
6d4fe84ddc back to dev [skip ci] 2024-11-22 00:41:46 +00:00
6 changed files with 76 additions and 39 deletions

View File

@@ -41,6 +41,13 @@ Demo database resets every hour. A lot of features are disabled for obvious reas
- 64 bit Intel and Apple Silicon (M-Series)
## Sponsorship Features
- Mac and Linux Agents
- Windows [Code Signed](https://docs.tacticalrmm.com/code_signing/) Agents
- Fully Customizable [Reporting](https://docs.tacticalrmm.com/ee/reporting/reporting_overview/) Module
- [Single Sign-On](https://docs.tacticalrmm.com/ee/sso/sso/) (SSO)
## Installation / Backup / Restore / Usage
### Refer to the [documentation](https://docs.tacticalrmm.com)

View File

@@ -0,0 +1,50 @@
import json
import os
from django.core.management.base import BaseCommand
from agents.models import Agent
class Command(BaseCommand):
help = "Toggle server maintenance mode, preserving existing state"
def add_arguments(self, parser):
parser.add_argument("--enable", action="store_true")
parser.add_argument("--disable", action="store_true")
parser.add_argument("--force-enable", action="store_true")
parser.add_argument("--force-disable", action="store_true")
def handle(self, *args, **kwargs):
enable = kwargs["enable"]
disable = kwargs["disable"]
force_enable = kwargs["force_enable"]
force_disable = kwargs["force_disable"]
home_dir = os.path.expanduser("~")
fp = os.path.join(home_dir, "agents_maint_mode.json")
if enable:
current = list(
Agent.objects.filter(maintenance_mode=True).values_list("id", flat=True)
)
with open(fp, "w") as f:
json.dump(current, f)
Agent.objects.update(maintenance_mode=True)
elif disable:
with open(fp, "r") as f:
state = json.load(f)
Agent.objects.exclude(pk__in=state).update(maintenance_mode=False)
elif force_enable:
Agent.objects.update(maintenance_mode=True)
elif force_disable:
if os.path.exists(fp):
os.remove(fp)
Agent.objects.update(maintenance_mode=False)

View File

@@ -152,9 +152,7 @@ class TestGetEditDeleteReportDataQuery:
@pytest.mark.django_db
class TestQuerySchema:
def test_get_query_schema_in_debug_mode(self, settings, authenticated_client):
# Set DEBUG mode
settings.DEBUG = True
def test_get_query_schema(self, settings, authenticated_client):
expected_data = {"sample": "json"}
@@ -166,19 +164,6 @@ class TestQuerySchema:
assert response.status_code == status.HTTP_200_OK
assert response.json() == expected_data
def test_get_query_schema_in_production_mode(self, settings, authenticated_client):
# Set production mode (DEBUG = False)
settings.DEBUG = False
response = authenticated_client.get("/reporting/queryschema/")
assert response.status_code == status.HTTP_200_OK
# Check that the X-Accel-Redirect header is set correctly
assert (
response["X-Accel-Redirect"]
== "/static/reporting/schemas/query_schema.json"
)
def test_get_query_schema_file_missing(self, settings, authenticated_client):
# Set DEBUG mode
settings.DEBUG = True

View File

@@ -836,15 +836,10 @@ class QuerySchema(APIView):
def get(self, request):
schema_path = "static/reporting/schemas/query_schema.json"
if djangosettings.DEBUG:
try:
with open(djangosettings.BASE_DIR / schema_path, "r") as f:
data = json.load(f)
try:
with open(djangosettings.BASE_DIR / schema_path, "r") as f:
data = json.load(f)
return JsonResponse(data)
except FileNotFoundError:
return notify_error("There was an error getting the file")
else:
response = HttpResponse()
response["X-Accel-Redirect"] = f"/{schema_path}"
return response
return JsonResponse(data)
except FileNotFoundError:
return notify_error("There was an error getting the file")

View File

@@ -1,11 +1,11 @@
asgiref==3.8.1
celery==5.4.0
certifi==2024.8.30
certifi==2025.1.31
cffi==1.17.1
channels==4.1.0
channels_redis==4.2.0
channels==4.2.0
channels_redis==4.2.1
cryptography==43.0.3
Django==4.2.16
Django==4.2.18
django-cors-headers==4.6.0
django-allauth[socialaccount]==65.2.0
django-filter==24.3
@@ -13,13 +13,13 @@ django-rest-knox==4.2.0
djangorestframework==3.15.2
drf-spectacular==0.27.2
hiredis==2.3.2
kombu==5.3.7
kombu==5.4.2
meshctrl==0.1.15
msgpack==1.1.0
nats-py==2.9.0
packaging==24.2
psutil==6.0.0
psycopg[binary]==3.2.3
psutil==6.1.1
psycopg[binary]==3.2.4
pycparser==2.22
pycryptodome==3.21.0
pyotp==2.9.0
@@ -33,7 +33,7 @@ sqlparse==0.5.1
tldextract==5.1.3
twilio==8.13.0
urllib3==2.2.3
uvicorn[standard]==0.31.1
uvicorn[standard]==0.34.0
uWSGI==2.0.28
validators==0.24.0
vine==5.1.0
@@ -41,7 +41,7 @@ websockets==13.1
zipp==3.20.2
pandas==2.2.3
kaleido==0.2.1
jinja2==3.1.4
jinja2==3.1.5
markdown==3.7
plotly==5.24.1
weasyprint==62.3

View File

@@ -23,14 +23,14 @@ MAC_UNINSTALL = BASE_DIR / "core" / "mac_uninstall.sh"
AUTH_USER_MODEL = "accounts.User"
# latest release
TRMM_VERSION = "0.20.0"
TRMM_VERSION = "0.20.1"
# https://github.com/amidaware/tacticalrmm-web
WEB_VERSION = "0.101.50"
WEB_VERSION = "0.101.52"
# bump this version everytime vue code is changed
# to alert user they need to manually refresh their browser
APP_VER = "0.0.196"
APP_VER = "0.0.197"
# https://github.com/amidaware/rmmagent
LATEST_AGENT_VER = "2.8.0"