Hello community,

here is the log from the commit of package docker-distribution for 
openSUSE:Factory checked in at 2020-08-20 22:28:06
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/docker-distribution (Old)
 and      /work/SRC/openSUSE:Factory/.docker-distribution.new.3399 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "docker-distribution"

Thu Aug 20 22:28:06 2020 rev:20 rq:827673 version:2.7.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/docker-distribution/docker-distribution.changes  
2020-02-27 14:36:46.781963183 +0100
+++ 
/work/SRC/openSUSE:Factory/.docker-distribution.new.3399/docker-distribution.changes
        2020-08-20 22:28:10.863963145 +0200
@@ -1,0 +2,36 @@
+Tue Aug 18 19:43:21 UTC 2020 - Stefan Nica <[email protected]>
+
+- Add 0002-Relax-filesystem-driver-folder-permissions-to-0777-cont.patch
+to get the registry to honor the umask when creating new folders
+(https://github.com/docker/distribution/pull/3204)
+
+- Add 0001-Fix-s3-driver-for-supporting-ceph-radosgw.patch
+(https://github.com/docker/distribution/pull/2879)
+
+-------------------------------------------------------------------
+Fri Jul 31 19:35:10 UTC 2020 - Stefan Nica <[email protected]>
+
+- include OSS and GCS backend drivers in the build
+
+-------------------------------------------------------------------
+Tue Jul 28 14:00:03 UTC 2020 - Thorsten Kukuk <[email protected]>
+
+- Remove registry.SuSEfirewall2, SuSEfirewall2 does not exist anymore
+
+-------------------------------------------------------------------
+Fri Jul 24 13:42:41 CEST 2020 - [email protected]
+
+- enabled changesgenerate option to automatically generate changes 
+
+-------------------------------------------------------------------
+Tue Jul  7 21:44:45 UTC 2020 - Stefan Nica <[email protected]>
+
+- Run registry as non-privileged user
+
+-------------------------------------------------------------------
+Thu Jun 25 22:58:30 UTC 2020 - Stefan Nica <[email protected]>
+
+- Reworked the RPM spec to use the golang-packaging macros instead
+of the provided Makefile
+
+-------------------------------------------------------------------

Old:
----
  registry.SuSEfirewall2

New:
----
  0001-Fix-s3-driver-for-supporting-ceph-radosgw.patch
  0002-Relax-filesystem-driver-folder-permissions-to-0777-cont.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ docker-distribution.spec ++++++
--- /var/tmp/diff_new_pack.H47Qv8/_old  2020-08-20 22:28:12.235963786 +0200
+++ /var/tmp/diff_new_pack.H47Qv8/_new  2020-08-20 22:28:12.243963790 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package docker-distribution
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -16,21 +16,28 @@
 #
 
 
+%define goipath github.com/docker/distribution
+%define registry_user registry
+%define registry_group registry
+
 Name:           docker-distribution
 Version:        2.7.1
 Release:        0
 Summary:        The Docker toolset to pack, ship, store, and deliver content
 License:        Apache-2.0
 Group:          System/Management
-Url:            https://github.com/docker/distribution
+URL:            https://github.com/docker/distribution
 Source0:        distribution-%{version}.tar.xz
 Source1:        registry-configuration.yml
 Source2:        registry.service
-Source3:        registry.SuSEfirewall2
 Source4:        README-registry.SUSE
+# PATCH-FIX-UPSTREAM https://github.com/docker/distribution/pull/2879
+Patch0:         0001-Fix-s3-driver-for-supporting-ceph-radosgw.patch
+# PATCH-FIX-UPSTREAM https://github.com/docker/distribution/pull/3204
+Patch1:         
0002-Relax-filesystem-driver-folder-permissions-to-0777-cont.patch
 BuildRequires:  go >= 1.11
+BuildRequires:  golang-packaging
 BuildRequires:  systemd-rpm-macros
-BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 ExclusiveArch:  x86_64 s390x aarch64 %arm ppc64le
 
 %description
@@ -54,20 +61,19 @@
 
 %prep
 %setup -q -n distribution-%{version}
+%patch0 -p1
+%patch1 -p1
 cp %{SOURCE4} .
 
 %build
-export GOPATH=$PWD/go
-mkdir -p $GOPATH/src/github.com/docker
-
-# Copy the vendor directory into the GOPATH.
-cp -r $PWD/vendor/* $GOPATH/src
-ln -s $PWD $GOPATH/src/github.com/docker/distribution
-
-make %{?_smp_mflags} binaries
+%goprep %{goipath}
+export CGO_ENABLED=0
+%define buildtags "include_oss include_gcs"
+%define ldflags "-s -w -X %{goipath}/version.Version=v%{version} -X 
%{goipath}/version.Package=%{goipath}"
+%gobuild -ldflags %{ldflags} -tags %{buildtags} cmd/registry
 
 %install
-install -D -m755 bin/registry %{buildroot}/%{_bindir}/registry
+%goinstall
 install -D -m644 %{SOURCE1} %{buildroot}/%{_sysconfdir}/registry/config.yml
 install -d  %{buildroot}%{_localstatedir}/lib/docker-registry
 
@@ -78,12 +84,13 @@
 install -D  -m 0644  %{SOURCE2} %{buildroot}%{_unitdir}/registry.service
 ln -sv %{_sbindir}/service %{buildroot}%{_sbindir}/rcregistry
 
-#
-# install SuSEfirewall2 rules
-#
-install -Dpm 0644  %{SOURCE3} 
%{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/registry
-
 %pre registry
+getent group %{registry_group} >/dev/null || groupadd -r %{registry_group}
+getent passwd %{registry_user} >/dev/null || useradd -r -g %{registry_group} \
+  -d %{_localstatedir}/lib/registry \
+  -s /sbin/nologin \
+  -c "user for docker-registry" \
+  %{registry_user}
 %service_add_pre registry.service
 
 %post registry
@@ -100,11 +107,10 @@
 %{_bindir}/registry
 %{_sbindir}/rcregistry
 %{_unitdir}/registry.service
-%config(noreplace) %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/registry
 %config %{_sysconfdir}/registry
 %config(noreplace) %{_sysconfdir}/registry/config.yml
 %doc README.md README-registry.SUSE
 %license LICENSE
-%{_localstatedir}/lib/docker-registry
+%attr(-,%{registry_user},%{registry_group}) 
%{_localstatedir}/lib/docker-registry
 
 %changelog

++++++ 0001-Fix-s3-driver-for-supporting-ceph-radosgw.patch ++++++
>From f87772650309d03049310dd7d623449554a10147 Mon Sep 17 00:00:00 2001
From: Eohyung Lee <[email protected]>
Date: Wed, 25 Apr 2018 23:31:07 +0900
Subject: [PATCH 1/2] Fix s3 driver for supporting ceph radosgw

Radosgw does not support S3 `GET Bucket` API v2 API but v1.
This API has backward compatibility, so most of this API is working
correctly but we can not get `KeyCount` in v1 API and which is only
for v2 API.

Signed-off-by: Eohyung Lee <[email protected]>
---
 registry/storage/driver/s3-aws/s3.go | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/registry/storage/driver/s3-aws/s3.go 
b/registry/storage/driver/s3-aws/s3.go
index 126a07f6b..1f610f796 100644
--- a/registry/storage/driver/s3-aws/s3.go
+++ b/registry/storage/driver/s3-aws/s3.go
@@ -970,8 +970,16 @@ func (d *driver) doWalk(parentCtx context.Context, 
objectCount *int64, path, pre
        defer done("s3aws.ListObjectsV2Pages(%s)", path)
        listObjectErr := d.S3.ListObjectsV2PagesWithContext(ctx, 
listObjectsInput, func(objects *s3.ListObjectsV2Output, lastPage bool) bool {
 
-               *objectCount += *objects.KeyCount
-               walkInfos := make([]walkInfoContainer, 0, *objects.KeyCount)
+               var count int64
+               if objects.KeyCount != nil {
+                       count = *objects.KeyCount
+                       *objectCount += *objects.KeyCount
+               } else {
+                       count = int64(len(objects.Contents) + 
len(objects.CommonPrefixes))
+                       *objectCount += count
+               }
+
+               walkInfos := make([]walkInfoContainer, 0, count)
 
                for _, dir := range objects.CommonPrefixes {
                        commonPrefix := *dir.Prefix

>From c18c6c33b24010b3bfd3c49539f44c49681b4981 Mon Sep 17 00:00:00 2001
From: Thomas Berger <[email protected]>
Date: Fri, 15 Mar 2019 21:05:21 +0100
Subject: [PATCH 2/2] S3 Driver: added comment for missing KeyCount workaround

Signed-off-by: Thomas Berger <[email protected]>
---
 registry/storage/driver/s3-aws/s3.go | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/registry/storage/driver/s3-aws/s3.go 
b/registry/storage/driver/s3-aws/s3.go
index 1f610f796..4b6c50d7b 100644
--- a/registry/storage/driver/s3-aws/s3.go
+++ b/registry/storage/driver/s3-aws/s3.go
@@ -971,6 +971,9 @@ func (d *driver) doWalk(parentCtx context.Context, 
objectCount *int64, path, pre
        listObjectErr := d.S3.ListObjectsV2PagesWithContext(ctx, 
listObjectsInput, func(objects *s3.ListObjectsV2Output, lastPage bool) bool {
 
                var count int64
+               // KeyCount was introduced with version 2 of the GET Bucket 
operation in S3.
+               // Some S3 implementations don't support V2 now, so we fall 
back to manual
+               // calculation of the key count if required
                if objects.KeyCount != nil {
                        count = *objects.KeyCount
                        *objectCount += *objects.KeyCount
++++++ 0002-Relax-filesystem-driver-folder-permissions-to-0777-cont.patch ++++++
commit a789d064102816ed12c56e5fac365a623f1abd12
Author: Stefan Nica <[email protected]>
Date:   Fri Jul 10 12:31:01 2020 +0200

    Relax filesystem driver folder permissions to 0777 (cont)
    
    There was a previous PR relaxing the filsystem driver permissions
    for files and folders to 0666 and 0777 respectively [1][2], but it was
    incomplete. This is required to get the registry to honor the umask
    value.
    
    [1] https://github.com/docker/distribution/pull/1304/
    [2] https://github.com/docker/distribution/issues/1295

diff --git a/registry/storage/driver/filesystem/driver.go 
b/registry/storage/driver/filesystem/driver.go
index 8fc9d1ca..ef6cc972 100644
--- a/registry/storage/driver/filesystem/driver.go
+++ b/registry/storage/driver/filesystem/driver.go
@@ -260,7 +260,7 @@ func (d *driver) Move(ctx context.Context, sourcePath 
string, destPath string) e
                return storagedriver.PathNotFoundError{Path: sourcePath}
        }
 
-       if err := os.MkdirAll(path.Dir(dest), 0755); err != nil {
+       if err := os.MkdirAll(path.Dir(dest), 0777); err != nil {
                return err
        }
 
++++++ _service ++++++
--- /var/tmp/diff_new_pack.H47Qv8/_old  2020-08-20 22:28:12.323963827 +0200
+++ /var/tmp/diff_new_pack.H47Qv8/_new  2020-08-20 22:28:12.327963829 +0200
@@ -5,6 +5,7 @@
     <param name="exclude">.git</param>
     <param name="versionformat">2.7.1</param>
     <param name="revision">v2.7.1</param>
+    <param name="changesgenerate">enable</param>
   </service>
   <service name="recompress" mode="disabled">
     <param name="file">distribution-*.tar</param>

++++++ registry.service ++++++
--- /var/tmp/diff_new_pack.H47Qv8/_old  2020-08-20 22:28:12.379963854 +0200
+++ /var/tmp/diff_new_pack.H47Qv8/_new  2020-08-20 22:28:12.383963855 +0200
@@ -5,6 +5,8 @@
 
 [Service]
 ExecStart=/usr/bin/registry serve /etc/registry/config.yml
+User=registry
+Group=registry
 
 [Install]
 WantedBy=multi-user.target


Reply via email to