* Fix #90: Support 2FA when running as a daemon In daemon mode, when PSTATUS_TFA_REQUIRED fires: - Automatically send an SMS 2FA code via psync_tfa_send_sms() - Log delivery details to syslog with instructions to use `echo 'tfa CODE' | pcloudcc -k` - Block on a condition variable until the code arrives via RPC Add a new `tfa <code>` command to the pcloudcc -k control interface. This sends the code to the daemon over the existing Unix socket RPC channel (SENDTFA message type). Bad codes (PSTATUS_BAD_TFA_CODE) are handled: the daemon logs a syslog warning and waits for a corrected code without re-sending SMS. Devices are trusted by default (trusted=1 in psync_tfa_set_code) so repeated 2FA prompts are avoided for the configured trust period. TFA codes are wiped from memory after use. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Add auth command: supply password to running daemon Mirrors the tfa command pattern. When PSTATUS_LOGIN_REQUIRED fires in daemon mode, read_password() now logs a syslog notice and blocks on a condition variable rather than calling exit(1). The new `auth <password>` control command (SENDAUTH RPC type) signals the condvar and unblocks the daemon. Usage: echo 'auth PASSWORD' | pcloudcc -k The password is wiped from the CLI-side buffer immediately after the RPC call. putil_wipe() is used for both the tfa and auth transient strings on the sending side. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Add status command: show current sync state from CLI Adds a `status` (alias `st`) command to the interactive CLI and to the pcloudcc -k control interface. The daemon-side handler calls psync_get_status(), formats the status name plus download/upload strings, and writes the result to shared memory. The client reads and prints it. Example output: Status: READY Download: idle Upload: idle Also works non-interactively: echo 'status' | pcloudcc -k Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Levi Neely <lkn@darkstar.example.net> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .github/workflows | ||
| dev | ||
| doc | ||
| pclsync | ||
| .clang-format | ||
| .envrc | ||
| .gitignore | ||
| CLI11.hpp | ||
| LOG-MANAGEMENT.md | ||
| Makefile | ||
| README.md | ||
| control_tools.cpp | ||
| control_tools.h | ||
| default.nix | ||
| 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.
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.