From 5a55c0913f4d48c6713826f833ca58b7a49f8e08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?William=20Lev=C3=A9n?= Date: Thu, 23 May 2019 20:45:29 +0200 Subject: [PATCH] Update config files --- Dockerfile | 4 +-- chalmers.it.config.toml | 64 ---------------------------------------- example.config.toml | 50 ++++++++++++++++++------------- prod.docker-compose.yaml | 6 ++-- 4 files changed, 35 insertions(+), 89 deletions(-) delete mode 100644 chalmers.it.config.toml diff --git a/Dockerfile b/Dockerfile index b6de58d..aef30af 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,14 +10,14 @@ RUN apk add --update git # Copy sources RUN mkdir -p /goldapps COPY . /goldapps -WORKDIR /goldapps/cmd +WORKDIR /goldapps/cmd/goldapps # Grab dependencies #RUN go get -d -v ./... # build binary RUN go install -v -RUN mkdir /app && mv $GOPATH/bin/cmd /app/goldapps +RUN mkdir /app && mv $GOPATH/bin/goldapps /app/goldapps ########################## # PRODUCTION STAGE # diff --git a/chalmers.it.config.toml b/chalmers.it.config.toml deleted file mode 100644 index d134f80..0000000 --- a/chalmers.it.config.toml +++ /dev/null @@ -1,64 +0,0 @@ -[gapps.consumer] - servicekeyfile = "gapps.json" - adminaccount = "admin@chalmers.it" - -[gapps.provider] - servicekeyfile = "gapps.json" - adminaccount = "admin@chalmers.it" - -[ldap] - url = "ldap.chalmers.it:636" - servername = "chalmers.it" - user = "cn=SERVICE_ACCOUNT_GOES_HERE,dc=chalmers,dc=it" - password = "PASSWORD_GOES_HERE" - custom = ["chairman", "chairmen.fkit", "chairmen.committees", "treasurers", "phadderchef", "fkit"] - -[ldap.groups] - basedn = "ou=fkit,ou=groups,dc=chalmers,dc=it" - filter = "(|(objectClass=itGroup)(objectClass=itPosition))" - attributes = ["cn", "displayName", "mail", "member", "type"] - -[ldap.users] - basedn = "ou=people,dc=chalmers,dc=it" - filter = "(&(objectClass=chalmersstudent))" - attributes = ["uid", "givenName", "sn", "nickname", "mail", "gdprEducated"] - -#### CUSTOM FILTERS #### -[ldap.fkit] - mail = "fkit@chalmers.it" - basedn = "ou=fkit,ou=groups,dc=chalmers,dc=it" - filter = "(&(objectClass=itGroup))" - parent_filter = "(&(ou=%childRDN%))" - attributes = ["cn", "displayName", "mail"] - -[ldap.chairman] - mail = "ordforande@chalmers.it" - basedn = "ou=styrit,ou=fkit,ou=groups,dc=chalmers,dc=it" - filter = "(&(objectClass=itPosition)(cn=ordf))" - attributes = ["cn", "displayName", "mail"] - -[ldap.chairmen.fkit] - mail = "ordforanden@chalmers.it" - basedn = "ou=fkit,ou=groups,dc=chalmers,dc=it" - filter = "(&(objectClass=itPosition)(cn=ordf))" - attributes = ["cn", "displayName", "mail"] - -[ldap.chairmen.committees] - mail = "ordforanden.kommiteer@chalmers.it" - basedn = "ou=fkit,ou=groups,dc=chalmers,dc=it" - filter = "(&(objectClass=itPosition)(cn=ordf))" - parent_filter = "(&(objectClass=itGroup)(type=Committee))" - attributes = ["cn", "displayName", "mail", "type"] - -[ldap.treasurers] - mail = "kassorer@chalmers.it" - basedn = "ou=fkit,ou=groups,dc=chalmers,dc=it" - filter = "(&(objectClass=itPosition)(cn=kassor))" - attributes = ["cn", "displayName", "mail"] - -[ldap.phadderchef] - mail = "phadderchef@chalmers.it" - basedn = "ou=nollkit,ou=fkit,ou=groups,dc=chalmers,dc=it" - filter = "(&(objectClass=itPosition)(cn=phadderchef))" - attributes = ["cn", "displayName", "mail"] -#### ============== #### diff --git a/example.config.toml b/example.config.toml index 9c0f9de..8212381 100644 --- a/example.config.toml +++ b/example.config.toml @@ -1,31 +1,41 @@ [gapps.consumer] - servicekeyfile = "gapps1.json" - adminaccount = "admin@example1.ex" + servicekeyfile = "gapps.json" + adminaccount = "admin@mydomain.ex" [gapps.provider] - servicekeyfile = "gapps2.json" - adminaccount = "admin@example2.ex" + servicekeyfile = "gapps.json" + adminaccount = "admin@mydomain.ex" [ldap] - url = "ldap.example.ex:999" - servername = "example.ex" - user = "cn=god,dc=example,dc=ex" - password = "secret" - custom = ["my_custom_filter"] + url = "ldap.mydomain.ex:636" + servername = "mydomain.ex" + user = "cn=admin,dc=mydomain,dc=ex" + password = "PASSWORD" + custom = ["fkit", "kit"] [ldap.groups] - basedn = "ou=some,ou=groups,dc=example,dc=ex" - filter = "(&(objectClass=Group))" - attributes = ["cn", "displayName", "mail", "member"] + basedn = "ou=groups,dc=mydomain,dc=ex" + filter = "(|(objectClass=itGroup)(objectClass=itPosition))" + attibutes = ["cn", "displayName", "mail", "member"] [ldap.users] - basedn = "ou=people,dc=example,dc=ex" - filter = "(&(objectClass=Group))" - attributes = ["uid", "mail"] + basedn = "ou=people,dc=mydomain,dc=ex" + filter = "(&(objectClass=chalmersstudent))" + attibutes = ["uid", "mail"] -[ldap.my_custom_filter] - mail = "custom@example.ex" - basedn = "ou=groups,dc=chalmers,dc=it" - filter = "(&(objectClass=Group))" +#### CUSTOM FILTERS #### +[ldap.fkit] + mail = "fkit@mydomain.ex" + basedn = "ou=fkit,ou=groups,dc=mydomain,dc=ex" + filter = "(&(objectClass=itGroup))" parent_filter = "(&(ou=%childRDN%))" - attributes = ["cn", "displayName", "mail"] + attibutes = ["cn", "displayName", "mail"] + + +[ldap.kit] + mail = "kit@mydomain.ex" + basedn = "ou=fkit,ou=groups,dc=mydomain,dc=ex" + filter = "(&(objectClass=itGroup)(type=Committee))" + parent_filter = "(&(ou=%childRDN%))" + attibutes = ["cn", "displayName", "mail"] +#### ============== #### diff --git a/prod.docker-compose.yaml b/prod.docker-compose.yaml index 3022090..7e02d04 100644 --- a/prod.docker-compose.yaml +++ b/prod.docker-compose.yaml @@ -15,8 +15,8 @@ services: "-dry" ] volumes: - - ./cmd/config.toml:/app/config.toml:ro - - ./cmd/gapps.json:/app/gapps.json:ro - - ./cmd/additions.json:/app/additions.json:ro + - ./config.toml:/app/config.toml:ro + - ./gapps.json:/app/gapps.json:ro + - ./additions.json:/app/additions.json:ro environment: - WAIT=1h \ No newline at end of file