Skip to content
Permalink
Browse files

Merge branch 'drybjed-nextcloud-ldap-quota'

  • Loading branch information...
drybjed committed Oct 6, 2019
2 parents 34b2e0e + 4c5e129 commit 35f17fa64b24c17d54fe4f1a82cc6a8559f23418
@@ -106,6 +106,9 @@ LDAP
operation of a given LDAP object, which can be used to, for example, check
the date of the last successful login of a given user account.

- Add support for :ref:`nextcloud LDAP schema <slapd__ref_nextcloud>` which
provides attributes needed to define disk quotas for Nextcloud user accounts.

:ref:`debops.unbound` role
''''''''''''''''''''''''''

@@ -211,6 +214,16 @@ General
documentation page for details about the required attributes and their
values.

- The default LDAP group filter configured in the
:envvar:`owncloud__ldap_group_filter` variable has been modified to limit the
available set of ``groupOfNames`` LDAP objects to only those that have the
``nextcloudEnabled`` attribute set to ``true``.

- Support for disk quotas for LDAP users has been added in the default
configuration, based on the :ref:`nextcloud LDAP schema
<slapd__ref_nextcloud>`. The default disk quota is set to 10 GB and can be
changed using the ``nextcloudQuota`` LDAP attribute.

:ref:`debops.resolvconf` role
'''''''''''''''''''''''''''''

@@ -1302,7 +1302,10 @@ owncloud__ldap_user_filter_objectclass: 'inetOrgPerson'
# .. envvar:: owncloud__ldap_group_filter
#
# Refer to the `official ownCloud documentation <https://doc.owncloud.org/server/9.0/admin_manual/configuration_user/user_auth_ldap.html#group-filter>`__ for details.
owncloud__ldap_group_filter: '(objectClass=groupOfNames)'
owncloud__ldap_group_filter: '(&
(objectClass=groupOfNames)
(nextcloudEnabled=true)
)'


# .. envvar:: owncloud__ldap_group_filter_groups
@@ -1511,6 +1514,12 @@ owncloud__ldap_default_config:
- name: 'ldapTLS'
value: '{{ "1" if (owncloud__ldap_method == "tls") else "0" }}'

- name: 'ldapQuotaAttribute'
value: 'nextcloudQuota'

- name: 'ldapQuotaDefault'
value: '10 GB'

- name: 'hasMemberOfFilterSupport'
value: '1'

@@ -65,6 +65,9 @@ slapd__default_schemas:
# Support for 'eduPerson' and 'eduOrg' schema, included in DebOps
- '{{ slapd__debops_schema_path + "/eduperson.schema" }}'

# Support for 'nextcloud' schema, included in DebOps
- '{{ slapd__debops_schema_path + "/nextcloud.schema" }}'

# ]]]
# .. envvar:: slapd__schemas [[[
#
@@ -0,0 +1,77 @@
# nextcloud.schema - Nextcloud schema definition

# Copyright (C) 2019 Maciej Delmanowski <drybjed@gmail.com>
# Copyright (C) 2019 DebOps project https://debops.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

# Based on: https://docs.nextcloud.com/server/stable/admin_manual/configuration_user/user_auth_ldap.html


# Object namespace definitions
# ----------------------------

# The Private Enterprise Number of the Nextcloud project registered at IANA
# https://www.iana.org/assignments/enterprise-numbers/enterprise-numbers
objectIdentifier Nextcloud 1.3.6.1.4.1.49213

# The Nextcloud LDAP namespace
objectIdentifier NextcloudLDAP Nextcloud:1

# The Nextcloud LDAP attribute namespace
objectIdentifier NextcloudLDAPAttribute NextcloudLDAP:1

# The Nextcloud LDAP object namespace
objectIdentifier NextcloudLDAPObject NextcloudLDAP:2


# Nextcloud attribute definitions
# -------------------------------

attributeType ( NextcloudLDAPAttribute:1
NAME 'nextcloudQuota'
DESC 'Nextcloud disk quota (e.g. 15 GB)'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )

attributeType ( NextcloudLDAPAttribute:2
NAME 'nextcloudEnabled'
DESC 'Whether user or group should be available in Nextcloud'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )


# Nextcloud object definitions
# ----------------------------

objectClass ( NextcloudLDAPObject:1
NAME 'nextcloudAccount'
DESC 'Object with attributes used by Nextcloud user accounts'
AUXILIARY
MUST ( cn $ uid )
MAY ( nextcloudQuota $ nextcloudEnabled ) )

objectClass ( NextcloudLDAPObject:2
NAME 'nextcloudGroup'
DESC 'Object with attributes used by Nextcloud groups'
AUXILIARY
MUST ( cn )
MAY ( nextcloudEnabled ) )
@@ -28,6 +28,12 @@ Object Classes and Attributes

- :ref:`debops.owncloud`: :envvar:`Object Classes <owncloud__ldap_self_object_classes>`, :envvar:`Attributes <owncloud__ldap_self_attributes>`

Custom objectClasses and attributes from the :ref:`nextcloud
<slapd__ref_nextcloud>` LDAP schema:

- objectClass ``nextcloudAccount``, attributes ``nextcloudEnabled``, ``nextcloudQuota``
- objectClass ``nextcloudGroup``, attributes ``nextcloudEnabled``


.. _owncloud__ref_ldap_dit_access:

@@ -261,3 +261,16 @@ The schema is available in Debian in the
slightly outdated and does not include object and attribute descriptions.
Because of that, DebOps contains its own copy of the schema, cleaned up and
updated, which will be imported by default to OpenLDAP directory server.


.. _slapd__ref_nextcloud:

The ``nextcloud`` schema
------------------------

The ``nextcloud`` schema provides a set of LDAP objectClasses and attributes
that can be used to control LDAP integration with :ref:`Nextcloud
<debops.owncloud>` application. Using these attributes, administrators can
define disk quotas for Nextcloud users stored in the LDAP directory, as well as
define which user groups present in LDAP are available in the Nextcloud user
interface.
@@ -119,7 +119,7 @@ Inventory variable changes
============================================== =============================================== ==============================
:envvar:`owncloud__ldap_login_filter` ``(&(|(objectclass=inetOrgPerson))(uid=%uid))`` too large; see the variable
---------------------------------------------- ----------------------------------------------- ------------------------------
:envvar:`owncloud__ldap_group_filter` ``(&(|(objectclass=posixGroup)))`` ``(objectClass=groupOfNames)``
:envvar:`owncloud__ldap_group_filter` ``(&(|(objectclass=posixGroup)))`` too large; see the variable
---------------------------------------------- ----------------------------------------------- ------------------------------
:envvar:`owncloud__ldap_group_assoc_attribute` ``memberUid`` ``member``
============================================== =============================================== ==============================

0 comments on commit 35f17fa

Please sign in to comment.
You can’t perform that action at this time.