cubething_psync 0.1.0.dev9__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.
- {cubething_psync-0.1.0.dev9/src/cubething_psync.egg-info → cubething_psync-0.2.0}/PKG-INFO +1 -1
- {cubething_psync-0.1.0.dev9 → cubething_psync-0.2.0}/pyproject.toml +1 -1
- {cubething_psync-0.1.0.dev9 → cubething_psync-0.2.0}/src/client/args.py +4 -4
- {cubething_psync-0.1.0.dev9 → cubething_psync-0.2.0}/src/client/main.py +4 -3
- {cubething_psync-0.1.0.dev9 → cubething_psync-0.2.0/src/cubething_psync.egg-info}/PKG-INFO +1 -1
- {cubething_psync-0.1.0.dev9 → cubething_psync-0.2.0}/src/server/main.py +6 -1
- {cubething_psync-0.1.0.dev9 → cubething_psync-0.2.0}/LICENSE +0 -0
- {cubething_psync-0.1.0.dev9 → cubething_psync-0.2.0}/README.md +0 -0
- {cubething_psync-0.1.0.dev9 → cubething_psync-0.2.0}/setup.cfg +0 -0
- {cubething_psync-0.1.0.dev9 → cubething_psync-0.2.0}/src/client/__init__.py +0 -0
- {cubething_psync-0.1.0.dev9 → cubething_psync-0.2.0}/src/client/__main__.py +0 -0
- {cubething_psync-0.1.0.dev9 → cubething_psync-0.2.0}/src/common/__init__.py +0 -0
- {cubething_psync-0.1.0.dev9 → cubething_psync-0.2.0}/src/common/data.py +0 -0
- {cubething_psync-0.1.0.dev9 → cubething_psync-0.2.0}/src/common/log.py +0 -0
- {cubething_psync-0.1.0.dev9 → cubething_psync-0.2.0}/src/cubething_psync.egg-info/SOURCES.txt +0 -0
- {cubething_psync-0.1.0.dev9 → cubething_psync-0.2.0}/src/cubething_psync.egg-info/dependency_links.txt +0 -0
- {cubething_psync-0.1.0.dev9 → cubething_psync-0.2.0}/src/cubething_psync.egg-info/entry_points.txt +0 -0
- {cubething_psync-0.1.0.dev9 → cubething_psync-0.2.0}/src/cubething_psync.egg-info/requires.txt +0 -0
- {cubething_psync-0.1.0.dev9 → cubething_psync-0.2.0}/src/cubething_psync.egg-info/top_level.txt +0 -0
- {cubething_psync-0.1.0.dev9 → cubething_psync-0.2.0}/src/server/__init__.py +0 -0
- {cubething_psync-0.1.0.dev9 → cubething_psync-0.2.0}/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
|
|
|
@@ -62,7 +62,7 @@ class PsyncClient:
|
|
|
62
62
|
PSYNC_SSH_PORT: The server instance's SSH port.
|
|
63
63
|
Default: 5001
|
|
64
64
|
PSYNC_SSH_USER: The server instance's SSH user.
|
|
65
|
-
Default:
|
|
65
|
+
Default: psync
|
|
66
66
|
PSYNC_CERT_PATH: Path to the SSL certificate. Used to trust self-signed certs. Should
|
|
67
67
|
match the server's certificate.
|
|
68
68
|
Default: ~/.local/share/psync/cert.pem
|
|
@@ -142,11 +142,12 @@ class PsyncClient:
|
|
|
142
142
|
|
|
143
143
|
def __rsync(project_hash: str, args: Args):
|
|
144
144
|
"""Runs rsync."""
|
|
145
|
-
|
|
146
|
-
url = f"ssh://{user}{SERVER_IP}:{SERVER_SSH_PORT}/{SERVER_DEST}/{project_hash}/"
|
|
145
|
+
url = f"{SERVER_IP}:{SERVER_DEST}/{project_hash}/"
|
|
147
146
|
rsync_args = [
|
|
148
147
|
"rsync",
|
|
149
148
|
"-avzr",
|
|
149
|
+
"-e",
|
|
150
|
+
f"/usr/bin/ssh -l {USER} -p {str(SERVER_SSH_PORT)}",
|
|
150
151
|
"--progress",
|
|
151
152
|
"--mkpath",
|
|
152
153
|
args.target_path,
|
|
@@ -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.dev9 → cubething_psync-0.2.0}/src/cubething_psync.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{cubething_psync-0.1.0.dev9 → cubething_psync-0.2.0}/src/cubething_psync.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{cubething_psync-0.1.0.dev9 → cubething_psync-0.2.0}/src/cubething_psync.egg-info/requires.txt
RENAMED
|
File without changes
|
{cubething_psync-0.1.0.dev9 → cubething_psync-0.2.0}/src/cubething_psync.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|