--- rpms/smeserver-nextcloud/contribs10/smeserver-nextcloud-1.2.0-bz12096-bz12095.patch 2022/07/08 16:30:14 1.2 +++ rpms/smeserver-nextcloud/contribs10/smeserver-nextcloud-1.2.0-bz12096-bz12095.patch 2022/07/08 18:24:00 1.3 @@ -1,7 +1,20 @@ diff -Nur --no-dereference smeserver-nextcloud-1.2.0.old/root/etc/e-smith/events/actions/nextcloud-conf smeserver-nextcloud-1.2.0/root/etc/e-smith/events/actions/nextcloud-conf --- smeserver-nextcloud-1.2.0.old/root/etc/e-smith/events/actions/nextcloud-conf 2022-07-08 12:03:27.238000000 -0400 -+++ smeserver-nextcloud-1.2.0/root/etc/e-smith/events/actions/nextcloud-conf 2022-07-08 12:07:34.584000000 -0400 -@@ -75,4 +75,9 @@ ++++ smeserver-nextcloud-1.2.0/root/etc/e-smith/events/actions/nextcloud-conf 2022-07-08 13:47:56.662000000 -0400 +@@ -52,7 +52,12 @@ + OCC "ldap:create-empty-config" # create config with empty id + OCC "ldap:create-empty-config" # create config with id s01 + OCC "ldap:delete-config ''" # delte config with empty id ++ mkdir -p /home/e-smith/files/nextcloud/skeleton/ibays ++ /usr/bin/occ config:system:set skeletondirectory --value="/home/e-smith/files/nextcloud/skeleton" ++ #/usr/bin/occ config:system:set templatedirectory --value="" + else ++ mkdir -p /home/e-smith/files/nextcloud/skeleton/ibays ++ /usr/bin/occ config:system:set skeletondirectory --value="/home/e-smith/files/nextcloud/skeleton" + # to satisfy code integrity check + if [ -f /usr/share/nextcloud/.htaccess.rpmsave ]; then + rm -f /usr/share/nextcloud/.htaccess.rpmsave +@@ -75,4 +80,9 @@ mkdir -p /var/www/.cache/samba chown www:shared /var/www/.cache/samba fi @@ -13,14 +26,74 @@ diff -Nur --no-dereference smeserver-nex diff -Nur --no-dereference smeserver-nextcloud-1.2.0.old/root/etc/e-smith/events/actions/nextcloud-occ-conf smeserver-nextcloud-1.2.0/root/etc/e-smith/events/actions/nextcloud-occ-conf --- smeserver-nextcloud-1.2.0.old/root/etc/e-smith/events/actions/nextcloud-occ-conf 2022-07-08 12:03:27.223000000 -0400 -+++ smeserver-nextcloud-1.2.0/root/etc/e-smith/events/actions/nextcloud-occ-conf 2022-07-08 12:29:34.464000000 -0400 -@@ -148,6 +148,9 @@ ++++ smeserver-nextcloud-1.2.0/root/etc/e-smith/events/actions/nextcloud-occ-conf 2022-07-08 14:12:02.289000000 -0400 +@@ -148,11 +148,16 @@ OCC "ldap:set-config s01 ldapExpertUUIDGroupAttr cn"; OCC "ldap:set-config s01 ldapExpertUUIDUserAttr uid"; OCC "ldap:set-config s01 ldapExpertUsernameAttr uid"; + # test new config to make it available, and sync user/groups + OCC "ldap:test-config s01"; + %NCusers= listUsers; ++ my $totrash = OCCr "group:list"; # set ibays shares foreach ( @ibays) { + my $group = $_->prop('Group') ||''; + my $key = $_->key; ++ print "Configuring file repo : $key\n"; + my $id = ""; + my $typ = $_->prop('type'); + my @wgroups = split(',', $_->prop('WriteGroups')||''); +@@ -183,9 +188,11 @@ + $id = OCCr "files_external:create -c datadir=/home/e-smith/files/$typ/$key 'ibays/$key' local null::null --output json"; + } + for $group (@groups) { ++ print " adding group $group to file repo $id\n"; + OCC "files_external:applicable --add-group $group $id --output json"; + } + for my $u (@uUsers) { ++ print " adding user $u to file repo $id\n"; + OCC "files_external:applicable --add-user $u $id --output json" ; + } + push @idOK,$id; +@@ -240,6 +247,7 @@ + my $key = $_->key; + my $id = ""; + my $user = $NCusers{$key}; ++ print "Configuring user $user ($key)\n"; + # in case user not already know by NC, skip + # normally not necessary, thanks to LDAP!! + next if ($user eq ""); +@@ -249,6 +257,7 @@ + unless ( !-d $idir || !-d "$idir/files" || -d "$idir/files/ibays") + { + mkdir "$idir/files/ibays", 0770; ++ print " created $idir/files/ibays\n"; + } + # we do this on every turn in case it was wrong + chown $uid, $gid,"$idir/files/ibays"; +@@ -269,13 +278,13 @@ + $id = OCCr "files_external:create -c share=$key -c host=localhost -c domain=$workgroup -c root='' -c show_hidden=false -c check_acl=false -c timeout='' '$key' smb password::logincredentials --output json"; + OCC "files_external:applicable --add-user $user $id"; + push @idOK,$id; +- print "created home dir for $key $user\n"; ++ print " created home dir for $key $user\n"; + next; + } + + if (scalar(@matching_keys) > 1) { + #if more than 1 delete all but older +- print "more than one $key, deleting the latest, keeping first\n"; ++ print " more than one $key, deleting the latest, keeping first\n"; + while (scalar(@matching_keys) > 1){ + my $bad = pop @matching_keys; + OCC "files_external:delete $bad -y"; +@@ -283,7 +292,7 @@ + } + $id = pop @matching_keys; + if (scalar(@{$localmounts{$id}{'applicable_groups'}}) >0 || scalar(@{$localmounts{$id}{'applicable_users'}}) >1 || scalar(@{$localmounts{$id}{'applicable_users'}}) == 0 || $localmounts{$id}{'applicable_users'}[0] ne $user) { +- print "updating $key\n"; ++ print " updating $key\n"; + OCC "files_external:applicable --remove-all $id"; + OCC "files_external:applicable --add-user $user $id" ; + }