feat(hasty-paste) add hasty-paste (#5549)

* feat(hasty-paste) add hasty-paste

* add icon

* add options

* UI

* whoops

* Apply suggestions from code review

Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com>

* Update charts/incubator/hasty-paste/questions.yaml

Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com>

* Update charts/incubator/hasty-paste/values.yaml

Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com>

* Update charts/incubator/hasty-paste/questions.yaml

Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com>

* hmm

* hmm

* heatlhchecks

* hmm

* port

Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com>
Co-authored-by: Stavros kois <s.kois@outlook.com>
Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com>
This commit is contained in:
Xstar97
2022-12-23 00:00:14 +02:00
committed by GitHub
co-authored by Stavros kois Stavros Kois
parent 57a02c6ae4
commit 05d1de18f3
9 changed files with 447 additions and 0 deletions
+30
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
@@ -0,0 +1 @@
# Changelog
+40
View File
@@ -0,0 +1,40 @@
apiVersion: v2
appVersion: "1.7.0"
dependencies:
- name: common
repository: https://library-charts.truecharts.org
version: 11.0.7
- condition: redis.enabled
name: redis
repository: https://charts.truecharts.org
version: 5.0.16
deprecated: false
description: A fast and minimal paste bin, written in Python using Quart.
home: https://truecharts.org/docs/charts/incubator/hasty-paste
icon: https://truecharts.org/img/hotlink-ok/chart-icons/hasty-paste.png
keywords:
- hasty-paste
- Cloud
- Productivity
- Tools-Utilities
- Network-Other
kubeVersion: ">=1.16.0-0"
maintainers:
- email: info@truecharts.org
name: TrueCharts
url: https://truecharts.org
name: hasty-paste
sources:
- https://github.com/truecharts/charts/tree/master/charts/incubator/hasty-paste
- https://github.com/enchant97/hasty-paste
- https://github.com/enchant97/hasty-paste/blob/main/docs/install.md
type: application
version: 0.0.1
annotations:
truecharts.org/catagories: |
- Cloud
- Productivity
- Tools-Utilities
- Network-Other
truecharts.org/SCALE-support: "true"
truecharts.org/grade: U
+1
View File
@@ -0,0 +1 @@
# hasty-paste
Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

+239
View File
@@ -0,0 +1,239 @@
# Include{groups}
portals:
open:
# Include{portalLink}
questions:
# Include{global}
# Include{controller}
# Include{replicas}
# Include{replica1}
# Include{controllerExpertExtraArgs}
- variable: hastyPaste
group: App Configuration
label: Hasty Paste Configuration
schema:
additional_attrs: true
type: dict
attrs:
- variable: new_at_index
label: New at Index
description: Index page displays new paste page instead
schema:
type: boolean
default: false
- variable: enable_public_list
label: Enable Public List
description: Whether to enable public access for listing pastes
schema:
type: boolean
default: false
- variable: max_body_size
label: Max Body Size
description: The max body size, given in bytes
schema:
type: int
required: true
default: 2000000
- variable: log_level
label: Log Level
description: What log level to use
schema:
type: string
required: true
default: INFO
enum:
- value: INFO
description: Info
- value: WARNING
description: Warning
- value: ERROR
description: Error
- value: DEBUG
description: Debug
- value: CRITICAL
description: Critical
- variable: workers
label: Workers
description: Number of separate processes to spawn
schema:
type: int
required: true
default: 1
- variable: interface
label: Interface (UI)
schema:
additional_attrs: true
type: dict
attrs:
- variable: default_use_long_id
label: Default Use Long ID
description: Setting this to "True" or "False" hides the long id checkbox in UI
schema:
type: boolean
default: false
- variable: default_expire_time_enable
label: Default Expire Time Enable
description: Enable a default expire time in web ui
schema:
type: boolean
default: false
- variable: default_expire_time_minutes
label: Default Expire Time Minutes
description: Default minutes in ui for expiry if enabled
schema:
type: int
required: true
default: 0
- variable: default_expire_time_hours
label: Default Expire Time Hours
description: Default hours in ui for expiry if enabled
schema:
type: int
required: true
default: 1
- variable: default_expire_time_days
label: Default Expire Time Days
description: Default days in ui for expiry if enabled
schema:
type: int
required: true
default: 0
- variable: branding
label: Branding
schema:
additional_attrs: true
type: dict
attrs:
- variable: title
label: Title
description: Customize the app title
schema:
type: string
default: ""
- variable: description
label: Description
description: Customize the app description
schema:
type: string
default: ""
- variable: icon
label: Icon
description: Customize the app icon, provide as absolute filepath (Path inside the container)
schema:
type: string
default: ""
- variable: favicon
label: Favicon
description: Customize the app favicon, provide as absolute filepath (Path inside the container)
schema:
type: string
default: ""
- variable: css_file
label: CSS File
description: Customize the site theme, using a provided css file (Path inside the container)
schema:
type: string
default: ""
- variable: hide_version
label: Hide Version
description: Hide the app version number
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: 10601
required: true
# Include{serviceExpertRoot}
default: false
# Include{serviceExpert}
# Include{serviceList}
# Include{persistenceRoot}
- variable: config
label: App Config Storage
description: Stores the Application Configuration.
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{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: true
- 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}
@@ -0,0 +1,54 @@
{{/* Define the secret */}}
{{- define "hastyPaste.secret" -}}
{{- $secretName := printf "%s-secret" (include "tc.common.names.fullname" .) }}
---
apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: {{ $secretName }}
labels:
{{- include "tc.common.labels" . | nindent 4 }}
stringData:
{{- $redis := .Values.redis -}}
{{- $redisPass := $redis.redisPassword | trimAll "\"" -}}
{{- $redisUser := $redis.redisUsername }}
{{- $redisURL := $redis.url.plain | trimAll "\"" }}
CACHE__REDIS_URI: {{ printf "redis://%v:%v@%v/0" $redisUser $redisPass $redisURL | quote }}
CACHE__ENABLE: "true"
PORT: {{ .Values.service.main.ports.main.port | quote }}
TIME_ZONE: {{ .Values.TZ }}
PASTE_ROOT: {{ .Values.persistence.config.mountPath | quote }}
{{/* User defined */}}
{{- $hasty := .Values.hastyPaste }}
NEW_AT_INDEX: {{ $hasty.new_at_index | quote }}
ENABLE_PUBLIC_LIST: {{ $hasty.enable_public_list | quote }}
MAX_BODY_SIZE: {{ (int $hasty.max_body_size) | quote }}
LOG_LEVEL: {{ $hasty.log_level }}
WORKERS: {{ $hasty.workers | quote }}
{{- $interface := $hasty.interface }}
UI_DEFAULT__USE_LONG_ID: {{ $interface.default_use_long_id | quote }}
UI_DEFAULT__EXPIRE_TIME__ENABLE: {{ $interface.default_expire_time_enable | quote }}
UI_DEFAULT__EXPIRE_TIME__MINUTES: {{ $interface.default_expire_time_minutes | quote }}
UI_DEFAULT__EXPIRE_TIME__HOURS: {{ $interface.default_expire_time_hours | quote }}
UI_DEFAULT__EXPIRE_TIME__DAYS: {{ $interface.default_expire_time_days | quote }}
{{- $branding := $hasty.branding }}
{{- with $branding.title }}
BRANDING__TITLE: {{ . | quote }}
{{- end -}}
{{- with $branding.description }}
BRANDING__DESCRIPTION: {{ . | quote }}
{{- end -}}
{{- with $branding.icon }}
BRANDING__ICON: {{ . | quote }}
{{- end -}}
{{- with $branding.favicon }}
BRANDING__FAVICON: {{ . | quote }}
{{- end -}}
{{- with $branding.css_file }}
BRANDING__CSS_FILE: {{ . | quote }}
{{- end }}
BRANDING__HIDE_VERSION: {{ $branding.hide_version | quote }}
{{- end }}
@@ -0,0 +1,8 @@
{{/* Make sure all variables are set properly */}}
{{- include "tc.common.loader.init" . }}
{{/* Render config */}}
{{- include "hastyPaste.secret" . }}
{{/* Render the templates */}}
{{ include "tc.common.loader.apply" . }}
+74
View File
@@ -0,0 +1,74 @@
image:
repository: tccr.io/truecharts/hasty-paste
pullPolicy: IfNotPresent
tag: 1.8.0@sha256:3ab77aead86237a92c149edf8c4f802e598aff58e371062242ddbb895264e0cd
hastyPaste:
new_at_index: false
enable_public_list: false
max_body_size: 2000000
log_level: INFO
workers: 1
interface:
default_use_long_id: false
default_expire_time_enable: false
default_expire_time_minutes: 0
default_expire_time_hours: 1
default_expire_time_days: 0
branding:
title: ""
description: ""
icon: ""
favicon: ""
css_file: ""
hide_version: false
envFrom:
- secretRef:
name: '{{ include "tc.common.names.fullname" . }}-secret'
probes:
liveness:
enabled: true
custom: true
spec:
exec:
command:
- /bin/sh
- health-check.sh
readiness:
enabled: true
custom: true
spec:
exec:
command:
- /bin/sh
- health-check.sh
startup:
enabled: true
custom: true
spec:
exec:
command:
- /bin/sh
- health-check.sh
service:
main:
ports:
main:
protocol: HTTP
port: 10601
persistence:
config:
enabled: true
mountPath: /app/data
redis:
enabled: true
existingSecret: rediscreds
redisUsername: default
portal:
enabled: true