Skip to content

Commit

Permalink
feat(lldap) add lldap (truecharts#7802)
Browse files Browse the repository at this point in the history
**Description**
<!--
Please include a summary of the change and which issue is fixed. Please
also include relevant motivation and context. List any dependencies that
are required for this change.
-->
Adding LLDAP a lightweight alternative to OpenLDAP for those who don't
need the extensive features of OpenLDAP with a user friendly interface.
This is a redo after conversations with the maintainer of LLDAP and some
modifications have been made including a change of image to assist in
fixing a chown bug.

⚒️ Fixes  truecharts#3753 

**⚙️ Type of change**

- [X] ⚙️ Feature/App addition
- [ ] 🪛 Bugfix
- [ ] ⚠️ Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] 🔃 Refactor of current code

**🧪 How Has This Been Tested?**
<!--
Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration
-->
Used previous PR but using the CI to test maintainer suggested
modifications.

**📃 Notes:**
<!-- Please enter any other relevant information here -->
CNPG database added from new common as postgres is now supported by the
app and tested with the CI.

**✔️ Checklist:**

- [X] ⚖️ My code follows the style guidelines of this project
- [X] 👀 I have performed a self-review of my own code
- [X] #️⃣ 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
- [ ] ⬆️ 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.

- [x] 🪞 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._

---------

Signed-off-by: MaverickD650 <92877124+MaverickD650@users.noreply.github.com>
Co-authored-by: Kjeld Schouten-Lebbing <kjeld@schouten-lebbing.nl>
  • Loading branch information
MaverickD650 and Kjeld Schouten-Lebbing authored Mar 20, 2023
1 parent ffee9eb commit e486953
Show file tree
Hide file tree
Showing 9 changed files with 263 additions and 0 deletions.
30 changes: 30 additions & 0 deletions charts/incubator/lldap/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
# OWNERS file for Kubernetes
OWNERS
# helm-docs templates
*.gotmpl
# docs folder
/docs
# icon
icon.png
33 changes: 33 additions & 0 deletions charts/incubator/lldap/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
apiVersion: v2
appVersion: "0.4.1"
dependencies:
- name: common
repository: https://library-charts.truecharts.org
version: 12.2.28
deprecated: false
description: Lightweight ldap server for authentication and user management
home: https://truecharts.org/charts/incubator/lldap
icon: https://truecharts.org/img/hotlink-ok/chart-icons/lldap.png
keywords:
- lldap
- ldap
- authentication
- auth
kubeVersion: ">=1.16.0-0"
maintainers:
- email: info@truecharts.org
name: TrueCharts
url: https://truecharts.org
name: lldap
sources:
- https://github.com/truecharts/charts/tree/master/charts/lldap
- https://hub.docker.com/r/nitnelave/lldap
- https://github.com/nitnelave/lldap
type: application
version: 0.0.1
annotations:
truecharts.org/catagories: |
- ldap
- auth
truecharts.org/SCALE-support: "true"
truecharts.org/grade: U
1 change: 1 addition & 0 deletions charts/incubator/lldap/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{- include "tc.v1.common.lib.chart.notes" $ -}}
Empty file.
Empty file.
117 changes: 117 additions & 0 deletions charts/incubator/lldap/questions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# Include{groups}
portals:
open:
# Include{portalLink}
questions:
# Include{global}
# Include{controllerExpert}
# Include{fixedEnv}
# Include{containerConfig}
- variable: env
group: "App Configuration"
label: "Image Environment"
schema:
additional_attrs: true
type: dict
attrs:
- variable: LLDAP_LDAP_USER_PASS
group: "App Configuration"
label: "Admin Password"
schema:
type: string
required: true
default: "change me"
- variable: LLDAP_LDAP_BASE_DN
group: "App Configuration"
label: "Base DN for LDAP"
schema:
type: string
required: true
default: "dc=example,dc=com"
# Include{serviceRoot}
- variable: main
label: "Main Service"
description: "The Primary service on which the healthcheck runs, often the webUI"
schema:
type: dict
attrs:
# Include{serviceSelector}
- variable: main
label: "Main Service Port Configuration"
schema:
type: dict
attrs:
- variable: port
label: "Port"
description: "This port exposes the container port on the service"
schema:
type: int
default: 17170
required: true
- variable: ldap
label: "LDAP Service Port Configuration"
description: "The Service in which external sources will connect to the LDAP service"
schema:
type: dict
attrs:
- variable: port
label: "Port"
description: "This port exposes the container port on the service"
schema:
type: int
default: 3890
required: true
# Include{serviceExpertRoot}
default: false
# Include{serviceExpert}
# Include{serviceList}
# Include{persistenceRoot}
- variable: data
label: "App Config Storage"
description: "Stores the Application Configuration."
schema:
type: dict
attrs:
# Include{persistenceBasic}
# Include{persistenceList}
# Include{ingressRoot}
- variable: main
label: "Main Ingress"
schema:
type: dict
attrs:
# Include{ingressDefault}
# Include{ingressTLS}
# Include{ingressTraefik}
# Include{ingressExpert}
# Include{ingressList}
# Include{securityContextAdvanced}
# Include{podSecurityContextRoot}
- variable: runAsUser
label: "runAsUser"
description: "The UserID of the user running the application"
schema:
type: int
default: 568
- variable: runAsGroup
label: "runAsGroup"
description: "The groupID this App of the user running the application"
schema:
type: int
default: 568
- variable: fsGroup
label: "fsGroup"
description: "The group that should own ALL storage."
schema:
type: int
default: 568
# Include{podSecurityContextAdvanced}
# Include{resources}
# Include{advanced}
# Include{postgresql}
# Include{postgresqlBasics}
# Include{addons}
# Include{codeserver}
# Include{promtail}
# Include{netshoot}
# Include{vpn}
16 changes: 16 additions & 0 deletions charts/incubator/lldap/templates/_secrets.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{/* Define the secrets */}}
{{- define "lldap.secrets" -}}
{{- $basename := include "tc.v1.common.lib.chart.names.fullname" $ -}}
{{- $fetchname := printf "%s-secret" $basename -}}

