diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..40a79026 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,79 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +## [0.1.1] - 2023-09-18 + +### Bug Fixes + +- Correct glob-matching for relative paths + ([#783](https://github.com/rustic-rs/rustic/issues/783)) + +### Documentation + +- Update Readme layout, move docs to separate repository, add rustic_core + Readme.md ([#820](https://github.com/rustic-rs/rustic/issues/820)) +- Add rustic_core logo +- Set subtitle for rustic_core readme +- Fix item links in documentation for rustic_core +- Pass "--document-private-items" to rustdoc via metadata in manifest + +### Features + +- Option to disable requiring git repository for git-ignore rules +- Wait for password-command to exit +- Add `--json` option to `forget` command + ([#806](https://github.com/rustic-rs/rustic/issues/806)) + +### Miscellaneous Tasks + +- Lint markdown with dprint, run initial dprint fmt + ([#830](https://github.com/rustic-rs/rustic/issues/830)) +- Lint has been removed +- Add cliff.toml and generate rustic_core changelog +- Add documentation field to rustic_core manifest +- Relink to new image location + +### Refactor + +- Replace `nom` with `shellwords` to split strings + ([#752](https://github.com/rustic-rs/rustic/issues/752)) +- Add metadata to crate manifests + ([#822](https://github.com/rustic-rs/rustic/issues/822)) + +### Build + +- Bump public-api from 0.29.1 to 0.31.2 + ([#695](https://github.com/rustic-rs/rustic/issues/695)) +- Bump public-api from 0.31.2 to 0.31.3 + ([#796](https://github.com/rustic-rs/rustic/issues/796)) +- Bump rustdoc-json from 0.8.6 to 0.8.7 + ([#794](https://github.com/rustic-rs/rustic/issues/794)) + +### Prune + +- Add example using rustic_core +- Don't abort if time is unset for pack-to-delete + +### Repoinfo + +- Add options --json, --only-files, --only-index + +### Rest/rclone + +- Make # of retries cusomizable and use sensible default + +### Restore + +- Download multiple contiguous blobs in one request + +### Rustic_core + +- Add NoProgress and NoProgressBars (e.g. for examples) +- Prepare v0.1.1 + +## [0.1.0] - 2023-08-11 + +- Initial refactoring out of rustic_core from rustic-rs + + diff --git a/Cargo.lock b/Cargo.lock index 03596519..f7623113 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1870,7 +1870,7 @@ dependencies = [ [[package]] name = "rustic_core" -version = "0.1.0" +version = "0.1.1" dependencies = [ "aes256ctr_poly1305aes", "aho-corasick 1.1.0", diff --git a/Cargo.toml b/Cargo.toml index 335540c5..96c30e9a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rustic_core" -version = "0.1.0" +version = "0.1.1" authors = ["Alexander Weiss"] categories = [ "Algorithms", @@ -16,13 +16,13 @@ homepage = "https://rustic.cli.rs/" include = ["src/**/*", "LICENSE-*", "README.md", "examples/**/*"] keywords = ["backup", "restic", "deduplication", "encryption", "library"] license = "Apache-2.0 OR MIT" -publish = false # Don't publish until we fix/stabilize public api!!! +publish = true readme = "README.md" repository = "https://github.com/rustic-rs/rustic_core" resolver = "2" rust-version = "1.66.1" description = """ -rustic_core - fast, encrypted, deduplicated backups that power rustic-rs +rustic_core - library for fast, encrypted, deduplicated backups that powers rustic-rs """ [lib] diff --git a/README.md b/README.md index 438064f8..4b735211 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@

- +

