Compare commits
3 Commits
51a3cb60ec
...
feature/ld
| Author | SHA1 | Date | |
|---|---|---|---|
|
0bd77bc37a
|
|||
|
02af69b055
|
|||
|
5d459e7e7d
|
@@ -58,6 +58,7 @@
|
||||
# LNDHUB_PG_PASSWORD=''
|
||||
|
||||
# MASTODON_PUBLIC_URL='https://kosmos.social'
|
||||
# MASTODON_ADDRESS_DOMAIN='https://kosmos.org'
|
||||
|
||||
# MEDIAWIKI_PUBLIC_URL='https://wiki.kosmos.org'
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ class LdapService < ApplicationService
|
||||
end
|
||||
|
||||
attributes = %w[
|
||||
dn cn uid mail displayName admin service
|
||||
dn cn uid mail displayName admin serviceEnabled
|
||||
mailRoutingAddress mailpassword nostrKey
|
||||
]
|
||||
filter = Net::LDAP::Filter.eq("uid", args[:uid] || "*")
|
||||
|
||||
@@ -19,6 +19,18 @@ namespace :ldap do
|
||||
}, true
|
||||
end
|
||||
|
||||
# TODO
|
||||
desc "Add application account to directory"
|
||||
task add_application_account: :environment do |t, args|
|
||||
# Add uid=service,ou=kosmos.org,cn=applications,dc=kosmos,dc=org with userPassword
|
||||
end
|
||||
|
||||
# TODO
|
||||
desc "Add application ACI/permissions for OU, i.e. read/search users"
|
||||
task add_application_account: :environment do |t, args|
|
||||
# (target="ldap:///cn=*,ou=#{ou},cn=users,#{ldap_suffix}")(targetattr="cn || sn || uid || mail || userPassword || nsRole || objectClass") (version 3.0; acl "service-#{ou.gsub(".", "-")}-read-search"; allow (read,search) userdn="ldap:///uid=service,ou=#{ou},cn=applications,#{ldap_suffix}";)
|
||||
end
|
||||
|
||||
desc "Add custom attributes to schema"
|
||||
task add_custom_attributes: :environment do |t, args|
|
||||
%w[ admin service_enabled nostr_key ].each do |name|
|
||||
|
||||
4
schemas/ldap/aci.ldif
Normal file
4
schemas/ldap/aci.ldif
Normal file
@@ -0,0 +1,4 @@
|
||||
dn: ou=kosmos.org,cn=users,dc=kosmos,dc=org
|
||||
changetype: modify
|
||||
add: aci
|
||||
aci: (target="ldap:///cn=*,ou=kosmos.org,cn=users,dc=kosmos,dc=org")(targetattr="cn || sn || uid || mail || userPassword || serviceEnabled || displayName || jpegPhoto || nsRole || objectClass") (version 3.0; acl "service-kosmos-read-search"; allow (read,search) userdn="ldap:///uid=service,ou=kosmos.org,cn=applications,dc=kosmos,dc=org";)
|
||||
4
schemas/ldap/delete-aci.ldif
Normal file
4
schemas/ldap/delete-aci.ldif
Normal file
@@ -0,0 +1,4 @@
|
||||
dn: ou=kosmos.org,cn=users,dc=kosmos,dc=org
|
||||
changetype: modify
|
||||
delete: aci
|
||||
aci: (target="ldap:///cn=*,ou=kosmos.org,cn=users,dc=kosmos,dc=org")(targetattr="cn || sn || uid || mail || userPassword || nsRole || objectClass") (version 3.0; acl "service-kosmos-read-search"; allow (read,search) userdn="ldap:///uid=service,ou=kosmos.org,cn=applications,dc=kosmos,dc=org";)
|
||||
Reference in New Issue
Block a user