simo 2.1.2__py3-none-any.whl → 2.1.4__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/__pycache__/tasks.cpython-38.pyc +0 -0
- simo/core/tasks.py +9 -2
- simo/management/__pycache__/on_http_start.cpython-38.pyc +0 -0
- simo/management/install.py +40 -11
- simo/management/on_http_start.py +5 -0
- {simo-2.1.2.dist-info → simo-2.1.4.dist-info}/METADATA +1 -1
- {simo-2.1.2.dist-info → simo-2.1.4.dist-info}/RECORD +11 -11
- simo-2.1.4.dist-info/entry_points.txt +2 -0
- simo-2.1.2.dist-info/entry_points.txt +0 -2
- {simo-2.1.2.dist-info → simo-2.1.4.dist-info}/LICENSE.md +0 -0
- {simo-2.1.2.dist-info → simo-2.1.4.dist-info}/WHEEL +0 -0
- {simo-2.1.2.dist-info → simo-2.1.4.dist-info}/top_level.txt +0 -0
|
Binary file
|
simo/core/tasks.py
CHANGED
|
@@ -9,6 +9,7 @@ import threading
|
|
|
9
9
|
import pkg_resources
|
|
10
10
|
import sys
|
|
11
11
|
import traceback
|
|
12
|
+
import uuid
|
|
12
13
|
from django.db.models import Q
|
|
13
14
|
from django.db import connection, transaction
|
|
14
15
|
from django.template.loader import render_to_string
|
|
@@ -102,9 +103,15 @@ def save_config(data):
|
|
|
102
103
|
def sync_with_remote():
|
|
103
104
|
from simo.users.models import User
|
|
104
105
|
|
|
106
|
+
try:
|
|
107
|
+
mac = str(hex(uuid.getnode()))
|
|
108
|
+
except:
|
|
109
|
+
mac = ''
|
|
110
|
+
|
|
105
111
|
report_data = {
|
|
106
112
|
'simo_version': pkg_resources.get_distribution('simo').version,
|
|
107
113
|
'local_http': 'https://%s' % get_self_ip(),
|
|
114
|
+
'mac': mac,
|
|
108
115
|
'hub_uid': dynamic_settings['core__hub_uid'],
|
|
109
116
|
'hub_secret': dynamic_settings['core__hub_secret'],
|
|
110
117
|
'remote_conn_version': dynamic_settings['core__remote_conn_version'],
|
|
@@ -321,7 +328,7 @@ def vacuum_full():
|
|
|
321
328
|
|
|
322
329
|
@celery_app.task
|
|
323
330
|
def update():
|
|
324
|
-
from simo.auto_update import perform_update
|
|
331
|
+
from simo.management.auto_update import perform_update
|
|
325
332
|
perform_update()
|
|
326
333
|
|
|
327
334
|
|
|
@@ -397,7 +404,7 @@ def setup_periodic_tasks(sender, **kwargs):
|
|
|
397
404
|
sender.add_periodic_task(1, watch_timers.s())
|
|
398
405
|
sender.add_periodic_task(20, sync_with_remote.s())
|
|
399
406
|
sender.add_periodic_task(60 * 60, clear_history.s())
|
|
400
|
-
sender.add_periodic_task(60 * 60
|
|
407
|
+
sender.add_periodic_task(60 * 60, update_latest_version_available.s())
|
|
401
408
|
sender.add_periodic_task(60, drop_fingerprints_learn.s())
|
|
402
409
|
sender.add_periodic_task(60 * 60 * 24, restart_postgresql.s())
|
|
403
410
|
sender.add_periodic_task(60 * 60, low_battery_notifications.s())
|
|
Binary file
|
simo/management/install.py
CHANGED
|
@@ -86,6 +86,7 @@ def copy_template(to_directory='/etc/SIMO'):
|
|
|
86
86
|
def install():
|
|
87
87
|
simo_directory = '/etc/SIMO'
|
|
88
88
|
installed_flag_file_path = os.path.join(simo_directory, 'is_installed.json')
|
|
89
|
+
HUB_DIR = os.path.join(simo_directory, 'hub')
|
|
89
90
|
|
|
90
91
|
if os.path.exists(installed_flag_file_path):
|
|
91
92
|
print("SIMO.io hub is already installed. ")
|
|
@@ -115,21 +116,50 @@ def install():
|
|
|
115
116
|
step += 1
|
|
116
117
|
print(f"{step}.___________Copy default template__________________")
|
|
117
118
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
119
|
+
shutil.rmtree(simo_directory, ignore_errors=True)
|
|
120
|
+
try:
|
|
121
|
+
copy_template(simo_directory)
|
|
122
|
+
except Exception as e:
|
|
123
|
+
print(traceback.format_exc(), file=sys.stderr)
|
|
124
|
+
shutil.rmtree(simo_directory, ignore_errors=True)
|
|
125
|
+
return
|
|
126
|
+
|
|
127
|
+
step += 1
|
|
128
|
+
print(f"{step}.___________Create database__________________")
|
|
129
|
+
subprocess.call(
|
|
130
|
+
'sudo -u postgres createuser -s -i -d -r -l -w root',
|
|
131
|
+
shell=True
|
|
132
|
+
)
|
|
133
|
+
subprocess.call('createdb SIMO', shell=True)
|
|
134
|
+
|
|
135
|
+
step += 1
|
|
136
|
+
print(f"{step}.___________Apply migrations__________________")
|
|
137
|
+
|
|
138
|
+
proc = subprocess.Popen(
|
|
139
|
+
[os.path.join(HUB_DIR, 'manage.py'), 'migrate'],
|
|
140
|
+
cwd=HUB_DIR,
|
|
141
|
+
stderr=subprocess.PIPE
|
|
142
|
+
)
|
|
143
|
+
out, err = proc.communicate()
|
|
144
|
+
if proc.returncode:
|
|
145
|
+
raise Exception(err.decode())
|
|
146
|
+
|
|
147
|
+
step += 1
|
|
148
|
+
print(f"{step}.___________Collect statics__________________")
|
|
149
|
+
proc = subprocess.Popen(
|
|
150
|
+
[os.path.join(HUB_DIR, 'manage.py'), 'collectstatic',
|
|
151
|
+
'--noinput'],
|
|
152
|
+
cwd=HUB_DIR, stderr=subprocess.PIPE
|
|
153
|
+
)
|
|
154
|
+
out, err = proc.communicate()
|
|
155
|
+
if proc.returncode:
|
|
156
|
+
raise Exception(err.decode())
|
|
127
157
|
|
|
128
158
|
step += 1
|
|
129
159
|
print(f"{step}.___________Configure supervisor__________________")
|
|
130
160
|
|
|
131
161
|
try:
|
|
132
|
-
os.remove('/etc/supervisor/conf.d/SIMO.conf'
|
|
162
|
+
os.remove('/etc/supervisor/conf.d/SIMO.conf')
|
|
133
163
|
except:
|
|
134
164
|
pass
|
|
135
165
|
os.symlink(
|
|
@@ -141,7 +171,6 @@ def install():
|
|
|
141
171
|
sys.exit("INSTALLATION FAILED! Unable to start supervisord")
|
|
142
172
|
|
|
143
173
|
|
|
144
|
-
|
|
145
174
|
step += 1
|
|
146
175
|
print("%d._____________ Configure NGINX _________________________" % step)
|
|
147
176
|
|
simo/management/on_http_start.py
CHANGED
|
@@ -68,6 +68,11 @@ def update_auto_update():
|
|
|
68
68
|
executable_path = '/usr/local/bin/simo-auto-update'
|
|
69
69
|
if os.geteuid() == 0:
|
|
70
70
|
# We are running as root!
|
|
71
|
+
if os.path.exists(executable_path):
|
|
72
|
+
# refresh the link if it already exists
|
|
73
|
+
os.remove(executable_path)
|
|
74
|
+
os.symlink(auto_update_file_path, executable_path)
|
|
75
|
+
|
|
71
76
|
if not os.path.islink(executable_path):
|
|
72
77
|
# There is no symbolic link yet made for auto updates.
|
|
73
78
|
# Let's make it!
|
|
@@ -40,7 +40,7 @@ simo/core/serializers.py,sha256=M3r2P1-Eb5eObOqcI9dttedh4UxgPwWwGYmOfXe3BDk,2030
|
|
|
40
40
|
simo/core/signal_receivers.py,sha256=ZhHg1mLn_Yhin-23Af1WNPfE5hnGYhhVDZDTEjRtO-A,6190
|
|
41
41
|
simo/core/socket_consumers.py,sha256=n7VE2Fvqt4iEAYLTRbTPOcI-7tszMAADu7gimBxB-Fg,9635
|
|
42
42
|
simo/core/storage.py,sha256=YlxmdRs-zhShWtFKgpJ0qp2NDBuIkJGYC1OJzqkbttQ,572
|
|
43
|
-
simo/core/tasks.py,sha256=
|
|
43
|
+
simo/core/tasks.py,sha256=VTr83_8avke6UwFZ9VQ8c2qROpVOqAWqc0RbMxNPd08,14005
|
|
44
44
|
simo/core/todos.py,sha256=eYVXfLGiapkxKK57XuviSNe3WsUYyIWZ0hgQJk7ThKo,665
|
|
45
45
|
simo/core/types.py,sha256=WJEq48mIbFi_5Alt4wxWMGXxNxUTXqfQU5koH7wqHHI,1108
|
|
46
46
|
simo/core/views.py,sha256=ze8yX0PBLN-DH8B8jol6NKj0hLOAE4WA1rTXf07G-MU,2129
|
|
@@ -73,7 +73,7 @@ simo/core/__pycache__/serializers.cpython-38.pyc,sha256=ibatzlaahJ0keKpml7JWuPsr
|
|
|
73
73
|
simo/core/__pycache__/signal_receivers.cpython-38.pyc,sha256=gKwUVUf1vtIo1Ecvm6xGmBSwpEUALHrXai5pkMmjr9I,4895
|
|
74
74
|
simo/core/__pycache__/socket_consumers.cpython-38.pyc,sha256=NJUr7nRyHFvmAumxxWpsod5wzVVZM99rCEuJs1utHA4,8432
|
|
75
75
|
simo/core/__pycache__/storage.cpython-38.pyc,sha256=BTkYH8QQyjqI0WOtJC8fHNtgu0YA1vjqZclXjC2vCVI,1116
|
|
76
|
-
simo/core/__pycache__/tasks.cpython-38.pyc,sha256=
|
|
76
|
+
simo/core/__pycache__/tasks.cpython-38.pyc,sha256=maImi7pqoVNvKNESi4xY_WdTOJdjDgP11knfXKKuVcI,9902
|
|
77
77
|
simo/core/__pycache__/todos.cpython-38.pyc,sha256=lOqGZ58siHM3isoJV4r7sg8igrfE9fFd-jSfeBa0AQI,253
|
|
78
78
|
simo/core/__pycache__/views.cpython-38.pyc,sha256=ULyoiWRiU_auXTuxzi2RyqYIea9VfaiMuTzkMAWaWOA,2343
|
|
79
79
|
simo/core/__pycache__/widgets.cpython-38.pyc,sha256=sR0ZeHCHrhnNDBJuRrxp3zUsfBp0xrtF0xrK2TkQv1o,3520
|
|
@@ -10337,10 +10337,10 @@ simo/generic/templates/generic/controllers_info/stateselect.md,sha256=T0w3vJg02W
|
|
|
10337
10337
|
simo/management/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10338
10338
|
simo/management/auto_update.py,sha256=4MDrJHdtC5LxEJM258Y0kc5yI4yloeKhDjh-S2BN-ZQ,2115
|
|
10339
10339
|
simo/management/copy_template.py,sha256=Iehq57FYMzdHNp3LU4ue6rr6AkRiGeOthG7PoGWd88Q,2002
|
|
10340
|
-
simo/management/install.py,sha256=
|
|
10341
|
-
simo/management/on_http_start.py,sha256=
|
|
10340
|
+
simo/management/install.py,sha256=IwSeullwXxATsL4cpLNmOgmVJASwLehopohp9Ua-064,9640
|
|
10341
|
+
simo/management/on_http_start.py,sha256=ZDotfMQaCjksD5FFf3eZYgJS-gd_-7eZhYTHLaD-448,3312
|
|
10342
10342
|
simo/management/__pycache__/__init__.cpython-38.pyc,sha256=ey9k5mPsmvAHRVf5Du6QUqy40LgBCAPN_B5EaR6h9Eg,164
|
|
10343
|
-
simo/management/__pycache__/on_http_start.cpython-38.pyc,sha256=
|
|
10343
|
+
simo/management/__pycache__/on_http_start.cpython-38.pyc,sha256=ERfcMNz3QnqDJTJ4PwbmDfLgPCh5hrEcaedejARFkUQ,2864
|
|
10344
10344
|
simo/management/_hub_template/hub/asgi.py,sha256=ElN_fdeSkf0Ysa7pS9rJVmZ1HmLhFxb8jFaMLqe1220,126
|
|
10345
10345
|
simo/management/_hub_template/hub/celeryc.py,sha256=3ksDXftIZKJ4Cq9WNKJERdZdQlDEnjTQXycweRFmsSQ,27
|
|
10346
10346
|
simo/management/_hub_template/hub/manage.py,sha256=PNNlw3EVeIJDgkG0l-klqoxsKWfTYWG9jzRG0upmAaI,620
|
|
@@ -10494,9 +10494,9 @@ simo/users/templates/invitations/expired_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCe
|
|
|
10494
10494
|
simo/users/templates/invitations/expired_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10495
10495
|
simo/users/templates/invitations/taken_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10496
10496
|
simo/users/templates/invitations/taken_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10497
|
-
simo-2.1.
|
|
10498
|
-
simo-2.1.
|
|
10499
|
-
simo-2.1.
|
|
10500
|
-
simo-2.1.
|
|
10501
|
-
simo-2.1.
|
|
10502
|
-
simo-2.1.
|
|
10497
|
+
simo-2.1.4.dist-info/LICENSE.md,sha256=M7wm1EmMGDtwPRdg7kW4d00h1uAXjKOT3HFScYQMeiE,34916
|
|
10498
|
+
simo-2.1.4.dist-info/METADATA,sha256=BV3GcDw-Fy6Wx4aVwZIwJ6vS_Qwea0cVZbGor3xjYiE,1817
|
|
10499
|
+
simo-2.1.4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
10500
|
+
simo-2.1.4.dist-info/entry_points.txt,sha256=SJBxiDpH7noO0STxVI_eRIsGR-nLgdXXeqCDe8cXlbM,65
|
|
10501
|
+
simo-2.1.4.dist-info/top_level.txt,sha256=GmS1hrAbpVqn9OWZh6UX82eIOdRLgYA82RG9fe8v4Rs,5
|
|
10502
|
+
simo-2.1.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|