diff --git a/charts/incubator/plexanisync/.helmignore b/charts/incubator/plexanisync/.helmignore new file mode 100644 index 00000000000..77ca5567b26 --- /dev/null +++ b/charts/incubator/plexanisync/.helmignore @@ -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 diff --git a/charts/incubator/plexanisync/CHANGELOG.md b/charts/incubator/plexanisync/CHANGELOG.md new file mode 100644 index 00000000000..825c32f0d03 --- /dev/null +++ b/charts/incubator/plexanisync/CHANGELOG.md @@ -0,0 +1 @@ +# Changelog diff --git a/charts/incubator/plexanisync/Chart.yaml b/charts/incubator/plexanisync/Chart.yaml new file mode 100644 index 00000000000..671428773b3 --- /dev/null +++ b/charts/incubator/plexanisync/Chart.yaml @@ -0,0 +1,30 @@ +apiVersion: v2 +appVersion: "1.3.21" +dependencies: + - name: common + repository: https://library-charts.truecharts.org + version: 11.1.2 +deprecated: false +description: Plex to AniList Sync. +home: https://truecharts.org/charts/incubator/plexanisync +icon: https://truecharts.org/img/hotlink-ok/chart-icons/plexanisync.png +keywords: + - plexanisync + - media +kubeVersion: ">=1.16.0-0" +maintainers: + - email: info@truecharts.org + name: TrueCharts + url: https://truecharts.org +name: plexanisync +sources: + - https://github.com/truecharts/charts/tree/master/charts/incubator/plexanisync + - https://github.com/RickDB/PlexAniSync + - https://github.com/RickDB/PlexAniSync/pkgs/container/plexanisync +type: application +version: 0.0.1 +annotations: + truecharts.org/catagories: | + - media + truecharts.org/SCALE-support: "true" + truecharts.org/grade: U diff --git a/charts/incubator/plexanisync/README.md b/charts/incubator/plexanisync/README.md new file mode 100644 index 00000000000..7e59600739c --- /dev/null +++ b/charts/incubator/plexanisync/README.md @@ -0,0 +1 @@ +# README diff --git a/charts/incubator/plexanisync/icon.png b/charts/incubator/plexanisync/icon.png new file mode 100644 index 00000000000..c34679917f0 Binary files /dev/null and b/charts/incubator/plexanisync/icon.png differ diff --git a/charts/incubator/plexanisync/questions.yaml b/charts/incubator/plexanisync/questions.yaml new file mode 100644 index 00000000000..37b789fa8c6 --- /dev/null +++ b/charts/incubator/plexanisync/questions.yaml @@ -0,0 +1,277 @@ +# Include{groups} +portals: {} +questions: +# Include{global} +# Include{controller} +# Include{replicas} +# Include{replica1} +# Include{controllerExpertExtraArgs} + - variable: plexanisync + group: App Configuration + label: PlexAniSync Configuration + schema: + additional_attrs: true + type: dict + attrs: + - variable: interval + label: Interval + description: The time in between syncs in seconds. + schema: + type: int + default: 3600 + min: 600 + - variable: plex + label: Plex Integration + schema: + additional_attrs: true + type: dict + attrs: + - variable: plex_section + label: Plex Section + description: The libraries where your anime resides. + schema: + type: list + required: true + default: [] + items: + - variable: plex_section_library_entry + label: Plex Section Library Entry + description: Single library per entry. + schema: + type: string + default: "" + required: true + - variable: plex_auth_method + label: Authentication Method + description: Select Direct if you plan to auth the admin user, select Myplex for all other home users. + schema: + type: string + required: true + default: direct + enum: + - value: direct + description: Direct + - value: myplex + description: MyPlex + - variable: plex_url + label: Plex URL + description: The address to your Plex Media Server. + schema: + type: string + show_if: [["plex_auth_method", "=", "direct"]] + required: true + default: "" + - variable: plex_token + label: Plex Token + schema: + type: string + show_if: [["plex_auth_method", "=", "direct"]] + required: true + private: true + default: "" + - variable: myplex_server_name + label: Plex Server Name + description: The name of your Plex Media Server. + schema: + type: string + show_if: [["plex_auth_method", "=", "myplex"]] + required: true + default: "" + - variable: myplex_user + label: My Plex User + schema: + type: string + show_if: [["plex_auth_method", "=", "myplex"]] + required: true + default: "" + - variable: myplex_token + label: My Plex Token + schema: + type: string + show_if: [["plex_auth_method", "=", "myplex"]] + required: true + private: true + default: "" + - variable: home_user_sync + label: Home User Sync + schema: + type: boolean + default: false + show_subquestions_if: true + subquestions: + - variable: home_username + label: Home Username + schema: + type: string + required: true + default: "" + - variable: home_server_url + label: Home Server URL + schema: + type: string + required: true + default: "" + - variable: anilist + label: Anilist Integration + schema: + additional_attrs: true + type: dict + attrs: + - variable: ani_username + label: Ani UserName + description: Your AniList.co username. + schema: + type: string + required: true + default: "" + - variable: ani_token + label: Ani Token + description: Your AniList.co token. + schema: + type: string + required: true + private: true + default: "" + - variable: plex_ep_count_priority + label: Plex Episode Count Priority + description: Plex episode watched count will take priority over AniList. + schema: + type: boolean + default: false + - variable: skip_list_update + label: Skip List Update + description: Will NOT update your AniList which is useful if you want to do a test run. + schema: + type: boolean + default: false + - variable: log_failed_matches + label: Log Failed Matches + description: Enables logs to be written when matches fail. + schema: + type: boolean + default: true + - variable: custom-mappings + group: App Configuration + label: Custom Mappings + schema: + additional_attrs: true + type: dict + attrs: + - variable: remote_urls + label: Remote URLs + schema: + type: list + default: [] + items: + - variable: remote_url_entry + label: Remote URL + schema: + type: string + required: true + default: "" + - variable: entries + label: Entries + schema: + type: list + default: [] + items: + - variable: entry + label: entry + schema: + additional_attrs: true + type: dict + attrs: + - variable: title + label: Title + schema: + type: string + required: true + default: "" + - variable: seasons + label: Seasons + schema: + type: list + default: [] + items: + - variable: season_entry + label: Season Entry + schema: + additional_attrs: true + type: dict + attrs: + - variable: season + label: Season + schema: + type: int + required: true + - variable: anilist_id + label: ANI List ID + schema: + type: int + required: true + - variable: synonyms + label: Synonyms + schema: + type: list + default: [] + items: + - variable: synonym + label: Synonym + schema: + type: string + required: true + default: "" +# Include{containerConfig} +# Include{serviceExpertRoot} + default: false +# Include{serviceExpert} +# Include{serviceList} +# Include{persistenceList} +# Include{security} +# Include{securityContextAdvancedRoot} + - variable: privileged + label: Privileged mode + schema: + type: boolean + default: false + - variable: readOnlyRootFilesystem + label: ReadOnly Root Filesystem + schema: + type: boolean + default: false + - variable: allowPrivilegeEscalation + label: Allow Privilege Escalation + schema: + type: boolean + default: false + - variable: runAsNonRoot + label: runAsNonRoot + schema: + type: boolean + default: false +# Include{podSecurityContextRoot} + - 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 this App of the user running the application + schema: + type: int + default: 0 + - 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} diff --git a/charts/incubator/plexanisync/templates/_secret.tpl b/charts/incubator/plexanisync/templates/_secret.tpl new file mode 100644 index 00000000000..3625221704e --- /dev/null +++ b/charts/incubator/plexanisync/templates/_secret.tpl @@ -0,0 +1,85 @@ +{{/* Define the secret */}} +{{- define "plexanisync.secret" -}} + +{{- $secretName := printf "%s-secret" (include "tc.common.names.fullname" .) }} +{{- $secretConfigName := printf "%s-config-secret" (include "tc.common.names.fullname" .) }} +{{- $pas := .Values.plexanisync }} +{{- $cm := .Values.custom_mappings }} +--- +apiVersion: v1 +kind: Secret +metadata: + name: {{ $secretName }} + labels: + {{- include "tc.common.labels" . | nindent 4 }} +stringData: + SETTINGS_FILE: {{ .Values.persistence.settings.mountPath }} + INTERVAL: {{ $pas.interval | quote }} +--- +apiVersion: v1 +kind: Secret +metadata: + name: {{ $secretConfigName }} + labels: + {{- include "tc.common.labels" . | nindent 4 }} +stringData: + settings.ini: | + [PLEX] + anime_section = {{ join "|" $pas.plex_section }} + + authentication_method = {{ $pas.plex.plex_auth_method }} + + {{- if eq $pas.plex.plex_auth_method "direct" }} + base_url = {{ $pas.plex.plex_url }} + token = {{ $pas.plex.plex_token }} + {{- end }} + + {{- if eq $pas.plex.plex_auth_method "myplex" }} + server = {{ $pas.plex.myplex_server_name }} + myplex_user = {{ $pas.plex.myplex_user }} + myplex_token = {{ $pas.plex.myplex_token }} + {{- end }} + + home_user_sync = {{ ternary "True" "False" $pas.plex.home_user_sync }} + {{- if $pas.plex.home_user_sync }} + home_username = {{ $pas.plex.home_username }} + home_server_base_url = {{ $pas.plex.home_server_url }} + {{- end }} + + [ANILIST] + access_token = {{ $pas.anilist.ani_token }} + plex_episode_count_priority = {{ ternary "True" "False" $pas.anilist.plex_ep_count_priority }} + skip_list_update = {{ ternary "True" "False" $pas.anilist.skip_list_update }} + username = {{ $pas.anilist.ani_username }} + log_failed_matches = {{ ternary "True" "False" $pas.anilist.log_failed_matches }} + custom_mappings.yaml: | + # https://github.com/RickDB/PlexAniSync/blob/master/custom_mappings.yaml.example + {{- if $cm }} + {{- with $cm.remote_urls }} + remote-urls: + {{- range $url := . }} + - {{ . | quote }} + {{- end }} + {{- end }} + + {{- with $cm.entries }} + entries: + {{- range $entry := . }} + - title: {{ $entry.title | quote }} + {{- with $entry.seasons }} + seasons: + {{- range $season_entry := . }} + - season: {{ $season_entry.season }} + anilist-id: {{ $season_entry.anilist_id }} + {{- end }} + {{- end }} + {{- with $entry.synonyms }} + synonyms: + {{- range $synonym := . }} + - {{ . | quote }} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + {{- end }} +{{- end -}} diff --git a/charts/incubator/plexanisync/templates/common.yaml b/charts/incubator/plexanisync/templates/common.yaml new file mode 100644 index 00000000000..b476d39f3d6 --- /dev/null +++ b/charts/incubator/plexanisync/templates/common.yaml @@ -0,0 +1,22 @@ +{{/* Make sure all variables are set properly */}} +{{- include "tc.common.loader.init" . }} + +{{/* Render secret */}} +{{- include "plexanisync.secret" . }} + +{{- define "plexanisync.custom.mappings" -}} +enabled: true +type: secret +readOnly: true +defaultMode: "0600" +objectName: '{{ include "tc.common.names.fullname" . }}-config-secret' +mountPath: /plexanisync/custom_mappings.yaml +subPath: custom_mappings.yaml +{{- end -}} + +{{- if .Values.custom_mappings -}} + {{- $_ := set .Values.persistence "custommappings" (include "plexanisync.custom.mappings" . | fromYaml) -}} +{{- end -}} + +{{/* Render the templates */}} +{{ include "tc.common.loader.apply" . }} diff --git a/charts/incubator/plexanisync/values.yaml b/charts/incubator/plexanisync/values.yaml new file mode 100644 index 00000000000..fb61c26ad4a --- /dev/null +++ b/charts/incubator/plexanisync/values.yaml @@ -0,0 +1,83 @@ +image: + repository: tccr.io/truecharts/plexanisync + pullPolicy: IfNotPresent + tag: latest@sha256:783613decc1a1041affe73ad90d04c3604b95824c156e0380c1a403bbe24ae3b + +securityContext: + readOnlyRootFilesystem: false + runAsNonRoot: false + +podSecurityContext: + runAsUser: 0 + runAsGroup: 0 + +plexanisync: + interval: 3600 + plex: + plex_section: + [] + # - section1 + # - section2 + # direct | myplex + plex_auth_method: direct + # myplex + myplex_server: "" + myplex_user: "" + myplex_token: "" + # direct + plex_url: "" + plex_token: "" + # Home user sync + home_user_sync: false + home_username: "" + home_server_url: "" + anilist: + ani_username: "" + ani_token: "" + plex_ep_count_priority: false + skip_list_update: false + log_failed_matches: false + +custom_mappings: + [] + # remote_urls: + # - https://blabal + # entries: + # - title: title + # seasons: + # - season: 1 + # anilist_id: 2345 + # synonyms: + # - asfdasd + +envFrom: + - secretRef: + name: '{{ include "tc.common.names.fullname" . }}-secret' + +service: + main: + enabled: false + ports: + main: + enabled: false + +probes: + liveness: + enabled: false + readiness: + enabled: false + startup: + enabled: false + +persistence: + settings: + enabled: true + type: secret + readOnly: true + defaultMode: "0600" + objectName: '{{ include "tc.common.names.fullname" . }}-config-secret' + mountPath: /plexanisync/settings.ini + subPath: settings.ini + +portal: + enabled: false