···71717272## Syncthing Setup
73737474-### Files to Sync
7474+### What Gets Synced
7575+7676+**Screener list directory**: `~/.config/neomd/lists/` - you can also sync the entire `neomd` folder, if you don't have passwords stored in there, only ENVs:
7777+- `screened_in.txt`
7878+- `screened_out.txt`
7979+- `feed.txt`
8080+- `papertrail.txt`
8181+- `spam.txt`
8282+8383+### Step-by-Step Setup
8484+8585+#### 1. Install Syncthing
8686+8787+**On Arch Linux / Server:**
8888+```sh
8989+sudo pacman -S syncthing
9090+systemctl --user enable syncthing
9191+systemctl --user start syncthing
9292+```
9393+9494+**On other systems**: See [Syncthing installation docs](https://docs.syncthing.net/intro/getting-started.html)
9595+9696+> **Note**: Use `systemctl --user` instead of adding to window manager autostart scripts. This ensures Syncthing runs on login, works across different environments, and continues running independently of your desktop session.
9797+9898+#### 2. Access Web UI
9999+100100+Open http://localhost:8384 on each device
101101+102102+#### 3. Connect Devices
103103+104104+**On Device A (e.g., your laptop):**
105105+1. Go to **Actions** → **Show ID** to get your Device ID
106106+2. Copy the long alphanumeric Device ID
107107+108108+**On Device B (e.g., your server):**
109109+1. Click **Add Remote Device**
110110+2. Paste Device A's Device ID
111111+3. Name it (e.g., "laptop")
112112+4. Click **Save**
113113+114114+**Back on Device A:**
115115+1. Accept the connection notification
116116+2. Name Device B (e.g., "server")
117117+3. Click **Save**
118118+119119+Repeat for all devices (laptop, server, Android).
120120+121121+#### 4. Create Shared Folder
122122+123123+**On one device (e.g., server):**
124124+1. Click **Add Folder**
125125+2. Set **Folder Label**: `neomd-lists`
126126+3. Set **Folder ID**: `neomd-lists` (same on all devices)
127127+4. Set **Folder Path**: `/home/user/.config/neomd/lists/` (or `~/.config/neomd/` if syncing entire folder)
128128+5. Go to **Sharing** tab → check all other devices
129129+6. Go to **File Versioning** tab:
130130+ - Select **Simple File Versioning**
131131+ - Keep Versions: `5`
132132+7. Click **Save**
751337676-Configure Syncthing to sync the following files across all your devices:
134134+**On other devices:**
135135+1. Accept the folder share notification
136136+2. Verify/set the correct path for that device
137137+3. Enable **File Versioning** (same as above)
138138+4. Click **Save**
771397878-1. **Screener list directory**: `~/.config/neomd/lists/`
7979- - `screened_in.txt`
8080- - `screened_out.txt`
8181- - `feed.txt`
8282- - `papertrail.txt`
8383- - `spam.txt`
140140+#### 5. Backup First (Important!)
841418585-2. **Config file** (optional): `~/.config/neomd/config.toml`
8686- - Useful for keeping settings consistent across devices
8787- - Be careful with account-specific settings (passwords, paths)
142142+Before syncing existing data, **backup your lists**:
881438989-### Syncthing Folder Setup
144144+```sh
145145+cp -r ~/.config/neomd/lists ~/.config/neomd/lists.backup-$(date +%Y%m%d)
146146+```
901479191-1. **Install Syncthing** on all devices (NAS, laptop, Android)
9292-2. **Create a shared folder** named "neomd-lists"
9393-3. **Set folder path** to `~/.config/neomd/lists/` on each device
9494-4. **Connect devices** and wait for initial sync
148148+#### 6. Wait for Initial Sync
951499696-Example Syncthing folder configuration:
9797-- **Folder ID**: `neomd-lists`
9898-- **Folder Path**: `/home/user/.config/neomd/lists/`
9999-- **Folder Type**: Send & Receive
100100-- **File Versioning**: Simple File Versioning (keep 5 versions)
150150+Watch the folder status in the web UI. It will show "Syncing" with progress, then "Up to Date" when complete.
151151+152152+### Server Setup (FreeBSD / No GUI)
153153+154154+If running neomd headless on a FreeBSD server without a desktop environment, use SSH port forwarding to access the Syncthing web UI:
155155+156156+#### 1. Start Syncthing on FreeBSD
157157+158158+```sh
159159+# Enable and start as system service
160160+sudo sysrc syncthing_enable="YES"
161161+sudo sysrc syncthing_user="sspaeti"
162162+sudo service syncthing start
163163+164164+# Or run as user service (no sudo)
165165+syncthing &
166166+167167+# Or with nohup for persistent operation
168168+nohup syncthing > ~/syncthing.log 2>&1 &
169169+```
170170+171171+Check it's running:
172172+```sh
173173+ps aux | grep syncthing
174174+```
175175+176176+#### 2. SSH Port Forwarding
177177+178178+From your **local machine** (laptop/desktop with browser), create an SSH tunnel:
179179+180180+```sh
181181+ssh -L 8385:localhost:8384 your-server
182182+```
183183+184184+This forwards `localhost:8385` on your local machine to `localhost:8384` on the server.
185185+186186+Now open in your **local browser**: http://localhost:8385
187187+188188+You'll see the server's Syncthing web UI!
189189+190190+#### 3. Get Server Device ID
191191+192192+In the web UI at http://localhost:8385:
193193+1. Go to **Actions** → **Show ID**
194194+2. Copy the Device ID
195195+196196+#### 4. Connect Your Devices
197197+198198+**On your local machine's Syncthing** (http://localhost:8384):
199199+1. Click **Add Remote Device**
200200+2. Paste the server's Device ID
201201+3. Name it (e.g., "freebsd-server")
202202+4. Click **Save**
203203+204204+**On the server's UI** (http://localhost:8385 via SSH tunnel):
205205+1. Accept the connection notification
206206+2. Name your local device (e.g., "laptop")
207207+3. Click **Save**
208208+209209+#### 5. Share the Folder
210210+211211+**On your local machine** (http://localhost:8384):
212212+1. Find your existing `neomd-lists` folder
213213+2. Click **Edit**
214214+3. Go to **Sharing** tab
215215+4. Check the box next to your server device
216216+5. Click **Save**
217217+218218+**On the server** (http://localhost:8385):
219219+1. Accept the folder share notification
220220+2. Set **Folder Path**: `/home/user/.config/neomd/lists/` (or `~/.config/neomd/` if syncing entire folder)
221221+3. Go to **File Versioning** tab:
222222+ - Select **Simple File Versioning**
223223+ - Keep Versions: `5`
224224+4. Click **Save**
225225+226226+#### 6. Handle Existing Files
227227+228228+Before syncing, **backup the server's existing lists**:
229229+230230+```sh
231231+# On server
232232+cp -r ~/.config/neomd/lists ~/.config/neomd/lists.backup-$(date +%Y%m%d)
233233+```
234234+235235+Syncthing will merge files from both sides. To **start fresh from your local machine's data**:
236236+237237+```sh
238238+# On server - remove existing files (after backup!)
239239+rm -rf ~/.config/neomd/lists/*
240240+```
241241+242242+#### 7. Close SSH Tunnel
243243+244244+Once setup is complete, you can close the SSH tunnel (Ctrl+C in the SSH session). Devices will continue syncing in the background.
245245+246246+For future configuration changes, create the SSH tunnel again when needed:
247247+```sh
248248+ssh -L 8385:localhost:8384 your-server
249249+```
250250+251251+### Verify Sync is Working
252252+253253+```sh
254254+# Check files exist
255255+ls -la ~/.config/neomd/lists/
256256+257257+# Watch real-time sync in logs
258258+journalctl --user -u syncthing -f
259259+```
260260+261261+The daemon watches for file changes and reloads screener lists automatically when Syncthing updates them.
101262102263### Conflict Handling
103264104104-- **File-level conflicts**: Syncthing creates `.sync-conflict` files if two devices modify the same file simultaneously
265265+- **File-level conflicts**: Syncthing creates `.sync-conflict-*` files if two devices modify the same file simultaneously
105266- **Email-level**: IMAP is the source of truth; no local email state to conflict
106267- **Screener lists**: Append-only operations are safe; duplicates are harmless (normalized automatically)
107268108108-The daemon watches for file changes and reloads screener lists automatically when Syncthing updates them.
269269+Check for conflicts periodically:
270270+```sh
271271+find ~/.config/neomd/lists -name "*.sync-conflict-*"
272272+```
109273110274## Systemd Service (Optional)
111275