feat(Linkwarden) Add Linkwarden to incubator (#14806)

**Description**

It's new app time, and this time it's Linkwarden!
Linkwarden is an open-source collaborative bookmark manager
https://github.com/linkwarden/linkwarden

⚒️ Fixes  # <!--(issue)-->

**⚙️ Type of change**

- [x] ⚙️ Feature/App addition
- [ ] 🪛 Bugfix
- [ ] ⚠️ Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] 🔃 Refactor of current code


**🧪 How Has This Been Tested?**

Tested on TrueNAS Scale Cobia 23.10.0.1


**📃 Notes:**

App is "hardcoded" (no env var to change yarn port) to port 3000, so
targetPort is set to avoid issues.

NEXTAUTH_URL has a weird behavior, the env var is required to be set but
only seems to affect a logout redirect (when logging out it redirects to
whatever NEXTAUTH_URL has set), we'll probably want to modify it so it
matches the host + service port or ingress. However, since the main port
has no env var to modify it we may want to keep it as is.


**✔️ Checklist:**

- [x] ⚖️ My code follows the style guidelines of this project
- [x] 👀 I have performed a self-review of my own code
- [x] #️⃣ I have commented my code, particularly in hard-to-understand
areas
- [x] 📄 I have made corresponding changes to the documentation
- [x] ⚠️ My changes generate no new warnings
- [x] 🧪 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.

- [x] 🖼️ I have added an icon in the Chart's root directory called
`icon.png`

---
This commit is contained in:
tuxsudo 2023-11-19 18:22:53 +00:00 committed by GitHub
parent 60b3a9991f
commit 31d210ffc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 331 additions and 0 deletions

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

View File

@ -0,0 +1 @@
## Linkwarden

View File

@ -0,0 +1,26 @@
apiVersion: v2
appVersion: "2.2.1"
dependencies:
- name: common
repository: https://library-charts.truecharts.org
version: 15.0.1
description: Linkwarden is a self-hosted, open-source collaborative bookmark manager to collect, organize and archive webpages.
home: https://truecharts.org/charts/incubator/linkwarden
icon: https://github.com/linkwarden/linkwarden/raw/main/assets/logo.png
keywords:
- linkwarden
- bookmark
- manager
kubeVersion: ">=1.16.0-0"
maintainers:
- email: info@truecharts.org
name: TrueCharts
url: https://truecharts.org
name: linkwarden
sources:
- https://github.com/truecharts/charts/tree/master/charts/incubator/linkwarden
- https://github.com/linkwarden/linkwarden
version: 0.0.1
annotations:
truecharts.org/category: bookmarks
truecharts.org/SCALE-support: "true"

View File

