plain.dev 0.20.0__py3-none-any.whl → 0.20.2__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.
- plain/dev/mkcert.py +12 -3
- plain/dev/precommit/cli.py +1 -1
- {plain_dev-0.20.0.dist-info → plain_dev-0.20.2.dist-info}/METADATA +1 -1
- {plain_dev-0.20.0.dist-info → plain_dev-0.20.2.dist-info}/RECORD +7 -7
- {plain_dev-0.20.0.dist-info → plain_dev-0.20.2.dist-info}/WHEEL +0 -0
- {plain_dev-0.20.0.dist-info → plain_dev-0.20.2.dist-info}/entry_points.txt +0 -0
- {plain_dev-0.20.0.dist-info → plain_dev-0.20.2.dist-info}/licenses/LICENSE +0 -0
plain/dev/mkcert.py
CHANGED
@@ -2,6 +2,7 @@ import platform
|
|
2
2
|
import shutil
|
3
3
|
import subprocess
|
4
4
|
import sys
|
5
|
+
import time
|
5
6
|
import urllib.request
|
6
7
|
|
7
8
|
import click
|
@@ -73,13 +74,17 @@ class MkcertManager:
|
|
73
74
|
def generate_certs(self, domain, storage_path):
|
74
75
|
cert_path = storage_path / f"{domain}-cert.pem"
|
75
76
|
key_path = storage_path / f"{domain}-key.pem"
|
77
|
+
timestamp_path = storage_path / f"{domain}.timestamp"
|
78
|
+
update_interval = 60 * 24 * 3600 # 60 days in seconds
|
76
79
|
|
77
|
-
if
|
78
|
-
|
80
|
+
# Check if the certs exist and if the timestamp is recent enough
|
81
|
+
if cert_path.exists() and key_path.exists() and timestamp_path.exists():
|
82
|
+
last_updated = timestamp_path.stat().st_mtime
|
83
|
+
if time.time() - last_updated < update_interval:
|
84
|
+
return cert_path, key_path
|
79
85
|
|
80
86
|
storage_path.mkdir(parents=True, exist_ok=True)
|
81
87
|
|
82
|
-
# Generate SSL certificates using mkcert
|
83
88
|
click.secho(f"Generating SSL certificates for {domain}...", bold=True)
|
84
89
|
subprocess.run(
|
85
90
|
[
|
@@ -93,4 +98,8 @@ class MkcertManager:
|
|
93
98
|
check=True,
|
94
99
|
)
|
95
100
|
|
101
|
+
# Update the timestamp file to the current time
|
102
|
+
with open(timestamp_path, "w") as f:
|
103
|
+
f.write(str(time.time()))
|
104
|
+
|
96
105
|
return cert_path, key_path
|
plain/dev/precommit/cli.py
CHANGED
@@ -57,7 +57,7 @@ def cli(install):
|
|
57
57
|
check_short("Running plain code checks", "plain", "code", "check")
|
58
58
|
|
59
59
|
if Path("uv.lock").exists():
|
60
|
-
check_short("Checking uv.lock", "uv", "lock", "--
|
60
|
+
check_short("Checking uv.lock", "uv", "lock", "--check")
|
61
61
|
|
62
62
|
if plain_db_connected():
|
63
63
|
check_short(
|
@@ -5,7 +5,7 @@ plain/dev/debug.py,sha256=Ka84K8zUdF0kMYNyqiLYDrdzU1jU8LSOkts3hcw_Gok,1005
|
|
5
5
|
plain/dev/default_settings.py,sha256=uXWYORWP_aRDwXIFXdu5kHyiBFUZzARIJdhPeFaX35c,75
|
6
6
|
plain/dev/entrypoints.py,sha256=TCjX9aCLQag_0UjWE6PU5MnuaNWHAqsZQh7opSjr8zM,386
|
7
7
|
plain/dev/gunicorn_logging.json,sha256=yU23jzs5G4YGdDWBNiyAc3KypR4HirR6afIkD7w6DhU,1113
|
8
|
-
plain/dev/mkcert.py,sha256=
|
8
|
+
plain/dev/mkcert.py,sha256=fm1U_UTGPREso6ZaP79WqEvd9uvA4lYWFo6fKhNglMM,3911
|
9
9
|
plain/dev/pdb.py,sha256=4ru3rlIIyuYVXteyI7v42i4MmdBIjpJP0IJemBpf83A,3742
|
10
10
|
plain/dev/pid.py,sha256=gRMBf7aGndrra1TnmKtPghTijnd0i0Xeo63mzfPWp7M,436
|
11
11
|
plain/dev/requests.py,sha256=D1NX0qC8ADtf_zwsGMTp9aiE6Sh9QmoxFJCU_V8Wers,6839
|
@@ -23,10 +23,10 @@ plain/dev/poncho/manager.py,sha256=xT8ur72ZaVrWYWtg5FnBSiZsENWKUHP7eG_A_ZUP-40,6
|
|
23
23
|
plain/dev/poncho/printer.py,sha256=wt1ioaGcPnVyrPy-UjvdsR9zfcr4DTTycmapW1MIdSU,1785
|
24
24
|
plain/dev/poncho/process.py,sha256=JJOKy-C6vMCg7-6JMCtu6C649h7HmOBSJqDP_hnX49I,2637
|
25
25
|
plain/dev/precommit/__init__.py,sha256=9ByBOIdM8DebChjNz-RH2atdz4vWe8somlwNEsbhwh4,40
|
26
|
-
plain/dev/precommit/cli.py,sha256=
|
26
|
+
plain/dev/precommit/cli.py,sha256=3HP9I47HP_ekNz8z65yuMBO1-UKAMBbxNHSHp7VlCOM,3382
|
27
27
|
plain/dev/templates/dev/requests.html,sha256=kQKJZq5L77juuL_t8UjcAehEU61U4RXNnKaAET-wAm8,7627
|
28
|
-
plain_dev-0.20.
|
29
|
-
plain_dev-0.20.
|
30
|
-
plain_dev-0.20.
|
31
|
-
plain_dev-0.20.
|
32
|
-
plain_dev-0.20.
|
28
|
+
plain_dev-0.20.2.dist-info/METADATA,sha256=hrKWR26cSHCzuTIKbgkiN6qfUEC9eA_vfqveH53yh0g,4167
|
29
|
+
plain_dev-0.20.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
30
|
+
plain_dev-0.20.2.dist-info/entry_points.txt,sha256=UtjUbxI-2TMZJGCfRTeU-YGr48XLwnc_pMuzDGD9uTg,219
|
31
|
+
plain_dev-0.20.2.dist-info/licenses/LICENSE,sha256=Cx4Dq9yR2fLHthf8Ke36B8QJvE1bZFXVzDIGE8wGzsY,4132
|
32
|
+
plain_dev-0.20.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|