diff --git a/charts/incubator/tsn-ranksystem/.helmignore b/charts/incubator/tsn-ranksystem/.helmignore new file mode 100644 index 00000000000..77ca5567b26 --- /dev/null +++ b/charts/incubator/tsn-ranksystem/.helmignore @@ -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 diff --git a/charts/incubator/tsn-ranksystem/Chart.yaml b/charts/incubator/tsn-ranksystem/Chart.yaml new file mode 100644 index 00000000000..a114028a49e --- /dev/null +++ b/charts/incubator/tsn-ranksystem/Chart.yaml @@ -0,0 +1,47 @@ +annotations: + max_scale_version: 24.04.0 + min_scale_version: 23.10.0 + truecharts.org/SCALE-support: "true" + truecharts.org/category: productivity + truecharts.org/max_helm_version: "3.14" + truecharts.org/min_helm_version: "3.11" + truecharts.org/train: incubator +apiVersion: v2 +appVersion: 20240301.0.0 +dependencies: + - name: common + version: 20.0.9 + repository: oci://tccr.io/truecharts + condition: "" + alias: "" + tags: [] + import-values: [] + - name: mariadb + version: 13.5.2 + repository: oci://tccr.io/truecharts + condition: mariadb.enabled + alias: "" + tags: [] + import-values: [] +deprecated: false +description: TS-N Ranksystem is a TeamSpeak 3 bot that allows you to assign ranks to users based on their activity on the server. +home: https://truecharts.org/charts/incubator/tsn-ranksystem +icon: https://truecharts.org/img/hotlink-ok/chart-icons/tsn-ranksystem.png +keywords: + - teamspeak + - tsn-ranksystem + - ranksystem +kubeVersion: ">=1.24.0-0" +maintainers: + - name: TrueCharts + email: info@truecharts.org + url: https://truecharts.org +name: tsn-ranksystem +sources: + - https://github.com/JohannesBauer97/tsn-ranksystem-webserver + - https://ts-ranksystem.com/ + - https://github.com/truecharts/charts/tree/master/charts/incubator/tsn-ranksystem + - https://github.com/Newcomer1989/TSN-Ranksystem + - https://hub.docker.com/r/serverlein/tsn-ranksystem-webserver +type: application +version: 0.0.1 diff --git a/charts/incubator/tsn-ranksystem/README.md b/charts/incubator/tsn-ranksystem/README.md new file mode 100644 index 00000000000..2b8cc49d247 --- /dev/null +++ b/charts/incubator/tsn-ranksystem/README.md @@ -0,0 +1,3 @@ +--- +title: README +--- diff --git a/charts/incubator/tsn-ranksystem/docs/credentials.md b/charts/incubator/tsn-ranksystem/docs/credentials.md new file mode 100644 index 00000000000..44f654dce02 --- /dev/null +++ b/charts/incubator/tsn-ranksystem/docs/credentials.md @@ -0,0 +1,6 @@ +--- +title: Default credentials +--- + +- Email: `ranksystem` +- Password: `ranksystem` diff --git a/charts/incubator/tsn-ranksystem/icon.png b/charts/incubator/tsn-ranksystem/icon.png new file mode 100644 index 00000000000..4018ee7e7a1 Binary files /dev/null and b/charts/incubator/tsn-ranksystem/icon.png differ diff --git a/charts/incubator/tsn-ranksystem/questions.yaml b/charts/incubator/tsn-ranksystem/questions.yaml new file mode 100644 index 00000000000..839b4b36821 --- /dev/null +++ b/charts/incubator/tsn-ranksystem/questions.yaml @@ -0,0 +1,84 @@ +# Include{groups} +portals: + open: +# Include{portalLink} +questions: +# Include{global} +# Include{workload} +# Include{workloadDeployment} +# Include{replicas1} +# Include{podSpec} +# Include{containerMain} +# Include{containerBasic} +# Include{containerAdvanced} +# Include{containerConfig} +# Include{podOptions} +# 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: 9300 + required: true +# Include{serviceExpertRoot} +# Include{serviceExpert} +# Include{serviceList} +# Include{persistenceRoot} + - variable: web + label: App Web Storage + description: Stores the Application Web Folder. + schema: + additional_attrs: true + type: dict + attrs: +# Include{persistenceBasic} +# Include{persistenceList} +# Include{ingressRoot} + - variable: main + label: "Main Ingress" + schema: + additional_attrs: true + type: dict + attrs: +# Include{ingressDefault} +# 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 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} diff --git a/charts/incubator/tsn-ranksystem/templates/NOTES.txt b/charts/incubator/tsn-ranksystem/templates/NOTES.txt new file mode 100644 index 00000000000..efcb74cb772 --- /dev/null +++ b/charts/incubator/tsn-ranksystem/templates/NOTES.txt @@ -0,0 +1 @@ +{{- include "tc.v1.common.lib.chart.notes" $ -}} diff --git a/charts/incubator/tsn-ranksystem/templates/common.yaml b/charts/incubator/tsn-ranksystem/templates/common.yaml new file mode 100644 index 00000000000..b51394e00a4 --- /dev/null +++ b/charts/incubator/tsn-ranksystem/templates/common.yaml @@ -0,0 +1 @@ +{{ include "tc.v1.common.loader.all" . }} diff --git a/charts/incubator/tsn-ranksystem/values.yaml b/charts/incubator/tsn-ranksystem/values.yaml new file mode 100644 index 00000000000..762de4a2344 --- /dev/null +++ b/charts/incubator/tsn-ranksystem/values.yaml @@ -0,0 +1,96 @@ +image: + repository: serverlein/tsn-ranksystem-webserver + pullPolicy: IfNotPresent + tag: latest@sha256:b97cee9b242bba0c792b0fa8c74d66917698725c93145327b1fa39a72ceb953c + +securityContext: + container: + readOnlyRootFilesystem: false + +workload: + main: + podSpec: + initContainers: + download-ranksystem: + enabled: true + type: init + imageSelector: "image" + command: + - /bin/sh + - -c + args: + - | + web_location={{ .Values.persistence.web.targetSelector.main.main.mountPath }} + indexFile=${web_location}/index.php + + if [ ! -f "${indexFile}" ]; then + # download with curl as git & wget not available + # automatically fetch newest version + LOCATION=$(curl -s https://api.github.com/repos/Newcomer1989/TSN-Ranksystem/releases/latest \ + | grep "tarball_url" \ + | awk '{ print $2 }' \ + | sed 's/,$//' \ + | sed 's/"//g' ) \ + ; curl -sL -o ${web_location}/ranksystem.tar.gz $LOCATION + # unzip file + tar -xzf ${web_location}/ranksystem.tar.gz + # get topfolder + top_folder=$(find ${web_location} -type d -name "Newcomer*" -exec basename \{} .po \;) + # move to topfolder + mv ${top_folder}/* ${web_location} + # delete obsolete folders & files + rm -rf ${web_location}/ranksystem.tar.gz ${top_folder} + + webinterface_location=${web_location}/webinterface + navFile=${webinterface_location}/_nav.php + + # remove annoying SSL message (doesnt work with traefik/ingress) + sed -i "$(($(wc -l < ${navFile})-4)),$(($(wc -l < ${navFile})))d" ${navFile} + + echo "Files downloaded and installed." + echo "Folder :$PWD" + echo "Files:" + ls + else + echo "Files Located. No action needed." + fi + containers: + main: + lifecycle: + postStart: + type: exec + command: + - /bin/sh + - -c + - | + web_location={{ .Values.persistence.web.targetSelector.main.main.mountPath }} + if [ -f "${web_location}/install.php" ]; then + curl -v -X POST -d "dbtype=mysql&dbhost={{ .Values.mariadb.creds.plainhost | trimAll "\"" }}&dbname={{ .Values.mariadb.mariadbDatabase }}&dbuser={{ .Values.mariadb.mariadbUsername }}&dbpass={{ .Values.mariadb.creds.mariadbPassword | trimAll "\"" }}&install=&installchecked=" http://localhost/install.php + sleep 1; + curl -v -X POST -d "user=ranksystem&pass=ranksystem&confweb=" http://localhost/install.php + echo "Install script executed." + else + echo "Install script doesnt exists, no further action is needed." + fi +service: + main: + ports: + main: + targetPort: 80 + port: 9300 +persistence: + web: + enabled: true + targetSelector: + main: + main: + mountPath: /var/www/html + download-ranksystem: + mountPath: /var/www/html +mariadb: + enabled: true + mariadbUsername: ranksystem + mariadbDatabase: ranksystem +portal: + open: + enabled: true