inventory: add current inventory implementation

feat: migrate statics and media to s3

Change-Id: I54df88ac288f0b436c852fb62fd60b6f5b4fd4bc
Reviewed-on: https://gerrit.hackerspace.pl/c/hscloud/+/1845
Reviewed-by: radex <radex@hackerspace.pl>
diff --git a/app/inventory/prod.jsonnet b/app/inventory/prod.jsonnet
index 5b94e53..5825ab4 100644
--- a/app/inventory/prod.jsonnet
+++ b/app/inventory/prod.jsonnet
@@ -1,4 +1,4 @@
-local kube = import "../../kube/hscloud.libsonnet";
+local kube = import '../../kube/hscloud.libsonnet';
 local postgres = import '../../kube/postgres.libsonnet';
 
 {
@@ -10,7 +10,7 @@
     namespace: 'inventory',
     domain: 'inventory.hackerspace.pl',
 
-    image: 'registry.k0.hswaw.net/palid/spejstore:1694280421',
+    image: 'registry.k0.hswaw.net/palid/inventory-19.01.2024-2',
     oauthClientId: '82fffb65-0bbd-4d18-becd-0ce0b31373cf',
     storageClassName: 'waw-hdd-redundant-3',
 
@@ -18,8 +18,12 @@
   },
 
   secretRefs:: {
+    // Uses basic auth
+    labelApi: { secretKeyRef: { name: cfg.name, key: 'label_api' } },
     postgres: { secretKeyRef: { name: cfg.name, key: 'postgres_password' } },
     oauth: { secretKeyRef: { name: cfg.name, key: 'oauth_secret' } },
+    s3Secret: { secretKeyRef: { name: cfg.name, key: 's3_secret_key' } },
+    s3Access: { secretKeyRef: { name: cfg.name, key: 's3_access_key' } },
   },
 
   local ns = kube.Namespace(cfg.namespace),
@@ -50,6 +54,16 @@
                 SPEJSTORE_MEDIA_ROOT: cfg.mediaPath,
                 SPEJSTORE_REQUIRE_AUTH: 'true',
                 SPEJSTORE_LAN_ALLOWED_ADDRESS_SPACE: '185.236.240.5',
+                SPEJSTORE_HOST: 'https://' + cfg.domain,
+                SPEJSTORE_LABEL_API: top.secretRefs.labelApi,
+                SPEJSTORE_FILE_STORAGE_TYPE: 's3',
+                SPEJSTORE_S3_ACCESS_KEY: top.secretRefs.s3Access,
+                SPEJSTORE_S3_SECRET_KEY: top.secretRefs.s3Secret,
+                SPEJSTORE_S3_BUCKET_NAME: 'inventory',
+                SPEJSTORE_S3_ENDPOINT_URL: 'https://object.ceph-eu.hswaw.net',
+                SPEJSTORE_S3_DOMAIN_NAME: 'object.ceph-eu.hswaw.net',
+                SPEJSTORE_S3_STATIC_LOCATION: 'static',
+                SPEJSTORE_S3_MEDIA_LOCATION: 'media',
               },
               volumeMounts_: {
                 media: { mountPath: cfg.mediaPath },