summaryrefslogtreecommitdiffstats
path: root/src/mad-server.conf
blob: 88213e64026519a8002fe7c3fa0241196ae9a69b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
LoadModule "FileLogger"

LoadModule "AuthBackendFile"

LoadModule "SystemBackendPosix"
LoadModule "SystemBackendProc"

LoadModule "UserDBBackendMysql"
LoadModule "UserConfigBackendHome"
LoadModule "UserConfigBackendKrb5"

Logger Console
Logger File "mad-server.log"


Listen 127.0.0.1


X509TrustFile ../Cert/ca-cert.pem
#X509CrlFile ../Cert/crl.pem
X509CertFile ../Cert/cert.pem
X509KeyFile ../Cert/key.pem

AuthBackendFile {
  File "users"
}

UserManager {
  MinUid 1000
  MaxUid 29999
  
  MinGid 1000
  MaxGid 29999
  
  HomeDir "/tmp/home"
  Skeleton "/tmp/skel"
  UserDirMode 0700
  
  Mysql {
    Username test
    Password test
    Database test
    
    Queries {
      ListUsers "SELECT id, gid, username, fullname FROM users"
      ListGroups "SELECT id, name FROM groups"
      ListUserGroups "SELECT gid FROM usergroups WHERE uid = {UID}"
      ListGroupUsers "SELECT uid FROM usergroups WHERE gid = {GID}"
      
      UserById "SELECT id, gid, username, fullname FROM users WHERE id = {UID}"
      UserByName "SELECT id, gid, username, fullname FROM users WHERE username = {USER}"
      GroupById "SELECT id, name FROM groups WHERE id = {GID}"
      GroupByName "SELECT id, name FROM groups WHERE name = {GROUP}"
      UserGroupTable "SELECT uid, gid FROM usergroups"
      
      AddUser "INSERT INTO users (id, gid, username, fullname) VALUES ({UID}, {GID}, {USER}, {FULL_NAME})"
      UpdateUser "UPDATE users SET id = {UID}, gid = {GID}, username = {USER}, fullname = {FULL_NAME} WHERE id = {ORIG_UID}"
      DeleteUser "DELETE FROM users WHERE id = {UID}"
      
      AddGroup "INSERT INTO groups (id, name) VALUES ({GID}, {GROUP})"
      UpdateGroup "UPDATE groups SET id = {GID}, name = {GROUP} WHERE id = {ORIG_GID}"
      DeleteGroup "DELETE FROM groups WHERE id = {GID}"
      
      AddUserToGroup "INSERT INTO usergroups (uid, gid) VALUES ({UID}, {GID})"
      DeleteUserFromGroup "DELETE FROM usergroups WHERE uid = {UID} AND gid = {GID}"
    }
  }
  
  Krb5 {
    Principal "root/admin"
    Password "test"
  }
}

Daemon test {
  IpAddress 127.0.0.1
}