@@ -16,6 +16,11 @@ backup tool that provides fast, encrypted, deduplicated backups. It reads and writes the `restic` repository format, which is described in their design document. +**Note**: `rustic_core` is in an early development stage and its API is subject +to change in the next releases. If you want to give feedback on that, please +open a thread in our +[discussions](https://github.com/rustic-rs/rustic/discussions). + ## Contact You can ask questions in the @@ -24,7 +29,7 @@ the [FAQ](https://rustic.cli.rs/docs/FAQ.html). | Contact | Where? | | ------------- | --------------------------------------------------------------------------------------------------------------- | -| Issue Tracker | [GitHub Issues](https://github.com/rustic-rs/rustic/issues) | +| Issue Tracker | [GitHub Issues](https://github.com/rustic-rs/rustic_core/issues/choose) | | Discord | [![Discord](https://dcbadge.vercel.app/api/server/WRUWENZnzQ?style=flat-square)](https://discord.gg/WRUWENZnzQ) | | Discussions | [GitHub Discussions](https://github.com/rustic-rs/rustic/discussions) | @@ -169,6 +174,18 @@ fn main() -> Result<(), Box> { } ``` +## Contributing + +Found a bug? +[Open an issue!](https://github.com/rustic-rs/rustic_core/issues/choose) + +Got an idea for an improvement? Don't keep it to yourself! + +- Contribute fixes or new features via a pull requests! + +Please make sure, that you read the +[contribution guide](https://rustic.cli.rs/docs/contributing-to-rustic.html). + ## Minimum Rust version policy This crate's minimum supported `rustc` version is `1.66.1`. diff --git a/cliff.toml b/cliff.toml new file mode 100644 index 00000000..484f4f88 --- /dev/null +++ b/cliff.toml @@ -0,0 +1,82 @@ +# git-cliff ~ default configuration file +# https://git-cliff.org/docs/configuration +# +# Lines starting with "#" are comments. +# Configuration options are organized into tables and keys. +# See documentation for more information on available options. + +[changelog] +# changelog header +header = """ +# Changelog\n +All notable changes to this project will be documented in this file.\n +""" +# template for the changelog body +# https://tera.netlify.app/docs +body = """ +{% if version %}\ + ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} +{% else %}\ + ## [unreleased] +{% endif %}\ +{% for group, commits in commits | group_by(attribute="group") %} + ### {{ group | upper_first }} + {% for commit in commits %} + - {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }}\ + {% endfor %} +{% endfor %}\n +""" +# remove the leading and trailing whitespace from the template +trim = true +# changelog footer +footer = """ + +""" +# postprocessors +postprocessors = [ + { pattern = '', replace = "https://github.com/rustic-rs/rustic" }, +] +[git] +# parse the commits based on https://www.conventionalcommits.org +conventional_commits = true +# filter out the commits that are not conventional +filter_unconventional = true +# process each line of a commit as an individual commit +split_commits = false +# regex for preprocessing the commit messages +commit_preprocessors = [ + { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](/issues/${2}))" }, # replace issue numbers +] +# regex for parsing and grouping commits +commit_parsers = [ + { message = "^feat", group = "Features" }, + { message = "^fix", group = "Bug Fixes" }, + { message = "^doc", group = "Documentation" }, + { message = "^perf", group = "Performance" }, + { message = "^refactor", group = "Refactor" }, + { message = "^style", group = "Styling", skip = true }, # we ignore styling in the changelog + { message = "^test", group = "Testing" }, + { message = "^chore\\(release\\): prepare for", skip = true }, + { message = "^chore\\(deps\\)", skip = true }, + { message = "^chore\\(pr\\)", skip = true }, + { message = "^chore\\(pull\\)", skip = true }, + { message = "^chore|ci", group = "Miscellaneous Tasks" }, + { body = ".*security", group = "Security" }, + { message = "^revert", group = "Revert" }, +] +# protect breaking changes from being skipped due to matching a skipping commit_parser +protect_breaking_commits = false +# filter out the commits that are not matched by commit parsers +filter_commits = false +# glob pattern for matching git tags +tag_pattern = "v[0-9]*" +# regex for skipping tags +skip_tags = "v0.1.0-beta.1" +# regex for ignoring tags +ignore_tags = "" +# sort the tags topologically +topo_order = false +# sort the commits inside sections by oldest/newest order +sort_commits = "oldest" +# limit the number of commits included in the changelog. +# limit_commits = 42 diff --git a/docs/Readme.md b/docs/Readme.md index ab0c7241..0dea0930 100644 --- a/docs/Readme.md +++ b/docs/Readme.md @@ -1,3 +1,3 @@ # Documentation -Our documentation can be found at: +Our documentation can be found at: diff --git a/src/lib.rs b/src/lib.rs index 7b426881..cb730c50 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,7 +5,21 @@ A library for deduplicated and encrypted backups, using repositories as specifie This section gives a brief overview of the primary types in this crate: -TODO +The main type is the [`Repository`] type which describes a way to access a repository. +It can be in different states and allows - depending on the state - various high-level +actions to be performed on the repository like listing snapshots, backing up or restoring. + +Besides this, various `*Option` types exist which allow to specify options for accessing a +[`Repository`] or for the methods used within a [`Repository`]. Those types usually offer +setter methods as well as implement [`serde::Serialize`] and [`serde::Deserialize`]. + +Other main types are typically result types obtained by [`Repository`] methods which sometimes +are also needed as input for other [`Repository`] method, like computing a [`PrunePlan`] and +performing it. + +There are also lower level data types which represent the stored repository format or +help accessing/writing it. Those are collected in the [`repofile`] module. These types typically +implement [`serde::Serialize`] and [`serde::Deserialize`]. # Example - initialize a repository, backup to it and get snapshots @@ -53,23 +67,19 @@ TODO assert_eq!(snaps[0], snap); ``` -# Lower level APIs - -TODO - # Crate features This crate exposes a few features for controlling dependency usage. +* **clap** - + Enables a dependency on the `clap` and `clap_complete` crate and enables + parsing from the commandline. This feature is disabled by default. * **cli** - Enables support for CLI features by enabling `merg` and `clap` features. * **merge** - Enables support for merging multiple values into one, which enables the `merge` dependency. This is needed for parsing commandline arguments and merging them into one (e.g. config). This feature is disabled by default. -* **clap** - - Enables a dependency on the `clap` and `clap_complete` crate and enables - parsing from the commandline. This feature is disabled by default. */ #![allow(dead_code)]