Compare commits

..

No commits in common. "03f691d38da3f6637332cc4b2406cd95bca761e8" and "604d1b6a717064b8f1bde84cca2a9a216fbc380a" have entirely different histories.

3 changed files with 28 additions and 94 deletions

View File

@ -27,16 +27,9 @@ Examples:
configs => {
wmde => {
password => "1234",
password_salt => "5678",
tree_suffix => "dc=wikimedia,dc=de",
admins => [
"cn=admin,dc=wikimedia,dc=de",
],
login_search_dn=>"cn=admin,dc=wikimedia,dc=de",
login_search_suffix=>"dc=wikimedia,dc=de",
login_search_password=>"123",
login_method=>"search" # or "listi or search allowed"
password_salt => "5678"
}
}
}

View File

@ -100,80 +100,27 @@ class wmdeit_ldap::lam(
generate("/bin/sh","-c", "echo -n $password_salt | openssl base64")
, '\n', "\n "))
$base64pw = base64( 'encode',"LAM_OBFUSCATE:${conf['login_search_password']}")
$spw = strip (regsubst(
generate("/bin/sh","-c", "echo -n '$base64pw' | /usr/bin/rot13")
, '\n', "\n "))
wmdeit_ldap::lam::config {$name:
encoded_password => $encoded_password,
encoded_password_salt => $encoded_password_salt,
suffix_user => $conf['suffix_user'],
suffix_group => $conf['suffix_group'],
tree_suffix => $conf['tree_suffix'],
admins => $conf['admins'],
login_method => $conf['login_method'] ? {undef => "list", default => $conf['login_method']},
login_search_suffix => $conf['login_search_suffix'],
login_search_dn => $conf['login_search_dn'],
login_search_filter => $conf['login_search_filter'] ? {
undef => "uid=%USER%",
default => $conf['login_search_filter']
},
login_search_password => $conf['login_search_password'] ? {
undef => "",
default => $spw
},
}
file {"$docroot/config/$name.conf":
ensure => file,
content => template("wmdeit_ldap/wmde.conf.erb"),
owner => "www-data",
require => File["$docroot/config/pdf"],
} ->
file {"$docroot/config/profiles/$name":
ensure=>directory
}->
file{"$docroot/config/profiles/$name/default.user":
ensure=>file,
content => template("wmdeit_ldap/default.user.erb")
} ->
file{"$docroot/config/profiles/$name/default.group":
ensure=>file,
content => template("wmdeit_ldap/default.group.erb")
}
}
}
define wmdeit_ldap::lam::config
(
$encoded_password,
$encoded_password_salt,
$tree_suffix,
$suffix_user = "ou=People,$tree_suffix",
$suffix_group = "ou=Groups,$tree_suffix",
$docroot = $::wmdeit_ldap::lam::docroot,
$admins = [],
$login_method = "search",
$login_search_suffix = "",
$login_search_dn = "",
$login_search_filter = "",
$login_search_password = "",
){
if (!$suffix_user) or (!$suffix_group) {
fail("no suffix_user or suffix_group given")
}
file {"$docroot/config/$title.conf":
ensure => file,
content => template("wmdeit_ldap/wmde.conf.erb"),
owner => "www-data",
require => File["$docroot/config/pdf"],
} ->
file {"$docroot/config/profiles/$title":
ensure=>directory
}->
file{"$docroot/config/profiles/$title/default.user":
ensure=>file,
content => template("wmdeit_ldap/default.user.erb")
} ->
file{"$docroot/config/profiles/$title/default.group":
ensure=>file,
content => template("wmdeit_ldap/default.group.erb")
}
}

View File

@ -10,13 +10,7 @@ ServerURL: ldap://localhost:389
# list of users who are allowed to use LDAP Account Manager
# names have to be seperated by semicolons
# e.g. admins: cn=admin,dc=yourdomain,dc=org;cn=root,dc=yourdomain,dc=org
Admins: <%- s='' -%>
<%- @admins.each do | admin | -%>
<%= s %><%= admin -%>
<%- s=';' -%>
<%- end -%>
#=admin,dc=wikimedia,dc=de
Admins: cn=admin,dc=wikimedia,dc=de
# password to change these preferences via webfrontend (default: lam)
#Passwd: {SSHA}T7uRmkbOgzr9k0BVJi1GvqqwJJQ= iaZAeQ==
@ -24,7 +18,7 @@ Passwd: {SSHA}<%= @encoded_password %> <%= @encoded_password_salt %>
# suffix of tree view
# e.g. dc=yourdomain,dc=org
treesuffix: <%= @tree_suffix %>
treesuffix: dc=wikimedia,dc=de
# default language (a line from config/language)
defaultLanguage: en_GB.utf8
@ -56,11 +50,11 @@ modules: posixAccount_pwdHash: SSHA
activeTypes: user,group
types: suffix_user: <%= @suffix_user %>
types: suffix_user: ou=People,dc=wikimedia,dc=de
types: attr_user: #uid;#givenName;#sn;#uidNumber;#gidNumber
types: modules_user: inetOrgPerson,posixAccount,shadowAccount
types: suffix_group: <%= @suffix_group %>
types: suffix_group: ou=group,dc=wikimedia,dc=de
types: attr_group: #cn;#gidNumber;#memberUID;#description
types: modules_group: wmdeGroup
@ -104,23 +98,23 @@ accessLevel: 100
# Login method.
loginMethod: <%= @login_method %>
loginMethod: list
# Search suffix for LAM login.
loginSearchSuffix: <%= @login_search_suffix %>
loginSearchSuffix: dc=yourdomain,dc=org
# Search filter for LAM login.
loginSearchFilter: <%= @login_search_filter %>
loginSearchFilter: uid=%USER%
# Bind DN for login search.
loginSearchDN: <%= @login_search_dn %>
loginSearchDN:
# Bind password for login search.
loginSearchPassword: <%= @login_search_password %>
loginSearchPassword:
# HTTP authentication for LAM login.