mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Init function init :p
This commit is contained in:
parent
92eb24df73
commit
cdd033f271
3 changed files with 81 additions and 2 deletions
|
@ -437,8 +437,8 @@ tools:
|
||||||
category_help: Specific tools
|
category_help: Specific tools
|
||||||
actions:
|
actions:
|
||||||
|
|
||||||
### tools_install()
|
### tools_init()
|
||||||
install:
|
init:
|
||||||
action_help: Install YunoHost LDAP initialization
|
action_help: Install YunoHost LDAP initialization
|
||||||
connections:
|
connections:
|
||||||
- ldap
|
- ldap
|
||||||
|
|
66
ldap_scheme.yml
Normal file
66
ldap_scheme.yml
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
ou=sudo:
|
||||||
|
ou: sudo
|
||||||
|
objectClass:
|
||||||
|
- organizationalUnit
|
||||||
|
- top
|
||||||
|
|
||||||
|
cn=admin,ou=sudo:
|
||||||
|
cn: admin
|
||||||
|
sudoUser: admin
|
||||||
|
sudoHost: ALL
|
||||||
|
sudoCommand: ALL
|
||||||
|
sudoOption: "!authenticate"
|
||||||
|
objectClass:
|
||||||
|
- sudoRole
|
||||||
|
- top
|
||||||
|
|
||||||
|
cn=www-data,ou=sudo:
|
||||||
|
cn: www-data
|
||||||
|
sudoUser: www-data
|
||||||
|
sudoHost: ALL
|
||||||
|
sudoCommand: /usr/bin/yunohost
|
||||||
|
sudoOption: "!authenticate"
|
||||||
|
objectClass:
|
||||||
|
- sudoRole
|
||||||
|
- top
|
||||||
|
|
||||||
|
ou=users:
|
||||||
|
ou: users
|
||||||
|
objectClass:
|
||||||
|
- organizationalUnit
|
||||||
|
- top
|
||||||
|
|
||||||
|
ou=domains:
|
||||||
|
ou: domains
|
||||||
|
objectClass:
|
||||||
|
- organizationalUnit
|
||||||
|
- top
|
||||||
|
|
||||||
|
ou=apps:
|
||||||
|
ou: apps
|
||||||
|
objectClass:
|
||||||
|
- organizationalUnit
|
||||||
|
- top
|
||||||
|
|
||||||
|
ou=groups:
|
||||||
|
ou: groups
|
||||||
|
objectClass:
|
||||||
|
- organizationalUnit
|
||||||
|
- top
|
||||||
|
|
||||||
|
cn=admins,ou=groups:
|
||||||
|
cn: admins
|
||||||
|
gidNumber: "4001"
|
||||||
|
memberUid: admin
|
||||||
|
objectClass:
|
||||||
|
- posixGroup
|
||||||
|
- top
|
||||||
|
|
||||||
|
cn=sftpusers,ou=groups:
|
||||||
|
cn: sftpusers
|
||||||
|
gidNumber: "4002"
|
||||||
|
memberUid: admin
|
||||||
|
objectClass:
|
||||||
|
- posixGroup
|
||||||
|
- top
|
||||||
|
|
13
yunohost_tools.py
Normal file
13
yunohost_tools.py
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import yaml
|
||||||
|
|
||||||
|
def tools_init(args, connections):
|
||||||
|
|
||||||
|
yldap = connections['ldap']
|
||||||
|
|
||||||
|
with open('ldap_scheme.yml') as f:
|
||||||
|
ldap_map = yaml.load(f)
|
||||||
|
|
||||||
|
for rdn, attr_dict in ldap_map:
|
||||||
|
yldap.add(rdn, attr_dict)
|
Loading…
Add table
Reference in a new issue