Skip to content

Commit

Permalink
fix(privatebin): fix errors (#3001)
Browse files Browse the repository at this point in the history
* privatebin: fix expire.default question default

* privatebin: add workaround for Helm render issue of large ints

* privatebin: fix quoting in conf.php

* privatebin: bump chart version

* privatebin: fix trailing whitespace
  • Loading branch information
schnerring committed Jun 28, 2022
1 parent 42a3456 commit a1c9013
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion charts/incubator/privatebin/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sources:
- https://github.com/PrivateBin/PrivateBin
- https://hub.docker.com/r/privatebin/pdo
type: application
version: 0.0.2
version: 0.0.3
annotations:
truecharts.org/catagories: |
- productivity
Expand Down
4 changes: 1 addition & 3 deletions charts/incubator/privatebin/questions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -307,11 +307,9 @@ questions:
description: "Expire value that is selected per default"
schema:
type: string
default: ""
default: "1week"
required: true
enum:
- value: ""
description: "PrivateBin Default"
- value: "5min"
description: "5min"
- value: "10min"
Expand Down
8 changes: 6 additions & 2 deletions charts/incubator/privatebin/templates/_configmap.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ kind: ConfigMap
metadata:
name: {{ include "tc.common.names.fullname" . }}-config
data:
{{/*
Multiply by 1, so large integers aren't rendered in scientific notation
See: https://github.com/helm/helm/issues/1707#issuecomment-1167860346
*/}}
sizelimits-php.ini: |-
upload_max_filesize = {{ .Values.privatebin.main.sizelimit }}
post_max_size = {{ .Values.privatebin.main.sizelimit }}
upload_max_filesize = {{ mul .Values.privatebin.main.sizelimit 1 }}
post_max_size = {{ mul .Values.privatebin.main.sizelimit 1 }}
memory_limit = {{ mul .Values.privatebin.main.sizelimit 2 }}
sizelimits-nginx.conf: |-
client_max_body_size {{ add (div (div .Values.privatebin.main.sizelimit 1024) 1024) 5 }}M;
Expand Down
18 changes: 11 additions & 7 deletions charts/incubator/privatebin/templates/_secrets.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ stringData:
{{- end }}

; size limit per paste or comment in bytes, defaults to 10 Mebibytes
sizelimit = {{ .Values.privatebin.main.sizelimit }}
{{/*
Multiply by 1, so large integers aren't rendered in scientific notation
See: https://github.com/helm/helm/issues/1707#issuecomment-1167860346
*/}}
sizelimit = {{ mul .Values.privatebin.main.sizelimit 1 }}
; template to include, default is "bootstrap" (tpl/bootstrap.php)
template = "{{ .Values.privatebin.main.template }}"
Expand Down Expand Up @@ -94,7 +98,7 @@ stringData:
; (optional) Let users create a QR code for sharing the paste URL with one click.
; It works both when a new paste is created and when you view a paste.
{{- with .Values.privatebin.main.qrcode }}
qrcode = "{{ . }}"
qrcode = {{ . }}
{{- end }}
; (optional) IP based icons are a weak mechanism to detect if a comment was from
Expand Down Expand Up @@ -130,7 +134,7 @@ stringData:
; if enabled will use base64.js version 1.7 instead of 2.1.9 and sha1 instead of
; sha256 in HMAC for the deletion token
{{- with .Values.privatebin.main.zerobincompatibility }}
zerobincompatibility = "{{ . }}"
zerobincompatibility = {{ . }}
{{- end }}
; Enable or disable the warning message when the site is served over an insecure
Expand All @@ -139,7 +143,7 @@ stringData:
; It is **strongly discouraged** to disable this.
; See https://github.com/PrivateBin/PrivateBin/wiki/FAQ#why-does-it-show-me-an-error-about-an-insecure-connection for more information.
{{- with .Values.privatebin.main.httpwarning }}
httpwarning = "{{ . }}"
httpwarning = {{ . }}
{{- end }}
; Pick compression algorithm or disable it. Only applies to pastes/comments
Expand Down Expand Up @@ -212,13 +216,13 @@ stringData:
batchsize = {{ .Values.privatebin.purge.batchsize }}

[model]
; example of DB configuration for PostgreSQL
; DB configuration for PostgreSQL
class = Database
[model_options]
dsn = {{ printf "pgsql:host=%v-postgresql;dbname=%v" .Release.Name .Values.postgresql.postgresqlDatabase }}
dsn = "{{ printf "pgsql:host=%v-postgresql;dbname=%v" .Release.Name .Values.postgresql.postgresqlDatabase }}"
tbl = "privatebin_" ; table prefix
usr = "{{ .Values.postgresql.postgresqlUsername }}"
pwd = "{{ .Values.postgresql.postgresqlPassword }}"
pwd = {{ .Values.postgresql.postgresqlPassword }}
opt[12] = true ; PDO::ATTR_PERSISTENT

{{- end }}

0 comments on commit a1c9013

Please sign in to comment.