about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--bundles/authelia/files/configuration_oidc.yml8
-rw-r--r--bundles/calibre/files/kube.yaml56
-rw-r--r--bundles/calibre/items.py26
-rw-r--r--bundles/calibre/metadata.py16
4 files changed, 106 insertions, 0 deletions
diff --git a/bundles/authelia/files/configuration_oidc.yml b/bundles/authelia/files/configuration_oidc.yml
index 1299955..9a120ba 100644
--- a/bundles/authelia/files/configuration_oidc.yml
+++ b/bundles/authelia/files/configuration_oidc.yml
@@ -47,3 +47,11 @@ identity_providers:
         redirect_uris:
           - https://where.gzr.im/oidc/callback
         claims_policy: geopulse
+
+      - client_id: calibre
+        client_name: 'Calibre-Web-Automated'
+        client_secret: '${repo.libs.util.hash_bcrypt(repo.vault.password_for("authelia_client_secret_calibre"), repo.vault.decrypt("encrypt$gAAAAABnOVCVoszwYPX_uTEIrMSyX94T_Mi8965InBlhKjkNBHMnN96ihiIt4yi8uYRl9DM70aPIwzXm2XVa_AXEEuIzbMJHBum6LTVDDE9CUYUErSFskMw="))}'
+        authorization_policy: one_factor
+        token_endpoint_auth_method: client_secret_basic
+        redirect_uris:
+          - https://calibre.gzr.im/login/generic/authorized
diff --git a/bundles/calibre/files/kube.yaml b/bundles/calibre/files/kube.yaml
new file mode 100644
index 0000000..b7329f5
--- /dev/null
+++ b/bundles/calibre/files/kube.yaml
@@ -0,0 +1,56 @@
+apiVersion: v1
+kind: Pod
+metadata:
+  name: calibre
+  labels:
+    traefik.enable: true
+    traefik.http.routers.calibre.tls: true
+    traefik.http.routers.calibre.tls.certresolver: le
+    traefik.http.routers.calibre.entrypoints: http,https
+    traefik.http.routers.calibre.rule: Host(`calibre.gzr.im`)
+    traefik.http.routers.calibre.service: calibre
+    traefik.http.services.calibre.loadbalancer.server.port: 8083
+spec:
+  dnsPolicy: Default
+  containers:
+    - name: calibre
+      image: ghcr.io/crocodilestick/calibre-web-automated:v${version}
+      env:
+        - name: PUID
+          value: 1000
+        - name: PGID
+          value: 1000
+        - name: TZ
+          value: Europe/Berlin
+        - name: NETWORK_SHARE_MODE
+          value: 'False'
+        - name: CWA_WATCH_MODE
+          value: poll
+      volumeMounts:
+        - mountPath: /calibre-library
+          name: library
+        - mountPath: /config
+          name: data
+          subPath: config
+        - mountPath: /cwa-book-ingest
+          name: data
+          subPath: inbox
+        - mountPath: /config/.config/calibre/plugins
+          name: data
+          subPath: plugins
+      ports:
+        - containerPort: 8083
+          protocol: TCP
+      livenessProbe:
+        exec:
+          command: ["curl", "-SLf", "localhost:8083/health"]
+        initialDelaySeconds: 10
+  volumes:
+  - name: library
+    hostPath:
+      path: /media/hayasui/media/books
+      type: Directory
+  - name: data
+    hostPath:
+      path: /var/lib/calibre
+      type: Directory
diff --git a/bundles/calibre/items.py b/bundles/calibre/items.py
new file mode 100644
index 0000000..849636e
--- /dev/null
+++ b/bundles/calibre/items.py
@@ -0,0 +1,26 @@
+files = {
+    "/etc/deployments/calibre/kube.yaml": {
+        "content_type": "mako",
+        "context": node.metadata.get("containers")["calibre"],
+        "triggers": {"svc_s6rc:calibre:restart"},
+    },
+}
+
+directories = {
+    "/var/lib/calibre/config": {
+        "owner": "robert",
+        "group": "robert",
+    },
+    "/var/lib/calibre/config/.config/calibre": {
+        "owner": "robert",
+        "group": "robert",
+    },
+    "/var/lib/calibre/inbox": {
+        "owner": "robert",
+        "group": "robert",
+    },
+    "/var/lib/calibre/plugins": {
+        "owner": "robert",
+        "group": "robert",
+    },
+}
diff --git a/bundles/calibre/metadata.py b/bundles/calibre/metadata.py
new file mode 100644
index 0000000..552e281
--- /dev/null
+++ b/bundles/calibre/metadata.py
@@ -0,0 +1,16 @@
+defaults = {
+    "containers": {
+        "calibre": {
+            "version": "4.0.6",
+        },
+    },
+    # "backup": {
+    #     "/var/lib/calibre": {},
+    # },
+    # "metrics": {
+    #     "calibre": {},
+    # },
+    # "go": {
+    #     "calibre": "https://calibre.gzr.im",
+    # },
+}