Skip to content
Open
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
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
strategy:
matrix:
python:
- "3.9"
- "3.13"
- "3.11" # Debian Bookworm
- "3.13" # Debian Trixie

services:
db:
Expand Down
8 changes: 4 additions & 4 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ name = "pypi"
# Like ipaddress but for MACs
netaddr = ">=0.8.0,<1.4.0"
# Debian stretch version
Django = "~=4.2"
Django = "~=5.2"
# postgres lib used by django
psycopg2-binary = "~=2.9"
# Django support for network address fields on PostgreSQL
Expand All @@ -21,7 +21,7 @@ Pillow = "~=10.0"
dateparser = "~=1.1"
# Use Twelve-factor methodology to configure environment variables
django-environ = "<1.0.0"
django_compressor = "~=4.4"
django_compressor = "~=4.6"
# Used for API access - adminapi
paramiko = ">=2.7,<4"
typing-extensions = "*"
Expand All @@ -31,7 +31,7 @@ typing-extensions = "*"
sphinx = "~=7.0"
sphinx-rtd-theme = "~=2.0"
# Provides runserver_plus and other gadgets
django-extensions = "<4.0.0"
django-extensions = "<5.0.0"
# Required for runserver_plus to work
Werkzeug = "<4.0.0"
# Used to package a single executable according to PEP 441
Expand All @@ -44,7 +44,7 @@ faker = "<14.0.0"
tblib = "*"

[requires]
python_version = "3.13"
python_version = ">=3.11,<3.14"

