migrate(pastey) migrate pastey to new common **BREAKING CHANGES** (#10158)

**Description**
- migrate app to new common
- housekeeping
- image selector
- bump app version (set static semVer)
⚒️ Fixes  # <!--(issue)-->

**⚙️ Type of change**

- [ ] ⚙️ Feature/App addition
- [ ] 🪛 Bugfix
- [X] ⚠️ Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [X] 🔃 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
- [ ] #️⃣ 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.
- [ ] 🖼️ 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:
Xstar97TheNoob 2023-07-08 17:52:46 -04:00 committed by GitHub
parent e930d9785a
commit 1d4603c0ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 169 additions and 90 deletions

View File

@ -1,16 +1,11 @@
annotations:
truecharts.org/SCALE-support: "true"
truecharts.org/catagories: |
- Productivity
- Tools-Utilities
apiVersion: v2
appVersion: "latest"
appVersion: "0.5.1"
dependencies:
- name: common
repository: https://library-charts.truecharts.org
version: 11.1.2
version: 12.14.6
deprecated: false
description: A lightweight, self-hosted paste platform (Pastebin alternative) with language detection and on-disk encryption.
description: A lightweight, self-hosted paste platform.
home: https://truecharts.org/charts/incubator/pastey
icon: https://truecharts.org/img/hotlink-ok/chart-icons/pastey.png
keywords:
@ -27,4 +22,9 @@ sources:
- https://github.com/truecharts/charts/tree/master/charts/incubator/pastey
- https://github.com/Cesura/pastey
type: application
version: 2.0.9
version: 3.0.0
annotations:
truecharts.org/catagories: |
- Productivity
- Tools-Utilities
truecharts.org/SCALE-support: "true"

View File

@ -0,0 +1 @@
imageSelector: image

View File

@ -0,0 +1 @@
imageSelector: slimImage

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -10,64 +10,110 @@ questions:
# Include{replicas1}
# Include{podSpec}
# Include{containerMain}
- variable: imageSelector
label: Select Image
schema:
type: string
default: image
enum:
- value: image
description: Image
- value: slimImage
description: Slim
- variable: env
label: Image Environment
schema:
additional_attrs: true
type: dict
attrs:
- variable: PASTEY_BEHIND_PROXY
label: "Pastey Behind Proxy"
description: "Inform Pastey if it is behind a reverse proxy."
schema:
type: boolean
default: false
- variable: PASTEY_GUESS_THRESHOLD
label: "Pastey Guess Threshold"
description: "Threshold for automatic language detection guesses."
schema:
type: string
default: "0.20"
- variable: PASTEY_RATE_LIMIT
label: "Pastey Rate Limit"
description: "Rate limit for pasting, for non-whitelisted users."
schema:
type: string
default: "5/hour"
- variable: PASTEY_RECENT_PASTES
label: "Pastey Recent Pastes"
description: "Number of recent pastes to show on the home page."
schema:
type: int
default: 10
- variable: PASTEY_RESTRICT_PASTING
label: "Pastey Restrict Pasting"
description: "Enable/disable restricting of pasting to whitelisted users."
schema:
type: boolean
default: false
- variable: PASTEY_RESTRICT_PASTING
label: "Pastey Restrict Pasting"
description: "Enable/disable restricting of pasting to whitelisted users."
schema:
type: boolean
default: false
- variable: PASTEY_USE_WHITELIST
label: "Pastey Use Whitelist"
description: "Enable/disable whitelisting for admin tasks."
schema:
type: boolean
default: true
- variable: PASTEY_WHITELIST_CIDR
label: "Pastey WhiteList CIDR"
description: "List of whitelisted IP addresses or networks."
schema:
type: string
default: "127.0.0.1/32,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16"
- variable: PASTEY_DEFAULT_THEME
label: "Pastey Default Theme"
schema:
type: string
default: "Dark"
enum:
- value: "Dark"
description: "Dark"
- value: "Light"
description: "Light"
- variable: PASTEY_PURGE_INTERVAL
label: "Pastey Purge Interval"
description: "Purge interval (in seconds) for checking expired pastes in background thread."
schema:
type: int
default: 10
- variable: PASTEY_FORCE_SHOW_RECENT
label: "Pastey Force Show Recent"
description: "Show recent pastes on the home page, even to non-whitelisted users."
schema:
type: boolean
default: false
- variable: PASTEY_IGNORE_GUESS
label: "Pastey Ignore Guess"
description: "Ignore these classifications for language detection."
schema:
type: string
default: "TeX,SQL"
- variable: PASTEY_SHOW_CLI_BUTTON
label: "Pastey Show Cli Button"
description: "Enable/disabling showing of CLI button on home page."
schema:
type: boolean
default: true
# Include{containerBasic}
# Include{containerAdvanced}
- variable: env
group: "App Configuration"
label: "Image Environment"
schema:
additional_attrs: true
type: dict
attrs:
- variable: PASTEY_RESTRICT_PASTING
label: "PASTEY_RESTRICT_PASTING"
description: "Enabledisable restricting of pasting to whitelisted users."
schema:
type: string
default: "False"
- variable: PASTEY_RESTRICT_RAW_PASTING
label: "PASTEY_RESTRICT_RAW_PASTING"
description: "Enabledisable restricting of pasting via raw to whitelisted users."
schema:
type: string
default: "True"
- variable: PASTEY_RATE_LIMIT
label: "PASTEY_RATE_LIMIT"
description: "Rate limit for pasting, for non-whitelisted users."
schema:
type: string
default: "5/hour"
- variable: PASTEY_RECENT_PASTES
label: "PASTEY_RECENT_PASTES"
description: "Number of recent pastes to show on the home page."
schema:
type: string
default: "10"
- variable: PASTEY_BEHIND_PROXY
label: "PASTEY_BEHIND_PROXY"
description: "Inform Pastey if it is behind a reverse proxy (nginx, etc.). If this is the case, it will rely on HTTP headers X-Real-IP or X-Forwarded-For. NOTE Make sure your proxy config sets these values."
schema:
type: string
default: "False"
- variable: PASTEY_USE_WHITELIST
label: "PASTEY_USE_WHITELIST"
description: "Enabledisable whitelisting for admin tasks (view recent, delete, config)."
schema:
type: string
default: "True"
- variable: PASTEY_WHITELIST_CIDR
label: "PASTEY_WHITELIST_CIDR"
description: "List of whitelisted IP addresses or networks (in CIDR format)."
schema:
type: string
default: "127.0.0.1/32,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16"
- variable: PASTEY_GUESS_THRESHOLD
label: "PASTEY_GUESS_THRESHOLD"
description: "Threshold for automatic language detection guesses. If a result is below this value, it is treated as Plaintext."
schema:
type: string
default: "0.20"
# Include{containerConfig}
# Include{serviceRoot}
- variable: main
@ -97,8 +143,8 @@ questions:
# Include{serviceList}
# Include{persistenceRoot}
- variable: data
label: "data Storage"
description: "Container Path appdata"
label: "App Data Storage"
description: "Stores the Application Data."
schema:
additional_attrs: true
type: dict

View File

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

View File

@ -1,2 +1 @@
{{/* Render the templates */}}
{{ include "tc.common.loader.all" . }}
{{ include "tc.v1.common.loader.all" . }}

View File

@ -1,33 +1,64 @@
env:
PASTEY_BEHIND_PROXY: "False"
PASTEY_GUESS_THRESHOLD: "0.20"
PASTEY_RATE_LIMIT: 5/hour
PASTEY_RECENT_PASTES: "10"
PASTEY_RESTRICT_PASTING: "False"
PASTEY_RESTRICT_RAW_PASTING: "True"
PASTEY_USE_WHITELIST: "True"
PASTEY_WHITELIST_CIDR: 127.0.0.1/32,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
image:
pullPolicy: IfNotPresent
repository: tccr.io/truecharts/pastey
tag: latest@sha256:636025eadb99257ec7cb21f7f519a52aed65fbd16b446f71d1d921850a6af996
persistence:
data:
enabled: true
mountPath: /app/data
podSecurityContext:
runAsGroup: 0
runAsUser: 0
tag: v0.5.1@sha256:cc7d7e848fb023bcc1bf82a568421d2fcb5bd29eb23a5694c925e71662e725ab
slimImage:
pullPolicy: IfNotPresent
repository: tccr.io/truecharts/pastey-slim
tag: v0.5.1@sha256:acde8ecaf0216a57e1ee4e449884a09b9d8493bcb69185ed74436489dabbece5
securityContext:
readOnlyRootFilesystem: false
runAsNonRoot: false
container:
runAsNonRoot: false
readOnlyRootFilesystem: false
runAsUser: 0
runAsGroup: 0
service:
main:
ports:
main:
protocol: http
port: 5000
protocol: TCP
targetPort: 5000
workload:
main:
podSpec:
containers:
main:
imageSelector: image
probes:
liveness:
type: http
path: /
readiness:
type: http
path: /
startup:
type: http
path: /
env:
PASTEY_LISTEN_PORT: "{{ .Values.service.main.ports.main.port }}"
PASTEY_LISTEN_ADDRESS: "0.0.0.0"
PASTEY_BEHIND_PROXY: false
PASTEY_GUESS_THRESHOLD: "0.20"
PASTEY_RATE_LIMIT: 5/hour
PASTEY_RECENT_PASTES: "10"
PASTEY_RESTRICT_PASTING: false
PASTEY_USE_WHITELIST: true
PASTEY_WHITELIST_CIDR: 127.0.0.1/32,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
# PASTEY_BLACKLIST_CIDR: ""
PASTEY_DEFAULT_THEME: "Dark"
PASTEY_PURGE_INTERVAL: 3600
PASTEY_FORCE_SHOW_RECENT: false
PASTEY_IGNORE_GUESS: "TeX,SQL"
PASTEY_SHOW_CLI_BUTTON: true
persistence:
data:
enabled: true
mountPath: /app/data
portal:
enabled: true
open:
enabled: true