{{/* Initialize all keys */}}
{{- $secrets := randAlphaNum 50 }}

enabled: true
data:
{{ with (lookup "v1" "Secret" .Release.Namespace $fetchname) }}
{{/* Get previous values and decode */}}
{{ $secrets = (index .data "LLDAP_JWT_SECRET") | b64dec }}
{{ end }}
LLDAP_JWT_SECRET: {{ $secrets }}
{{- end -}}
11 changes: 11 additions & 0 deletions charts/incubator/lldap/templates/common.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{/* Make sure all variables are set properly */}}
{{- include "tc.v1.common.loader.init" . }}

{{/* Render secrets for LLDAP */}}
{{- $secrets := include "lldap.secrets" . | fromYaml -}}
{{- if $secrets -}}
{{- $_ := set .Values.secret "secret" $secrets -}}
{{- end -}}

{{/* Render the templates */}}
{{ include "tc.v1.common.loader.apply" . }}
55 changes: 55 additions & 0 deletions charts/incubator/lldap/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
image:
repository: nitnelave/lldap
pullPolicy: IfNotPresent
tag: latest-debian

securityContext:
container:
readOnlyRootFilesystem: false

service:
main:
ports:
main:
targetPort: 17170
port: 17170
ldap:
ports:
main:
targetPort: 3890
port: 3890

workload:
main:
podSpec:
containers:
main:
command: ["/app/lldap"]
args: ["run"]
env:
LLDAP_LDAP_BASE_DN: "dc=example,dc=com"
LLDAP_LDAP_USER_PASS: "change me"
LLDAP_JWT_SECRET:
- secretRef:
name: secrets
key: LLDAP_JWT_SECRET
LLDAP_key_file: "/data/private_key"
LLDAP_database_url:
secretKeyRef:
name: cnpg-main-urls
key: std

persistence:
data:
enabled: true
mountPath: "/data"

cnpg:
main:
enabled: true
user: lldap
database: lldap

portal:
open:
enabled: true

0 comments on commit e486953

Please sign in to comment.