[production]
sentry-sdk = {version = "*", extras = ["django"]}
60 changes: 30 additions & 30 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions serveradmin/api/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Copyright (c) 2019 InnoGames GmbH
"""

from datetime import datetime, timedelta
from datetime import datetime, timedelta, timezone as dt_timezone
from functools import update_wrapper
from logging import getLogger
from base64 import b64decode
Expand Down Expand Up @@ -55,7 +55,7 @@ def _wrapper(request):
token = request.META.get('HTTP_X_SECURITYTOKEN')
then = datetime.utcfromtimestamp(
int(request.META['HTTP_X_TIMESTAMP'])
).replace(tzinfo=timezone.utc)
).replace(tzinfo=dt_timezone.utc)
body_json = json.loads(body) if body else None
status_code = 200

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('serverdb', '0023_attribute_multi_target_servertype'),
]

operations = [
# Drop obsolete indexes. The like one is not required because we do not
# support (fuzzy) search for attribute ids and the other one is
# redundant.
migrations.RunSQL(
sql=[
"DROP INDEX IF EXISTS "
"server_boolean_attribute_attribute_id_b1ad575f;",
"DROP INDEX IF EXISTS "
"server_boolean_attribute_attribute_id_b1ad575f_like;",
],
reverse_sql=[
"CREATE INDEX server_boolean_attribute_attribute_id_b1ad575f "
"ON server_boolean_attribute (attribute_id);",
"CREATE INDEX "
"server_boolean_attribute_attribute_id_b1ad575f_like "
"ON server_boolean_attribute (attribute_id varchar_pattern_ops);",
],
state_operations=[
migrations.AlterField(
model_name='serverbooleanattribute',
name='attribute',
field=models.ForeignKey(
db_index=False,
limit_choices_to={'type': 'boolean'},
on_delete=django.db.models.deletion.CASCADE,
to='serverdb.attribute',
),
),
],
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Generated by Django 5.2.15 on 2026-06-12 14:00

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('serverdb', '0024_alter_serverbooleanattribute_attribute'),
]

operations = [
migrations.RenameIndex(
model_name='serverbooleanattribute',
new_name='server_bool_attribu_25fb6c_idx',
old_fields=('attribute',),
),
migrations.RenameIndex(
model_name='serverdateattribute',
new_name='server_date_attribu_12cbb2_idx',
old_fields=('attribute', 'value'),
),
migrations.RenameIndex(
model_name='serverdatetimeattribute',
new_name='server_date_attribu_f35d26_idx',
old_fields=('attribute', 'value'),
),
migrations.RenameIndex(
model_name='serverinetattribute',
new_name='server_inet_attribu_8feba2_idx',
old_fields=('attribute', 'value'),
),
migrations.RenameIndex(
model_name='servermacaddressattribute',
new_name='server_maca_attribu_1bcfb5_idx',
old_fields=('attribute', 'value'),
),
migrations.RenameIndex(
model_name='servernumberattribute',
new_name='server_numb_attribu_6223e1_idx',
old_fields=('attribute', 'value'),
),
migrations.RenameIndex(
model_name='serverrelationattribute',
new_name='server_rela_attribu_ecf9db_idx',
old_fields=('attribute', 'value'),
),
migrations.RenameIndex(
model_name='serverstringattribute',
new_name='server_stri_attribu_59edc4_idx',
old_fields=('attribute', 'value'),
),
]
17 changes: 9 additions & 8 deletions serveradmin/serverdb/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ class Meta:
app_label = "serverdb"
db_table = "server_string_attribute"
unique_together = [["server", "attribute", "value"]]
index_together = [["attribute", "value"]]
indexes = [models.Index(fields=["attribute", "value"])]

def save_value(self, value):
for char in "'\"":
Expand Down Expand Up @@ -659,7 +659,7 @@ class Meta:
app_label = "serverdb"
db_table = "server_relation_attribute"
unique_together = [["server", "attribute", "value"]]
index_together = [["attribute", "value"]]
indexes = [models.Index(fields=["attribute", "value"])]

def save_value(self, value):
try:
Expand All @@ -682,6 +682,7 @@ def save_value(self, value):
class ServerBooleanAttribute(ServerAttribute):
attribute = models.ForeignKey(
Attribute,
db_index=False,
on_delete=models.CASCADE,
limit_choices_to=dict(type="boolean"),
)
Expand All @@ -690,7 +691,7 @@ class Meta:
app_label = "serverdb"
db_table = "server_boolean_attribute"
unique_together = [["server", "attribute"]]
index_together = [["attribute"]]
indexes = [models.Index(fields=["attribute"])]

def get_value(self):
return True
Expand All @@ -715,7 +716,7 @@ class Meta:
app_label = "serverdb"
db_table = "server_number_attribute"
unique_together = [["server", "attribute", "value"]]
index_together = [["attribute", "value"]]
indexes = [models.Index(fields=["attribute", "value"])]

def get_value(self):
return (
Expand All @@ -738,8 +739,8 @@ class Meta:
app_label = "serverdb"
db_table = "server_inet_attribute"
unique_together = [["server", "attribute", "value"]]
index_together = [["attribute", "value"]]
indexes = [
models.Index(fields=["attribute", "value"]),
GistIndex(fields=["value"], opclasses=["inet_ops"], name="server_inet_attribute_value_idx"),
]

Expand Down Expand Up @@ -798,7 +799,7 @@ class Meta:
app_label = "serverdb"
db_table = "server_macaddr_attribute"
unique_together = [["server", "attribute", "value"]]
index_together = [["attribute", "value"]]
indexes = [models.Index(fields=["attribute", "value"])]


class ServerDateAttribute(ServerAttribute):
Expand All @@ -814,7 +815,7 @@ class Meta:
app_label = "serverdb"
db_table = "server_date_attribute"
unique_together = [["server", "attribute", "value"]]
index_together = [["attribute", "value"]]
indexes = [models.Index(fields=["attribute", "value"])]


class ServerDateTimeAttribute(ServerAttribute):
Expand All @@ -830,7 +831,7 @@ class Meta:
app_label = "serverdb"
db_table = "server_datetime_attribute"
unique_together = [["server", "attribute", "value"]]
index_together = [["attribute", "value"]]
indexes = [models.Index(fields=["attribute", "value"])]


class ChangeCommit(models.Model):
Expand Down
4 changes: 0 additions & 4 deletions serveradmin/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,6 @@
# to load the internationalization machinery.
USE_I18N = False

# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale.
USE_L10N = False

# If you set this to False, Django will not use timezone-aware datetimes.
USE_TZ = True

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
'paramiko>=2.7,<4',
'netaddr>=0.8.0,<1.4.0',
],
python_requires=">=3.9,<3.14",
python_requires=">=3.11,<3.14",
author='InnoGames System Administration',
author_email='it@innogames.com',
)
Loading