From dbf7ef72b92ee612a17d8e30c0722d71bf25cb68 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Wed, 25 Oct 2023 22:00:42 +0200 Subject: [PATCH 01/14] Add read the docs config file version 2 The config file is by now necessary to build documentation: https://blog.readthedocs.com/migrate-configuration-v2/ --- .readthedocs.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .readthedocs.yaml diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 000000000..4425a81a1 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,18 @@ +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +version: 2 + +build: + os: ubuntu-22.04 + tools: + python: "3.11" + +# Build documentation in the docs/ directory with Sphinx +sphinx: + configuration: docs/conf.py + +# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html +# python: +# install: +# - requirements: docs/requirements.txt From 826d8806147efd4eae6133a99c1c4e58ac0fb45e Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Thu, 26 Oct 2023 20:39:43 +0200 Subject: [PATCH 02/14] Fix doc path typo in readthedocs configuration --- .readthedocs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 4425a81a1..344d14300 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -10,7 +10,7 @@ build: # Build documentation in the docs/ directory with Sphinx sphinx: - configuration: docs/conf.py + configuration: doc/conf.py # https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html # python: From 69dec02a14ef0275e7a2d6745702fb6837fa3131 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Thu, 26 Oct 2023 21:02:35 +0200 Subject: [PATCH 03/14] Remove readthedocs special case from docs configuration Apparently it's now required to bring your own theme. --- .readthedocs.yaml | 6 +++--- doc/conf.py | 30 +++++++++++------------------- 2 files changed, 14 insertions(+), 22 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 344d14300..2a7769e9c 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -13,6 +13,6 @@ sphinx: configuration: doc/conf.py # https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html -# python: -# install: -# - requirements: docs/requirements.txt +python: + install: + - requirements: doc/requirements.txt diff --git a/doc/conf.py b/doc/conf.py index 3fd8dc119..f40a8c79e 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -12,14 +12,16 @@ # # All configuration values have a default; values that are commented out # serve to show the default. -import os # -- General configuration ------------------------------------------------ # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = ['sphinx.ext.extlinks'] +extensions = [ + 'sphinx.ext.extlinks', + 'sphinx_rtd_theme', +] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -35,7 +37,7 @@ master_doc = 'index' # General information about the project. project = 'restic' -copyright = '2018, restic authors' +copyright = '2023, restic authors' author = 'fd0' # The version info for the project you're documenting, acts as replacement for @@ -54,7 +56,7 @@ release = version # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = None +language = "en" # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. @@ -72,21 +74,11 @@ todo_include_todos = False # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -# -if os.environ.get('READTHEDOCS') == 'True': - html_context = { - 'css_files': [ - 'https://media.readthedocs.org/css/sphinx_rtd_theme.css', - 'https://media.readthedocs.org/css/readthedocs-doc-embed.css', - '_static/css/restic.css', - ] - } -else: - # we're not built by rtd => add rtd-theme - import sphinx_rtd_theme - html_theme = 'sphinx_rtd_theme' - html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] - html_style = 'css/restic.css' +html_theme = 'sphinx_rtd_theme' + +html_css_files = [ + 'css/restic.css', +] html_logo = 'logo/logo.png' From d47581b25ec3810a62b645a8f93b52161afa97b0 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Thu, 26 Oct 2023 19:59:27 +0200 Subject: [PATCH 04/14] verify-release-binaries.sh: don't show warning if binaries are correct --- helpers/verify-release-binaries.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/helpers/verify-release-binaries.sh b/helpers/verify-release-binaries.sh index a41885862..4e80528e2 100755 --- a/helpers/verify-release-binaries.sh +++ b/helpers/verify-release-binaries.sh @@ -12,6 +12,10 @@ go_version="$2" # invalid if zero is_valid=1 +set_invalid() { + echo $1 + is_valid=0 +} tmpdir="$(mktemp -d -p .)" cd "${tmpdir}" @@ -41,7 +45,7 @@ for i in $(cat SHA256SUMS | cut -d " " -f 3 ) ; do echo "Downloading $i" curl -OLSs https://github.com/restic/restic/releases/download/v${restic_version}/"$i" done -shasum -a256 -c SHA256SUMS || echo "WARNING: RELEASE BINARIES DO NOT MATCH SHA256SUMS!" && is_valid=0 +shasum -a256 -c SHA256SUMS || set_invalid "WARNING: RELEASE BINARIES DO NOT MATCH SHA256SUMS!" gpg --verify restic-${restic_version}.tar.gz.asc restic-${restic_version}.tar.gz # TODO verify that the release does not contain any unexpected files @@ -74,9 +78,9 @@ cp "restic-${restic_version}.tar.gz" output cp SHA256SUMS output # check that all release binaries have been reproduced successfully -(cd output && shasum -a256 -c SHA256SUMS) || echo "WARNING: REPRODUCED BINARIES DO NOT MATCH RELEASE BINARIES!" && is_valid=0 +(cd output && shasum -a256 -c SHA256SUMS) || set_invalid "WARNING: REPRODUCED BINARIES DO NOT MATCH RELEASE BINARIES!" # and that the SHA256SUMS files does not miss binaries -for i in output/restic* ; do grep "$(basename "$i")" SHA256SUMS > /dev/null || echo "WARNING: $i MISSING FROM RELEASE SHA256SUMS FILE!" && is_valid=0 ; done +for i in output/restic* ; do grep "$(basename "$i")" SHA256SUMS > /dev/null || set_invalid "WARNING: $i MISSING FROM RELEASE SHA256SUMS FILE!" ; done extract_docker() { @@ -95,8 +99,7 @@ extract_docker() { tar -xvf "$i" -C img usr/bin/restic 2> /dev/null 1>&2 || true if [[ -f img/usr/bin/restic ]]; then if [[ -f restic-docker ]]; then - echo "WARNING: CONTAINER CONTAINS MULTIPLE RESTIC BINARIES" - is_valid=0 + set_invalid "WARNING: CONTAINER CONTAINS MULTIPLE RESTIC BINARIES" fi mv img/usr/bin/restic restic-docker fi @@ -118,7 +121,7 @@ for img in restic/restic ghcr.io/restic/restic; do extract_docker "$img" 386 386 extract_docker "$img" amd64 amd64 - (cd docker && shasum -a256 -c SHA256SUMS) || echo "WARNING: DOCKER CONTAINER DOES NOT CONTAIN RELEASE BINARIES!" && is_valid=0 + (cd docker && shasum -a256 -c SHA256SUMS) || set_invalid "WARNING: DOCKER CONTAINER DOES NOT CONTAIN RELEASE BINARIES!" mv docker docker-$(( ctr++ )) done From de6135351e7d1eb05001afb67a4f50c63904ed5d Mon Sep 17 00:00:00 2001 From: Martin Michlmayr Date: Thu, 26 Oct 2023 14:22:44 +0800 Subject: [PATCH 05/14] Format option correctly --- doc/050_restore.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/050_restore.rst b/doc/050_restore.rst index ed2ddfd40..56f6458ed 100644 --- a/doc/050_restore.rst +++ b/doc/050_restore.rst @@ -106,7 +106,7 @@ Restic supports storage and preservation of hard links. However, since hard links exist in the scope of a filesystem by definition, restoring hard links from a fuse mount should be done by a program that preserves hard links. A program that does so is ``rsync``, used with the option ---hard-links. +``--hard-links``. .. note:: ``restic mount`` is mostly useful if you want to restore just a few files out of a snapshot, or to check which files are contained in a snapshot. From 0b6ccea461a7dcc5599a6330082cf3ef18f960c4 Mon Sep 17 00:00:00 2001 From: Martin Michlmayr Date: Thu, 26 Oct 2023 14:27:19 +0800 Subject: [PATCH 06/14] Fix typos --- doc/030_preparing_a_new_repo.rst | 4 ++-- doc/040_backup.rst | 2 +- doc/045_working_with_repos.rst | 2 +- internal/fuse/file.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/030_preparing_a_new_repo.rst b/doc/030_preparing_a_new_repo.rst index d7d6c55b6..5ff26934a 100644 --- a/doc/030_preparing_a_new_repo.rst +++ b/doc/030_preparing_a_new_repo.rst @@ -331,7 +331,7 @@ Wasabi ************ `Wasabi `__ is a low cost Amazon S3 conformant object storage provider. -Due to it's S3 conformance, Wasabi can be used as a storage provider for a restic repository. +Due to its S3 conformance, Wasabi can be used as a storage provider for a restic repository. - Create a Wasabi bucket using the `Wasabi Console `__. - Determine the correct Wasabi service URL for your bucket `here `__. @@ -822,7 +822,7 @@ To make this work we can employ the help of the ``setgid`` permission bit available on Linux and most other Unix systems. This permission bit makes newly created directories inherit both the group owner (gid) and setgid bit from the parent directory. Setting this bit requires root but since it -propagates down to any new directories we only have to do this priviledged +propagates down to any new directories we only have to do this privileged setup once: .. code-block:: console diff --git a/doc/040_backup.rst b/doc/040_backup.rst index a3b280476..c917c3c29 100644 --- a/doc/040_backup.rst +++ b/doc/040_backup.rst @@ -146,7 +146,7 @@ change detection rule based on file metadata to determine whether a file is likely unchanged since a previous backup. If it is, the file is not scanned again. -The previous backup snapshot, called "parent" snaphot in restic terminology, +The previous backup snapshot, called "parent" snapshot in restic terminology, is determined as follows. By default restic groups snapshots by hostname and backup paths, and then selects the latest snapshot in the group that matches the current backup. You can change the selection criteria using the diff --git a/doc/045_working_with_repos.rst b/doc/045_working_with_repos.rst index 55f17bfc9..3f6b1090e 100644 --- a/doc/045_working_with_repos.rst +++ b/doc/045_working_with_repos.rst @@ -337,7 +337,7 @@ over 5 separate invocations: $ restic -r /srv/restic-repo check --read-data-subset=4/5 $ restic -r /srv/restic-repo check --read-data-subset=5/5 -Use ``--read-data-subset=x%`` to check a randomly choosen subset of the +Use ``--read-data-subset=x%`` to check a randomly chosen subset of the repository pack files. It takes one parameter, ``x``, the percentage of pack files to check as an integer or floating point number. This will not guarantee to cover all available pack files after sufficient runs, but it is diff --git a/internal/fuse/file.go b/internal/fuse/file.go index aec39273a..2fedf30bf 100644 --- a/internal/fuse/file.go +++ b/internal/fuse/file.go @@ -143,7 +143,7 @@ func (f *openFile) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.R // the methods being called are responsible for appropriate synchronization. // // However, no lock needed here as getBlobAt can be called conurrently - // (blobCache has it's own locking) + // (blobCache has its own locking) for i := startContent; remainingBytes > 0 && i < len(f.cumsize)-1; i++ { blob, err := f.getBlobAt(ctx, i) if err != nil { From 8c1125fe13c34ecb5c41225cee0a9d8932cb2140 Mon Sep 17 00:00:00 2001 From: "Leo R. Lundgren" Date: Fri, 27 Oct 2023 18:56:00 +0200 Subject: [PATCH 07/14] doc: Correct two typos --- CHANGELOG.md | 2 +- changelog/0.14.0_2022-08-25/pull-3475 | 4 ++-- internal/repository/repository.go | 2 +- internal/restic/repository.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b92853c1..5ff46a72f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1492,7 +1492,7 @@ Details Restic did not support limiting the IO concurrency / number of connections for accessing repositories stored using the local or SFTP backends. The number of connections is now limited - as for other backends, and can be configured via the the `-o local.connections=2` and `-o + as for other backends, and can be configured via the `-o local.connections=2` and `-o sftp.connections=5` options. This ensures that restic does not overwhelm the backend with concurrent IO operations. diff --git a/changelog/0.14.0_2022-08-25/pull-3475 b/changelog/0.14.0_2022-08-25/pull-3475 index 9932ae632..e79432faf 100644 --- a/changelog/0.14.0_2022-08-25/pull-3475 +++ b/changelog/0.14.0_2022-08-25/pull-3475 @@ -3,7 +3,7 @@ Enhancement: Allow limiting IO concurrency for local and SFTP backend Restic did not support limiting the IO concurrency / number of connections for accessing repositories stored using the local or SFTP backends. The number of connections is now limited as for other backends, and can be configured via the -the `-o local.connections=2` and `-o sftp.connections=5` options. This ensures -that restic does not overwhelm the backend with concurrent IO operations. +`-o local.connections=2` and `-o sftp.connections=5` options. This ensures that +restic does not overwhelm the backend with concurrent IO operations. https://github.com/restic/restic/pull/3475 diff --git a/internal/repository/repository.go b/internal/repository/repository.go index 8ec3c598e..d034911c5 100644 --- a/internal/repository/repository.go +++ b/internal/repository/repository.go @@ -829,7 +829,7 @@ func (r *Repository) List(ctx context.Context, t restic.FileType, fn func(restic } // ListPack returns the list of blobs saved in the pack id and the length of -// the the pack header. +// the pack header. func (r *Repository) ListPack(ctx context.Context, id restic.ID, size int64) ([]restic.Blob, uint32, error) { h := restic.Handle{Type: restic.PackFile, Name: id.String()} diff --git a/internal/restic/repository.go b/internal/restic/repository.go index a651f9906..60e57f38a 100644 --- a/internal/restic/repository.go +++ b/internal/restic/repository.go @@ -39,7 +39,7 @@ type Repository interface { List(ctx context.Context, t FileType, fn func(ID, int64) error) error // ListPack returns the list of blobs saved in the pack id and the length of - // the the pack header. + // the pack header. ListPack(context.Context, ID, int64) ([]Blob, uint32, error) LoadBlob(context.Context, BlobType, ID, []byte) ([]byte, error) From 4be45de1c213c12914f3056b07bea883d558d4d3 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Fri, 27 Oct 2023 19:52:14 +0200 Subject: [PATCH 08/14] Restore support for ARMv5 platforms --- changelog/unreleased/issue-4540 | 9 +++++++++ helpers/build-release-binaries/main.go | 3 +++ 2 files changed, 12 insertions(+) create mode 100644 changelog/unreleased/issue-4540 diff --git a/changelog/unreleased/issue-4540 b/changelog/unreleased/issue-4540 new file mode 100644 index 000000000..5cac99b47 --- /dev/null +++ b/changelog/unreleased/issue-4540 @@ -0,0 +1,9 @@ +Bugfix: Restore ARMv5 support for ARM binaries + +The official release binaries for restic 0.16.1 were accidentally built to +require ARMv7. We have updated the build process to restore support for ARMv5. + +Please note that restic 0.17.0 will drop support for ARMv5 and require at least +ARMv6. + +https://github.com/restic/restic/issues/4540 diff --git a/helpers/build-release-binaries/main.go b/helpers/build-release-binaries/main.go index f14f60db6..169e1e001 100644 --- a/helpers/build-release-binaries/main.go +++ b/helpers/build-release-binaries/main.go @@ -125,6 +125,9 @@ func build(sourceDir, outputDir, goos, goarch string) (filename string) { "GOOS="+goos, "GOARCH="+goarch, ) + if goarch == "arm" { + c.Env = append(c.Env, "GOARM=5") + } verbose("run %v %v in %v", "go", c.Args, c.Dir) err := c.Run() From d863234e3ed683e3b045ad4d7b5aa2b62136ebc9 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Sat, 28 Oct 2023 20:25:24 +0200 Subject: [PATCH 09/14] add changelog for missing documentation --- changelog/unreleased/pull-4545 | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 changelog/unreleased/pull-4545 diff --git a/changelog/unreleased/pull-4545 b/changelog/unreleased/pull-4545 new file mode 100644 index 000000000..d2f6e8ba2 --- /dev/null +++ b/changelog/unreleased/pull-4545 @@ -0,0 +1,8 @@ +Bugfix: Repair documentation build on readthedocs + +For restic 0.16.1, no documentation was available at +https://restic.readthedocs.io/ . + +We have updated the documentation build process to work again. + +https://github.com/restic/restic/pull/4545 From 7d980b469d2b950a4dc22f86d7a1df212ee875bd Mon Sep 17 00:00:00 2001 From: "Leo R. Lundgren" Date: Sun, 29 Oct 2023 00:44:53 +0200 Subject: [PATCH 10/14] doc: Polish changelogs --- changelog/unreleased/issue-4540 | 2 +- changelog/unreleased/pull-4545 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/changelog/unreleased/issue-4540 b/changelog/unreleased/issue-4540 index 5cac99b47..666bad59f 100644 --- a/changelog/unreleased/issue-4540 +++ b/changelog/unreleased/issue-4540 @@ -1,7 +1,7 @@ Bugfix: Restore ARMv5 support for ARM binaries The official release binaries for restic 0.16.1 were accidentally built to -require ARMv7. We have updated the build process to restore support for ARMv5. +require ARMv7. The build process is now updated to restore support for ARMv5. Please note that restic 0.17.0 will drop support for ARMv5 and require at least ARMv6. diff --git a/changelog/unreleased/pull-4545 b/changelog/unreleased/pull-4545 index d2f6e8ba2..fd510a1e2 100644 --- a/changelog/unreleased/pull-4545 +++ b/changelog/unreleased/pull-4545 @@ -1,8 +1,8 @@ -Bugfix: Repair documentation build on readthedocs +Bugfix: Repair documentation build on Read the Docs For restic 0.16.1, no documentation was available at https://restic.readthedocs.io/ . -We have updated the documentation build process to work again. +The documentation build process is now updated to work again. https://github.com/restic/restic/pull/4545 From c8dd95f104f7024b34e8732172509694d8b1fc13 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sun, 29 Oct 2023 19:50:04 +0100 Subject: [PATCH 11/14] Prepare changelog for 0.16.2 --- changelog/{unreleased => 0.16.2_2023-10-29}/issue-4540 | 0 changelog/{unreleased => 0.16.2_2023-10-29}/pull-4545 | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename changelog/{unreleased => 0.16.2_2023-10-29}/issue-4540 (100%) rename changelog/{unreleased => 0.16.2_2023-10-29}/pull-4545 (100%) diff --git a/changelog/unreleased/issue-4540 b/changelog/0.16.2_2023-10-29/issue-4540 similarity index 100% rename from changelog/unreleased/issue-4540 rename to changelog/0.16.2_2023-10-29/issue-4540 diff --git a/changelog/unreleased/pull-4545 b/changelog/0.16.2_2023-10-29/pull-4545 similarity index 100% rename from changelog/unreleased/pull-4545 rename to changelog/0.16.2_2023-10-29/pull-4545 From d33fe6dd3c9e6bf529f7c45e43bbc22442881931 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sun, 29 Oct 2023 19:50:04 +0100 Subject: [PATCH 12/14] Generate CHANGELOG.md for 0.16.2 --- CHANGELOG.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ff46a72f..ab07cc225 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,36 @@ +Changelog for restic 0.16.2 (2023-10-29) +======================================= + +The following sections list the changes in restic 0.16.2 relevant to +restic users. The changes are ordered by importance. + +Summary +------- + + * Fix #4540: Restore ARMv5 support for ARM binaries + * Fix #4545: Repair documentation build on Read the Docs + +Details +------- + + * Bugfix #4540: Restore ARMv5 support for ARM binaries + + The official release binaries for restic 0.16.1 were accidentally built to require ARMv7. The + build process is now updated to restore support for ARMv5. + + Please note that restic 0.17.0 will drop support for ARMv5 and require at least ARMv6. + + https://github.com/restic/restic/issues/4540 + + * Bugfix #4545: Repair documentation build on Read the Docs + + For restic 0.16.1, no documentation was available at https://restic.readthedocs.io/ . + + The documentation build process is now updated to work again. + + https://github.com/restic/restic/pull/4545 + + Changelog for restic 0.16.1 (2023-10-24) ======================================= From 1a5efcf68077e21805fc439c6349f2c010bf7dfd Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sun, 29 Oct 2023 19:50:07 +0100 Subject: [PATCH 13/14] Add version for 0.16.2 --- VERSION | 2 +- cmd/restic/global.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 2a0970ca7..201a22c8f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.16.1 +0.16.2 diff --git a/cmd/restic/global.go b/cmd/restic/global.go index fd735edf7..cfca60521 100644 --- a/cmd/restic/global.go +++ b/cmd/restic/global.go @@ -43,7 +43,7 @@ import ( "golang.org/x/term" ) -var version = "0.16.1-dev (compiled manually)" +var version = "0.16.2" // TimeFormat is the format used for all timestamps printed by restic. const TimeFormat = "2006-01-02 15:04:05" From 59fe24cb2b8d9630cda2b03887501b1440a5f185 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sun, 29 Oct 2023 19:50:12 +0100 Subject: [PATCH 14/14] Set development version for 0.16.2 --- cmd/restic/global.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/restic/global.go b/cmd/restic/global.go index cfca60521..8101354ce 100644 --- a/cmd/restic/global.go +++ b/cmd/restic/global.go @@ -43,7 +43,7 @@ import ( "golang.org/x/term" ) -var version = "0.16.2" +var version = "0.16.2-dev (compiled manually)" // TimeFormat is the format used for all timestamps printed by restic. const TimeFormat = "2006-01-02 15:04:05"