Skip to content

Add Directory Groups plugin: multi-domain OU groups and browser - #39

Merged
mastacontrola merged 2 commits into
mainfrom
feat/directorygroups
Oct 16, 2026
Merged

mastacontrola merged 2 commits into
mainfrom
feat/directorygroups

Conversation

@mastacontrola

Copy link
Copy Markdown
Member

Adds directorygroups, the replacement for the ou plugin agreed on FOGProject/fogproject#1879.

What it does

  • Keeps a list of Active Directory domains (Directory Domains). Each has its own server URI, bind DN, bind password, CA certificate, computer search base and OU browse base.
  • Answers core's DIRECTORY_CONNECTION with the domain that matches the host's AD domain (case-insensitive). A host in no listed domain gets no connection, and placement skips it.
  • Hides FOG_DIRECTORY_LDAP_URI, _BIND_DN, _BIND_PASSWORD, _CA_CERT and _BASE_DN on the FOG Settings page while installed (SETTINGS_HIDDEN). FOG_DIRECTORY_PLACEMENT_ENABLED stays visible. Uninstall brings them back.
  • A domain's Organizational Units tab lists the OUs under the browse base as a searchable tree, and adds the selected ones as directory groups (fogad.local/Sales/Staging).
  • The host Active Directory tab gets Browse Directory. Picking an OU fills Domain Name and Organizational Unit. Nothing saves until Update.
  • Groups hosts by OU, as ou did (node directorygroups, tables directoryOUs, directoryOUAssoc).

Install migration

  • The FOG_DIRECTORY_* connection becomes the first domain. Its name comes from the base DN's DC= parts.
  • If ou is installed, its OUs and host links are copied in with their ids (INSERT IGNORE, so a re-run is a no-op). Copied groups get the domain their DN sits under.
  • ou itself is left installed. Retiring it is a separate change.

Security

  • The bind password uses the API's always sensitive tier and is stripped from the export. The edit form never renders it; a blank field keeps it.
  • Domains have their own permission node, directorydomain, so grouping hosts does not grant access to bind accounts. Adding OUs as groups also needs directorygroups.create.

Depends on FOGProject/fogproject#1882 (merged into working-1.6).

Tests

  • sh tests/run-all.sh: 18 of 18 pass.
  • Live on a 1.6 server with #1882 deployed: install migrated 1 ou row and 1 host link, and seeded the first domain. A second domain on a Samba AD listed 1104 OUs over LDAPS with CA verification. Two OUs were added as groups from the tree. Browse Directory filled both host fields. The settings page showed only the placement switch. A General save with a blank password kept the stored one. Uninstall dropped all three tables and left ou untouched.

🤖 Generated with Claude Code

mastacontrola and others added 2 commits October 16, 2026 07:41
Namespace FOG\Plugins\DirectoryGroups, node and permission
'directorygroups', tables directoryOUs / directoryOUAssoc with do*/doa*
columns plus a nullable doDomainID. The host select is posted as
'directorygroups' instead of 'ou'. The ou plugin is untouched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each domain has its own server, bind account, CA certificate and base
DNs. The plugin answers core's DIRECTORY_CONNECTION with the domain
that matches the host's AD domain, and hides the FOG_DIRECTORY_*
connection settings while it is installed (SETTINGS_HIDDEN).

A domain's Organizational Units tab lists its OUs as a searchable tree
and adds the selected ones as directory groups. The host's Active
Directory tab gets a Browse Directory button that fills the Domain Name
and OU fields from the tree.

On install, the FOG_DIRECTORY_* connection becomes the first domain,
and the ou plugin's OUs and host links are copied in, idempotently.
Uninstall drops all three tables.

Refs FOGProject/fogproject#1879

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant