arthexis 0.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 arthexis might be problematic. Click here for more details.
- arthexis-0.1.3.dist-info/METADATA +126 -0
- arthexis-0.1.3.dist-info/RECORD +73 -0
- arthexis-0.1.3.dist-info/WHEEL +5 -0
- arthexis-0.1.3.dist-info/licenses/LICENSE +21 -0
- arthexis-0.1.3.dist-info/top_level.txt +5 -0
- config/__init__.py +6 -0
- config/active_app.py +15 -0
- config/asgi.py +29 -0
- config/auth_app.py +8 -0
- config/celery.py +19 -0
- config/context_processors.py +68 -0
- config/loadenv.py +11 -0
- config/logging.py +43 -0
- config/middleware.py +25 -0
- config/offline.py +47 -0
- config/settings.py +374 -0
- config/urls.py +91 -0
- config/wsgi.py +17 -0
- core/__init__.py +0 -0
- core/admin.py +830 -0
- core/apps.py +67 -0
- core/backends.py +82 -0
- core/entity.py +97 -0
- core/environment.py +43 -0
- core/fields.py +70 -0
- core/lcd_screen.py +77 -0
- core/middleware.py +34 -0
- core/models.py +1277 -0
- core/notifications.py +95 -0
- core/release.py +451 -0
- core/system.py +111 -0
- core/tasks.py +100 -0
- core/tests.py +483 -0
- core/urls.py +11 -0
- core/user_data.py +333 -0
- core/views.py +431 -0
- nodes/__init__.py +0 -0
- nodes/actions.py +72 -0
- nodes/admin.py +347 -0
- nodes/apps.py +76 -0
- nodes/lcd.py +151 -0
- nodes/models.py +577 -0
- nodes/tasks.py +50 -0
- nodes/tests.py +1072 -0
- nodes/urls.py +13 -0
- nodes/utils.py +62 -0
- nodes/views.py +262 -0
- ocpp/__init__.py +0 -0
- ocpp/admin.py +392 -0
- ocpp/apps.py +24 -0
- ocpp/consumers.py +267 -0
- ocpp/evcs.py +911 -0
- ocpp/models.py +300 -0
- ocpp/routing.py +9 -0
- ocpp/simulator.py +357 -0
- ocpp/store.py +175 -0
- ocpp/tasks.py +27 -0
- ocpp/test_export_import.py +129 -0
- ocpp/test_rfid.py +345 -0
- ocpp/tests.py +1229 -0
- ocpp/transactions_io.py +119 -0
- ocpp/urls.py +17 -0
- ocpp/views.py +359 -0
- pages/__init__.py +0 -0
- pages/admin.py +231 -0
- pages/apps.py +10 -0
- pages/checks.py +41 -0
- pages/context_processors.py +72 -0
- pages/models.py +224 -0
- pages/tests.py +628 -0
- pages/urls.py +17 -0
- pages/utils.py +13 -0
- pages/views.py +191 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: arthexis
|
|
3
|
+
Version: 0.1.3
|
|
4
|
+
Summary: Django-based MESH system
|
|
5
|
+
Author-email: "Rafael J. Guillén-Osorio" <tecnologia@gelectriic.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Repository, https://github.com/arthexis/arthexis
|
|
8
|
+
Project-URL: Homepage, https://arthexis.com
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Framework :: Django
|
|
11
|
+
Requires-Python: >=3.10
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Requires-Dist: amqp==5.3.1
|
|
15
|
+
Requires-Dist: annotated-types==0.7.0
|
|
16
|
+
Requires-Dist: anyio==4.9.0
|
|
17
|
+
Requires-Dist: asgiref==3.9.1
|
|
18
|
+
Requires-Dist: atproto==0.0.61
|
|
19
|
+
Requires-Dist: attrs==25.3.0
|
|
20
|
+
Requires-Dist: autobahn==24.4.2
|
|
21
|
+
Requires-Dist: Automat==25.4.16
|
|
22
|
+
Requires-Dist: billiard==4.2.1
|
|
23
|
+
Requires-Dist: bleach==6.2.0
|
|
24
|
+
Requires-Dist: celery==5.5.3
|
|
25
|
+
Requires-Dist: certifi==2025.7.14
|
|
26
|
+
Requires-Dist: cffi==1.17.1
|
|
27
|
+
Requires-Dist: channels==4.1.0
|
|
28
|
+
Requires-Dist: charset-normalizer==3.4.2
|
|
29
|
+
Requires-Dist: click==8.2.1
|
|
30
|
+
Requires-Dist: click-didyoumean==0.3.1
|
|
31
|
+
Requires-Dist: click-plugins==1.1.1.2
|
|
32
|
+
Requires-Dist: click-repl==0.3.0
|
|
33
|
+
Requires-Dist: colorama==0.4.6
|
|
34
|
+
Requires-Dist: constantly==23.10.4
|
|
35
|
+
Requires-Dist: cron-descriptor==1.4.5
|
|
36
|
+
Requires-Dist: cryptography==45.0.5
|
|
37
|
+
Requires-Dist: daphne==4.2.1
|
|
38
|
+
Requires-Dist: diff-match-patch==20241021
|
|
39
|
+
Requires-Dist: Django==5.2.4
|
|
40
|
+
Requires-Dist: django-celery-beat==2.8.1
|
|
41
|
+
Requires-Dist: django-debug-toolbar==6.0.0
|
|
42
|
+
Requires-Dist: django-import-export==4.3.9
|
|
43
|
+
Requires-Dist: django-object-actions==5.0.0
|
|
44
|
+
Requires-Dist: django-post_office==3.10.1
|
|
45
|
+
Requires-Dist: django-timezone-field==7.1
|
|
46
|
+
Requires-Dist: dnspython==2.7.0
|
|
47
|
+
Requires-Dist: docutils==0.22
|
|
48
|
+
Requires-Dist: gpiozero==2.0.1; sys_platform == "linux"
|
|
49
|
+
Requires-Dist: h11==0.16.0
|
|
50
|
+
Requires-Dist: httpcore==1.0.9
|
|
51
|
+
Requires-Dist: httpx==0.28.1
|
|
52
|
+
Requires-Dist: hyperlink==21.0.0
|
|
53
|
+
Requires-Dist: idna==3.10
|
|
54
|
+
Requires-Dist: incremental==24.7.2
|
|
55
|
+
Requires-Dist: kombu==5.5.4
|
|
56
|
+
Requires-Dist: libipld==3.1.1
|
|
57
|
+
Requires-Dist: Markdown==3.8.2
|
|
58
|
+
Requires-Dist: mfrc522==0.0.7; sys_platform == "linux"
|
|
59
|
+
Requires-Dist: outcome==1.3.0.post0
|
|
60
|
+
Requires-Dist: packaging==25.0
|
|
61
|
+
Requires-Dist: pillow==11.3.0
|
|
62
|
+
Requires-Dist: prompt_toolkit==3.0.51
|
|
63
|
+
Requires-Dist: psycopg==3.2.9
|
|
64
|
+
Requires-Dist: psycopg-binary==3.2.9
|
|
65
|
+
Requires-Dist: pyasn1==0.6.1
|
|
66
|
+
Requires-Dist: pyasn1_modules==0.4.2
|
|
67
|
+
Requires-Dist: pycparser==2.22
|
|
68
|
+
Requires-Dist: pydantic==2.11.7
|
|
69
|
+
Requires-Dist: pydantic_core==2.33.2
|
|
70
|
+
Requires-Dist: pyOpenSSL==25.1.0
|
|
71
|
+
Requires-Dist: pyperclip==1.9.0
|
|
72
|
+
Requires-Dist: PySocks==1.7.1
|
|
73
|
+
Requires-Dist: python-crontab==3.3.0
|
|
74
|
+
Requires-Dist: python-dateutil==2.9.0.post0
|
|
75
|
+
Requires-Dist: python-dotenv==1.1.1
|
|
76
|
+
Requires-Dist: qrcode==8.2
|
|
77
|
+
Requires-Dist: redis==5.0.8
|
|
78
|
+
Requires-Dist: requests==2.32.4
|
|
79
|
+
Requires-Dist: selenium==4.34.2
|
|
80
|
+
Requires-Dist: service-identity==24.2.0
|
|
81
|
+
Requires-Dist: setuptools==80.9.0
|
|
82
|
+
Requires-Dist: six==1.17.0
|
|
83
|
+
Requires-Dist: smbus2==0.5.0
|
|
84
|
+
Requires-Dist: sniffio==1.3.1
|
|
85
|
+
Requires-Dist: sortedcontainers==2.4.0
|
|
86
|
+
Requires-Dist: sqlparse==0.5.3
|
|
87
|
+
Requires-Dist: tablib==3.8.0
|
|
88
|
+
Requires-Dist: tinycss2==1.4.0
|
|
89
|
+
Requires-Dist: toml==0.10.2
|
|
90
|
+
Requires-Dist: trio==0.30.0
|
|
91
|
+
Requires-Dist: trio-websocket==0.12.2
|
|
92
|
+
Requires-Dist: Twisted==25.5.0
|
|
93
|
+
Requires-Dist: twine==6.1.0
|
|
94
|
+
Requires-Dist: txaio==25.6.1
|
|
95
|
+
Requires-Dist: typing-inspection==0.4.1
|
|
96
|
+
Requires-Dist: typing_extensions==4.14.1
|
|
97
|
+
Requires-Dist: tzdata==2025.2
|
|
98
|
+
Requires-Dist: urllib3==2.5.0
|
|
99
|
+
Requires-Dist: vine==5.1.0
|
|
100
|
+
Requires-Dist: wcwidth==0.2.13
|
|
101
|
+
Requires-Dist: webencodings==0.5.1
|
|
102
|
+
Requires-Dist: websocket-client==1.8.0
|
|
103
|
+
Requires-Dist: websockets==13.1
|
|
104
|
+
Requires-Dist: plyer==2.1.0; sys_platform == "win32"
|
|
105
|
+
Requires-Dist: wsproto==1.2.0
|
|
106
|
+
Requires-Dist: zope.interface==7.2
|
|
107
|
+
Dynamic: license-file
|
|
108
|
+
|
|
109
|
+
# Arthexis Constellation
|
|
110
|
+
|
|
111
|
+
## Purpose
|
|
112
|
+
Arthexis Constellation is a narrative-driven Django-based suite that centralizes tools for managing charging infrastructure and orchestrating energy related products and services.
|
|
113
|
+
|
|
114
|
+
## Features
|
|
115
|
+
- Compatibility with all OCPP 1.6 certified chargers
|
|
116
|
+
- Native API integration with Odoo 1.6-based CRMs
|
|
117
|
+
- Runs everywhere Python 3.10+ is installed
|
|
118
|
+
- Single codebase with special features per role
|
|
119
|
+
|
|
120
|
+
## Support
|
|
121
|
+
You may contact us at tecnologia at gelectriic dot com or visit our web page https://www.gelectriic.com/ for professional services and commercial support.
|
|
122
|
+
|
|
123
|
+
## About Me
|
|
124
|
+
> "What? You want to know about me too? Well, I enjoy developing software, roleplaying games, long walks on the beach and a fourth secret thing."
|
|
125
|
+
> --Arthexis
|
|
126
|
+
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
arthexis-0.1.3.dist-info/licenses/LICENSE,sha256=rBjcKtvD5yIpzAnkw3XRofK8KCAeL43DXmNaiRuYJrg,1092
|
|
2
|
+
config/__init__.py,sha256=5EyLFDrM6aTOHSnyBcLXRvMInZMPmAAy9Icu0cHHK5o,110
|
|
3
|
+
config/active_app.py,sha256=MET_G7oHL7GkoSo3VkkMzymM-PwsSZazMLZxpgjFLTo,388
|
|
4
|
+
config/asgi.py,sha256=n09URedOmQ_59II3UCl3iodGSDWOuN_A8DFyfLjuylA,803
|
|
5
|
+
config/auth_app.py,sha256=65cHsGtnwa0Q7-IjWIwJ73Kq4FpEcxSjHH_fu9Dr868,207
|
|
6
|
+
config/celery.py,sha256=BSkOFmvaCz36BMTo9iSSg2mvTvIxVqV6pU_UVRH8h4U,434
|
|
7
|
+
config/context_processors.py,sha256=_oQ5F8MZpAuv2QZl5QHoobEwTharl1lC7SRCUEmf3cQ,2341
|
|
8
|
+
config/loadenv.py,sha256=bhFbHTbRJSkSwrFk3UInKEKQ8ZY-poatOGi7rC57YAI,298
|
|
9
|
+
config/logging.py,sha256=KtQJi8CzE0EYTS9ptv2CyXHOz2TL10cD6GOnWzSqiXs,1559
|
|
10
|
+
config/middleware.py,sha256=EvraDumepnKwCDswHGXb1mK7vud_dEEoZ4eh0IQ7fhQ,744
|
|
11
|
+
config/offline.py,sha256=7XHGFlV7IAWUJ93dEjknrHkAHDEyzWxK_hj_ht4-6-Q,1427
|
|
12
|
+
config/settings.py,sha256=1Ix8ee5S6SP7z51sLK5g3ejNr524xEJj_0LpeJsICuI,10854
|
|
13
|
+
config/urls.py,sha256=mgC0PqY1JBH6GdOxM6A_p5rDzx9vDoEVAOrH36DWSB4,2991
|
|
14
|
+
config/wsgi.py,sha256=Fu-ONO2SgYeU6rhmy909P-uLX-n8ALJQObdm9MHPS-k,450
|
|
15
|
+
core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
|
+
core/admin.py,sha256=Iu5diTWTC69ZDbnRD0ogmfMRlIZYMF3kqH0YBHvGxSI,27009
|
|
17
|
+
core/apps.py,sha256=fr4s_sNGe6gmSP4OPw-zDukIXpLkRnGzzW2h01Hg1f0,2577
|
|
18
|
+
core/backends.py,sha256=f8gb5D3_f8sM6UJop0aS8TAkrkh14NaP0JrqTcT_L3Y,2686
|
|
19
|
+
core/entity.py,sha256=Ok2dj-Hd5kJjzXaHIEIIfPY52nmucEmkH8mLO3N-10A,3107
|
|
20
|
+
core/environment.py,sha256=QcOshpWNG0l_agW-b9efNvVFKqdatj6sUK8FT6p92gU,1238
|
|
21
|
+
core/fields.py,sha256=uS5nDozL6IsTAbjg08VcOB8K85e0XROUYCBAOIfAcPE,2127
|
|
22
|
+
core/lcd_screen.py,sha256=7iSg8OZMK8qHGM1FVOwbgsWCogEe5eR6mie-A5YQKY4,2649
|
|
23
|
+
core/middleware.py,sha256=utMGESBrR-rHRV5_q1X2g2wnmpziaUcc9jGzoZwvqqQ,1258
|
|
24
|
+
core/models.py,sha256=KtdlA3mefAbmU2cUsOZMAyvDxVSfExM69peTNyM02hk,43209
|
|
25
|
+
core/notifications.py,sha256=w9rPCsZfZNSoBUH-1KVe9Yr8LvG9vtkgmzw3DKLcDoM,3787
|
|
26
|
+
core/release.py,sha256=hoiw45zNh6wQ3N8rWx48EN5hh2fwcgkSRVGjBUKev_E,14959
|
|
27
|
+
core/system.py,sha256=brMyjooSAPx1sYiRGEUkppD4tv7Ys2DNkahUSsaYa_A,3488
|
|
28
|
+
core/tasks.py,sha256=Q4QweRlhahbXYEeL9ytlyQWwWQFP63q-ZY_fN0EXwtg,3145
|
|
29
|
+
core/tests.py,sha256=hQLrDtnieZaThs5mWQXezcYFzLAqqSg4gTsHIlyq4-A,17872
|
|
30
|
+
core/urls.py,sha256=pBkcWdiA0Aag7z4UOu7HT4Im4ghPPfBZKeogmoO0H5U,406
|
|
31
|
+
core/user_data.py,sha256=pfi4fgHl0CosG9jkfe__bSNN-Knhnzp7UirnCT_tae8,12029
|
|
32
|
+
core/views.py,sha256=D_1KF4IwDyqxicO1YSpOf4V4DMcVBfuRr8aDecdjpok,15342
|
|
33
|
+
nodes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
34
|
+
nodes/actions.py,sha256=2QOtRdhm__4f0Pgy3n2tg9HCbS47ZK9qBdTXJ9YZJfA,2339
|
|
35
|
+
nodes/admin.py,sha256=YCjKqnb3GbYhke8CQI1VBzOliYjFEvJFkpobcxixfPY,12877
|
|
36
|
+
nodes/apps.py,sha256=n1ZEsw5p6eYKaXEmachkT1saqQNLzeLExKyiYsoMazY,2297
|
|
37
|
+
nodes/lcd.py,sha256=axttp6AhKO2QMMXAf6nPe3Ox7nrBP-8yZD_oDUfMAvI,5602
|
|
38
|
+
nodes/models.py,sha256=wO8ppIVJLU26Kmab6FfPb9y3ROgVCuBs7Xd1hdSOkdQ,20887
|
|
39
|
+
nodes/tasks.py,sha256=1YeUqwSvqqTisusH-25nMQJCMQY2faEyDVrcBYqQghU,1588
|
|
40
|
+
nodes/tests.py,sha256=XyAM__wJpFyEK00sLGfYxeXWfOuxjOy-ofz8L7x2fw0,43133
|
|
41
|
+
nodes/urls.py,sha256=20yZDZf4DNgIZ9hQWsUzjp8k5Fryg9ukk761_KGQt9k,548
|
|
42
|
+
nodes/utils.py,sha256=aVEHtoisHyhWe_Fy2KPiP24Fs0wELtQMyfs4JGYnkuY,2320
|
|
43
|
+
nodes/views.py,sha256=5LF82eIhhiOl4FdzhOKZbD-TUT5QSr_RvI6_Xz92_w4,8465
|
|
44
|
+
ocpp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
45
|
+
ocpp/admin.py,sha256=9A_uLUg7l9DiqJq1foy47oFLb7zPuBOJeS73p7l0M0k,11851
|
|
46
|
+
ocpp/apps.py,sha256=QXwvJt1TnJKzxhZOSbyPjDIByLNhkBxu3_TQtZVoRB4,751
|
|
47
|
+
ocpp/consumers.py,sha256=ykAkAicHRmn_qfUTp6psNUFkDrOnzuJfnHca9vgJLQI,11768
|
|
48
|
+
ocpp/evcs.py,sha256=ZQKLqN8yJ4IOdedVt1z_gz_2eXBPdHHPvgxU2NkWgpw,33333
|
|
49
|
+
ocpp/models.py,sha256=JN6CfoHdB84JM3VYN3-tEvd1xx7HrVCcZ8OsJgGUzYg,10364
|
|
50
|
+
ocpp/routing.py,sha256=g9vPnLw-D1N8L_mW0_oCe-nTDibjC0Et-SFxe8NFAOI,308
|
|
51
|
+
ocpp/simulator.py,sha256=kk2QWqekOrnNiSTwTO2kshAxGvxQrek36wy4uJgjhm0,13224
|
|
52
|
+
ocpp/store.py,sha256=qzVWNXZY3sUAC3DtOnAv4BOj185DAGUxguVN9G4qkbw,5850
|
|
53
|
+
ocpp/tasks.py,sha256=F15s9Hkx2Y54ytqXq3tyn0YmxgVepXsIctjuck2LWVI,841
|
|
54
|
+
ocpp/test_export_import.py,sha256=w3GRh0zTWZ5byev7H1g9mZ3xbgnlHxQx2InHcp69x4w,4667
|
|
55
|
+
ocpp/test_rfid.py,sha256=UrlB-amytnpvD1I4c0fRUKaPozRoEynYrZkKPCLfZDU,12318
|
|
56
|
+
ocpp/tests.py,sha256=zq5C1-TGJXgsEoLJLc1Oq6ttn9o4V7xZ1jEzrWm1cJY,47752
|
|
57
|
+
ocpp/transactions_io.py,sha256=ulRkBZTjubN01Geur9t4zjANQu-yCeS8N3prR03rQE8,4062
|
|
58
|
+
ocpp/urls.py,sha256=MMrYiCW9y8cf2CZqpcEiF-jsjWdqLAl4a1cFnG36AEg,877
|
|
59
|
+
ocpp/views.py,sha256=lX5vyCKxAOe-pBA5FpjbDiOt0zkx18GcH8NH0ncrDac,13201
|
|
60
|
+
pages/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
61
|
+
pages/admin.py,sha256=hgaIeN0FyW4sWq4Ulhbr65wy5RfLheMkcmkint_urXA,7562
|
|
62
|
+
pages/apps.py,sha256=P1zJH4LV3ATTu7z4r_BA-fiOtui_UW6-GP--LNMUYhs,299
|
|
63
|
+
pages/checks.py,sha256=E2_ZYPD-2vw27ImA-Q29OvxbdQUvKx26ACZwiPflTaI,1569
|
|
64
|
+
pages/context_processors.py,sha256=mQj43pb4Y1u8cfBrl3m0bP-_iWHDKXxfuRE4Rbn6l-g,2432
|
|
65
|
+
pages/models.py,sha256=vG2knV91jRJ5PpIB-UKbsyuzB-e0KXYi9lwCFbIVUSA,7536
|
|
66
|
+
pages/tests.py,sha256=AF6UbMg52RY8fq3PsbCydYCh0aUGPPdj14K_rTm8U7w,26034
|
|
67
|
+
pages/urls.py,sha256=glhQExK2vVLzzvaRypWfmMdnggBrpjlxCaN1BUbC_MY,457
|
|
68
|
+
pages/utils.py,sha256=bCcjku0mQhzgvTR46QwQgyc8YnSS7VumC6Qv968aCic,313
|
|
69
|
+
pages/views.py,sha256=4msg1kPmcZFghpPa7lkwWpHKdBM01Aka5m7by31rXMc,7046
|
|
70
|
+
arthexis-0.1.3.dist-info/METADATA,sha256=AUAQY7eIo7Cg_Absv4obDG2xpg-kIEh7o3tWNgwfI-k,4507
|
|
71
|
+
arthexis-0.1.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
72
|
+
arthexis-0.1.3.dist-info/top_level.txt,sha256=J2a2q8_BWrCZ8H2WFUNMBfO2jz8j2gax6zZh-_1QDac,29
|
|
73
|
+
arthexis-0.1.3.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Rafael Guillen
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
config/__init__.py
ADDED
config/active_app.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import threading
|
|
2
|
+
import socket
|
|
3
|
+
|
|
4
|
+
_active = threading.local()
|
|
5
|
+
_active.name = socket.gethostname()
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def get_active_app():
|
|
9
|
+
"""Return the currently active app name."""
|
|
10
|
+
return getattr(_active, "name", socket.gethostname())
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def set_active_app(name: str) -> None:
|
|
14
|
+
"""Set the active app name for the current thread."""
|
|
15
|
+
_active.name = name or socket.gethostname()
|
config/asgi.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"""
|
|
2
|
+
ASGI config for config project.
|
|
3
|
+
|
|
4
|
+
It exposes the ASGI callable as a module-level variable named ``application``.
|
|
5
|
+
|
|
6
|
+
For more information on this file, see
|
|
7
|
+
https://docs.djangoproject.com/en/5.2/howto/deployment/asgi/
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
import os
|
|
11
|
+
from config.loadenv import loadenv
|
|
12
|
+
from channels.auth import AuthMiddlewareStack
|
|
13
|
+
from channels.routing import ProtocolTypeRouter, URLRouter
|
|
14
|
+
from django.core.asgi import get_asgi_application
|
|
15
|
+
import ocpp.routing
|
|
16
|
+
|
|
17
|
+
loadenv()
|
|
18
|
+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings")
|
|
19
|
+
|
|
20
|
+
django_asgi_app = get_asgi_application()
|
|
21
|
+
|
|
22
|
+
websocket_patterns = ocpp.routing.websocket_urlpatterns
|
|
23
|
+
|
|
24
|
+
application = ProtocolTypeRouter(
|
|
25
|
+
{
|
|
26
|
+
"http": django_asgi_app,
|
|
27
|
+
"websocket": AuthMiddlewareStack(URLRouter(websocket_patterns)),
|
|
28
|
+
}
|
|
29
|
+
)
|
config/auth_app.py
ADDED
config/celery.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""Celery application configuration."""
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
|
|
5
|
+
from celery import Celery
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings")
|
|
9
|
+
|
|
10
|
+
app = Celery("config")
|
|
11
|
+
app.config_from_object("django.conf:settings", namespace="CELERY")
|
|
12
|
+
app.autodiscover_tasks()
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@app.task(bind=True)
|
|
16
|
+
def debug_task(self): # pragma: no cover - debug helper
|
|
17
|
+
"""A simple debug task."""
|
|
18
|
+
print(f"Request: {self.request!r}")
|
|
19
|
+
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import socket
|
|
2
|
+
|
|
3
|
+
from django.contrib.sites.models import Site
|
|
4
|
+
from django.http import HttpRequest
|
|
5
|
+
from django.conf import settings
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def site_and_node(request: HttpRequest):
|
|
9
|
+
"""Provide current Site and Node based on request host.
|
|
10
|
+
|
|
11
|
+
Returns a dict with keys ``badge_site`` and ``badge_node``.
|
|
12
|
+
``badge_site`` is a ``Site`` instance or ``None`` if no match.
|
|
13
|
+
``badge_node`` is a ``Node`` instance or ``None`` if no match.
|
|
14
|
+
``badge_site_color`` and ``badge_node_color`` provide the configured colors.
|
|
15
|
+
"""
|
|
16
|
+
host = request.get_host().split(':')[0]
|
|
17
|
+
site = Site.objects.filter(domain__iexact=host).first()
|
|
18
|
+
|
|
19
|
+
node = None
|
|
20
|
+
try:
|
|
21
|
+
from nodes.models import Node
|
|
22
|
+
|
|
23
|
+
node = Node.get_local()
|
|
24
|
+
if not node:
|
|
25
|
+
hostname = socket.gethostname()
|
|
26
|
+
try:
|
|
27
|
+
addresses = socket.gethostbyname_ex(hostname)[2]
|
|
28
|
+
except socket.gaierror:
|
|
29
|
+
addresses = []
|
|
30
|
+
|
|
31
|
+
node = Node.objects.filter(hostname__iexact=hostname).first()
|
|
32
|
+
if not node:
|
|
33
|
+
for addr in addresses:
|
|
34
|
+
node = Node.objects.filter(address=addr).first()
|
|
35
|
+
if node:
|
|
36
|
+
break
|
|
37
|
+
if not node:
|
|
38
|
+
node = (
|
|
39
|
+
Node.objects.filter(hostname__iexact=host).first()
|
|
40
|
+
or Node.objects.filter(address=host).first()
|
|
41
|
+
)
|
|
42
|
+
except Exception:
|
|
43
|
+
node = None
|
|
44
|
+
|
|
45
|
+
site_color = "#28a745"
|
|
46
|
+
if site:
|
|
47
|
+
try:
|
|
48
|
+
site_color = site.badge.badge_color
|
|
49
|
+
except Exception:
|
|
50
|
+
pass
|
|
51
|
+
|
|
52
|
+
node_color = "#28a745"
|
|
53
|
+
if node:
|
|
54
|
+
node_color = node.badge_color
|
|
55
|
+
|
|
56
|
+
site_name = site.name if site else ""
|
|
57
|
+
node_role_name = node.role.name if node and node.role else ""
|
|
58
|
+
return {
|
|
59
|
+
"badge_site": site,
|
|
60
|
+
"badge_node": node,
|
|
61
|
+
# Public views fall back to the node role when the site name is blank.
|
|
62
|
+
"badge_site_name": site_name or node_role_name,
|
|
63
|
+
# Admin site badge uses the site display name if set, otherwise the domain.
|
|
64
|
+
"badge_admin_site_name": site_name or (site.domain if site else ""),
|
|
65
|
+
"badge_site_color": site_color,
|
|
66
|
+
"badge_node_color": node_color,
|
|
67
|
+
"TIME_ZONE": settings.TIME_ZONE,
|
|
68
|
+
}
|
config/loadenv.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
from dotenv import load_dotenv
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
BASE_DIR = Path(__file__).resolve().parent.parent
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def loadenv() -> None:
|
|
9
|
+
"""Load all .env files from the repository root."""
|
|
10
|
+
for env_file in sorted(BASE_DIR.glob("*.env")):
|
|
11
|
+
load_dotenv(env_file, override=False)
|
config/logging.py
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
import os
|
|
3
|
+
import glob
|
|
4
|
+
import logging
|
|
5
|
+
from logging.handlers import TimedRotatingFileHandler
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
from django.conf import settings
|
|
8
|
+
|
|
9
|
+
from .active_app import get_active_app
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ActiveAppFileHandler(TimedRotatingFileHandler):
|
|
13
|
+
"""File handler that writes to a file named after the active app."""
|
|
14
|
+
|
|
15
|
+
def _current_file(self) -> Path:
|
|
16
|
+
if "test" in sys.argv:
|
|
17
|
+
return Path(settings.LOG_DIR) / "tests.log"
|
|
18
|
+
return Path(settings.LOG_DIR) / f"{get_active_app()}.log"
|
|
19
|
+
|
|
20
|
+
def emit(self, record: logging.LogRecord) -> None:
|
|
21
|
+
current = str(self._current_file())
|
|
22
|
+
if self.baseFilename != current:
|
|
23
|
+
self.baseFilename = current
|
|
24
|
+
if self.stream:
|
|
25
|
+
self.stream.close()
|
|
26
|
+
self.stream = self._open()
|
|
27
|
+
super().emit(record)
|
|
28
|
+
|
|
29
|
+
def rotation_filename(self, default_name: str) -> str:
|
|
30
|
+
"""Place rotated logs inside the old log directory."""
|
|
31
|
+
default_path = Path(default_name)
|
|
32
|
+
return str(Path(settings.OLD_LOG_DIR) / default_path.name)
|
|
33
|
+
|
|
34
|
+
def getFilesToDelete(self):
|
|
35
|
+
"""Return files to delete in the old log directory respecting backupCount."""
|
|
36
|
+
if self.backupCount <= 0:
|
|
37
|
+
return []
|
|
38
|
+
_, base_name = os.path.split(self.baseFilename)
|
|
39
|
+
files = glob.glob(os.path.join(settings.OLD_LOG_DIR, base_name + ".*"))
|
|
40
|
+
files.sort()
|
|
41
|
+
if len(files) <= self.backupCount:
|
|
42
|
+
return []
|
|
43
|
+
return files[: len(files) - self.backupCount]
|
config/middleware.py
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
from utils.sites import get_site
|
|
2
|
+
import socket
|
|
3
|
+
from nodes.models import Node
|
|
4
|
+
|
|
5
|
+
from .active_app import set_active_app
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ActiveAppMiddleware:
|
|
9
|
+
"""Store the current app based on the request's site."""
|
|
10
|
+
|
|
11
|
+
def __init__(self, get_response):
|
|
12
|
+
self.get_response = get_response
|
|
13
|
+
|
|
14
|
+
def __call__(self, request):
|
|
15
|
+
site = get_site(request)
|
|
16
|
+
node = Node.get_local()
|
|
17
|
+
role_name = node.role.name if node and node.role else "Terminal"
|
|
18
|
+
active = site.name or role_name
|
|
19
|
+
set_active_app(active)
|
|
20
|
+
request.active_app = active
|
|
21
|
+
try:
|
|
22
|
+
response = self.get_response(request)
|
|
23
|
+
finally:
|
|
24
|
+
set_active_app(socket.gethostname())
|
|
25
|
+
return response
|
config/offline.py
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import functools
|
|
3
|
+
import asyncio
|
|
4
|
+
|
|
5
|
+
class OfflineError(RuntimeError):
|
|
6
|
+
"""Raised when a network operation is attempted in offline mode."""
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def _is_offline() -> bool:
|
|
10
|
+
flag = os.environ.get("ARTHEXIS_OFFLINE", "").lower()
|
|
11
|
+
return flag not in ("", "0", "false", "no")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def requires_network(func):
|
|
15
|
+
"""Decorator that blocks execution when offline mode is enabled.
|
|
16
|
+
|
|
17
|
+
When the environment variable ``ARTHEXIS_OFFLINE`` is set to a truthy value,
|
|
18
|
+
any function decorated with ``@requires_network`` will raise
|
|
19
|
+
:class:`OfflineError` before executing. Works with both synchronous and
|
|
20
|
+
asynchronous callables.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
if asyncio.iscoroutinefunction(func):
|
|
24
|
+
@functools.wraps(func)
|
|
25
|
+
async def async_wrapper(*args, **kwargs):
|
|
26
|
+
if _is_offline():
|
|
27
|
+
raise OfflineError(f"{func.__name__} requires network access")
|
|
28
|
+
return await func(*args, **kwargs)
|
|
29
|
+
|
|
30
|
+
return async_wrapper
|
|
31
|
+
|
|
32
|
+
@functools.wraps(func)
|
|
33
|
+
def sync_wrapper(*args, **kwargs):
|
|
34
|
+
if _is_offline():
|
|
35
|
+
raise OfflineError(f"{func.__name__} requires network access")
|
|
36
|
+
return func(*args, **kwargs)
|
|
37
|
+
|
|
38
|
+
return sync_wrapper
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def network_available() -> bool:
|
|
42
|
+
"""Return ``True`` if network operations are permitted."""
|
|
43
|
+
|
|
44
|
+
return not _is_offline()
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
__all__ = ["OfflineError", "requires_network", "network_available"]
|