cubething_psync 0.1.0.dev10__tar.gz → 0.2.1__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.
- {cubething_psync-0.1.0.dev10/src/cubething_psync.egg-info → cubething_psync-0.2.1}/PKG-INFO +1 -1
- {cubething_psync-0.1.0.dev10 → cubething_psync-0.2.1}/pyproject.toml +1 -1
- {cubething_psync-0.1.0.dev10 → cubething_psync-0.2.1}/src/client/args.py +4 -4
- {cubething_psync-0.1.0.dev10 → cubething_psync-0.2.1}/src/client/main.py +5 -11
- {cubething_psync-0.1.0.dev10 → cubething_psync-0.2.1/src/cubething_psync.egg-info}/PKG-INFO +1 -1
- {cubething_psync-0.1.0.dev10 → cubething_psync-0.2.1}/src/server/main.py +6 -1
- {cubething_psync-0.1.0.dev10 → cubething_psync-0.2.1}/LICENSE +0 -0
- {cubething_psync-0.1.0.dev10 → cubething_psync-0.2.1}/README.md +0 -0
- {cubething_psync-0.1.0.dev10 → cubething_psync-0.2.1}/setup.cfg +0 -0
- {cubething_psync-0.1.0.dev10 → cubething_psync-0.2.1}/src/client/__init__.py +0 -0
- {cubething_psync-0.1.0.dev10 → cubething_psync-0.2.1}/src/client/__main__.py +0 -0
- {cubething_psync-0.1.0.dev10 → cubething_psync-0.2.1}/src/common/__init__.py +0 -0
- {cubething_psync-0.1.0.dev10 → cubething_psync-0.2.1}/src/common/data.py +0 -0
- {cubething_psync-0.1.0.dev10 → cubething_psync-0.2.1}/src/common/log.py +0 -0
- {cubething_psync-0.1.0.dev10 → cubething_psync-0.2.1}/src/cubething_psync.egg-info/SOURCES.txt +0 -0
- {cubething_psync-0.1.0.dev10 → cubething_psync-0.2.1}/src/cubething_psync.egg-info/dependency_links.txt +0 -0
- {cubething_psync-0.1.0.dev10 → cubething_psync-0.2.1}/src/cubething_psync.egg-info/entry_points.txt +0 -0
- {cubething_psync-0.1.0.dev10 → cubething_psync-0.2.1}/src/cubething_psync.egg-info/requires.txt +0 -0
- {cubething_psync-0.1.0.dev10 → cubething_psync-0.2.1}/src/cubething_psync.egg-info/top_level.txt +0 -0
- {cubething_psync-0.1.0.dev10 → cubething_psync-0.2.1}/src/server/__init__.py +0 -0
- {cubething_psync-0.1.0.dev10 → cubething_psync-0.2.1}/src/server/__main__.py +0 -0
|
@@ -28,8 +28,8 @@ Variable | Default
|
|
|
28
28
|
PSYNC_SERVER_IP | 127.0.0.1
|
|
29
29
|
PSYNC_SERVER_PORT | 5000
|
|
30
30
|
PSYNC_SSH_PORT | 5022
|
|
31
|
-
PSYNC_SERVER_DEST | /
|
|
32
|
-
PSYNC_SSH_USER |
|
|
31
|
+
PSYNC_SERVER_DEST | /home/psync/
|
|
32
|
+
PSYNC_SSH_USER | psync
|
|
33
33
|
PSYNC_CERT_PATH | ~/.local/share/psync/cert.pem
|
|
34
34
|
""",
|
|
35
35
|
)
|
|
@@ -57,8 +57,8 @@ _action = parser.add_argument(
|
|
|
57
57
|
SERVER_IP: str = os.environ.get("PSYNC_SERVER_IP", "127.0.0.1")
|
|
58
58
|
SERVER_PORT: int = int(os.environ.get("PSYNC_SERVER_PORT", "5000"))
|
|
59
59
|
SERVER_SSH_PORT: int = int(os.environ.get("PSYNC_SSH_PORT", "5022"))
|
|
60
|
-
SERVER_DEST: str = os.environ.get("PSYNC_SERVER_DEST", "/
|
|
61
|
-
USER: str = os.environ.get("PSYNC_SSH_USER", "")
|
|
60
|
+
SERVER_DEST: str = os.environ.get("PSYNC_SERVER_DEST", "/home/psync")
|
|
61
|
+
USER: str = os.environ.get("PSYNC_SSH_USER", "psync")
|
|
62
62
|
SSL_CERT_PATH: str = os.environ.get("PSYNC_CERT_PATH", "~/.local/share/psync/cert.pem")
|
|
63
63
|
|
|
64
64
|
|
|
@@ -40,12 +40,6 @@ class PsyncClient:
|
|
|
40
40
|
rsync, then execute them remotely while receiving the logs.
|
|
41
41
|
|
|
42
42
|
CLI arguments: ::
|
|
43
|
-
|
|
44
|
-
usage: psync-client [-h] --path PATH [--extra EXTRA [EXTRA ...]] [--env ENV] [--args ARGS]
|
|
45
|
-
|
|
46
|
-
Client for the psync server.
|
|
47
|
-
|
|
48
|
-
options:
|
|
49
43
|
-h, --help show this help message and exit
|
|
50
44
|
--path, -p PATH Path to the target exectuable.
|
|
51
45
|
--extra, -E EXTRA [EXTRA ...]
|
|
@@ -60,9 +54,9 @@ class PsyncClient:
|
|
|
60
54
|
PSYNC_SERVER_PORT: The port of the server instance.
|
|
61
55
|
Default: 5000
|
|
62
56
|
PSYNC_SSH_PORT: The server instance's SSH port.
|
|
63
|
-
Default:
|
|
57
|
+
Default: 5022
|
|
64
58
|
PSYNC_SSH_USER: The server instance's SSH user.
|
|
65
|
-
Default:
|
|
59
|
+
Default: psync
|
|
66
60
|
PSYNC_CERT_PATH: Path to the SSL certificate. Used to trust self-signed certs. Should
|
|
67
61
|
match the server's certificate.
|
|
68
62
|
Default: ~/.local/share/psync/cert.pem
|
|
@@ -142,14 +136,14 @@ class PsyncClient:
|
|
|
142
136
|
|
|
143
137
|
def __rsync(project_hash: str, args: Args):
|
|
144
138
|
"""Runs rsync."""
|
|
145
|
-
|
|
146
|
-
url = f"{user}{SERVER_IP}:{SERVER_DEST}/{project_hash}/"
|
|
139
|
+
url = f"{SERVER_IP}:{SERVER_DEST}/{project_hash}/"
|
|
147
140
|
rsync_args = [
|
|
148
141
|
"rsync",
|
|
149
142
|
"-avzr",
|
|
143
|
+
"-e",
|
|
144
|
+
f"/usr/bin/ssh -l {USER} -p {str(SERVER_SSH_PORT)}",
|
|
150
145
|
"--progress",
|
|
151
146
|
"--mkpath",
|
|
152
|
-
f"--port={str(SERVER_SSH_PORT)}",
|
|
153
147
|
args.target_path,
|
|
154
148
|
*args.extra,
|
|
155
149
|
url,
|
|
@@ -6,6 +6,8 @@ import asyncio
|
|
|
6
6
|
from asyncio.subprocess import Process
|
|
7
7
|
from asyncio.tasks import Task
|
|
8
8
|
from collections.abc import Awaitable
|
|
9
|
+
import functools
|
|
10
|
+
import operator
|
|
9
11
|
from os import environ
|
|
10
12
|
from os.path import basename
|
|
11
13
|
import pathlib
|
|
@@ -187,8 +189,11 @@ class PsyncServer:
|
|
|
187
189
|
path = pathlib.Path.expanduser(req.path).resolve()
|
|
188
190
|
args = [str(path), *req.args]
|
|
189
191
|
env = {"PYTHONUNBUFFERED": "1", **req.env}
|
|
192
|
+
reduced: str = functools.reduce(
|
|
193
|
+
operator.add, map(lambda x: (f"{x[0]}={x[1]}"), env.items())
|
|
194
|
+
)
|
|
190
195
|
logging.info(
|
|
191
|
-
f"Running `{
|
|
196
|
+
f"Running `{reduced} [...]/{basename(args[0])} {' '.join(args[1:])}`"
|
|
192
197
|
)
|
|
193
198
|
try:
|
|
194
199
|
p = await asyncio.create_subprocess_exec(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cubething_psync-0.1.0.dev10 → cubething_psync-0.2.1}/src/cubething_psync.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{cubething_psync-0.1.0.dev10 → cubething_psync-0.2.1}/src/cubething_psync.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{cubething_psync-0.1.0.dev10 → cubething_psync-0.2.1}/src/cubething_psync.egg-info/requires.txt
RENAMED
|
File without changes
|
{cubething_psync-0.1.0.dev10 → cubething_psync-0.2.1}/src/cubething_psync.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|