confsync-server 0.1.0__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.
@@ -0,0 +1,69 @@
1
+ """systemd user-service management for bare-metal deployments.
2
+
3
+ Docker (deploy/) is the primary deployment mode; this is the alternative for
4
+ hosts without Docker. Mirrors the flexgate service pattern.
5
+ """
6
+ from __future__ import annotations
7
+
8
+ import os
9
+ import shutil
10
+ import subprocess
11
+ import sys
12
+
13
+ UNIT_NAME = "confsync-server.service"
14
+ UNIT_DIR = os.path.expanduser("~/.config/systemd/user")
15
+ UNIT_PATH = os.path.join(UNIT_DIR, UNIT_NAME)
16
+
17
+ UNIT_TEMPLATE = """\
18
+ [Unit]
19
+ Description=confsync server — encrypted config document store
20
+ After=network-online.target
21
+
22
+ [Service]
23
+ ExecStart={exe} serve
24
+ Restart=on-failure
25
+ RestartSec=3
26
+
27
+ [Install]
28
+ WantedBy=default.target
29
+ """
30
+
31
+
32
+ def _run(args: list[str]) -> subprocess.CompletedProcess[str]:
33
+ return subprocess.run(["systemctl", "--user", *args], capture_output=True, text=True)
34
+
35
+
36
+ def install() -> None:
37
+ exe = shutil.which("confsync-server")
38
+ if exe is None:
39
+ print("confsync-server executable not found in PATH.")
40
+ sys.exit(1)
41
+ os.makedirs(UNIT_DIR, exist_ok=True)
42
+ with open(UNIT_PATH, "w") as f:
43
+ f.write(UNIT_TEMPLATE.format(exe=exe))
44
+ _run(["daemon-reload"])
45
+ proc = _run(["enable", "--now", UNIT_NAME])
46
+ if proc.returncode != 0:
47
+ print(proc.stderr.strip())
48
+ sys.exit(1)
49
+ print(f"Installed and started {UNIT_NAME}.")
50
+
51
+
52
+ def uninstall() -> None:
53
+ _run(["disable", "--now", UNIT_NAME])
54
+ if os.path.exists(UNIT_PATH):
55
+ os.remove(UNIT_PATH)
56
+ _run(["daemon-reload"])
57
+ print(f"Uninstalled {UNIT_NAME}.")
58
+
59
+
60
+ def control(action: str) -> None:
61
+ if action == "status":
62
+ proc = _run(["status", UNIT_NAME])
63
+ print(proc.stdout or proc.stderr)
64
+ return
65
+ proc = _run([action, UNIT_NAME])
66
+ if proc.returncode != 0:
67
+ print(proc.stderr.strip())
68
+ sys.exit(1)
69
+ print(f"{action}: OK")
@@ -0,0 +1,20 @@
1
+ Metadata-Version: 2.5
2
+ Name: confsync-server
3
+ Version: 0.1.0
4
+ Summary: confsync server — encrypted config document store with GitHub OAuth and Web UI
5
+ Requires-Python: >=3.11
6
+ Requires-Dist: cryptography>=42
7
+ Requires-Dist: httpx>=0.27
8
+ Requires-Dist: python-multipart>=0.0.9
9
+ Requires-Dist: pyyaml>=6
10
+ Requires-Dist: starlette>=0.37
11
+ Requires-Dist: uvicorn>=0.29
12
+ Provides-Extra: dev
13
+ Requires-Dist: pytest>=8; extra == 'dev'
14
+ Description-Content-Type: text/markdown
15
+
16
+ # confsync-server
17
+
18
+ Server for [confsync](https://github.com/Agony5757/confsync) — encrypted config document store with GitHub OAuth and Web UI.
19
+
20
+ See the repository root README for full documentation.
@@ -0,0 +1,13 @@
1
+ confsync_server/__init__.py,sha256=e8lagNVICTgRYSBnStFQp3w78CfOWXBPvGMdr9TswGc,82
2
+ confsync_server/__main__.py,sha256=RX7tZXJcqFZ9Feqz4tcPzvazAfaIWL2fMzvZUaHHL9o,45
3
+ confsync_server/app.py,sha256=8OYiyQMVl-AWOn1RZTlJ64U9pQCq1qCoSUTa3yD-Jm4,26098
4
+ confsync_server/auth.py,sha256=ZQHoGrVudh5iUaKSEKi-2ummZ63PtosrNC2zJvATvcU,2510
5
+ confsync_server/cli.py,sha256=1zMAA3dpiux5tZEGVufKw4I0w8Z16meLCpQRv0ZyRdY,2928
6
+ confsync_server/config.py,sha256=TeZ8E6ztKIJMTl5hihYdwSoqmSohIUW3iEn9k9F6WwI,2668
7
+ confsync_server/crypto.py,sha256=FMf-zvkenT62sS30mDIZn74Ntyp51eZieRi7CgQSpcA,2274
8
+ confsync_server/db.py,sha256=928Y0PFROH05N7AtA0ZrhrnCn6j1s6DOvpKnwWiUmuk,12916
9
+ confsync_server/service.py,sha256=BhKyK_OkzwQxnY9U-UcZJpJnIuqWoC439Eyn7FIVY9Y,1828
10
+ confsync_server-0.1.0.dist-info/METADATA,sha256=wnRsuF_G3irTZrdeLcCd3zG0wjstRK3DXKsdZ6AHNEk,660
11
+ confsync_server-0.1.0.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
12
+ confsync_server-0.1.0.dist-info/entry_points.txt,sha256=MamuVuFHCmgyHDxZn1-9DVDIxVZ6x4VRBmiv8burakU,61
13
+ confsync_server-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.32.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ confsync-server = confsync_server.cli:main