Task #19 — ppagecache.c decomposition (ppagecache_helpers.c/h) ppagecache_compute_page_priority(usecnt): pure function returning the LRU eviction tier (0–4) that matches the five pagecache_entry_cmp_* sort comparators in ppagecache.c (thresholds 2/4/8/16). ppagecache_verify_crc(data, size, stored_crc): wraps pcrc32c_compute and compares; returns 0 on match, -1 on mismatch. ppagecache_get_download_urls(fileid, hash, nout): __attribute__((weak)) URL-injection seam; default returns NULL (falls through to real API). ppagecache.c updated to include ppagecache_helpers.h. test_ppagecache.c: 10 tests covering tier boundary conditions (0/1/2/3/4 including UINT32_MAX), CRC match, single-bit flip, wrong stored CRC, zero-length buffer, and weak URL override. Task #20 — pfs.c helper extraction (pfs_helpers.c/h) pfs_row_to_folder_stat(row, stbuf): converts psql folder row → struct stat; uses pfs_task_get_folder_tasks_rdlocked for in-memory mtime. pfs_row_to_file_stat(row, stbuf, flags): converts psql file row → stat; encrypted path calls pfs_crpt_plain_size. pfs_mkdir_to_folder_stat(mk, stbuf): converts in-memory mkdir task → stat (no SQL). pfs_apply_task_overlay(stbuf, folder, name, flags): applies pending mkdir/rmdir/unlink/creat-new overlays from the in-memory task queue; returns 1/2/-1/0. pfs_stat_uid/gid: exported globals; pfs.c syncs them from myuid/mygid. pfs.c updated to #include pfs_helpers.h and sync the uid/gid globals. pfsfolder.c: pfs_fldr_resolve_path decorated __attribute__((weak)) so tests can inject fake path resolution without a FUSE mount or psql. test_pfs_helpers.c: 7 tests covering folder/file stat field correctness, overlay NULL/mkdir/rmdir/no-match cases, and weak path override; uses --wrap for pfs_task_get_folder_tasks_rdlocked, pfs_crpt_plain_size, and ptimer_time to stay SQL/crypto/timer-free. Production build clean; make check exits 0. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .github/workflows | ||
| dev | ||
| doc | ||
| pclsync | ||
| tests | ||
| .clang-format | ||
| .clang-tidy | ||
| .envrc | ||
| .gitignore | ||
| CLI11.hpp | ||
| LOG-MANAGEMENT.md | ||
| Makefile | ||
| README.md | ||
| control_tools.cpp | ||
| control_tools.h | ||
| default.nix | ||
| detect_fuse.sh | ||
| flake.lock | ||
| flake.nix | ||
| main.cpp | ||
| pcloudcc.logrotate | ||
| pclsync_lib.cpp | ||
| pclsync_lib.h | ||
| rpcclient.cpp | ||
| rpcclient.h | ||
README.md
Introduction
pcloudcc is simple linux console client for pCloud cloud storage derived from the console-client developed by pCloud. This version is independently maintained by me, whose only affiliation with pCloud is as a user of their services. Due credit goes to Anton Titov, Ivan Stoev, and pCloud.
Supported Platforms & Distributions
The target operating system and platform for this program is linux/amd64, and has been reported to work on linux/aarch64. Program behavior on 32-bit architectures is considered undefined.
I aim to support as many distributions as possible. I maintain a package for AUR and Nix. I do not plan on providing or maintaining any other packages, but encourage anyone interested in doing so for their own distributions.
Compatibility Matrix
| Distribution | FUSE |
|---|---|
| Debian trixie | 2.x |
| Debian trixie | 3.x |
| Arch Linux (rolling) | 3.x latest |
| Fedora 41 | 3.x |
| Fedora (latest) | 3.x latest |
| Debian forky | 3.18+ |
| Slackware 15 | 3.10.5 |
All configurations require mbedTLS 3.x. Runtime mount testing was performed manually on FUSE 2 (libfuse 2.9.x), FUSE 3 (libfuse3 3.10.5), and FUSE 3.18+ (Debian forky container).
Notices
Security Notice
My code audits are best-effort, and I make security enhancements as I identify problems. However, I do not promise that this program is free of even older and well-known security vulnerabilities. Therefore, I recommend using this program only on a trusted single-user system. Security-related code audits and contributions are most welcome!
See Also
-
Contributing: Read this if you're interested in helping out. Short version: do your best to write good code, be courteous to maintainers, and most importantly: have fun!
-
Building: Read this if you're not sure how to build
pcloudcc. For most users,makeandmake installare enough. -
mbedtls 3.x migration notes: Read this if you use an older distribution such as
debian:bookwormand encounter build problems. -
Device Validation Guide: Read this if you're running
pcloudccand encounter device validation-related errors. -
Usage Guide: Read this if you're unsure how to start using
pcloudcc. -
Log Management Guide: Read this to configure log rotation, cache size limits, and custom log paths. To set up automatic log rotation, copy
pcloudcc.logrotateto/etc/logrotate.d/pcloudcc. -
pcloudcc-service: Container-based systemd service for running
pcloudccin userspace with podman. Includes multi-stage Dockerfile that buildspcloudccfrom source and Quadlet systemd unit for automated background syncing.