simo 3.1.0__py3-none-any.whl → 3.1.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of simo might be problematic. Click here for more details.
- simo/core/api.py +2 -0
- simo/core/db_backend/base.py +8 -10
- simo/core/management/_hub_template/hub/supervisor.conf +5 -0
- simo/core/management/commands/on_http_start.py +1 -1
- simo/core/management/commands/run_app_mqtt_control.py +1 -0
- simo/core/management/commands/run_app_mqtt_fanout.py +1 -0
- simo/settings.py +8 -0
- simo/users/serializers.py +4 -1
- simo/users/templates/conf/mosquitto.conf +10 -1
- {simo-3.1.0.dist-info → simo-3.1.3.dist-info}/METADATA +1 -1
- {simo-3.1.0.dist-info → simo-3.1.3.dist-info}/RECORD +15 -15
- {simo-3.1.0.dist-info → simo-3.1.3.dist-info}/WHEEL +0 -0
- {simo-3.1.0.dist-info → simo-3.1.3.dist-info}/entry_points.txt +0 -0
- {simo-3.1.0.dist-info → simo-3.1.3.dist-info}/licenses/LICENSE.md +0 -0
- {simo-3.1.0.dist-info → simo-3.1.3.dist-info}/top_level.txt +0 -0
simo/core/api.py
CHANGED
|
@@ -7,6 +7,7 @@ from django.utils.translation import gettext_lazy as _
|
|
|
7
7
|
from django.utils import timezone
|
|
8
8
|
from django.http import HttpResponse, Http404
|
|
9
9
|
from simo.core.utils.helpers import get_self_ip, search_queryset
|
|
10
|
+
from simo.core.middleware import introduce_instance
|
|
10
11
|
from rest_framework import status
|
|
11
12
|
from actstream.models import Action
|
|
12
13
|
from rest_framework.pagination import PageNumberPagination
|
|
@@ -41,6 +42,7 @@ class InstanceMixin:
|
|
|
41
42
|
).last()
|
|
42
43
|
if not self.instance:
|
|
43
44
|
raise Http404()
|
|
45
|
+
introduce_instance(self.instance)
|
|
44
46
|
return super().dispatch(request, *args, **kwargs)
|
|
45
47
|
|
|
46
48
|
def get_serializer_context(self):
|
simo/core/db_backend/base.py
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
|
-
import random, time
|
|
2
1
|
from django.contrib.gis.db.backends.postgis.base import (
|
|
3
2
|
DatabaseWrapper as PostGisPsycopg2DatabaseWrapper
|
|
4
3
|
)
|
|
5
|
-
from django.db import
|
|
4
|
+
from django.db.utils import OperationalError, InterfaceError
|
|
6
5
|
from django.utils.asyncio import async_unsafe
|
|
7
|
-
from django.db.utils import InterfaceError
|
|
8
|
-
from django.conf import settings
|
|
9
6
|
|
|
10
7
|
|
|
11
8
|
class DatabaseWrapper(PostGisPsycopg2DatabaseWrapper):
|
|
12
|
-
|
|
13
9
|
@async_unsafe
|
|
14
10
|
def create_cursor(self, name=None):
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
try:
|
|
12
|
+
return super().create_cursor(name=name)
|
|
13
|
+
except (InterfaceError, OperationalError):
|
|
14
|
+
# Heal this very connection
|
|
15
|
+
self.close()
|
|
16
|
+
self.connect()
|
|
17
|
+
return super().create_cursor(name=name)
|
|
20
18
|
|
|
21
19
|
|
|
@@ -12,6 +12,7 @@ autostart=true
|
|
|
12
12
|
autorestart=false
|
|
13
13
|
stopwaitsecs=15
|
|
14
14
|
killasgroup=true
|
|
15
|
+
environment=PYTHONUNBUFFERED=1
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
# using gunicorn for regular requests
|
|
@@ -60,6 +61,7 @@ autostart=true
|
|
|
60
61
|
autorestart=true
|
|
61
62
|
stopwaitsecs=15
|
|
62
63
|
killasgroup=true
|
|
64
|
+
environment=PYTHONUNBUFFERED=1
|
|
63
65
|
|
|
64
66
|
|
|
65
67
|
[program:simo-gateways]
|
|
@@ -76,6 +78,7 @@ autorestart=true
|
|
|
76
78
|
stopwaitsecs=15
|
|
77
79
|
killasgroup=true
|
|
78
80
|
stopsignal=INT
|
|
81
|
+
environment=PYTHONUNBUFFERED=1
|
|
79
82
|
|
|
80
83
|
|
|
81
84
|
[program:simo-app-mqtt]
|
|
@@ -92,6 +95,7 @@ autorestart=true
|
|
|
92
95
|
stopwaitsecs=15
|
|
93
96
|
killasgroup=true
|
|
94
97
|
stopsignal=INT
|
|
98
|
+
environment=PYTHONUNBUFFERED=1
|
|
95
99
|
|
|
96
100
|
[program:simo-app-mqtt-fanout]
|
|
97
101
|
directory={{ project_dir }}/hub/
|
|
@@ -107,6 +111,7 @@ autorestart=true
|
|
|
107
111
|
stopwaitsecs=15
|
|
108
112
|
killasgroup=true
|
|
109
113
|
stopsignal=INT
|
|
114
|
+
environment=PYTHONUNBUFFERED=1
|
|
110
115
|
|
|
111
116
|
|
|
112
117
|
[program:simo-celery-beat]
|
|
@@ -37,6 +37,7 @@ class Command(BaseCommand):
|
|
|
37
37
|
|
|
38
38
|
def on_message(self, client, userdata, msg):
|
|
39
39
|
try:
|
|
40
|
+
print("Control: ", msg.topic)
|
|
40
41
|
parts = msg.topic.split('/')
|
|
41
42
|
# SIMO/user/<user-id>/control/<instance-uid>/Component/<component-id>
|
|
42
43
|
if len(parts) < 7 or parts[0] != 'SIMO' or parts[1] != 'user' or parts[3] != 'control':
|
|
@@ -36,6 +36,7 @@ class Command(BaseCommand):
|
|
|
36
36
|
|
|
37
37
|
def on_message(self, client, userdata, msg):
|
|
38
38
|
try:
|
|
39
|
+
print("Fanout: ", msg.topic)
|
|
39
40
|
topic_parts = msg.topic.split('/')
|
|
40
41
|
# SIMO/obj-state/<instance-uid>/<Model>/<id>
|
|
41
42
|
if len(topic_parts) < 5 or topic_parts[0] != 'SIMO' or topic_parts[1] != 'obj-state':
|
simo/settings.py
CHANGED
|
@@ -133,6 +133,14 @@ DATABASES = {
|
|
|
133
133
|
'ENGINE': 'simo.core.db_backend',
|
|
134
134
|
'NAME': 'SIMO',
|
|
135
135
|
'ATOMIC_REQUESTS': False,
|
|
136
|
+
'CONN_HEALTH_CHECKS': True,
|
|
137
|
+
'CONN_MAX_AGE': 300,
|
|
138
|
+
'OPTIONS': {
|
|
139
|
+
"keepalives": 1,
|
|
140
|
+
"keepalives_idle": 30,
|
|
141
|
+
"keepalives_interval": 10,
|
|
142
|
+
"keepalives_count": 3,
|
|
143
|
+
}
|
|
136
144
|
}
|
|
137
145
|
}
|
|
138
146
|
|
simo/users/serializers.py
CHANGED
|
@@ -32,7 +32,10 @@ class UserSerializer(serializers.ModelSerializer):
|
|
|
32
32
|
iu = InstanceUser.objects.filter(
|
|
33
33
|
user=obj, instance=get_current_instance()
|
|
34
34
|
).first()
|
|
35
|
-
|
|
35
|
+
try:
|
|
36
|
+
return iu.is_active
|
|
37
|
+
except:
|
|
38
|
+
return False
|
|
36
39
|
|
|
37
40
|
def get_avatar(self, obj):
|
|
38
41
|
if not obj.avatar:
|
|
@@ -3,4 +3,13 @@ allow_anonymous false
|
|
|
3
3
|
# ....which are stored in the following file
|
|
4
4
|
password_file /etc/mosquitto/mosquitto_users
|
|
5
5
|
|
|
6
|
-
acl_file /etc/mosquitto/acls.conf
|
|
6
|
+
acl_file /etc/mosquitto/acls.conf
|
|
7
|
+
|
|
8
|
+
# Ensure WebSocket listener for /mqtt/ via Nginx
|
|
9
|
+
listener 8083 127.0.0.1
|
|
10
|
+
protocol websockets
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# Ensure local TCP listener for internal services
|
|
14
|
+
listener 1883 127.0.0.1
|
|
15
|
+
|
|
@@ -2,7 +2,7 @@ simo/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
|
2
2
|
simo/asgi.py,sha256=J0Xmxbi26_EWRTOn36ada6YMX7Pjp_ngMRrcdPUEFes,1839
|
|
3
3
|
simo/celeryc.py,sha256=eab7_e9rw0c__DCeoUFUh_tjAGVlulxVrk75BaJf57Q,1512
|
|
4
4
|
simo/conf.py,sha256=H2BhXAV8MEDVXF8AbkaLSfR4ULd-9_bS4bnhE5sE5fg,112
|
|
5
|
-
simo/settings.py,sha256=
|
|
5
|
+
simo/settings.py,sha256=V5m3CWeCSAJPrGhQVo0AF5RFTMvB8j4YwPEA9sv-PqA,7324
|
|
6
6
|
simo/urls.py,sha256=AwTvBi1NE1j-MIUIsrHtlDXo34HRU4__ASwIedzBjPU,2535
|
|
7
7
|
simo/__pycache__/__init__.cpython-312.pyc,sha256=EAVr4EWzl4QAeIboNWdHmEaFudefMrqjEq6IRDYtkGs,117
|
|
8
8
|
simo/__pycache__/__init__.cpython-38.pyc,sha256=j81de0BqHMr6bs0C7cuYrXl7HwtK_vv8hDEtAdSwDJc,153
|
|
@@ -93,7 +93,7 @@ simo/backups/migrations/__pycache__/__init__.cpython-312.pyc,sha256=gxhvSSUK92Z7
|
|
|
93
93
|
simo/backups/migrations/__pycache__/__init__.cpython-38.pyc,sha256=Lz1fs6V05h2AoxTOLNye0do9bEMnyuaXB_hHOjG5-HU,172
|
|
94
94
|
simo/core/__init__.py,sha256=_s2TjJfQImsMrTIxqLAx9AZie1Ojmm6sCHASdl3WLGU,50
|
|
95
95
|
simo/core/admin.py,sha256=blhsDujAQZ5UAbwhmatKvYiAns9fOzRPL2LyOTHaUBw,18880
|
|
96
|
-
simo/core/api.py,sha256=
|
|
96
|
+
simo/core/api.py,sha256=kr6eb2D70GlHvEJGkvadAs1ZCh8zJS_mjd2N9dnZdsA,29997
|
|
97
97
|
simo/core/api_auth.py,sha256=I9bALko_L7M2dodUkVLRHPctdwR-KPbyZ-r1HygDyEU,1229
|
|
98
98
|
simo/core/api_meta.py,sha256=Y-kq5lLwjymARnKOx0jHCS4OOH9PhyWNwIUxLUJMny8,5350
|
|
99
99
|
simo/core/app_widgets.py,sha256=VxZzapuc-a29wBH7JzpvNF2SK1ECrgNUySId5ke1ffc,2509
|
|
@@ -191,7 +191,7 @@ simo/core/__pycache__/views.cpython-38.pyc,sha256=kYKvEcyKicdkTcN0iEJ4pT101-KHiZ
|
|
|
191
191
|
simo/core/__pycache__/widgets.cpython-312.pyc,sha256=f_AiYFfA7Wl4Wm9FqUOlluSGLAN_nkLyDUsKpkScsXg,4447
|
|
192
192
|
simo/core/__pycache__/widgets.cpython-38.pyc,sha256=sR0ZeHCHrhnNDBJuRrxp3zUsfBp0xrtF0xrK2TkQv1o,3520
|
|
193
193
|
simo/core/db_backend/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
194
|
-
simo/core/db_backend/base.py,sha256=
|
|
194
|
+
simo/core/db_backend/base.py,sha256=4vl0Nx8PcBG5C8QQpAQPFu-TKH8Hs6R5OmzJqIiLibQ,598
|
|
195
195
|
simo/core/db_backend/__pycache__/__init__.cpython-312.pyc,sha256=Brq4UBCggJrt590OFV3VmgARJYRK902FnnFFFK_Azng,133
|
|
196
196
|
simo/core/db_backend/__pycache__/__init__.cpython-38.pyc,sha256=sxC6PmFqnwe6RRKzSR7QtUFzRc_aRRR1fffsR3TPLRc,169
|
|
197
197
|
simo/core/db_backend/__pycache__/base.cpython-312.pyc,sha256=ykKrTOC28v2cl0C--bqeLEaydHS5CG1RFGL0lon53HU,1135
|
|
@@ -286,7 +286,7 @@ simo/core/management/_hub_template/hub/celeryc.py,sha256=3ksDXftIZKJ4Cq9WNKJERdZ
|
|
|
286
286
|
simo/core/management/_hub_template/hub/manage.py,sha256=PNNlw3EVeIJDgkG0l-klqoxsKWfTYWG9jzRG0upmAaI,620
|
|
287
287
|
simo/core/management/_hub_template/hub/nginx.conf,sha256=_-ch60oQYXMWmcvYUEbxMvXq9S46exwKmiBaVrxkQ3c,2339
|
|
288
288
|
simo/core/management/_hub_template/hub/settings.py,sha256=4QhvhbtLRxHvAntwqG_qeAAtpDUqKvN4jzw9u3vqff8,361
|
|
289
|
-
simo/core/management/_hub_template/hub/supervisor.conf,sha256=
|
|
289
|
+
simo/core/management/_hub_template/hub/supervisor.conf,sha256=dWgBeLucl355Lw0MmM7HXVl7ZUBT-Mb8LwRyEjn2QOo,3647
|
|
290
290
|
simo/core/management/_hub_template/hub/urls.py,sha256=Ydm-1BkYAzWeEF-MKSDIFf-7aE4qNLPm48-SA51XgJQ,25
|
|
291
291
|
simo/core/management/_hub_template/hub/wsgi.py,sha256=Lo-huLHnMDTxSmMBOodVFMWBls9poddrV2KRzXU0xGo,280
|
|
292
292
|
simo/core/management/_hub_template/hub/__pycache__/asgi.cpython-312.pyc,sha256=FVjb5whNF2mVopSz71s0Zms8d_b90_4smf84OWWkzDI,396
|
|
@@ -297,10 +297,10 @@ simo/core/management/_hub_template/hub/__pycache__/urls.cpython-312.pyc,sha256=d
|
|
|
297
297
|
simo/core/management/_hub_template/hub/__pycache__/wsgi.cpython-312.pyc,sha256=oA9duba-bsc_OOQnUaz_qiaB-0OcsS5dfjSVHTscrUM,529
|
|
298
298
|
simo/core/management/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
299
299
|
simo/core/management/commands/gateways_manager.py,sha256=oHzgC-eV4w_KHkiz6eCAlt3XMIwtS8_7mHDQ4UsU5y0,6967
|
|
300
|
-
simo/core/management/commands/on_http_start.py,sha256=
|
|
300
|
+
simo/core/management/commands/on_http_start.py,sha256=kxtWB3lOSyQA8tVmZRmLmaoVsliy5mhZp9_wwCvkj_A,6279
|
|
301
301
|
simo/core/management/commands/republish_mqtt_state.py,sha256=mc8e7qnhDyC9_fiYr6d0g2s_3wGUXCrLo95-HBIrkOA,2248
|
|
302
|
-
simo/core/management/commands/run_app_mqtt_control.py,sha256=
|
|
303
|
-
simo/core/management/commands/run_app_mqtt_fanout.py,sha256=
|
|
302
|
+
simo/core/management/commands/run_app_mqtt_control.py,sha256=oB0KbwDD_a08qwxo9jvKJJnCblzbrARr9xiQ6d54Hdc,4862
|
|
303
|
+
simo/core/management/commands/run_app_mqtt_fanout.py,sha256=JHlRXDDsRYf72XzhV8uHcTh0-HlKYpk8f1uCw9hsHac,3861
|
|
304
304
|
simo/core/management/commands/run_gateway.py,sha256=bp0FQQoBeOSoxjHCCMicDL1fxPZZGyLgnq2QKht3bJo,645
|
|
305
305
|
simo/core/management/commands/__pycache__/__init__.cpython-312.pyc,sha256=2Rw8IQ8vlr-wLXgjtc9zACkDD_SWZCxDlbrXw5vfI6o,142
|
|
306
306
|
simo/core/management/commands/__pycache__/__init__.cpython-38.pyc,sha256=WKpfZZpAB9D7U4X6oWQIrU_H-6rUmq8Gl9fj9XaY2fw,178
|
|
@@ -10850,7 +10850,7 @@ simo/users/managers.py,sha256=OHgEP85MBtdkdYxdstBd8RavTBT8F_2WyDxUJ9aCqqM,246
|
|
|
10850
10850
|
simo/users/middleware.py,sha256=tNPmnzo0eTrJ25SLHP7NotqYKI2cKnmv8hf6v5DLOWo,427
|
|
10851
10851
|
simo/users/models.py,sha256=hEspAbqpbIYfQ4IiXnYtl96waILuuqlfTg4p44rBUTY,25355
|
|
10852
10852
|
simo/users/permissions.py,sha256=IwtYS8yQdupWbYKR9VimSRDV3qCJ2jXP57Lyjpb2EQM,242
|
|
10853
|
-
simo/users/serializers.py,sha256=
|
|
10853
|
+
simo/users/serializers.py,sha256=zhotOlezhU43A2QeJCju-SqFrgGUDFF21u8WQclQGXI,2668
|
|
10854
10854
|
simo/users/sso_urls.py,sha256=gQOaPvGMYFD0NCVSwyoWO-mTEHe5j9sbzV_RK7kdvp0,251
|
|
10855
10855
|
simo/users/sso_views.py,sha256=qHjiw3Ru-hWZRJAcLJa46DrQuDORl5ZKUHgRwmN3XlE,4335
|
|
10856
10856
|
simo/users/tasks.py,sha256=FhbczWFHRFI6To4xqkx4gUX4p0vCwwTT297GWBPAoIg,1162
|
|
@@ -11026,7 +11026,7 @@ simo/users/migrations/__pycache__/0043_userdevicereportlog_avg_speed_kmh.cpython
|
|
|
11026
11026
|
simo/users/migrations/__pycache__/0044_permissionsrole_is_person.cpython-312.pyc,sha256=ONWJu9MdXkOPlq1exNumEf1iEnCbvIsEul1EW2WMVgA,832
|
|
11027
11027
|
simo/users/migrations/__pycache__/__init__.cpython-312.pyc,sha256=i3P6nr4OxZF7ZodnxhMfQ4jecJ7O0gsEAnUPiAEtNZ0,134
|
|
11028
11028
|
simo/users/migrations/__pycache__/__init__.cpython-38.pyc,sha256=NKq7WLgktK8WV1oOqCPbAbdkrPV5GRGhYx4VxxI4dcs,170
|
|
11029
|
-
simo/users/templates/conf/mosquitto.conf,sha256=
|
|
11029
|
+
simo/users/templates/conf/mosquitto.conf,sha256=Df0-4luyyU5b_WW2XJd0SzDYUccNVvWjKqjoTwEfXc0,361
|
|
11030
11030
|
simo/users/templates/conf/mosquitto_acls.conf,sha256=e_2GN-5stuOO2QgFmELUCdHzZEF4pd2M7YGTTGpVQYo,369
|
|
11031
11031
|
simo/users/templates/invitations/authenticated_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11032
11032
|
simo/users/templates/invitations/authenticated_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -11034,9 +11034,9 @@ simo/users/templates/invitations/expired_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCe
|
|
|
11034
11034
|
simo/users/templates/invitations/expired_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11035
11035
|
simo/users/templates/invitations/taken_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11036
11036
|
simo/users/templates/invitations/taken_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11037
|
-
simo-3.1.
|
|
11038
|
-
simo-3.1.
|
|
11039
|
-
simo-3.1.
|
|
11040
|
-
simo-3.1.
|
|
11041
|
-
simo-3.1.
|
|
11042
|
-
simo-3.1.
|
|
11037
|
+
simo-3.1.3.dist-info/licenses/LICENSE.md,sha256=M7wm1EmMGDtwPRdg7kW4d00h1uAXjKOT3HFScYQMeiE,34916
|
|
11038
|
+
simo-3.1.3.dist-info/METADATA,sha256=B7aSWj9iQ9HzHfD0b3mnLVPsfKtqGrpkkSHnTH8i-VM,2224
|
|
11039
|
+
simo-3.1.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
11040
|
+
simo-3.1.3.dist-info/entry_points.txt,sha256=S9PwnUYmTSW7681GKDCxUbL0leRJIaRk6fDQIKgbZBA,135
|
|
11041
|
+
simo-3.1.3.dist-info/top_level.txt,sha256=GmS1hrAbpVqn9OWZh6UX82eIOdRLgYA82RG9fe8v4Rs,5
|
|
11042
|
+
simo-3.1.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|