From 039b8ae1f8edca7391057465b3b671e23eff1f14 Mon Sep 17 00:00:00 2001 From: Xstar97TheNoob <9399967+xstar97@users.noreply.github.com> Date: Fri, 14 Jul 2023 04:45:22 -0400 Subject: [PATCH] feat(lldap) make services, auth, and smtp configurable in lldap (#10434) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** - Make the web and ldap service configurable. - Add the option to set the admin user and password. - set SMTP ⚒️ Fixes # **⚙️ Type of change** - [X] ⚙️ Feature/App addition - [ ] 🪛 Bugfix - [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [X] 🔃 Refactor of current code **🧪 How Has This Been Tested?** **📃 Notes:** **✔️ Checklist:** - [X] ⚖️ My code follows the style guidelines of this project - [X] 👀 I have performed a self-review of my own code - [ ] #️⃣ I have commented my code, particularly in hard-to-understand areas - [ ] 📄 I have made corresponding changes to the documentation - [ ] ⚠️ My changes generate no new warnings - [ ] 🧪 I have added tests to this description that prove my fix is effective or that my feature works - [X] ⬆️ I increased versions for any altered app according to semantic versioning **➕ App addition** If this PR is an app addition please make sure you have done the following. - [ ] 🪞 I have opened a PR on [truecharts/containers](https://github.com/truecharts/containers) adding the container to TrueCharts mirror repo. - [ ] 🖼️ I have added an icon in the Chart's root directory called `icon.png` --- _Please don't blindly check all the boxes. Read them and only check those that apply. Those checkboxes are there for the reviewer to see what is this all about and the status of this PR with a quick glance._ --- charts/stable/lldap/Chart.yaml | 2 +- .../stable/lldap/docs/installation-notes.md | 4 - charts/stable/lldap/questions.yaml | 91 ++++++++++++++++++- charts/stable/lldap/values.yaml | 20 +++- 4 files changed, 108 insertions(+), 9 deletions(-) diff --git a/charts/stable/lldap/Chart.yaml b/charts/stable/lldap/Chart.yaml index 7ba95b6652e..834e7198efb 100644 --- a/charts/stable/lldap/Chart.yaml +++ b/charts/stable/lldap/Chart.yaml @@ -23,7 +23,7 @@ sources: - https://github.com/truecharts/charts/tree/master/charts/stable/lldap - https://github.com/nitnelave/lldap type: application -version: 1.1.16 +version: 1.2.0 annotations: truecharts.org/catagories: | - ldap diff --git a/charts/stable/lldap/docs/installation-notes.md b/charts/stable/lldap/docs/installation-notes.md index e64531b5058..4997bb4318c 100644 --- a/charts/stable/lldap/docs/installation-notes.md +++ b/charts/stable/lldap/docs/installation-notes.md @@ -6,14 +6,10 @@ LLDAP is configured using the default options generated by the application on fi By default, LLDAP will use the following options: -- Admin username: admin -- Admin password: password - Base DN for LDAP: dc=example,dc=org - LDAP port: 3890 - JWT secret: random (generated on first run) -> ⚠️ **WARNING**: The default configuration is not secure and should not be used in production. Please change the admin password for LDAP before using LLDAP in production. ⚠️ - ## Usage LLDAP can be used as the user backend for Authelia and Authentik as well as any other application that supports LDAP e.g. Jellyfin and Nextcloud. A specific guide for Authelia is available in this documentation but other authentication applications can be configured in a similar way. diff --git a/charts/stable/lldap/questions.yaml b/charts/stable/lldap/questions.yaml index 64dcdb6feb3..f8c0998664a 100644 --- a/charts/stable/lldap/questions.yaml +++ b/charts/stable/lldap/questions.yaml @@ -17,11 +17,98 @@ questions: type: dict attrs: - variable: LLDAP_LDAP_BASE_DN - label: "Base DN for LDAP" + label: "LDAP Base DN" schema: type: string required: true default: "dc=example,dc=com" + - variable: LLDAP_LDAP_USER_DN + label: "Ldap User DN" + schema: + type: string + required: true + default: "" + - variable: LLDAP_LDAP_USER_EMAIL + label: "Ldap User Email" + schema: + type: string + required: true + default: "" + - variable: LLDAP_LDAP_USER_PASS + label: "Ldap User Password" + schema: + type: string + required: true + private: true + default: "" + min: 8 + - variable: LLDAP_HTTP_URL + label: "Public URL" + schema: + type: string + required: true + default: "" + - variable: LLDAP_VERBOSE + label: "Enable Verbose" + description: "Tune the logging to be more verbose" + schema: + type: boolean + default: false + - variable: smtp + label: Show SMTP Settings + schema: + type: boolean + default: false + show_subquestions_if: true + subquestions: + - variable: LLDAP_SMTP_OPTIONS__ENABLE_PASSWORD_RESET + label: Enable Password Reset + schema: + type: boolean + default: false + - variable: LLDAP_SMTP_OPTIONS__SERVER + label: SMTP Server Url + schema: + type: string + default: "" + - variable: LLDAP_SMTP_OPTIONS__PORT + label: SMTP Server Port + schema: + type: int + default: 587 + - variable: LLDAP_SMTP_OPTIONS__SMTP_ENCRYPTION + label: SMTP Encryption + schema: + type: string + default: "STARTTLS" + enum: + - value: NONE + description: None + - value: STARTTLS + description: StartTLS + - value: TLS + description: TLS + - variable: LLDAP_SMTP_OPTIONS__USER + label: SMTP User + schema: + type: string + default: "" + - variable: LLDAP_SMTP_OPTIONS__PASSWORD + label: SMTP Password + schema: + type: string + default: "" + - variable: LLDAP_SMTP_OPTIONS__FROM + label: SMTP From + schema: + type: string + default: "LLDAP Admin " + - variable: LLDAP_SMTP_OPTIONS__REPLY_TO + label: SMTP Reply TO + schema: + type: string + default: "Do not reply " + # Include{containerBasic} # Include{containerAdvanced} # Include{containerConfig} @@ -105,7 +192,7 @@ questions: default: 568 - variable: runAsGroup label: "runAsGroup" - description: "The groupID this App of the user running the application" + description: "The groupID of the user running the application" schema: type: int default: 568 diff --git a/charts/stable/lldap/values.yaml b/charts/stable/lldap/values.yaml index 577eb942b97..17abee90c48 100644 --- a/charts/stable/lldap/values.yaml +++ b/charts/stable/lldap/values.yaml @@ -11,14 +11,12 @@ service: main: ports: main: - targetPort: 17170 port: 17170 ldap: enabled: true ports: ldap: enabled: true - targetPort: 3890 port: 3890 workload: @@ -31,7 +29,25 @@ workload: args: - "run" env: + LLDAP_HTTP_PORT: "{{ .Values.service.main.ports.main.port }}" + LLDAP_LDAP_PORT: "{{ .Values.service.ldap.ports.ldap.port }}" + LLDAP_HTTP_URL: "http://localhost:{{ .Values.service.main.ports.main.port }}" LLDAP_LDAP_BASE_DN: "dc=example,dc=com" + # ADMIN + LLDAP_LDAP_USER_DN: "admin" + LLDAP_LDAP_USER_EMAIL: "admin@example.com" + LLDAP_LDAP_USER_PASS: "password" + # LOGGING + LLDAP_VERBOSE: false + # SMTP + LLDAP_SMTP_OPTIONS__ENABLE_PASSWORD_RESET: false + LLDAP_SMTP_OPTIONS__SERVER: "" + LLDAP_SMTP_OPTIONS__PORT: 587 + LLDAP_SMTP_OPTIONS__SMTP_ENCRYPTION: "STARTTLS" + LLDAP_SMTP_OPTIONS__USER: "" + LLDAP_SMTP_OPTIONS__PASSWORD: "" + LLDAP_SMTP_OPTIONS__FROM: "LLDAP Admin " + LLDAP_SMTP_OPTIONS__REPLY_TO: "Do not reply " LLDAP_JWT_SECRET: - secretRef: name: secrets