From 54ef71fe28351919c744b980bbeefa62a36cf40a Mon Sep 17 00:00:00 2001 From: Xstar97 Date: Sun, 1 Jan 2023 12:13:57 -0500 Subject: [PATCH] feat(nitter) add nitter (#5910) * feat(nitter) add nitter * fix hmacKey * update hmacKey * remove excess code * fix qui descriptions + hmacKey variable * Update charts/incubator/nitter/values.yaml Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Signed-off-by: Xstar97 * Update charts/incubator/nitter/values.yaml Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> * Update charts/incubator/nitter/templates/_configmap.tpl Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> * Update charts/incubator/nitter/templates/_configmap.tpl Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Signed-off-by: Xstar97 * Update charts/incubator/nitter/templates/_configmap.tpl Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Signed-off-by: Xstar97 * Update charts/incubator/nitter/values.yaml Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> * Update charts/incubator/nitter/values.yaml Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Signed-off-by: Xstar97 * Update charts/incubator/nitter/values.yaml Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Signed-off-by: Xstar97 * Update charts/incubator/nitter/templates/_configmap.tpl Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Signed-off-by: Xstar97 * Update charts/incubator/nitter/templates/_configmap.tpl Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Signed-off-by: Xstar97 * Apply suggestions from code review Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> * Apply suggestions from code review Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> * Update charts/incubator/nitter/templates/_configmap.tpl Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> * Update charts/incubator/nitter/values.yaml Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> * Update charts/incubator/nitter/values.yaml Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Signed-off-by: Xstar97 * Update charts/incubator/nitter/values.yaml Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> * adjust secret * tpl * ui * no need for persistence * add http probe * fix quests * hm * secret * ofc... * hostname Signed-off-by: Xstar97 Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Co-authored-by: Stavros kois --- charts/incubator/nitter/.helmignore | 30 ++ charts/incubator/nitter/CHANGELOG.md | 1 + charts/incubator/nitter/Chart.yaml | 33 +++ charts/incubator/nitter/README.md | 1 + charts/incubator/nitter/icon.png | Bin 0 -> 1865 bytes charts/incubator/nitter/questions.yaml | 257 ++++++++++++++++++ charts/incubator/nitter/templates/_secret.tpl | 70 +++++ charts/incubator/nitter/templates/common.yaml | 7 + charts/incubator/nitter/values.yaml | 62 +++++ cspell.config.yaml | 1 + 10 files changed, 462 insertions(+) create mode 100644 charts/incubator/nitter/.helmignore create mode 100644 charts/incubator/nitter/CHANGELOG.md create mode 100644 charts/incubator/nitter/Chart.yaml create mode 100644 charts/incubator/nitter/README.md create mode 100644 charts/incubator/nitter/icon.png create mode 100644 charts/incubator/nitter/questions.yaml create mode 100644 charts/incubator/nitter/templates/_secret.tpl create mode 100644 charts/incubator/nitter/templates/common.yaml create mode 100644 charts/incubator/nitter/values.yaml diff --git a/charts/incubator/nitter/.helmignore b/charts/incubator/nitter/.helmignore new file mode 100644 index 00000000000..77ca5567b26 --- /dev/null +++ b/charts/incubator/nitter/.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/nitter/CHANGELOG.md b/charts/incubator/nitter/CHANGELOG.md new file mode 100644 index 00000000000..825c32f0d03 --- /dev/null +++ b/charts/incubator/nitter/CHANGELOG.md @@ -0,0 +1 @@ +# Changelog diff --git a/charts/incubator/nitter/Chart.yaml b/charts/incubator/nitter/Chart.yaml new file mode 100644 index 00000000000..7a3cf925118 --- /dev/null +++ b/charts/incubator/nitter/Chart.yaml @@ -0,0 +1,33 @@ +apiVersion: v2 +appVersion: "latest" +dependencies: + - name: common + repository: https://library-charts.truecharts.org + version: 11.1.2 + - condition: redis.enabled + name: redis + repository: https://charts.truecharts.org + version: 5.0.22 +deprecated: false +description: A free and open source alternative Twitter front-end focused on privacy and performance. +home: https://truecharts.org/charts/incubator/nitter +icon: https://truecharts.org/img/hotlink-ok/chart-icons/nitter.png +keywords: + - nitter + - libre +kubeVersion: ">=1.16.0-0" +maintainers: + - email: info@truecharts.org + name: TrueCharts + url: https://truecharts.org +name: nitter +sources: + - https://github.com/truecharts/charts/tree/master/charts/incubator/nitter + - https://github.com/zedeus/nitter +type: application +version: 1.0.0 +annotations: + truecharts.org/catagories: | + - media + truecharts.org/SCALE-support: "true" + truecharts.org/grade: U diff --git a/charts/incubator/nitter/README.md b/charts/incubator/nitter/README.md new file mode 100644 index 00000000000..7e59600739c --- /dev/null +++ b/charts/incubator/nitter/README.md @@ -0,0 +1 @@ +# README diff --git a/charts/incubator/nitter/icon.png b/charts/incubator/nitter/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..24caa2714eb1b215d3c9188f2696406430cffb2d GIT binary patch literal 1865 zcmb_ddsGu=77x-&YZl_^3CwA6gS)oM%ClXIRwhAt1_%sV6c9qNb<5^Ni+jvM7$Iq~ ziklQuYulu-1i~Zf`XGnW6pe;>%E_kf9ycU&7AmdDai}u0G^4CbgE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iDo{@W7afi*7M5g@+3B5WKEwj z8p#JZMa!u+w7WiChcrR9w>(0CjJBS8INDkhTnjAt$dlHp;5uMszX@0oj6)^9Qqay} z|0*SFfu;AS(S?+Rcwjc^JIVQ?{{b?1!APo|b@`?Q+v$4Y%4W1%ULD*FFxW?L3ta@~ z0qQCt4(tKvFs^Z>NJND!42km;X0UBt97BZO^l6gIsS*|Ch*o%Lci4e1yVNQXAHgD( z!Q6nDN+dfaUOo$p91WBNYN!-Yqaw+6PF@)-M}r^9ceY@*mJ^Lri&k3pBDYNOJ8r!I z!9;vDgaKD(sEZB;V$ai;k4(r7}urcYbLBJ>E*Q Z4`ZM_q9GwGGZpMQMsY!T{zz^^$4{-3>C6BC literal 0 HcmV?d00001 diff --git a/charts/incubator/nitter/questions.yaml b/charts/incubator/nitter/questions.yaml new file mode 100644 index 00000000000..cfbacf1a684 --- /dev/null +++ b/charts/incubator/nitter/questions.yaml @@ -0,0 +1,257 @@ +# Include{groups} +portals: + open: +# Include{portalLink} +questions: +# Include{global} +# Include{controller} +# Include{replicas} +# Include{replica1} +# Include{controllerExpertExtraArgs} + - variable: nitter + group: App Configuration + label: Nitter Configuration + schema: + additional_attrs: true + type: dict + attrs: + - variable: general + label: General + schema: + additional_attrs: true + type: dict + attrs: + - variable: title + label: Website Title + schema: + type: string + required: true + default: Nitter + - variable: hostname + label: Hostname + schema: + type: string + required: true + default: localhost:10606 + - variable: httpMaxConnections + label: HTTP Max Connections + schema: + type: int + required: true + default: 100 + - variable: cache + label: Cache + schema: + additional_attrs: true + type: dict + attrs: + - variable: listMinutes + label: List Minutes + description: How long to cache list info (not the tweets, so keep it high). + schema: + type: int + required: true + default: 240 + - variable: rssMinutes + label: RSS Minutes + description: How long to cache rss queries. + schema: + type: int + required: true + default: 10 + - variable: config + label: Configuration + schema: + additional_attrs: true + type: dict + attrs: + - variable: base64Media + label: Base64 Encoding + description: Enable base64 encoding for proxied media urls. + schema: + type: boolean + default: false + - variable: enableRSS + label: Enable RSS + description: Uncheck to disable RSS feeds. + schema: + type: boolean + default: true + - variable: enableDebug + label: Enable Debug + description: Enable request logs and debug endpoints. + schema: + type: boolean + default: false + - variable: proxy + label: Proxy + description: http/https url, SOCKS proxies are not supported. + schema: + type: string + default: "" + - variable: proxyAuth + label: Proxy Auth + schema: + type: string + default: "" + - variable: tokenCount + label: Token Count + description: Minimum amount of usable tokens that are used to authorize API requests. + schema: + type: int + required: true + default: 10 + - variable: preferences + label: Preferences + schema: + additional_attrs: true + type: dict + attrs: + - variable: theme + label: Theme + schema: + type: string + required: true + default: nitter + enum: + - value: auto + description: Auto + - value: auto_(twitter) + description: Auto (Twitter) + - value: black + description: Black + - value: dracula + description: Dracula + - value: mastodon + description: Mastodon + - value: nitter + description: Nitter + - value: pleroma + description: Pleroma + - value: twitter + description: Twitter + - value: twitter_dark + description: Twitter Dark + - variable: replaceTwitter + label: Replace Twitter + schema: + type: string + default: nitter.net + - variable: replaceYouTube + label: Replace YouTube + schema: + type: string + default: piped.video + - variable: replaceReddit + label: Replace Reddit + schema: + type: string + default: teddit.net + - variable: replaceInstagram + label: Replace Instagram + schema: + type: string + default: "" + - variable: proxyVideos + label: Proxy Videos + schema: + type: boolean + default: true + - variable: hlsPlayback + label: HLS PlayBack + schema: + type: boolean + default: false + - variable: infiniteScroll + label: infinite Scroll + schema: + type: boolean + default: false +# Include{containerConfig} +# Include{serviceRoot} + - variable: main + label: Main Service + description: The Primary service on which the healthcheck runs, often the webUI + schema: + additional_attrs: true + type: dict + attrs: +# 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: 10606 + required: true +# Include{serviceExpertRoot} + default: false +# 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{ingressList} +# Include{security} +# Include{securityContextAdvancedRoot} + - variable: privileged + label: Privileged mode + schema: + type: boolean + default: false + - variable: readOnlyRootFilesystem + label: ReadOnly Root Filesystem + schema: + type: boolean + default: false + - variable: allowPrivilegeEscalation + label: Allow Privilege Escalation + schema: + type: boolean + default: false + - variable: runAsNonRoot + label: runAsNonRoot + schema: + type: boolean + default: true +# 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{addons} +# Include{codeserver} +# Include{vpn} +# Include{documentation} diff --git a/charts/incubator/nitter/templates/_secret.tpl b/charts/incubator/nitter/templates/_secret.tpl new file mode 100644 index 00000000000..446290e83bb --- /dev/null +++ b/charts/incubator/nitter/templates/_secret.tpl @@ -0,0 +1,70 @@ +{{/* Define the configmap */}} +{{- define "nitter.secret" -}} + +{{- $secretName := printf "%s-nitter-secret" (include "tc.common.names.fullname" .) }} +{{- $storageSecretName := printf "%s-nitter-storage-secret" (include "tc.common.names.fullname" .) }} + +{{- $hmacKey := "" -}} +{{- with (lookup "v1" "Secret" .Release.Namespace $storageSecretName) -}} + {{- $hmacKey = (index .data "hmacKey") | b64dec -}} +{{- else -}} + {{- $hmacKey = randAlphaNum 32 -}} +{{- end }} + +--- +apiVersion: v1 +kind: Secret +type: Opaque +metadata: + name: {{ $storageSecretName }} + labels: + {{- include "tc.common.labels" . | nindent 4 }} +data: {{/* Store to reuse */}} + hmacKey: {{ $hmacKey | b64enc }} +--- +apiVersion: v1 +kind: Secret +type: Opaque +metadata: + name: {{ $secretName }} + labels: + {{- include "tc.common.labels" . | nindent 4 }} +stringData: + nitter.conf: | + [Server] + https = false + address = "0.0.0.0" + staticDir = "./public" + port = {{ .Values.service.main.ports.main.port }} + httpMaxConnections = {{ .Values.nitter.general.httpMaxConnections }} + title = {{ .Values.nitter.general.title | quote }} + hostname = {{ .Values.nitter.general.hostname | quote }} + + [Cache] + redisPort = 6379 + redisConnections = 20 + redisMaxConnections = 30 + redisHost = {{ .Values.redis.url.plain | trimAll "\"" | quote }} + redisPassword = {{ .Values.redis.redisPassword | trimAll "\"" | quote }} + listMinutes = {{ .Values.nitter.cache.listMinutes }} + rssMinutes = {{ .Values.nitter.cache.rssMinutes }} + + [Config] + hmacKey: {{ $hmacKey | quote }} + base64Media = {{ .Values.nitter.config.base64Media }} + enableRSS = {{ .Values.nitter.config.enableRSS }} + enableDebug = {{ .Values.nitter.config.enableDebug }} + proxy = {{ .Values.nitter.config.proxy | quote }} + proxyAuth = {{ .Values.nitter.config.proxyAuth | quote }} + tokenCount = {{ .Values.nitter.config.tokenCount }} + + [Preferences] + theme = {{ .Values.nitter.preferences.theme | quote }} + replaceTwitter = {{ .Values.nitter.preferences.replaceTwitter | quote }} + replaceYouTube = {{ .Values.nitter.preferences.replaceYouTube | quote }} + replaceReddit = {{ .Values.nitter.preferences.replaceReddit | quote }} + replaceInstagram = {{ .Values.nitter.preferences.replaceInstagram | quote }} + proxyVideos = {{ .Values.nitter.preferences.proxyVideos }} + hlsPlayback = {{ .Values.nitter.preferences.hlsPlayback }} + infiniteScroll = {{ .Values.nitter.preferences.infiniteScroll }} +{{- end }} diff --git a/charts/incubator/nitter/templates/common.yaml b/charts/incubator/nitter/templates/common.yaml new file mode 100644 index 00000000000..10ba5789515 --- /dev/null +++ b/charts/incubator/nitter/templates/common.yaml @@ -0,0 +1,7 @@ +{{/* Make sure all variables are set properly */}} +{{- include "tc.common.loader.init" . }} + +{{- include "nitter.secret" . -}} + +{{/* Render the templates */}} +{{ include "tc.common.loader.apply" . }} diff --git a/charts/incubator/nitter/values.yaml b/charts/incubator/nitter/values.yaml new file mode 100644 index 00000000000..2a7a75e860b --- /dev/null +++ b/charts/incubator/nitter/values.yaml @@ -0,0 +1,62 @@ +image: + repository: tccr.io/truecharts/nitter + pullPolicy: IfNotPresent + tag: latest@sha256:dde49ae0122fe8da6d00432ec26e596efd36e81e0f14851df6ff40e1c656ddf7 + +nitter: + general: + title: nitter + hostname: localhost:10606 + httpMaxConnections: 100 + cache: + listMinutes: 240 + rssMinutes: 10 + config: + base64Media: false + enableRSS: true + enableDebug: false + proxy: "" + proxyAuth: "" + tokenCount: 10 + preferences: + theme: Nitter + replaceTwitter: nitter.net + replaceYouTube: piped.video + replaceReddit: teddit.net + replaceInstagram: "" + proxyVideos: true + hlsPlayback: false + infiniteScroll: false + +probes: + liveness: + type: HTTP + path: / + readiness: + type: HTTP + path: / + startup: + type: HTTP + path: / + +service: + main: + ports: + main: + protocol: HTTP + port: 10606 + +persistence: + nitter-conf: + enabled: true + mountPath: /src/nitter.conf + type: secret + objectName: '{{ template "tc.common.names.fullname" . }}-nitter-secret' + subPath: nitter.conf + +redis: + enabled: true + existingSecret: rediscreds + +portal: + enabled: true diff --git a/cspell.config.yaml b/cspell.config.yaml index 15fb7fb54f5..c8c34580e2d 100644 --- a/cspell.config.yaml +++ b/cspell.config.yaml @@ -166,6 +166,7 @@ words: - netdata - networkv - nextcloud + - nitter - nobind - nocaptcha - nodeport