mirror of
https://github.com/narrrl/proton-drive-linux.git
synced 2026-11-16 17:51:59 +01:00
feat(gui,core,cli): edit excluded files, open-with rules and the launcher in Preferences (#99)
Preferences gains two pages for the config.json settings that had no place in the app: - Sync: the patterns every synced folder leaves out (own patterns, and each built-in one on or off), and what the conflict sweep may do. - Apps: which program opens which kind of file (open_with), and how the search launcher opens (prompt). Each synced folder kept on this computer gets "Excluded Files…" in its menu for its own .pdfsignore: checked as typed, "Check a path" says which rule decides, and a version changed elsewhere is never written over without asking. `pdfs sync ignore list|add|remove|reset|check` does the same from a terminal, and `--page preferences-sync` (and -apps, -storage) opens Preferences at a page. Every writer of config.json now goes through AppDirs::update_config, which reads, changes and writes under an flock on config.json.lock, so the app, the tray and the daemon no longer undo each other's change (B292). The opener reads its rules on each open, so a new rule applies without a restart. The built-in ignore list also leaves out what Nextcloud, Dropbox and Syncthing leave out: desktop.ini, .directory, trash folders, NFS/FUSE leftovers, partial downloads, Kate swap and office lock files.
This commit is contained in:
1 parent
14b9e0fe64
commit
0df4b3c5f9
40 files changed
+8376
-3303
No files matched your search
@@ -306,6 +306,7 @@ a live account since.
|
||||
|
||||
| Entry | Title |
|
||||
|---|---|
|
||||
| [B292](#b292--two-programs-changing-settings-at-once-lose-one-of-the-changes) | Two programs changing settings at once lose one of the changes |
|
||||
| [B290](#b290--reopening-the-database-right-after-closing-it-can-be-refused-as-another-daemon) | Reopening the database right after closing it can be refused as another daemon |
|
||||
| [B276](#b276--a-stop-can-end-with-a-panic-in-a-thread-the-stop-never-waited-for) | A stop can end with a panic in a thread the stop never waited for |
|
||||
| [B258](#b258--journalctl--p-warning-shows-nothing-whatever-the-daemon-logged) | `journalctl -p warning` shows nothing, whatever the daemon logged |
|
||||
@@ -394,6 +395,34 @@ a live account since.
|
||||
|
||||
Newest first.
|
||||
|
||||
### B292 — Two programs changing settings at once lose one of the changes
|
||||
|
||||
**Status:** Fixed
|
||||
|
||||
**Found:** 2026-11-15, reading every writer of `config.json` while adding settings to Preferences.
|
||||
|
||||
**Where:** `crates/pdfs-core/src/config.rs`, `AppDirs::save_config` and its callers in the app,
|
||||
the tray and the daemon
|
||||
|
||||
**Repro:** Change the cache size in Preferences (the daemon writes `cache_budget`) while the app
|
||||
saves the window size or the tray hides itself. Both read the file before either wrote it, and
|
||||
the one that wrote last puts the other setting back. Not seen in the field; the window is a few
|
||||
milliseconds, but more settings in the app make it more likely.
|
||||
|
||||
**Cause:** Every writer loaded the file, changed one field and wrote the whole file back, with
|
||||
nothing ordering them. The atomic rename kept the file whole, not the changes.
|
||||
|
||||
**Fix:** `AppDirs::update_config` reads, changes and writes under an `flock` on
|
||||
`config.json.lock`, and every writer goes through it. It refuses an unreadable file before
|
||||
applying the change (B223). A lock held longer than 5 seconds is reported as an error instead of
|
||||
waited on.
|
||||
|
||||
**Verified:** `cargo test -p pdfs-core config::tests` on 2026-11-15,
|
||||
`concurrent_changes_to_different_settings_are_all_kept` and
|
||||
`a_change_is_never_applied_over_an_unreadable_config`.
|
||||
|
||||
---
|
||||
|
||||
### B291 — On Fedora 45's oo7, every saved sign-in is lost at the next reboot
|
||||
|
||||
**Status:** Fixed, not verified live
|
||||
|
||||
@@ -18,6 +18,27 @@ Existing folders stay device backups. Older builds cannot open the upgraded data
|
||||
|
||||
### Added
|
||||
|
||||
- **Excluded files, opening files and the search launcher in Preferences** (#99). Settings that
|
||||
could only be changed in `config.json` now have a place in the app:
|
||||
- **Sync → Excluded Files**: the patterns every synced folder leaves out. Add your own, such as
|
||||
`*.db` or `build/`, and turn each built-in pattern on or off. A change applies at once.
|
||||
- **Sync → Conflict Copies**: whether identical conflict copies are only reported, moved to the
|
||||
trash, or not looked for.
|
||||
- **Apps → Open Files With**: which program opens which kind of file, in order, optionally in a
|
||||
terminal, for example `nvim` for text files. A change applies to the next file opened.
|
||||
- **Apps → Search Launcher**: whether `pdfs-prompt` opens its own window, your dmenu-style
|
||||
launcher (rofi, wofi, fuzzel, bemenu) or fzf in a terminal.
|
||||
|
||||
Each synced folder kept on this computer has **Excluded Files…** in its menu on the Sync page,
|
||||
for its own `.pdfsignore`. It checks every line as you type, tells you whether a path is synced
|
||||
and which pattern decides, and asks before replacing rules that changed on another computer
|
||||
meanwhile. `pdfs sync ignore list|add|remove|reset|check` does the same from a terminal.
|
||||
`pdfs-app --page preferences-sync` (or `-apps`, `-storage`, plain `preferences`) opens
|
||||
Preferences at that page.
|
||||
- **More clutter left out of synced folders by default**: `desktop.ini`, `.directory`, trash
|
||||
folders, `.fuse_hidden*` and `.nfs*` leftovers, partial downloads (`*.part`, `*.crdownload`),
|
||||
Kate swap files and office lock files. This only changes folders where you never set your own
|
||||
list. Leaving a file out never deletes its copy on Proton Drive.
|
||||
- **Sync a local folder with a folder you already have in My files** (#67, #77).
|
||||
`pdfs sync attach ~/Work --to Work` keeps `~/Work` an ordinary local folder and syncs it both
|
||||
ways with My files/Work. The first sync uploads files that are only on this computer, downloads
|
||||
@@ -146,6 +167,9 @@ Existing folders stay device backups. Older builds cannot open the upgraded data
|
||||
|
||||
### Fixed
|
||||
|
||||
- **Two programs changing settings at once no longer lose one of the changes** (B292). The app,
|
||||
the tray and the service now change `config.json` under a lock, so for example a new cache
|
||||
size saved by the service and the window size saved by the app both stay.
|
||||
- **Resuming a Google Photos import no longer fails at once** (#94, B286, B287). A photo upload
|
||||
that was cut short left a draft behind, and every later run stopped with
|
||||
`check for existing photos: serialization error: invalid type: null`. Such drafts are now
|
||||
|
||||
@@ -119,6 +119,10 @@ commands are for scripts and for cases where the mount is not available.
|
||||
| `pdfs sync reset ID` | Forget what a synced folder synced before and compare it with Proton Drive again. A file on one side only is copied to the other, and a file that differs keeps both versions. Nothing is deleted. |
|
||||
| `pdfs sync pause [--for 1h] [--folder ID]` | Pause uploads and synced folders. Reading files keeps working. `--for` ends the pause by itself (`30m`, `1h`, `2d`). |
|
||||
| `pdfs sync resume [--folder ID]` | Resume after a pause. |
|
||||
| `pdfs sync ignore list` | Print the patterns every synced folder leaves out. Built-in ones are marked. |
|
||||
| `pdfs sync ignore add PATTERN` / `remove PATTERN` | Leave out, or stop leaving out, files matching a gitignore-style pattern such as `*.db` or `build/`. A pattern starting with `-` goes after `--`. |
|
||||
| `pdfs sync ignore reset` | Use the built-in patterns again. |
|
||||
| `pdfs sync ignore check PATH` | Say whether a file in a synced folder is synced, and which pattern decides. |
|
||||
| `pdfs sync limit [--up RATE] [--down RATE]` | Cap bandwidth, for example `500K` or `2M` per second. `0` removes a cap. Without options, prints the current caps. |
|
||||
| `pdfs sync queue` | List changes that have not reached Proton Drive yet. |
|
||||
| `pdfs sync issues` | List queued changes Proton Drive refused or that keep failing, and what to do. |
|
||||
|
||||
+15
-7
@@ -44,9 +44,13 @@ the [security model](SECURITY_MODEL.md#what-is-kept-on-this-computer).
|
||||
## `config.json`
|
||||
|
||||
The file is created with defaults on first start. Every key is optional; a missing key takes its
|
||||
default. Edit it while the app is closed, then restart the service
|
||||
default. Most keys can be changed in the app, under **Preferences** (the "In app" column below).
|
||||
To edit the file by hand, close the app first, then restart the service
|
||||
(`systemctl --user restart proton-drive.service`) for service settings to apply.
|
||||
|
||||
The app, the tray and the service each change the file under a lock (`config.json.lock` next to
|
||||
it), so two of them changing different settings at once both keep their change.
|
||||
|
||||
An unreadable file is never overwritten: the programs log an error and run with defaults until you
|
||||
fix it.
|
||||
|
||||
@@ -80,9 +84,9 @@ fix it.
|
||||
| `cache_budget` | bytes | 5 GiB | Storage → Cache | Soft limit for cached content. `0` means unlimited. Available-offline files do not count against it |
|
||||
| `upload_limit` | bytes/s | none | General → Network | Shared cap for all uploads. `0` or `null` means none |
|
||||
| `download_limit` | bytes/s | none | General → Network | Shared cap for all downloads, reads from the mount included |
|
||||
| `ignore_patterns` | list | see below | — | Global ignore rules for synced folders |
|
||||
| `ignore_patterns` | list | see below | Sync → Excluded Files | Global ignore rules for synced folders |
|
||||
| `device_uid` | string | none | Computers → Continue This Backup Here… or Sync With This Computer… | The computer this machine syncs into. Unset means "match by hostname" |
|
||||
| `conflict_sweep` | `off` / `report` / `enforce` | `report` | — | See [`conflict_sweep`](#conflict_sweep) |
|
||||
| `conflict_sweep` | `off` / `report` / `enforce` | `report` | Sync → Conflict Copies | See [`conflict_sweep`](#conflict_sweep) |
|
||||
| `local_first` | bool | `true` | — | See [`local_first`](#local_first) |
|
||||
| `language` | gettext code | system | General → Appearance | Language of the app, tray and prompt, such as `de` or `pt_BR` |
|
||||
| `proton_theme` | bool | follow system | General → Appearance | Proton's colours instead of the system theme |
|
||||
@@ -93,8 +97,8 @@ fix it.
|
||||
| `update_latest` | version | none | — | The latest release the update check found |
|
||||
| `files_view` | object | grid, by name | My files view menu | `list`, `sort` (`name`, `size`, `modified`), `descending`, `folders_first` |
|
||||
| `window` | object | 980 × 680 | Resizing the app window | `width`, `height` (the unmaximized size), `maximized` |
|
||||
| `open_with` | object | `xdg-open` | — | See [`open_with`](#open_with) |
|
||||
| `prompt` | object | built-in window | — | See [`prompt`](#prompt) |
|
||||
| `open_with` | object | `xdg-open` | Apps → Open Files With | See [`open_with`](#open_with) |
|
||||
| `prompt` | object | built-in window | Apps → Search Launcher | See [`prompt`](#prompt) |
|
||||
|
||||
`app_version` and `user_agent` identify the client to Proton. When the keys are absent, the
|
||||
client sends its own release (`external-drive-linux@<version>-stable`, `proton-drive-linux/<version>`).
|
||||
@@ -109,10 +113,14 @@ Gitignore-style rules applied to every synced folder, in addition to each folder
|
||||
|
||||
```json
|
||||
[".git/", ".hg/", ".svn/", "node_modules/", "target/", ".venv/", "__pycache__/",
|
||||
"*~", "*.swp", "*.tmp", ".DS_Store", "Thumbs.db"]
|
||||
"*~", "*.swp", "*.tmp", ".DS_Store", "Thumbs.db",
|
||||
"desktop.ini", ".directory", ".Trash-*/", ".Trashes/", ".Spotlight-V100/",
|
||||
".fuse_hidden*", ".nfs*", "*.part", "*.crdownload", "*.kate-swp", ".~lock.*#", "~$*"]
|
||||
```
|
||||
|
||||
Set it to `[]` to turn the defaults off. See
|
||||
Preferences → Sync → Excluded Files edits this list, and `pdfs sync ignore` does the same from
|
||||
a terminal. A list equal to the defaults is saved as absent, so it follows the defaults of later
|
||||
releases. Set it to `[]` to turn the defaults off. See
|
||||
[Synced folders](SYNCED_FOLDERS.md#excluding-files-with-pdfsignore) for how excluding behaves.
|
||||
|
||||
### `conflict_sweep`
|
||||
|
||||
@@ -69,9 +69,10 @@ windowrulev2 = center, class:^(pdfs-prompt)$
|
||||
bind = SUPER, space, exec, pdfs-prompt --fzf
|
||||
```
|
||||
|
||||
To make `--dmenu` or `--fzf` the default without changing your shortcut, set `prompt.mode` in
|
||||
`config.json` (see [Configuration → `prompt`](CONFIGURATION.md#prompt)). `--gtk` always opens the
|
||||
built-in window.
|
||||
To make `--dmenu` or `--fzf` the default without changing your shortcut, pick it in
|
||||
**Preferences → Apps → Search Launcher**, or set `prompt.mode` in `config.json` (see
|
||||
[Configuration → `prompt`](CONFIGURATION.md#prompt)). `--gtk` always opens the built-in window.
|
||||
Which program opens a file you pick is set under **Preferences → Apps → Open Files With**.
|
||||
|
||||
## Tray
|
||||
|
||||
|
||||
+26
-4
@@ -100,10 +100,32 @@ apply together:
|
||||
!important.log
|
||||
```
|
||||
|
||||
2. The `ignore_patterns` list in `config.json`, for every synced folder (see
|
||||
[Configuration](CONFIGURATION.md#ignore_patterns)). When you have not set it, it skips
|
||||
`.git/`, `.hg/`, `.svn/`, `node_modules/`, `target/`, `.venv/`, `__pycache__/`, `*~`,
|
||||
`*.swp`, `*.tmp`, `.DS_Store` and `Thumbs.db`.
|
||||
2. The patterns for every synced folder: **Preferences → Sync → Excluded Files** in the app, or
|
||||
`ignore_patterns` in `config.json` (see [Configuration](CONFIGURATION.md#ignore_patterns)).
|
||||
Built in are version control (`.git/`, `.hg/`, `.svn/`), dependency and build folders
|
||||
(`node_modules/`, `target/`, `.venv/`, `__pycache__/`), and what editors, downloads and other
|
||||
systems leave behind (`*~`, `*.swp`, `*.tmp`, `*.part`, `*.crdownload`, `*.kate-swp`, office
|
||||
lock files, `.DS_Store`, `Thumbs.db`, `desktop.ini`, `.directory`, trash folders, `.nfs*` and
|
||||
`.fuse_hidden*`). Each built-in pattern can be turned off on its own.
|
||||
|
||||
To edit a folder's own rules in the app, open the **Sync** page, then **Folders**, and pick
|
||||
**Excluded Files…** in the folder's menu. It checks every line as you type, and **Check a path**
|
||||
tells you whether a file is synced and which pattern decides. If the file changed meanwhile, for
|
||||
example on another computer, it asks before replacing that version.
|
||||
|
||||
From a terminal:
|
||||
|
||||
```bash
|
||||
pdfs sync ignore list # the patterns for every synced folder
|
||||
pdfs sync ignore add '*.db' # leave out files ending in .db
|
||||
pdfs sync ignore remove '*.db'
|
||||
pdfs sync ignore reset # back to the built-in patterns
|
||||
pdfs sync ignore check ~/Projects/app/node_modules
|
||||
```
|
||||
|
||||
The rules apply to folders kept on this computer. Files you save into `~/ProtonDrive` itself or into
|
||||
an online-only folder are always uploaded, except download and editor scratch files, which wait for
|
||||
their final name.
|
||||
|
||||
Rules are read again on every sync pass. Excluding never deletes anything: a file that becomes
|
||||
excluded is no longer synced, and its copy on Proton Drive stays.
|
||||
|
||||
@@ -53,6 +53,8 @@ The app uses these words, and so do these pages:
|
||||
| Page | Settings |
|
||||
|---|---|
|
||||
| **General** | Start on login · Proton Drive folder location · upload and download limits · Proton theme, street map for Places, tray icon · language · check for updates |
|
||||
| **Sync** | Files and folders every synced folder leaves out · what happens to identical conflict copies |
|
||||
| **Apps** | Which program opens which kind of file · how the search launcher opens |
|
||||
| **Storage** | Cache size limit · clear the cache · files kept available offline |
|
||||
|
||||
The account menu shows the storage you use and holds **Sign Out…**. Settings that are not in the
|
||||
|
||||
Reference in new issue
Block a user