feat(collabora): add collabora (#9794)

**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.
-->
⚒️ Fixes  # <!--(issue)-->

**⚙️ 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
-->

**📃 Notes:**
<!-- Please enter any other relevant information here -->

**✔️ 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
- [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.
- [x] 🖼️ 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._
This commit is contained in:
Stavros Kois 2023-06-21 10:22:07 +03:00 committed by GitHub
parent 9927cf0dd4
commit 8ddcfb9e18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 367 additions and 0 deletions

View File

@ -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

View File

@ -0,0 +1,28 @@
apiVersion: v2
appVersion: v23.05.0.5.1
dependencies:
- name: common
repository: https://library-charts.truecharts.org
version: 12.14.2
deprecated: false
description: An awesome, Online Office suite image suitable for home use.
home: https://truecharts.org/charts/stable/collabora
icon: https://truecharts.org/img/hotlink-ok/chart-icons/collabora.png
keywords:
- office
- document
kubeVersion: ">=1.16.0-0"
maintainers:
- email: info@truecharts.org
name: TrueCharts
url: https://truecharts.org
name: collabora
sources:
- https://github.com/truecharts/charts/tree/master/charts/stable/collabora
- https://github.com/CollaboraOnline/online
type: application
version: 1.0.0
annotations:
truecharts.org/catagories: |
- office
truecharts.org/SCALE-support: "true"

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1,192 @@
# Include{groups}
portals:
open:
# Include{portalLink}
admin:
# Include{portalLink}
path: /browser/dist/admin/admin.html
questions:
# Include{global}
# Include{workload}
# Include{workloadDeployment}
# Include{replicas1}
# Include{podSpec}
# Include{containerMain}
# Include{containerBasic}
# Include{containerAdvanced}
# Include{containerConfig}
# Include{podOptions}
- variable: collabora
label: Collabora Configuration
group: App Configuration
schema:
additional_attrs: true
type: dict
attrs:
- variable: username
label: Username
schema:
type: string
default: admin
required: true
- variable: password
label: Password
schema:
type: string
default: ""
required: true
private: true
- variable: dictionaries
label: Dictionaries
description: Dictionaries
schema:
type: list
default:
- de_DE
- en_GB
- en_US
- el_GR
- es_ES
- fr_FR
- pt_BR
- pt_PT
- it
- nl
- ru
items:
- variable: dictionary
label: Dictionary
description: Dictionary
schema:
type: string
default: ""
required: true
- variable: interface
label: Interface
description: Interface
schema:
type: string
default: default
required: true
enum:
- value: default
description: Default
- value: compact
description: Compact
- value: tabbed
description: Tabbed
- variable: server_name
label: Server Name
description: Server Name
schema:
type: string
default: ""
- variable: aliasgroup1
label: Alias Group 1
description: Alias Group 1
schema:
type: list
default: []
items:
- variable: alias1
label: Alias 1
description: Alias 1
schema:
type: string
default: ""
required: true
- variable: no_gen_ssl
label: Disable SSL Generation
description: Disable SSL Generation
schema:
type: boolean
default: true
- variable: ssl_enable
label: Enable SSL
description: Enable SSL
schema:
type: boolean
default: false
- variable: ssl_termination
label: Terminate SSL
description: Terminate SSL
schema:
type: boolean
default: true
- variable: extra_params
label: Extra Parameters
description: Extra Parameters
schema:
type: list
default:
- --o:welcome.enable=false
items:
- variable: param
label: Parameter
description: Parameter
schema:
type: string
default: ""
required: true
# Include{serviceRoot}
# Include{serviceMain}
# Include{serviceSelectorLoadBalancer}
# Include{serviceSelectorExtras}
- variable: main
label: Main Service Port Configuration
schema:
additional_attrs: true
type: dict
attrs:
- variable: port
label: Port
description: This port exposes the container port on the service
schema:
type: int
default: 9980
required: true
# Include{serviceExpertRoot}
# Include{serviceExpert}
# Include{serviceList}
# Include{persistenceList}
# Include{ingressRoot}
- variable: main
label: Main Ingress
schema:
additional_attrs: true
type: dict
attrs:
# Include{ingressDefault}
# Include{ingressTLS}
# Include{ingressTraefik}
# Include{ingressAdvanced}
# Include{ingressList}
# Include{securityContextRoot}
- 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
# Include{securityContextContainer}
# Include{securityContextAdvanced}
# Include{securityContextPod}
- variable: fsGroup
label: fsGroup
description: The group that should own ALL storage.
schema:
type: int
default: 568
# Include{resources}
# Include{advanced}
# Include{addons}
# Include{codeserver}
# Include{netshoot}
# Include{vpn}
# Include{documentation}

View File

@ -0,0 +1 @@
{{- include "tc.v1.common.lib.chart.notes" $ -}}

View File

@ -0,0 +1,46 @@
{{/* Define the configmap */}}
{{- define "collabora.configmap" -}}
{{- if lt (len .Values.collabora.password) 8 -}}
{{- fail "Collabora - [Password] must be at least 8 characters" -}}
{{- end -}}
{{- if contains "$" .Values.collabora.password -}}
{{- fail "Collabora - [Password] cannot contain [$]" -}}
{{- end -}}
{{- $collaboraUIModes := (list "default" "compact" "tabbed") -}}
{{- if not (mustHas .Values.collabora.interface $collaboraUIModes) -}}
{{- fail (printf "Colabora - Expected [Interface Mode] to be one of [%v], but got [%v]" (join "," $collaboraUIModes) .Values.collabora.interface) -}}
{{- end -}}
{{- if not .Values.collabora.dictionaries -}}
{{- fail "Collabora - Expected non-empty [Dictionaries]" -}}
{{- end -}}
{{- $fixedParams := (list "--o:mount_jail_tree=false"
"--o:security.seccomp=true"
"--o:home_mode.enable=true"
"--o:logging.level=warning"
"--o:logging.level_startup=warning"
(printf "--o:user_interface.mode=%v" .Values.collabora.interface)
(printf "--o:ssl.enable=%v" .Values.collabora.ssl_enable)
(printf "--o:ssl.termination=%v" .Values.collabora.ssl_termination) ) -}}
{{- $params := concat $fixedParams .Values.collabora.extra_params -}}
{{- $checkParams := list -}}
{{- range $item := $params -}}
{{- $checkParams = mustAppend $checkParams (regexReplaceAll "--o:(.*)=.*" $item "${1}") -}}
{{- end -}}
{{- if not (deepEqual $checkParams (uniq $checkParams)) -}}
{{- fail (printf "Collabora - [Dictionaries] must be unique, but got [%v]" ((join ", " $params) | replace "--o:" "")) -}}
{{- end }}
collabora-config:
enabled: true
data:
aliasgroup1: {{ join "," .Values.collabora.aliasgroup1 }}
server_name: {{ .Values.collabora.server_name }}
dictionaries: {{ join " " .Values.collabora.dictionaries }}
username: {{ .Values.collabora.username | quote }}
password: {{ .Values.collabora.password | quote }}
DONT_GEN_SSL_CERT: {{ .Values.collabora.no_gen_ssl | quote }}
extra_params: {{ join " " $params }}
{{- end -}}

View File

@ -0,0 +1,10 @@
{{/* Make sure all variables are set properly */}}
{{- include "tc.v1.common.loader.init" . -}}
{{- $configmaps := include "collabora.configmap" . | fromYaml -}}
{{- if $configmaps -}}
{{- $_ := mustMergeOverwrite .Values.configmap $configmaps -}}
{{- end -}}
{{/* Render the templates */}}
{{- include "tc.v1.common.loader.apply" . -}}

View File

@ -0,0 +1,60 @@
image:
repository: tccr.io/truecharts/collabora
pullPolicy: IfNotPresent
tag: v23.05.0.5.1@sha256:a753bfe9d5479e992e914f5818bc96f33ff95dd3760cb10938ae2296286c416e
collabora:
username: admin
password: changeme
interface: default
dictionaries:
- de_DE
- en_GB
- en_US
- el_GR
- es_ES
- fr_FR
- pt_BR
- pt_PT
- it
- nl
- ru
server_name: example.com
aliasgroup1: https://cloud.example.com
ssl_enable: false
ssl_termination: true
no_gen_ssl: true
extra_params:
- --o:welcome.enable=false
workload:
main:
podSpec:
containers:
main:
envFrom:
- configMapRef:
name: collabora-config
securityContext:
runAsUser: 100
runAsGroup: 102
readOnlyRootFilesystem: false
allowPrivilegeEscalation: true
capabilities:
add:
- CHOWN
- FOWNER
- SYS_CHROOT
- MKNOD
service:
main:
ports:
main:
protocol: http
targetPort: 9980
port: 9980
portal:
open:
enabled: true