Skip to content
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ For details on the changes in each release, see [the Releases page](https://gith

## Version-specific update instructions:

### 1.8 -> 1.9
- schema migration:
- the new LDAP schema should be added in conjunction with the old
- all entries should have the `piGroup` objectClass replaced with `unityGroup`
- the `setup-pi-group-owners.php` worker should be run
Comment thread
simonLeary42 marked this conversation as resolved.
Outdated

### 1.7 -> 1.8
- the [webhook] section of the config file can be removed
- all mail templates are no longer PHP files, now they are `.html.twig`
Expand Down
5 changes: 3 additions & 2 deletions resources/lib/UnityGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,10 @@ private function init(): void
assert(!$this->entry->exists());
$nextGID = $this->LDAP->getNextPIGIDNumber();
$this->entry->create([
"objectclass" => ["piGroup", "posixGroup", "top"],
"objectclass" => ["unityGroup", "posixGroup", "top"],
"gidnumber" => strval($nextGID),
"memberuid" => [$owner->uid],
"owneruid" => $owner->uid,
]);
// TODO if we ever make this project based,
// we need to update the cache here with the memberuid
Expand Down Expand Up @@ -480,7 +481,7 @@ public function addPlusAddressToMail(string $mail): string
$owner = $this->getOwner();
$suffix = "_" . $owner->getOrg();
assert(str_ends_with($owner->uid, $suffix));
$short_name = substr($owner->uid, 0, -1 * strlen($suffix));
$short_name = substr($owner->uid, 0, -strlen($suffix));
$parts = explode("@", $mail, 2);
return sprintf("%s+%s@%s", $parts[0], $short_name, $parts[1]);
}
Expand Down
12 changes: 11 additions & 1 deletion tools/docker-dev/identity/account-portal-schema.ldif
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,17 @@ olcAttributeTypes: ( 1.1.3 NAME 'managerUid'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
)
olcAttributeTypes: ( 1.1.4 NAME 'ownerUid'
DESC 'group owner'
EQUALITY caseIgnoreMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
SINGLE-VALUE
)
Comment thread
simonLeary42 marked this conversation as resolved.
olcObjectClasses: ( 1.1.2 NAME 'piGroup' SUP top AUXILIARY
DESC 'PI Group'
DESC 'DEPRECATED, DO NOT USE'
MAY ( isDisabled $ managerUid )
)
olcObjectClasses: ( 1.1.5 NAME 'unityGroup' SUP top AUXILIARY
DESC 'general-purpose group in the Unity HPC Platform'
MAY ( isDisabled $ managerUid $ ownerUid )
)
Comment thread
simonLeary42 marked this conversation as resolved.
12 changes: 12 additions & 0 deletions workers/setup-pi-group-owners.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env php
<?php
include __DIR__ . "/init.php";

use UnityWebPortal\lib\UnityGroup;
use UnityWebPortal\lib\UnityLDAP;

foreach ($LDAP->getPIGroupsAttributes(["cn"], filter: UnityLDAP::INCLUDE_DISABLED) as $attributes) {
$gid = $attributes["cn"][0];
Comment thread
simonLeary42 marked this conversation as resolved.
$entry->setAttribute("ownerUid", UnityGroup::GID2OwnerUID($gid));
}

Comment thread
simonLeary42 marked this conversation as resolved.
Loading