'opencloud storage-users revisions cleanup' deletes old revisions, according to a cleanup strategy, of: - the files of spaces (--space, repeatable), - or of a file or folder within a space (--space with --path), - or of all spaces (--all), - or of a file or folder given by its path on disk (--fs-path, posix only). The id of a file or folder is rejected as the id of a space, as the command would otherwise clean up its whole space. So is an id without a space id, e.g. 'storage$'. The storage-users service only cleans up the revisions of a file when it gets a new one. The command also covers the files that are not changed anymore, and applies a different strategy once. The strategy and the settings of the background workers default to the configured ones (STORAGE_USERS_REVISIONS_CLEANUP_*), and can be overridden with --strategy, --async, --workers and --queue-size. Only --queue-full defaults to 'block' without a timeout, whatever is configured: the command finds files faster than the workers clean them up, so dropping the files that find the queue full, or giving up after the timeout meant for uploads, would skip most of them. --queue-full-timeout sets one for the run. The command uses the storage driver directly, in its own process, like 'uploads sessions': posix neither scans nor watches the file system, and no driver joins the postprocessing consumer group of the service. For posix, the driver needs NATS for its event stream. The command waits for it 10 seconds at most, instead of the 15 minutes the stream retries for, and ctrl-c also stops that wait: with the single binary, NATS only runs within the server (opencloud-eu/opencloud#3805). The driver gets the logger of the command: posix passes it on to the NATS connections of its id cache, whose handlers would panic on a lost connection without one. Ctrl-C also stops waiting for the driver, e.g. for the id cache, which retries for up to 15 minutes as well. Unless it is a dry run, which changes nothing on disk, the command warns when the storage belongs to another user than the one it runs as, e.g. root: the lock files it creates belong to that user, and the server may not be able to lock these files anymore. Output: a line for every file whose revisions were deleted, that failed or that was skipped, with its path within its space, and a summary; --verbose adds every file and every revision with the decision and its reason; --json prints the same as JSON objects, one per line, with a final summary object. --dry-run deletes nothing. --timeout stops the cleanup gracefully, as does ctrl-c, and a second ctrl-c ends the command right away, which can leave the blob of a deleted revision behind; the help says so. Whether the timeout or ctrl-c stopped the cleanup is told by the contexts of the command, not by the error: the storage can return context errors of its own. --shuffle walks the spaces and folders in a random order, so that repeated runs that are stopped by the timeout, e.g. from a cron job, eventually reach all files. The help explains that a file waiting for a lock can't be interrupted, and that a dry run changes nothing on disk, but decides on a snapshot, as it doesn't keep the files locked while it decides. The common flags have short forms: -a (--all), -p (--fs-path), -s (--strategy), -n (--dry-run), -v (--verbose), -j (--json) and -t (--timeout). Exit codes: - 0 when done, - 1 if the cleanup or any file failed, or if it was interrupted, - 2 if the timeout stopped the cleanup before all files were cleaned up. The storage-users README documents the command, along with the cleanup strategies and how they relate to the configured cleanup. Assisted-by: Claude Code:claude-opus-5-5
Server Backend
Tip
For general information about OpenCloud and how to install please visit OpenCloud on Github and OpenCloud GmbH.
This is the main repository of the OpenCloud server. It contains the golang codebase for the backend services.
Getting Involved
The OpenCloud server is released under Apache 2.0. The project is thrilled to receive contributions in all forms. Start hacking now, there are many ways to get involved such as:
- Reporting issues or bugs
- Requesting features
- Writing documentation
- Writing code or extend our tests
- Reviewing code
- Helping others in the community
Every contribution is meaningful and appreciated! Please refer to our Contribution Guidelines if you want to get started.
Build OpenCloud
To build the backend, follow these instructions:
Generate the assets needed by e.g., the web UI and the builtin IDP
make generate
Then compile the opencloud binary
make -C opencloud build
That will produce the binary opencloud/bin/opencloud. It can be started as a local test instance right away with a two step command:
opencloud/bin/opencloud init && opencloud/bin/opencloud server
This creates a server configuration (by default in $HOME/.opencloud) and starts the server.
For more setup- and installation options consult the Development Documentation.
Technology
Important information for contributors about the technology in use.
Authentication
The OpenCloud backend authenticates users via OpenID Connect using either an external IdP like Keycloak or the embedded LibreGraph Connect identity provider.
Database
The OpenCloud backend does not use a database. It stores all data in the filesystem. By default, the root directory of the backend is $HOME/.opencloud/.
Security
If you find a security-related issue, please contact security@opencloud.eu immediately.
