diff --git a/api/website/ldap.py b/api/website/ldap.py new file mode 100644 index 0000000..76095df --- /dev/null +++ b/api/website/ldap.py @@ -0,0 +1,27 @@ +import ldap +from django_auth_ldap.config import LDAPSearch, GroupOfNamesType +AUTH_LDAP_SERVER_URI = "ldaps://foo.example.com ldaps://bar.example.com" +AUTH_LDAP_BIND_DN = "cn=foo,ou=bar,dc=example,dc=com" +AUTH_LDAP_BIND_PASSWORD = "foobar" +AUTH_LDAP_USER_SEARCH = LDAPSearch( + "ou=foo-users,dc=example,dc=com", ldap.SCOPE_ONELEVEL, "(&(uid=%(user)s)(objectClass=nsPerson)(|(memberOf=cn=foo_access,ou=bar,dc=example,dc=com)(memberOf=cn=foo_staff,ou=bar,dc=example,dc=com)(memberOf=cn=foo_admins,ou=bar,dc=example,dc=com)))" +) +AUTH_LDAP_USER_ATTR_MAP = { + "first_name": "givenName", + "last_name": "sn", + "full_name": "legalName", + "email": "mail", +} +AUTH_LDAP_GROUP_TYPE = GroupOfNamesType() +AUTH_LDAP_GROUP_SEARCH = LDAPSearch( + "ou=bar,dc=example,dc=com", ldap.SCOPE_ONELEVEL, "(&(objectClass=groupOfNames)(|(cn=foo_access)(cn=foo_staff)(cn=foo_admins)))" +) +AUTH_LDAP_REQUIRE_GROUP = "cn=foo_access,ou=foo_groups,dc=syscid,dc=com" +AUTH_LDAP_MIRROR_GROUPS = True +AUTH_LDAP_USER_FLAGS_BY_GROUP = { + "is_active": "cn=foo_access,ou=foo_groups,dc=example,dc=com", + "is_staff": "cn=foo_staff,ou=foo_groups,dc=example,dc=com", + "is_superuser": "cn=foo_admins,ou=foo_groups,groups,dc=example,dc=com" +} +AUTH_LDAP_FIND_GROUP_PERMS = True +AUTH_LDAP_CACHE_TIMEOUT = 3600 diff --git a/api/website/settings.py b/api/website/settings.py index 294ee1b..d96bbe2 100644 --- a/api/website/settings.py +++ b/api/website/settings.py @@ -186,3 +186,12 @@ REST_FRAMEWORK = { # }, # }, # } + +REMOTE_AUTH_ENABLED = True +REMOTE_AUTH_BACKEND = 'netbox.authentication.LDAPBackend' +REMOTE_AUTH_HEADER = 'HTTP_REMOTE_USER' +REMOTE_AUTH_AUTO_CREATE_USER = True +REMOTE_AUTH_DEFAULT_GROUPS = [] +REMOTE_AUTH_DEFAULT_PERMISSIONS = {} + +SESSION_COOKIE_NAME = 'libertacasa-dev' diff --git a/public/libcasa/public/about-libertacasa/index.html b/public/libcasa/public/about-libertacasa/index.html new file mode 100644 index 0000000..7d4d10c --- /dev/null +++ b/public/libcasa/public/about-libertacasa/index.html @@ -0,0 +1 @@ +https://liberta.casa/about/ \ No newline at end of file diff --git a/public/libcasa/public/about-us/index.html b/public/libcasa/public/about-us/index.html new file mode 100644 index 0000000..7d4d10c --- /dev/null +++ b/public/libcasa/public/about-us/index.html @@ -0,0 +1 @@ +https://liberta.casa/about/ \ No newline at end of file diff --git a/public/libcasa/public/categories/index.xml b/public/libcasa/public/categories/index.xml new file mode 100644 index 0000000..7de92b6 --- /dev/null +++ b/public/libcasa/public/categories/index.xml @@ -0,0 +1,10 @@ + + + + Categories on Liberta Casa + https://liberta.casa/categories/ + Recent content in Categories on Liberta Casa + Hugo -- gohugo.io + en-us + + diff --git a/public/libcasa/public/contact/index.html b/public/libcasa/public/contact/index.html new file mode 100644 index 0000000..7d4d10c --- /dev/null +++ b/public/libcasa/public/contact/index.html @@ -0,0 +1 @@ +https://liberta.casa/about/ \ No newline at end of file diff --git a/public/libcasa/public/index.xml b/public/libcasa/public/index.xml new file mode 100644 index 0000000..f41aec8 --- /dev/null +++ b/public/libcasa/public/index.xml @@ -0,0 +1,28 @@ + + + + Liberta Casa + https://liberta.casa/ + Recent content on Liberta Casa + Hugo -- gohugo.io + en-us + + About + https://liberta.casa/about/ + Sun, 12 Dec 2021 00:00:00 +0000 + + https://liberta.casa/about/ + + + + + Rules + https://liberta.casa/rules/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://liberta.casa/rules/ + + + + + diff --git a/public/libcasa/public/series/index.xml b/public/libcasa/public/series/index.xml new file mode 100644 index 0000000..6ddc1c2 --- /dev/null +++ b/public/libcasa/public/series/index.xml @@ -0,0 +1,10 @@ + + + + Series on Liberta Casa + https://liberta.casa/series/ + Recent content in Series on Liberta Casa + Hugo -- gohugo.io + en-us + + diff --git a/public/libcasa/public/sitemap.xml b/public/libcasa/public/sitemap.xml new file mode 100644 index 0000000..51bfa9f --- /dev/null +++ b/public/libcasa/public/sitemap.xml @@ -0,0 +1,18 @@ + + + + https://liberta.casa/about/ + 2021-12-12T00:00:00+00:00 + + https://liberta.casa/ + + https://liberta.casa/categories/ + + https://liberta.casa/rules/ + + https://liberta.casa/series/ + + https://liberta.casa/tags/ + + diff --git a/public/libcasa/public/tags/index.xml b/public/libcasa/public/tags/index.xml new file mode 100644 index 0000000..c75a385 --- /dev/null +++ b/public/libcasa/public/tags/index.xml @@ -0,0 +1,10 @@ + + + + Tags on Liberta Casa + https://liberta.casa/tags/ + Recent content in Tags on Liberta Casa + Hugo -- gohugo.io + en-us + +