Skip to content

Commit 3f00a77

Browse files
authored
kapowarr: use v2 (truenas#1048)
1 parent 1b82bae commit 3f00a77

69 files changed

Lines changed: 5875 additions & 1377 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ix-dev/community/kapowarr/app.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ icon: https://media.sys.truenas.net/apps/kapowarr/icons/icon.svg
1010
keywords:
1111
- comic
1212
- media
13-
lib_version: 1.1.7
14-
lib_version_hash: d05e43e25b7dc1736be6cc1efa4b9255368aa346e3e7a4350a38440f29b73186
13+
lib_version: 2.0.25
14+
lib_version_hash: 37aa2a7f78f8ef1e8f3d705f4ce5d8bb66eddd4f023c25294a53a893b21a6048
1515
maintainers:
1616
1717
name: truenas
@@ -31,4 +31,4 @@ sources:
3131
- https://github.com/Casvt/Kapowarr
3232
title: Kapowarr
3333
train: community
34-
version: 1.0.22
34+
version: 1.1.0

ix-dev/community/kapowarr/ix_values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ images:
55

66
consts:
77
kapowarr_container_name: kapowarr
8+
internal_web_port: 5656

ix-dev/community/kapowarr/questions.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ groups:
55
description: Configure Network for Kapowarr
66
- name: Storage Configuration
77
description: Configure Storage for Kapowarr
8+
- name: Labels Configuration
9+
description: Configure Labels for Kapowarr
810
- name: Resources Configuration
911
description: Configure Resources for Kapowarr
1012

@@ -437,6 +439,42 @@ questions:
437439
description: The domain to use for the SMB share.
438440
schema:
439441
type: string
442+
- variable: labels
443+
label: ""
444+
group: Labels Configuration
445+
schema:
446+
type: list
447+
default: []
448+
items:
449+
- variable: label
450+
label: Label
451+
schema:
452+
type: dict
453+
attrs:
454+
- variable: key
455+
label: Key
456+
schema:
457+
type: string
458+
required: true
459+
- variable: value
460+
label: Value
461+
schema:
462+
type: string
463+
required: true
464+
- variable: containers
465+
label: Containers
466+
description: Containers where the label should be applied
467+
schema:
468+
type: list
469+
items:
470+
- variable: container
471+
label: Container
472+
schema:
473+
type: string
474+
required: true
475+
enum:
476+
- value: kapowarr
477+
description: kapowarr
440478
- variable: resources
441479
label: ""
442480
group: Resources Configuration
Lines changed: 16 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,22 @@
1-
{# Stores storage items that contains info for volumes, vol mounts, perms dirs and perms mounts #}
2-
{% set storage_items = namespace(items=[]) %}
3-
{# Stores the top level volumes #}
4-
{% set volumes = namespace(items={}) %}
5-
{# Stores the container volume mounts #}
6-
{% set volume_mounts = namespace(items=[]) %}
1+
{% set tpl = ix_lib.base.render.Render(values) %}
72

8-
{% do storage_items.items.append(ix_lib.base.storage.storage_item(data=dict(values.storage.config, **{"mount_path": "/app/db"}), values=values)) %}
9-
{% do storage_items.items.append(ix_lib.base.storage.storage_item(data=dict(values.storage.downloads, **{"mount_path": "/app/temp_downloads"}), values=values)) %}
10-
{% do storage_items.items.append(ix_lib.base.storage.storage_item(data=dict(values.storage.content, **{"mount_path": "/content"}), values=values)) %}
11-
{% do storage_items.items.append(ix_lib.base.storage.storage_item(data={"type":"anonymous", "mount_path": "/tmp"})) %}
3+
{% set c1 = tpl.add_container(values.consts.kapowarr_container_name, "image") %}
4+
{% do c1.healthcheck.set_test("http", {"port": values.consts.internal_web_port, "path": "/"}) %}
125

13-
{% for store in values.storage.additional_storage %}
14-
{% do storage_items.items.append(ix_lib.base.storage.storage_item(data=store, values=values)) %}
15-
{% endfor %}
6+
{% do c1.environment.add_user_envs(values.kapowarr.additional_envs) %}
167

17-
{# Add each item to the above lists #}
18-
{% for item in storage_items.items %}
19-
{% if item.vol and volumes.items.update(item.vol) %}{% endif %}
20-
{% if item.vol_mount and volume_mounts.items.append(item.vol_mount) %}{% endif %}
21-
{% endfor %}
8+
{% if not values.network.host_network %}
9+
{% do c1.ports.add_port(values.network.web_port, values.consts.internal_web_port) %}
10+
{% endif %}
2211

23-
{# Containers #}
24-
services:
25-
{{ values.consts.kapowarr_container_name }}:
26-
image: {{ ix_lib.base.utils.get_image(images=values.images, name="image") }}
27-
restart: unless-stopped
28-
deploy:
29-
resources: {{ ix_lib.base.resources.resources(values.resources) | tojson }}
30-
devices: {{ ix_lib.base.resources.get_devices(values.resources) | tojson }}
31-
{% if values.network.host_network %}
32-
network_mode: host
33-
{% endif %}
34-
cap_drop: {{ ix_lib.base.security.get_caps().drop | tojson }}
35-
security_opt: {{ ix_lib.base.security.get_sec_opts() | tojson }}
36-
{% if values.network.dns_opts %}
37-
dns_opt: {{ ix_lib.base.network.dns_opts(values.network.dns_opts) | tojson }}
38-
{% endif %}
39-
{% set test = ix_lib.base.healthchecks.http_test(port=5656, path="/") %}
40-
healthcheck: {{ ix_lib.base.healthchecks.check_health(test) | tojson }}
41-
environment: {{ ix_lib.base.environment.envs(app={}, user=values.kapowarr.additional_envs, values=values) | tojson }}
42-
{% if not values.network.host_network %}
43-
ports:
44-
- {{ ix_lib.base.ports.get_port(port={"target": 5656, "published": values.network.web_port}) | tojson }}
45-
{% endif %}
46-
volumes: {{ volume_mounts.items | tojson }}
12+
{% do c1.add_storage("/app/db", values.storage.config) %}
13+
{% do c1.add_storage("/app/temp_downloads", values.storage.downloads) %}
14+
{% do c1.add_storage("/content", values.storage.content) %}
4715

48-
{% if volumes.items %}
49-
volumes: {{ volumes.items | tojson }}
50-
{% endif %}
16+
{% for store in values.storage.additional_storage %}
17+
{% do c1.add_storage(store.mount_path, store) %}
18+
{% endfor %}
19+
20+
{% do tpl.portals.add_portal({"port": values.consts.internal_web_port if values.network.host_network else values.network.web_port}) %}
5121

52-
x-portals: {{ ix_lib.base.metadata.get_portals([{"port": 5656 if values.network.host_network else values.network.web_port}]) | tojson }}
53-
x-notes: {{ ix_lib.base.metadata.get_notes("Kapowarr") | tojson }}
22+
{{ tpl.render() | tojson }}

ix-dev/community/kapowarr/templates/library/base_v1_1_7/environment.py

Lines changed: 0 additions & 98 deletions
This file was deleted.

ix-dev/community/kapowarr/templates/library/base_v1_1_7/healthchecks.py

Lines changed: 0 additions & 120 deletions
This file was deleted.

0 commit comments

Comments
 (0)