Compare commits
No commits in common. "b7e31b92327f75379fb049e4e2c6f72122eaf3c7" and "3fecf86fd3eddfdeaf8d66731140a963471fb95a" have entirely different histories.
b7e31b9232
...
3fecf86fd3
5 changed files with 14 additions and 31 deletions
|
@ -12,5 +12,3 @@ REDIS_HOST=
|
||||||
REDIS_PORT=
|
REDIS_PORT=
|
||||||
SECRET_KEY=
|
SECRET_KEY=
|
||||||
|
|
||||||
# LDAP section
|
|
||||||
LDAP_ADMIN_PASSWORD=
|
|
|
@ -6,7 +6,7 @@ edition = { workspace = true }
|
||||||
[dependencies]
|
[dependencies]
|
||||||
actix-web = "4"
|
actix-web = "4"
|
||||||
serde = { version = "1", features = ["derive"] }
|
serde = { version = "1", features = ["derive"] }
|
||||||
ldap3 = "0.11"
|
ldap3 = "0.10"
|
||||||
tokio = { version = "1", features = ["full"] }
|
tokio = { version = "1", features = ["full"] }
|
||||||
env_logger = "0.11"
|
env_logger = "0.10"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
|
|
|
@ -13,7 +13,11 @@ impl MigrationTrait for Migration {
|
||||||
Table::create()
|
Table::create()
|
||||||
.table(Project::Table)
|
.table(Project::Table)
|
||||||
.if_not_exists()
|
.if_not_exists()
|
||||||
.col(pk_uuid(Project::Id).extra("DEFAULT gen_random_uuid()"))
|
.col(
|
||||||
|
uuid(Project::Id)
|
||||||
|
.extra("DEFAULT gen_random_uuid()")
|
||||||
|
.primary_key(),
|
||||||
|
)
|
||||||
.col(string(Project::Name))
|
.col(string(Project::Name))
|
||||||
.to_owned(),
|
.to_owned(),
|
||||||
)
|
)
|
||||||
|
@ -45,8 +49,12 @@ impl MigrationTrait for Migration {
|
||||||
Table::create()
|
Table::create()
|
||||||
.table(User::Table)
|
.table(User::Table)
|
||||||
.if_not_exists()
|
.if_not_exists()
|
||||||
.col(pk_uuid(User::Id).extra("DEFAULT gen_random_uuid()"))
|
.col(
|
||||||
.col(string_uniq(User::Name))
|
uuid(User::Id)
|
||||||
|
.extra("DEFAULT gen_random_uuid()")
|
||||||
|
.primary_key(),
|
||||||
|
)
|
||||||
|
.col(string(User::Name))
|
||||||
.col(string(User::Role))
|
.col(string(User::Role))
|
||||||
.to_owned(),
|
.to_owned(),
|
||||||
)
|
)
|
||||||
|
@ -93,16 +101,6 @@ impl MigrationTrait for Migration {
|
||||||
)
|
)
|
||||||
.to_owned(),
|
.to_owned(),
|
||||||
)
|
)
|
||||||
.await?;
|
|
||||||
manager
|
|
||||||
.create_table(
|
|
||||||
Table::create()
|
|
||||||
.table(LocalAuth::Table)
|
|
||||||
.if_not_exists()
|
|
||||||
.col(pk_uuid(LocalAuth::Id))
|
|
||||||
.col(string(LocalAuth::Hash))
|
|
||||||
.to_owned(),
|
|
||||||
)
|
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,10 +117,6 @@ impl MigrationTrait for Migration {
|
||||||
|
|
||||||
manager
|
manager
|
||||||
.drop_table(Table::drop().table(User::Table).to_owned())
|
.drop_table(Table::drop().table(User::Table).to_owned())
|
||||||
.await?;
|
|
||||||
|
|
||||||
manager
|
|
||||||
.drop_table(Table::drop().table(UserGroupProject::Table).to_owned())
|
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -157,10 +151,3 @@ enum UserGroupProject {
|
||||||
GroupId,
|
GroupId,
|
||||||
ProjectId,
|
ProjectId,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(DeriveIden)]
|
|
||||||
enum LocalAuth {
|
|
||||||
Table,
|
|
||||||
Id,
|
|
||||||
Hash,
|
|
||||||
}
|
|
||||||
|
|
|
@ -36,8 +36,7 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- openldap_data:/var/lib/ldap
|
- openldap_data:/var/lib/ldap
|
||||||
- openldap_config:/etc/ldap/slapd.d
|
- openldap_config:/etc/ldap/slapd.d
|
||||||
# Custom LDAP configuration
|
- users.ldif:/container/service/slapd/assets/config/bootstrap/ldif/custom/users.ldif
|
||||||
- ./crates/ldap/src/users.ldif:/container/service/slapd/assets/config/bootstrap/ldif/custom/users.ldif
|
|
||||||
|
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "ldapsearch", "-x", "-H", "ldap://localhost", "-b", "dc=Schule,dc=intern"]
|
test: ["CMD", "ldapsearch", "-x", "-H", "ldap://localhost", "-b", "dc=Schule,dc=intern"]
|
||||||
|
|
Loading…
Add table
Reference in a new issue