SyncTwink 0.1.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.
- synctwink-0.1.0/LICENSE +21 -0
- synctwink-0.1.0/PKG-INFO +138 -0
- synctwink-0.1.0/README.md +120 -0
- synctwink-0.1.0/SyncTwink.egg-info/PKG-INFO +138 -0
- synctwink-0.1.0/SyncTwink.egg-info/SOURCES.txt +25 -0
- synctwink-0.1.0/SyncTwink.egg-info/dependency_links.txt +1 -0
- synctwink-0.1.0/SyncTwink.egg-info/entry_points.txt +2 -0
- synctwink-0.1.0/SyncTwink.egg-info/requires.txt +7 -0
- synctwink-0.1.0/SyncTwink.egg-info/top_level.txt +1 -0
- synctwink-0.1.0/pyproject.toml +32 -0
- synctwink-0.1.0/setup.cfg +4 -0
- synctwink-0.1.0/synctwink/__init__.py +8 -0
- synctwink-0.1.0/synctwink/__main__.py +4 -0
- synctwink-0.1.0/synctwink/cli.py +434 -0
- synctwink-0.1.0/synctwink/config.py +204 -0
- synctwink-0.1.0/synctwink/osutil.py +108 -0
- synctwink-0.1.0/synctwink/services.py +137 -0
- synctwink-0.1.0/synctwink/syncthing.py +418 -0
- synctwink-0.1.0/synctwink/tailscale.py +80 -0
- synctwink-0.1.0/synctwink/templates/config.example.yaml +40 -0
- synctwink-0.1.0/synctwink/templates/io.synctwink.battery.plist.tmpl +27 -0
- synctwink-0.1.0/synctwink/templates/io.synctwink.webdav.plist.tmpl +28 -0
- synctwink-0.1.0/synctwink/templates/stignore.example +52 -0
- synctwink-0.1.0/synctwink/templates/synctwink-webdav.service.tmpl +19 -0
- synctwink-0.1.0/synctwink/webdav.py +94 -0
- synctwink-0.1.0/tests/test_config.py +75 -0
- synctwink-0.1.0/tests/test_sync.py +82 -0
synctwink-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jake
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
synctwink-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: SyncTwink
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A skinny but powerful, self-hosted file sync across your devices over a Tailscale tailnet.
|
|
5
|
+
Author: Jake
|
|
6
|
+
License: MIT
|
|
7
|
+
Keywords: webdav,syncthing,tailscale,file-sync,self-hosted
|
|
8
|
+
Requires-Python: >=3.9
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Requires-Dist: WsgiDAV>=4.3.0
|
|
12
|
+
Requires-Dist: cheroot>=10.0.0
|
|
13
|
+
Requires-Dist: PyYAML>=6.0
|
|
14
|
+
Requires-Dist: requests>=2.28
|
|
15
|
+
Provides-Extra: dev
|
|
16
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
17
|
+
Dynamic: license-file
|
|
18
|
+
|
|
19
|
+
# SyncTwink
|
|
20
|
+
|
|
21
|
+
A skinny but powerful, self-hosted file sync across your devices over a [Tailscale](https://tailscale.com) tailnet.
|
|
22
|
+
|
|
23
|
+
Two always-on servers (e.g. a **Raspberry Pi** and a **Mac Mini**) each expose
|
|
24
|
+
the *same* folder over **WebDAV** for iOS Files and other clients, while
|
|
25
|
+
**Syncthing** keeps the two copies replicated. Either server can go offline and
|
|
26
|
+
your files stay reachable from the other.
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
Tailnet (WireGuard, end-to-end encrypted)
|
|
30
|
+
┌──────────────────────────────────────────────────┐
|
|
31
|
+
│ │
|
|
32
|
+
┌──┴──────────────┐ Syncthing replication ┌─────────┴───────┐
|
|
33
|
+
│ Raspberry Pi │ <───────────────────────> │ Mac Mini │
|
|
34
|
+
│ • Tailscale │ │ • Tailscale │
|
|
35
|
+
│ • WebDAV :8080 │ │ • WebDAV :8080 │
|
|
36
|
+
│ • Syncthing │ │ • Syncthing │
|
|
37
|
+
└──┬──────────────┘ └─────────┬───────┘
|
|
38
|
+
│ │
|
|
39
|
+
│ WebDAV over Tailscale (HTTP/HTTPS) │
|
|
40
|
+
└──────────────────────┬──────────────────────────────┘
|
|
41
|
+
│
|
|
42
|
+
┌─────────────┴─────────────┐
|
|
43
|
+
│ iPhone / iPad Files app │ ← connects to whichever
|
|
44
|
+
│ Mac / other devices │ server is reachable
|
|
45
|
+
└───────────────────────────┘
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
SyncTwink is the glue: a small Python package + CLI you install on **each
|
|
49
|
+
server**. It configures the WebDAV service (via [WsgiDAV](https://wsgidav.readthedocs.io/)),
|
|
50
|
+
sets up the Syncthing shared folder, and optionally fronts WebDAV with HTTPS
|
|
51
|
+
using `tailscale serve`.
|
|
52
|
+
|
|
53
|
+
## What it does
|
|
54
|
+
|
|
55
|
+
- **WebDAV server** backed by WsgiDAV + cheroot, serving one folder with
|
|
56
|
+
per-user auth (basic + digest). Works with iOS Files, macOS Finder, and any
|
|
57
|
+
WebDAV client.
|
|
58
|
+
- **Syncthing replication** between the two servers, configured for you via
|
|
59
|
+
Syncthing's REST API (adds the folder, pairs peers, enables file versioning).
|
|
60
|
+
- **Native services** — installed as a `systemd` unit on Linux or a `launchd`
|
|
61
|
+
agent/daemon on macOS, so WebDAV starts on boot and restarts on failure.
|
|
62
|
+
- **Tailscale-aware** — reads your tailnet status to print the right
|
|
63
|
+
connection URLs and can expose WebDAV over HTTPS with a valid MagicDNS cert.
|
|
64
|
+
|
|
65
|
+
SyncTwink assumes Tailscale is already installed and `tailscale up` has been
|
|
66
|
+
run on each machine. It does **not** manage the tailnet itself.
|
|
67
|
+
|
|
68
|
+
## Quick start (run on *each* server)
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# 1. Install the CLI (pick one)
|
|
72
|
+
pipx install synctwink
|
|
73
|
+
# or from source:
|
|
74
|
+
# pipx install git+https://github.com/jchaselubitz/synctwink.git
|
|
75
|
+
# pipx install . # from a git clone
|
|
76
|
+
|
|
77
|
+
# 2. Create a config (generates a WebDAV password for you)
|
|
78
|
+
sudo synctwink init --user jake --data-dir /srv/synctwink/data
|
|
79
|
+
|
|
80
|
+
# 3. Find this machine's Syncthing device id (after Syncthing has run once)
|
|
81
|
+
synctwink syncthing id
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Put **each server's** device id into the **other server's** config under
|
|
85
|
+
`syncthing.peers`, then on both machines:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
sudo synctwink install # installs deps, configures Syncthing, starts WebDAV
|
|
89
|
+
synctwink status # health check + connection URLs
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
See [`docs/INSTALL.md`](docs/INSTALL.md) for the full walkthrough and
|
|
93
|
+
[`docs/IOS.md`](docs/IOS.md) for connecting the iPhone Files app.
|
|
94
|
+
|
|
95
|
+
## CLI
|
|
96
|
+
|
|
97
|
+
| Command | What it does |
|
|
98
|
+
| --- | --- |
|
|
99
|
+
| `synctwink init` | Write a config file (with a generated password). |
|
|
100
|
+
| `synctwink install` | Full setup: deps, Syncthing folder/peers, WebDAV service, HTTPS. |
|
|
101
|
+
| `synctwink serve` | Run the WebDAV server in the foreground (used by the service). |
|
|
102
|
+
| `synctwink status` | Show Tailscale / WebDAV / Syncthing health + URLs. |
|
|
103
|
+
| `synctwink info` | Print client connection details (for iOS Files etc.). |
|
|
104
|
+
| `synctwink syncthing id` | Print this node's Syncthing device id. |
|
|
105
|
+
| `synctwink syncthing pair <id>` | Add a peer and share the folder with it. |
|
|
106
|
+
| `synctwink syncthing configure` | Re-apply folder + peers from config. |
|
|
107
|
+
| `synctwink sync` | Wake Syncthing, pull/push now, re-quiet on battery (for laptops). |
|
|
108
|
+
| `synctwink pause` / `synctwink resume` | Stop / start peer syncing. |
|
|
109
|
+
| `synctwink service restart` | Restart the WebDAV service. |
|
|
110
|
+
| `synctwink uninstall` | Remove the WebDAV service and reset `tailscale serve`. |
|
|
111
|
+
|
|
112
|
+
For an **often-offline laptop** that wants offline files without burning
|
|
113
|
+
battery, see [`docs/LAPTOP.md`](docs/LAPTOP.md): join it as a Syncthing peer,
|
|
114
|
+
pause on battery, and use `synctwink sync` to pull changes on demand.
|
|
115
|
+
|
|
116
|
+
## Configuration
|
|
117
|
+
|
|
118
|
+
A single YAML file. Default location is `/etc/synctwink/config.yaml` (root) or
|
|
119
|
+
`~/.config/synctwink/config.yaml`. Override with `--config` or `SYNCTWINK_CONFIG`.
|
|
120
|
+
See [`synctwink/templates/config.example.yaml`](synctwink/templates/config.example.yaml).
|
|
121
|
+
|
|
122
|
+
The config holds plaintext WebDAV passwords and is written `0600`. Because all
|
|
123
|
+
traffic rides the encrypted tailnet, HTTP basic auth is safe here.
|
|
124
|
+
|
|
125
|
+
## Requirements
|
|
126
|
+
|
|
127
|
+
- Python 3.9+
|
|
128
|
+
- Tailscale (installed + `tailscale up` already done)
|
|
129
|
+
- Syncthing (auto-installed via `apt`/`dnf`/`pacman`/`brew` if missing)
|
|
130
|
+
- A Linux host with `systemd`, or macOS with `launchd`
|
|
131
|
+
|
|
132
|
+
## Architecture & design notes
|
|
133
|
+
|
|
134
|
+
See [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md).
|
|
135
|
+
|
|
136
|
+
## License
|
|
137
|
+
|
|
138
|
+
MIT — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# SyncTwink
|
|
2
|
+
|
|
3
|
+
A skinny but powerful, self-hosted file sync across your devices over a [Tailscale](https://tailscale.com) tailnet.
|
|
4
|
+
|
|
5
|
+
Two always-on servers (e.g. a **Raspberry Pi** and a **Mac Mini**) each expose
|
|
6
|
+
the *same* folder over **WebDAV** for iOS Files and other clients, while
|
|
7
|
+
**Syncthing** keeps the two copies replicated. Either server can go offline and
|
|
8
|
+
your files stay reachable from the other.
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
Tailnet (WireGuard, end-to-end encrypted)
|
|
12
|
+
┌──────────────────────────────────────────────────┐
|
|
13
|
+
│ │
|
|
14
|
+
┌──┴──────────────┐ Syncthing replication ┌─────────┴───────┐
|
|
15
|
+
│ Raspberry Pi │ <───────────────────────> │ Mac Mini │
|
|
16
|
+
│ • Tailscale │ │ • Tailscale │
|
|
17
|
+
│ • WebDAV :8080 │ │ • WebDAV :8080 │
|
|
18
|
+
│ • Syncthing │ │ • Syncthing │
|
|
19
|
+
└──┬──────────────┘ └─────────┬───────┘
|
|
20
|
+
│ │
|
|
21
|
+
│ WebDAV over Tailscale (HTTP/HTTPS) │
|
|
22
|
+
└──────────────────────┬──────────────────────────────┘
|
|
23
|
+
│
|
|
24
|
+
┌─────────────┴─────────────┐
|
|
25
|
+
│ iPhone / iPad Files app │ ← connects to whichever
|
|
26
|
+
│ Mac / other devices │ server is reachable
|
|
27
|
+
└───────────────────────────┘
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
SyncTwink is the glue: a small Python package + CLI you install on **each
|
|
31
|
+
server**. It configures the WebDAV service (via [WsgiDAV](https://wsgidav.readthedocs.io/)),
|
|
32
|
+
sets up the Syncthing shared folder, and optionally fronts WebDAV with HTTPS
|
|
33
|
+
using `tailscale serve`.
|
|
34
|
+
|
|
35
|
+
## What it does
|
|
36
|
+
|
|
37
|
+
- **WebDAV server** backed by WsgiDAV + cheroot, serving one folder with
|
|
38
|
+
per-user auth (basic + digest). Works with iOS Files, macOS Finder, and any
|
|
39
|
+
WebDAV client.
|
|
40
|
+
- **Syncthing replication** between the two servers, configured for you via
|
|
41
|
+
Syncthing's REST API (adds the folder, pairs peers, enables file versioning).
|
|
42
|
+
- **Native services** — installed as a `systemd` unit on Linux or a `launchd`
|
|
43
|
+
agent/daemon on macOS, so WebDAV starts on boot and restarts on failure.
|
|
44
|
+
- **Tailscale-aware** — reads your tailnet status to print the right
|
|
45
|
+
connection URLs and can expose WebDAV over HTTPS with a valid MagicDNS cert.
|
|
46
|
+
|
|
47
|
+
SyncTwink assumes Tailscale is already installed and `tailscale up` has been
|
|
48
|
+
run on each machine. It does **not** manage the tailnet itself.
|
|
49
|
+
|
|
50
|
+
## Quick start (run on *each* server)
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
# 1. Install the CLI (pick one)
|
|
54
|
+
pipx install synctwink
|
|
55
|
+
# or from source:
|
|
56
|
+
# pipx install git+https://github.com/jchaselubitz/synctwink.git
|
|
57
|
+
# pipx install . # from a git clone
|
|
58
|
+
|
|
59
|
+
# 2. Create a config (generates a WebDAV password for you)
|
|
60
|
+
sudo synctwink init --user jake --data-dir /srv/synctwink/data
|
|
61
|
+
|
|
62
|
+
# 3. Find this machine's Syncthing device id (after Syncthing has run once)
|
|
63
|
+
synctwink syncthing id
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Put **each server's** device id into the **other server's** config under
|
|
67
|
+
`syncthing.peers`, then on both machines:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
sudo synctwink install # installs deps, configures Syncthing, starts WebDAV
|
|
71
|
+
synctwink status # health check + connection URLs
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
See [`docs/INSTALL.md`](docs/INSTALL.md) for the full walkthrough and
|
|
75
|
+
[`docs/IOS.md`](docs/IOS.md) for connecting the iPhone Files app.
|
|
76
|
+
|
|
77
|
+
## CLI
|
|
78
|
+
|
|
79
|
+
| Command | What it does |
|
|
80
|
+
| --- | --- |
|
|
81
|
+
| `synctwink init` | Write a config file (with a generated password). |
|
|
82
|
+
| `synctwink install` | Full setup: deps, Syncthing folder/peers, WebDAV service, HTTPS. |
|
|
83
|
+
| `synctwink serve` | Run the WebDAV server in the foreground (used by the service). |
|
|
84
|
+
| `synctwink status` | Show Tailscale / WebDAV / Syncthing health + URLs. |
|
|
85
|
+
| `synctwink info` | Print client connection details (for iOS Files etc.). |
|
|
86
|
+
| `synctwink syncthing id` | Print this node's Syncthing device id. |
|
|
87
|
+
| `synctwink syncthing pair <id>` | Add a peer and share the folder with it. |
|
|
88
|
+
| `synctwink syncthing configure` | Re-apply folder + peers from config. |
|
|
89
|
+
| `synctwink sync` | Wake Syncthing, pull/push now, re-quiet on battery (for laptops). |
|
|
90
|
+
| `synctwink pause` / `synctwink resume` | Stop / start peer syncing. |
|
|
91
|
+
| `synctwink service restart` | Restart the WebDAV service. |
|
|
92
|
+
| `synctwink uninstall` | Remove the WebDAV service and reset `tailscale serve`. |
|
|
93
|
+
|
|
94
|
+
For an **often-offline laptop** that wants offline files without burning
|
|
95
|
+
battery, see [`docs/LAPTOP.md`](docs/LAPTOP.md): join it as a Syncthing peer,
|
|
96
|
+
pause on battery, and use `synctwink sync` to pull changes on demand.
|
|
97
|
+
|
|
98
|
+
## Configuration
|
|
99
|
+
|
|
100
|
+
A single YAML file. Default location is `/etc/synctwink/config.yaml` (root) or
|
|
101
|
+
`~/.config/synctwink/config.yaml`. Override with `--config` or `SYNCTWINK_CONFIG`.
|
|
102
|
+
See [`synctwink/templates/config.example.yaml`](synctwink/templates/config.example.yaml).
|
|
103
|
+
|
|
104
|
+
The config holds plaintext WebDAV passwords and is written `0600`. Because all
|
|
105
|
+
traffic rides the encrypted tailnet, HTTP basic auth is safe here.
|
|
106
|
+
|
|
107
|
+
## Requirements
|
|
108
|
+
|
|
109
|
+
- Python 3.9+
|
|
110
|
+
- Tailscale (installed + `tailscale up` already done)
|
|
111
|
+
- Syncthing (auto-installed via `apt`/`dnf`/`pacman`/`brew` if missing)
|
|
112
|
+
- A Linux host with `systemd`, or macOS with `launchd`
|
|
113
|
+
|
|
114
|
+
## Architecture & design notes
|
|
115
|
+
|
|
116
|
+
See [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md).
|
|
117
|
+
|
|
118
|
+
## License
|
|
119
|
+
|
|
120
|
+
MIT — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: SyncTwink
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A skinny but powerful, self-hosted file sync across your devices over a Tailscale tailnet.
|
|
5
|
+
Author: Jake
|
|
6
|
+
License: MIT
|
|
7
|
+
Keywords: webdav,syncthing,tailscale,file-sync,self-hosted
|
|
8
|
+
Requires-Python: >=3.9
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Requires-Dist: WsgiDAV>=4.3.0
|
|
12
|
+
Requires-Dist: cheroot>=10.0.0
|
|
13
|
+
Requires-Dist: PyYAML>=6.0
|
|
14
|
+
Requires-Dist: requests>=2.28
|
|
15
|
+
Provides-Extra: dev
|
|
16
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
17
|
+
Dynamic: license-file
|
|
18
|
+
|
|
19
|
+
# SyncTwink
|
|
20
|
+
|
|
21
|
+
A skinny but powerful, self-hosted file sync across your devices over a [Tailscale](https://tailscale.com) tailnet.
|
|
22
|
+
|
|
23
|
+
Two always-on servers (e.g. a **Raspberry Pi** and a **Mac Mini**) each expose
|
|
24
|
+
the *same* folder over **WebDAV** for iOS Files and other clients, while
|
|
25
|
+
**Syncthing** keeps the two copies replicated. Either server can go offline and
|
|
26
|
+
your files stay reachable from the other.
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
Tailnet (WireGuard, end-to-end encrypted)
|
|
30
|
+
┌──────────────────────────────────────────────────┐
|
|
31
|
+
│ │
|
|
32
|
+
┌──┴──────────────┐ Syncthing replication ┌─────────┴───────┐
|
|
33
|
+
│ Raspberry Pi │ <───────────────────────> │ Mac Mini │
|
|
34
|
+
│ • Tailscale │ │ • Tailscale │
|
|
35
|
+
│ • WebDAV :8080 │ │ • WebDAV :8080 │
|
|
36
|
+
│ • Syncthing │ │ • Syncthing │
|
|
37
|
+
└──┬──────────────┘ └─────────┬───────┘
|
|
38
|
+
│ │
|
|
39
|
+
│ WebDAV over Tailscale (HTTP/HTTPS) │
|
|
40
|
+
└──────────────────────┬──────────────────────────────┘
|
|
41
|
+
│
|
|
42
|
+
┌─────────────┴─────────────┐
|
|
43
|
+
│ iPhone / iPad Files app │ ← connects to whichever
|
|
44
|
+
│ Mac / other devices │ server is reachable
|
|
45
|
+
└───────────────────────────┘
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
SyncTwink is the glue: a small Python package + CLI you install on **each
|
|
49
|
+
server**. It configures the WebDAV service (via [WsgiDAV](https://wsgidav.readthedocs.io/)),
|
|
50
|
+
sets up the Syncthing shared folder, and optionally fronts WebDAV with HTTPS
|
|
51
|
+
using `tailscale serve`.
|
|
52
|
+
|
|
53
|
+
## What it does
|
|
54
|
+
|
|
55
|
+
- **WebDAV server** backed by WsgiDAV + cheroot, serving one folder with
|
|
56
|
+
per-user auth (basic + digest). Works with iOS Files, macOS Finder, and any
|
|
57
|
+
WebDAV client.
|
|
58
|
+
- **Syncthing replication** between the two servers, configured for you via
|
|
59
|
+
Syncthing's REST API (adds the folder, pairs peers, enables file versioning).
|
|
60
|
+
- **Native services** — installed as a `systemd` unit on Linux or a `launchd`
|
|
61
|
+
agent/daemon on macOS, so WebDAV starts on boot and restarts on failure.
|
|
62
|
+
- **Tailscale-aware** — reads your tailnet status to print the right
|
|
63
|
+
connection URLs and can expose WebDAV over HTTPS with a valid MagicDNS cert.
|
|
64
|
+
|
|
65
|
+
SyncTwink assumes Tailscale is already installed and `tailscale up` has been
|
|
66
|
+
run on each machine. It does **not** manage the tailnet itself.
|
|
67
|
+
|
|
68
|
+
## Quick start (run on *each* server)
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# 1. Install the CLI (pick one)
|
|
72
|
+
pipx install synctwink
|
|
73
|
+
# or from source:
|
|
74
|
+
# pipx install git+https://github.com/jchaselubitz/synctwink.git
|
|
75
|
+
# pipx install . # from a git clone
|
|
76
|
+
|
|
77
|
+
# 2. Create a config (generates a WebDAV password for you)
|
|
78
|
+
sudo synctwink init --user jake --data-dir /srv/synctwink/data
|
|
79
|
+
|
|
80
|
+
# 3. Find this machine's Syncthing device id (after Syncthing has run once)
|
|
81
|
+
synctwink syncthing id
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Put **each server's** device id into the **other server's** config under
|
|
85
|
+
`syncthing.peers`, then on both machines:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
sudo synctwink install # installs deps, configures Syncthing, starts WebDAV
|
|
89
|
+
synctwink status # health check + connection URLs
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
See [`docs/INSTALL.md`](docs/INSTALL.md) for the full walkthrough and
|
|
93
|
+
[`docs/IOS.md`](docs/IOS.md) for connecting the iPhone Files app.
|
|
94
|
+
|
|
95
|
+
## CLI
|
|
96
|
+
|
|
97
|
+
| Command | What it does |
|
|
98
|
+
| --- | --- |
|
|
99
|
+
| `synctwink init` | Write a config file (with a generated password). |
|
|
100
|
+
| `synctwink install` | Full setup: deps, Syncthing folder/peers, WebDAV service, HTTPS. |
|
|
101
|
+
| `synctwink serve` | Run the WebDAV server in the foreground (used by the service). |
|
|
102
|
+
| `synctwink status` | Show Tailscale / WebDAV / Syncthing health + URLs. |
|
|
103
|
+
| `synctwink info` | Print client connection details (for iOS Files etc.). |
|
|
104
|
+
| `synctwink syncthing id` | Print this node's Syncthing device id. |
|
|
105
|
+
| `synctwink syncthing pair <id>` | Add a peer and share the folder with it. |
|
|
106
|
+
| `synctwink syncthing configure` | Re-apply folder + peers from config. |
|
|
107
|
+
| `synctwink sync` | Wake Syncthing, pull/push now, re-quiet on battery (for laptops). |
|
|
108
|
+
| `synctwink pause` / `synctwink resume` | Stop / start peer syncing. |
|
|
109
|
+
| `synctwink service restart` | Restart the WebDAV service. |
|
|
110
|
+
| `synctwink uninstall` | Remove the WebDAV service and reset `tailscale serve`. |
|
|
111
|
+
|
|
112
|
+
For an **often-offline laptop** that wants offline files without burning
|
|
113
|
+
battery, see [`docs/LAPTOP.md`](docs/LAPTOP.md): join it as a Syncthing peer,
|
|
114
|
+
pause on battery, and use `synctwink sync` to pull changes on demand.
|
|
115
|
+
|
|
116
|
+
## Configuration
|
|
117
|
+
|
|
118
|
+
A single YAML file. Default location is `/etc/synctwink/config.yaml` (root) or
|
|
119
|
+
`~/.config/synctwink/config.yaml`. Override with `--config` or `SYNCTWINK_CONFIG`.
|
|
120
|
+
See [`synctwink/templates/config.example.yaml`](synctwink/templates/config.example.yaml).
|
|
121
|
+
|
|
122
|
+
The config holds plaintext WebDAV passwords and is written `0600`. Because all
|
|
123
|
+
traffic rides the encrypted tailnet, HTTP basic auth is safe here.
|
|
124
|
+
|
|
125
|
+
## Requirements
|
|
126
|
+
|
|
127
|
+
- Python 3.9+
|
|
128
|
+
- Tailscale (installed + `tailscale up` already done)
|
|
129
|
+
- Syncthing (auto-installed via `apt`/`dnf`/`pacman`/`brew` if missing)
|
|
130
|
+
- A Linux host with `systemd`, or macOS with `launchd`
|
|
131
|
+
|
|
132
|
+
## Architecture & design notes
|
|
133
|
+
|
|
134
|
+
See [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md).
|
|
135
|
+
|
|
136
|
+
## License
|
|
137
|
+
|
|
138
|
+
MIT — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
SyncTwink.egg-info/PKG-INFO
|
|
5
|
+
SyncTwink.egg-info/SOURCES.txt
|
|
6
|
+
SyncTwink.egg-info/dependency_links.txt
|
|
7
|
+
SyncTwink.egg-info/entry_points.txt
|
|
8
|
+
SyncTwink.egg-info/requires.txt
|
|
9
|
+
SyncTwink.egg-info/top_level.txt
|
|
10
|
+
synctwink/__init__.py
|
|
11
|
+
synctwink/__main__.py
|
|
12
|
+
synctwink/cli.py
|
|
13
|
+
synctwink/config.py
|
|
14
|
+
synctwink/osutil.py
|
|
15
|
+
synctwink/services.py
|
|
16
|
+
synctwink/syncthing.py
|
|
17
|
+
synctwink/tailscale.py
|
|
18
|
+
synctwink/webdav.py
|
|
19
|
+
synctwink/templates/config.example.yaml
|
|
20
|
+
synctwink/templates/io.synctwink.battery.plist.tmpl
|
|
21
|
+
synctwink/templates/io.synctwink.webdav.plist.tmpl
|
|
22
|
+
synctwink/templates/stignore.example
|
|
23
|
+
synctwink/templates/synctwink-webdav.service.tmpl
|
|
24
|
+
tests/test_config.py
|
|
25
|
+
tests/test_sync.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
synctwink
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "SyncTwink"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "A skinny but powerful, self-hosted file sync across your devices over a Tailscale tailnet."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
authors = [{ name = "Jake" }]
|
|
13
|
+
keywords = ["webdav", "syncthing", "tailscale", "file-sync", "self-hosted"]
|
|
14
|
+
|
|
15
|
+
dependencies = [
|
|
16
|
+
"WsgiDAV>=4.3.0",
|
|
17
|
+
"cheroot>=10.0.0",
|
|
18
|
+
"PyYAML>=6.0",
|
|
19
|
+
"requests>=2.28",
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
[project.scripts]
|
|
23
|
+
synctwink = "synctwink.cli:main"
|
|
24
|
+
|
|
25
|
+
[project.optional-dependencies]
|
|
26
|
+
dev = ["pytest>=7.0"]
|
|
27
|
+
|
|
28
|
+
[tool.setuptools]
|
|
29
|
+
packages = ["synctwink"]
|
|
30
|
+
|
|
31
|
+
[tool.setuptools.package-data]
|
|
32
|
+
synctwink = ["templates/*"]
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"""SyncTwink: personal cross-device file sync over a Tailscale tailnet.
|
|
2
|
+
|
|
3
|
+
Two always-on servers (e.g. a Raspberry Pi and a Mac Mini) each expose the same
|
|
4
|
+
folder over WebDAV (for iOS Files and ad-hoc clients) while Syncthing keeps the
|
|
5
|
+
two copies replicated so either server can go offline without data loss.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
__version__ = "0.1.0"
|