Skip to content

Commit

Permalink
✨ (bookstack): Add optional CronJob that cascades shelf permissions t…
Browse files Browse the repository at this point in the history
…o all child books

Relates to #59
  • Loading branch information
gabe565 committed Mar 3, 2023
1 parent c0ba77a commit d15d620
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 4 deletions.
6 changes: 3 additions & 3 deletions charts/bookstack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: A simple, self-hosted, easy-to-use platform for organising and stor
home: https://charts.gabe565.com/charts/bookstack
icon: https://raw.githubusercontent.com/gabe565/charts/main/charts/bookstack/icon.svg
type: application
version: 0.5.1
version: 0.6.0
# renovate datasource=docker depName=ghcr.io/linuxserver/bookstack
appVersion: version-v23.02.1
kubeVersion: ">=1.22.0-0"
Expand All @@ -27,5 +27,5 @@ sources:
- https://ghcr.io/linuxserver/bookstack
annotations:
artifacthub.io/changes: |-
- kind: changed
description: Update ghcr.io/linuxserver/bookstack Docker tag to version-v23.02.1
- kind: added
description: Add optional CronJob that copies shelf permissions to all child books
6 changes: 5 additions & 1 deletion charts/bookstack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<img src="https://raw.githubusercontent.com/gabe565/charts/main/charts/bookstack/icon.svg" align="right" width="92" alt="bookstack logo" style="padding-left: 20px">

![Version: 0.5.1](https://img.shields.io/badge/Version-0.5.1-informational?style=flat)
![Version: 0.6.0](https://img.shields.io/badge/Version-0.6.0-informational?style=flat)
![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat)
![AppVersion: version-v23.02.1](https://img.shields.io/badge/AppVersion-version--v23.02.1-informational?style=flat)

Expand Down Expand Up @@ -93,6 +93,10 @@ N/A
| mariadb | object | See [values.yaml](./values.yaml) | Enable and configure mariadb database subchart under this key. For more options see [mariadb chart documentation](https://github.com/bitnami/charts/tree/master/bitnami/mariadb) |
| persistence.config | object | See [values.yaml](./values.yaml) | Configure persistence settings for the chart under this key. |
| service | object | See [values.yaml](./values.yaml) | Configures service settings for the chart. |
| shelfPermissionsCron.command | list | See [values.yaml](./values.yaml) | Shelf permissions CronJob command |
| shelfPermissionsCron.controller.cronjob.schedule | string | `"0 0 * * *"` | Shelf permissions CronJob time |
| shelfPermissionsCron.enabled | bool | `false` | Enables a CronJob that copies shelf permissions to all child books. [[ref]](https://bookstackapp.com/docs/admin/commands/#copy-shelf-permission) |
| shelfPermissionsCron.nameOverride | string | `"copy-shelf-permissions"` | Shelf permissions CronJob name |

---
Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/helm-docs)
11 changes: 11 additions & 0 deletions charts/bookstack/templates/cronjob.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{- with .Values.shelfPermissionsCron }}
{{- if .enabled }}
{{- $ctx := deepCopy $ }}
{{- include "bjw-s.common.values.init" $ctx -}}
{{- $_ := merge $ctx.Values (include "bookstack.harcodedValues" $ | fromYaml) -}}
{{- $_ = mergeOverwrite $ctx.Values . }}
{{- $_ = set $ctx.Values "service" dict }}
{{- $_ = set $ctx.Values "persistence" dict }}
{{- include "bjw-s.common.class.cronjob" $ctx }}
{{- end }}
{{- end }}
21 changes: 21 additions & 0 deletions charts/bookstack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,24 @@ mariadb:
enabled: false
# storageClass: ""
# size: 8Gi

shelfPermissionsCron:
# -- Enables a CronJob that copies shelf permissions to all child books.
# [[ref]](https://bookstackapp.com/docs/admin/commands/#copy-shelf-permission)
enabled: false
# -- Shelf permissions CronJob name
nameOverride: copy-shelf-permissions
controller:
# @ignored
type: cronjob
cronjob:
# -- Shelf permissions CronJob time
schedule: 0 0 * * *
# -- Shelf permissions CronJob command
# @default -- See [values.yaml](./values.yaml)
command:
- php
- /app/www/artisan
- bookstack:copy-shelf-permissions
- --no-interaction
- --all

0 comments on commit d15d620

Please sign in to comment.