@ -0,0 +1,27 @@
# README
## General Info
TrueCharts can be installed as both *normal* Helm Charts or as Apps on TrueNAS SCALE.
However only installations using the TrueNAS SCALE Apps system are supported.
For more information about this App, please check the docs on the TrueCharts [website](https://truecharts.org/charts/incubator/)
**This chart is not maintained by the upstream project and any issues with the chart should be raised [here](https://github.com/truecharts/charts/issues/new/choose)**
## Support
- Please check our [quick-start guides for TrueNAS SCALE](https://truecharts.org/manual/SCALE/guides/scale-intro).
- See the [Website](https://truecharts.org)
- Check our [Discord](https://discord.gg/tVsPTHWTtr)
- Open a [issue](https://github.com/truecharts/charts/issues/new/choose)
---
## Sponsor TrueCharts
TrueCharts can only exist due to the incredible effort of our staff.
Please consider making a [donation](https://truecharts.org/sponsor) or contributing back to the project any way you can!
*All Rights Reserved - The TrueCharts Project*

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

View File

@ -0,0 +1,158 @@
# 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}
- variable: config
label: ""
group: "App Configuration"
schema:
additional_attrs: true
type: dict
attrs:
- variable: nextauth_url
label: "Public URL"
description: "This is the public-facing URL that Linkwarden will be hosted on."
schema:
type: string
default: "http://example.com"
- variable: pagination_take_count
label: "Pagination Take Count"
description: "The numbers of Links to fetch every time you reach to the bottom of the webpage."
schema:
type: int
default: 20
- variable: autoscroll_timeout
label: "Autoscroll Timeout"
description: "The amount of time to wait for the website to be archived (in seconds)."
schema:
type: int
default: 30
- variable: disable_registration
label: "Disable User Registration"
description: "If set to true, registration will be disabled."
schema:
type: boolean
default: false
- variable: archive_limit
label: "Archive Limit"
description: "Adjusts how often a user can trigger a new archive for each link (in minutes)."
schema:
type: int
default: 5
- variable: smtp
label: "SMTP Settings (Email)"
schema:
additional_attrs: true
type: dict
attrs:
- variable: enabled
label: "Enable SMTP Support"
description: "If set to true, email will be enabled and you'll need to define the next two variables below."
schema:
type: boolean
default: false
show_subquestions_if: true
subquestions:
- variable: from
label: "SMTP sender e-mail address"
description: "The email that will send the verification emails."
schema:
type: string
default: ""
- variable: server
label: "SMTP Server"
description: "That sensitive string that starts with smtp://... ."
schema:
type: string
default: ""
# 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: 2985
required: true
# Include{serviceExpertRoot}
# Include{serviceExpert}
# Include{serviceList}
# Include{persistenceRoot}
- variable: data
label: "App Data Storage"
description: "Stores the Application Data."
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{ingressAdvanced}
# Include{ingressList}
# Include{securityContextRoot}
- variable: runAsUser
label: "runAsUser"
description: "The UserID of the user running the application"
schema:
type: int
default: 0
- variable: runAsGroup
label: "runAsGroup"
description: "The groupID of the user running the application"
schema:
type: int
default: 0
# 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}

View File

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

View File

@ -0,0 +1,10 @@
{{- define "linkwarden.secrets" -}}
{{- $secretName := (printf "%s-linkwarden-secrets" (include "tc.v1.common.lib.chart.names.fullname" $)) }}
{{- $secret := randAlphaNum 32 -}}
{{- with (lookup "v1" "Secret" .Release.Namespace $secretName) -}}
{{- $secret = index .data "NEXTAUTH_SECRET" | b64dec -}}
{{- end }}
enabled: true
data:
NEXTAUTH_SECRET: {{ $secret }}
{{- end -}}

View File

@ -0,0 +1,11 @@
{{/* Make sure all variables are set properly */}}
{{- include "tc.v1.common.loader.init" . }}
{{/* Render secrets for Linkwarden */}}
{{- $secrets := include "linkwarden.secrets" . | fromYaml -}}
{{- if $secrets -}}
{{- $_ := set .Values.secret "linkwarden-secrets" $secrets -}}
{{- end -}}
{{/* Render the templates */}}
{{ include "tc.v1.common.loader.apply" . }}

View File

@ -0,0 +1,67 @@
image:
repository: ghcr.io/linkwarden/linkwarden
pullPolicy: IfNotPresent
tag: v2.2.1@sha256:c948cdcf683ec7b6c634eb2a0e184e270e167401d41ef8e82f7ff64c61f39f9c
config:
nextauth_url: "http://example.com"
pagination_take_count: 20
autoscroll_timeout: 30
disable_registration: false
archive_limit: 5
smtp:
enabled: false
from: ""
server: ""
securityContext:
container:
readOnlyRootFilesystem: false
runAsGroup: 0
runAsUser: 0
service:
main:
ports:
main:
port: 2985
targetPort: 3000
workload:
main:
podSpec:
containers:
main:
env:
DATABASE_URL:
secretKeyRef:
name: cnpg-main-urls
key: std
NEXTAUTH_SECRET:
secretKeyRef:
name: linkwarden-secrets
key: NEXTAUTH_SECRET
NEXTAUTH_URL: "{{ .Values.config.nextauth_url }}"
PAGINATION_TAKE_COUNT: "{{ .Values.config.pagination_take_count }}"
STORAGE_FOLDER: "data"
AUTOSCROLL_TIMEOUT: "{{ .Values.config.autoscroll_timeout }}"
NEXT_PUBLIC_DISABLE_REGISTRATION: "{{ .Values.config.disable_registration }}"
RE_ARCHIVE_LIMIT: "{{ .Values.config.archive_limit }}"
NEXT_PUBLIC_EMAIL_PROVIDER: "{{ .Values.config.smtp.enabled }}"
EMAIL_FROM: "{{ .Values.config.smtp.from }}"
EMAIL_SERVER: "{{ .Values.config.smtp.server }}"
persistence:
data:
enabled: true
mountPath: "/data/data"
cnpg:
main:
enabled: true
database: linkwarden
user: linkwarden
portal:
open:
enabled: true