yearning-cli 0.1.8__tar.gz → 0.2.0__tar.gz
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.
- {yearning_cli-0.1.8 → yearning_cli-0.2.0}/.github/workflows/docker-image.yml +6 -7
- {yearning_cli-0.1.8 → yearning_cli-0.2.0}/.github/workflows/publish-pypi.yml +4 -4
- yearning_cli-0.2.0/.python-version +1 -0
- {yearning_cli-0.1.8 → yearning_cli-0.2.0}/Dockerfile +3 -2
- {yearning_cli-0.1.8 → yearning_cli-0.2.0}/PKG-INFO +2 -2
- {yearning_cli-0.1.8 → yearning_cli-0.2.0}/docker-compose.yml +1 -0
- {yearning_cli-0.1.8 → yearning_cli-0.2.0}/pyproject.toml +2 -2
- yearning_cli-0.2.0/renovate.json +6 -0
- {yearning_cli-0.1.8 → yearning_cli-0.2.0}/uv.lock +5 -5
- {yearning_cli-0.1.8 → yearning_cli-0.2.0}/yearning_cli/cli.py +21 -2
- yearning_cli-0.1.8/.python-version +0 -1
- {yearning_cli-0.1.8 → yearning_cli-0.2.0}/.dockerignore +0 -0
- {yearning_cli-0.1.8 → yearning_cli-0.2.0}/.gitignore +0 -0
- {yearning_cli-0.1.8 → yearning_cli-0.2.0}/README.md +0 -0
- {yearning_cli-0.1.8 → yearning_cli-0.2.0}/mysql_proxy/README.md +0 -0
- {yearning_cli-0.1.8 → yearning_cli-0.2.0}/mysql_proxy/__init__.py +0 -0
- {yearning_cli-0.1.8 → yearning_cli-0.2.0}/mysql_proxy/protocol.py +0 -0
- {yearning_cli-0.1.8 → yearning_cli-0.2.0}/mysql_proxy/server.py +0 -0
- {yearning_cli-0.1.8 → yearning_cli-0.2.0}/yearning_cli/__init__.py +0 -0
- {yearning_cli-0.1.8 → yearning_cli-0.2.0}/yearning_cli/__main__.py +0 -0
- {yearning_cli-0.1.8 → yearning_cli-0.2.0}/yearning_cli/client.py +0 -0
|
@@ -17,32 +17,31 @@ jobs:
|
|
|
17
17
|
|
|
18
18
|
steps:
|
|
19
19
|
- name: Checkout
|
|
20
|
-
uses: actions/checkout@
|
|
20
|
+
uses: actions/checkout@v6
|
|
21
21
|
|
|
22
22
|
- name: Set up QEMU
|
|
23
|
-
uses: docker/setup-qemu-action@
|
|
23
|
+
uses: docker/setup-qemu-action@v4
|
|
24
24
|
|
|
25
25
|
- name: Set up Docker Buildx
|
|
26
|
-
uses: docker/setup-buildx-action@
|
|
26
|
+
uses: docker/setup-buildx-action@v4
|
|
27
27
|
|
|
28
28
|
- name: Login to Docker Hub
|
|
29
|
-
uses: docker/login-action@
|
|
29
|
+
uses: docker/login-action@v4
|
|
30
30
|
with:
|
|
31
31
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
32
32
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
33
33
|
|
|
34
34
|
- name: Docker metadata
|
|
35
35
|
id: meta
|
|
36
|
-
uses: docker/metadata-action@
|
|
36
|
+
uses: docker/metadata-action@v6
|
|
37
37
|
with:
|
|
38
38
|
images: ${{ env.IMAGE_NAME }}
|
|
39
39
|
tags: |
|
|
40
|
-
type=ref,event=tag
|
|
41
40
|
type=semver,pattern={{version}}
|
|
42
41
|
type=raw,value=latest
|
|
43
42
|
|
|
44
43
|
- name: Build and push
|
|
45
|
-
uses: docker/build-push-action@
|
|
44
|
+
uses: docker/build-push-action@v7
|
|
46
45
|
with:
|
|
47
46
|
context: .
|
|
48
47
|
file: ./Dockerfile
|
|
@@ -15,15 +15,15 @@ jobs:
|
|
|
15
15
|
|
|
16
16
|
steps:
|
|
17
17
|
- name: Checkout
|
|
18
|
-
uses: actions/checkout@
|
|
18
|
+
uses: actions/checkout@v6
|
|
19
19
|
|
|
20
20
|
- name: Set up Python
|
|
21
|
-
uses: actions/setup-python@
|
|
21
|
+
uses: actions/setup-python@v6
|
|
22
22
|
with:
|
|
23
|
-
python-version: "3.
|
|
23
|
+
python-version: "3.14"
|
|
24
24
|
|
|
25
25
|
- name: Set up uv
|
|
26
|
-
uses: astral-sh/setup-uv@
|
|
26
|
+
uses: astral-sh/setup-uv@v8.2.0
|
|
27
27
|
with:
|
|
28
28
|
enable-cache: true
|
|
29
29
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.14
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
FROM python:3.
|
|
1
|
+
FROM python:3.14-slim
|
|
2
2
|
|
|
3
3
|
ENV PYTHONUNBUFFERED=1 \
|
|
4
4
|
PIP_NO_CACHE_DIR=1 \
|
|
5
|
+
TZ=Asia/Shanghai \
|
|
5
6
|
SQL_PROXY_HOST=0.0.0.0 \
|
|
6
7
|
SQL_PROXY_PORT=3307
|
|
7
8
|
|
|
@@ -18,7 +19,7 @@ EXPOSE 3307
|
|
|
18
19
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
|
19
20
|
CMD python -c "import os, socket; s=socket.create_connection(('127.0.0.1', int(os.getenv('SQL_PROXY_PORT', '3307'))), 3); s.close()"
|
|
20
21
|
|
|
21
|
-
CMD sql proxy \
|
|
22
|
+
CMD sql proxy -v \
|
|
22
23
|
--host "${SQL_PROXY_HOST}" \
|
|
23
24
|
--port "${SQL_PROXY_PORT}" \
|
|
24
25
|
${SQL_PROXY_SOURCE:+--source "$SQL_PROXY_SOURCE"} \
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: yearning-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: Yearning MySQL Audit Platform CLI Tool
|
|
5
5
|
Project-URL: Homepage, https://github.com/la3rence/yearning-cli
|
|
6
6
|
Project-URL: Repository, https://github.com/la3rence/yearning-cli
|
|
@@ -9,7 +9,7 @@ License-Expression: MIT
|
|
|
9
9
|
Requires-Python: >=3.11
|
|
10
10
|
Requires-Dist: msgpack>=1.1.2
|
|
11
11
|
Requires-Dist: openpyxl>=3.1
|
|
12
|
-
Requires-Dist: requests>=2.
|
|
12
|
+
Requires-Dist: requests>=2.34
|
|
13
13
|
Requires-Dist: websocket-client>=1.9.0
|
|
14
14
|
Description-Content-Type: text/markdown
|
|
15
15
|
|
|
@@ -12,6 +12,7 @@ services:
|
|
|
12
12
|
YEARNING_URL: "${YEARNING_URL:-http://192.168.1.135}"
|
|
13
13
|
YEARNING_USER: "${YEARNING_USER:-}"
|
|
14
14
|
YEARNING_PASS: "${YEARNING_PASS:-}"
|
|
15
|
+
TZ: "Asia/Shanghai"
|
|
15
16
|
SQL_PROXY_HOST: "0.0.0.0"
|
|
16
17
|
SQL_PROXY_PORT: "${SQL_PROXY_PORT:-3307}"
|
|
17
18
|
SQL_PROXY_SOURCE: "${SQL_PROXY_SOURCE:-}"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "yearning-cli"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.2.0"
|
|
4
4
|
description = "Yearning MySQL Audit Platform CLI Tool"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [
|
|
@@ -11,7 +11,7 @@ requires-python = ">=3.11"
|
|
|
11
11
|
dependencies = [
|
|
12
12
|
"msgpack>=1.1.2",
|
|
13
13
|
"openpyxl>=3.1",
|
|
14
|
-
"requests>=2.
|
|
14
|
+
"requests>=2.34",
|
|
15
15
|
"websocket-client>=1.9.0",
|
|
16
16
|
]
|
|
17
17
|
|
|
@@ -185,7 +185,7 @@ wheels = [
|
|
|
185
185
|
|
|
186
186
|
[[package]]
|
|
187
187
|
name = "requests"
|
|
188
|
-
version = "2.
|
|
188
|
+
version = "2.34.2"
|
|
189
189
|
source = { registry = "https://pypi.org/simple" }
|
|
190
190
|
dependencies = [
|
|
191
191
|
{ name = "certifi" },
|
|
@@ -193,9 +193,9 @@ dependencies = [
|
|
|
193
193
|
{ name = "idna" },
|
|
194
194
|
{ name = "urllib3" },
|
|
195
195
|
]
|
|
196
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
196
|
+
sdist = { url = "https://files.pythonhosted.org/packages/ac/c3/e2a2b89f2d3e2179abd6d00ebd70bff6273f37fb3e0cc209f48b39d00cbf/requests-2.34.2.tar.gz", hash = "sha256:f288924cae4e29463698d6d60bc6a4da69c89185ad1e0bcc4104f584e960b9ed", size = 142856, upload-time = "2026-05-14T19:25:27.735Z" }
|
|
197
197
|
wheels = [
|
|
198
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
198
|
+
{ url = "https://files.pythonhosted.org/packages/a0/f4/c67b0b3f1b9245e8d266f0f112c500d50e5b4e83cb6f3b71b6528104182a/requests-2.34.2-py3-none-any.whl", hash = "sha256:2a0d60c172f83ac6ab31e4554906c0f3b3588d37b5cb939b1c061f4907e278e0", size = 73075, upload-time = "2026-05-14T19:25:26.443Z" },
|
|
199
199
|
]
|
|
200
200
|
|
|
201
201
|
[[package]]
|
|
@@ -218,7 +218,7 @@ wheels = [
|
|
|
218
218
|
|
|
219
219
|
[[package]]
|
|
220
220
|
name = "yearning-cli"
|
|
221
|
-
version = "0.
|
|
221
|
+
version = "0.2.0"
|
|
222
222
|
source = { editable = "." }
|
|
223
223
|
dependencies = [
|
|
224
224
|
{ name = "msgpack" },
|
|
@@ -231,6 +231,6 @@ dependencies = [
|
|
|
231
231
|
requires-dist = [
|
|
232
232
|
{ name = "msgpack", specifier = ">=1.1.2" },
|
|
233
233
|
{ name = "openpyxl", specifier = ">=3.1" },
|
|
234
|
-
{ name = "requests", specifier = ">=2.
|
|
234
|
+
{ name = "requests", specifier = ">=2.34" },
|
|
235
235
|
{ name = "websocket-client", specifier = ">=1.9.0" },
|
|
236
236
|
]
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""CLI entry point for yearning-cli."""
|
|
2
2
|
|
|
3
3
|
import argparse
|
|
4
|
+
from datetime import datetime, timedelta, timezone
|
|
4
5
|
import logging
|
|
5
6
|
import os
|
|
6
7
|
import sys
|
|
@@ -12,6 +13,17 @@ from mysql_proxy.server import serve
|
|
|
12
13
|
|
|
13
14
|
BASE_URL = os.environ.get("YEARNING_URL", "http://192.168.1.135")
|
|
14
15
|
CONFIG_FILE = os.path.expanduser("~/.sqlrc")
|
|
16
|
+
EAST_8 = timezone(timedelta(hours=8))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class East8Formatter(logging.Formatter):
|
|
20
|
+
"""Format log timestamps with a fixed UTC+8 timezone."""
|
|
21
|
+
|
|
22
|
+
def formatTime(self, record: logging.LogRecord, datefmt: str | None = None) -> str:
|
|
23
|
+
dt = datetime.fromtimestamp(record.created, tz=EAST_8)
|
|
24
|
+
if datefmt:
|
|
25
|
+
return dt.strftime(datefmt)
|
|
26
|
+
return dt.strftime("%Y-%m-%d %H:%M:%S")
|
|
15
27
|
|
|
16
28
|
|
|
17
29
|
def load_config() -> dict:
|
|
@@ -359,10 +371,17 @@ def cmd_shell(args: argparse.Namespace) -> None:
|
|
|
359
371
|
def cmd_proxy(args: argparse.Namespace) -> None:
|
|
360
372
|
"""Start MySQL protocol proxy server."""
|
|
361
373
|
level = logging.DEBUG if VERBOSE else logging.INFO
|
|
374
|
+
handler = logging.StreamHandler()
|
|
375
|
+
handler.setFormatter(
|
|
376
|
+
East8Formatter(
|
|
377
|
+
fmt="%(asctime)s [%(levelname)s] %(message)s",
|
|
378
|
+
datefmt="%Y-%m-%d %H:%M:%S",
|
|
379
|
+
)
|
|
380
|
+
)
|
|
362
381
|
logging.basicConfig(
|
|
363
382
|
level=level,
|
|
364
|
-
|
|
365
|
-
|
|
383
|
+
handlers=[handler],
|
|
384
|
+
force=True,
|
|
366
385
|
)
|
|
367
386
|
if not VERBOSE:
|
|
368
387
|
logging.getLogger("websocket").setLevel(logging.WARNING)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
3.11
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|