summary refs log tree commit diff
path: root/services/shiori.nix
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2024-12-09 18:39:57 +0100
committerMel <einebeere@gmail.com>2024-12-09 18:39:57 +0100
commitf1333608a54a3c6255d996844645f99a433ace94 (patch)
tree518e788b2f7ae72fc8667963fa4fd83ea52f295f /services/shiori.nix
parent5ac307b7bc51f8f94b7a7c10ec978bc302e8b303 (diff)
downloadnetwork-f1333608a54a3c6255d996844645f99a433ace94.tar.zst
network-f1333608a54a3c6255d996844645f99a433ace94.zip
Add my custom shiori fork for bookmark management
Signed-off-by: Mel <einebeere@gmail.com>
Diffstat (limited to 'services/shiori.nix')
-rw-r--r--services/shiori.nix59
1 files changed, 59 insertions, 0 deletions
diff --git a/services/shiori.nix b/services/shiori.nix
new file mode 100644
index 0000000..d57ebdc
--- /dev/null
+++ b/services/shiori.nix
@@ -0,0 +1,59 @@
+{ lib, pkgs, auxiliaryPkgs, ... }:
+
+let
+  inherit (pkgs) dockerTools;
+  inherit (auxiliaryPkgs) common;
+
+  # using my own fork for updated
+  # pocket data import support.
+  # see: https://github.com/go-shiori/shiori/pull/1023
+  shiori = pkgs.shiori.overrideAttrs {
+    src = pkgs.fetchFromGitHub {
+      owner = "melnary";
+      repo = "shiori";
+      rev = "68e2e50ce57113e3074504ed7a537415396fa757";
+      sha256 = "sha256-8EPW3iot/14nv4G3rLSKMy+fOw6NiCT5TIBjleIPJxE=";
+    };
+
+    vendorHash = "sha256-PEQemiipVywSuSY2LCAa8g5YT/0bjdyDfyiAVjgTfOA=";
+  };
+
+  shioriLocalPort = 1989;
+  shioriDir = "/srv/shiori";
+
+  shioriImage = dockerTools.streamLayeredImage {
+    name = "shiori";
+    tag = shiori.version;
+    fromImage = common.alpine.base;
+    contents = [ shiori ];
+  };
+
+in
+{
+  foundation.services.shiori = {
+    image = shioriImage;
+    ports = [ [ shioriLocalPort 8080 ] ];
+
+    volumes = [
+      [ "${shioriDir}" "/shiori" ]
+    ];
+
+    environment = {
+      SHIORI_HTTP_ROOT_PATH = "/shiori/";
+      SHIORI_DIR = "/shiori";
+    };
+
+    entrypoint = "${shiori}/bin/shiori";
+    cmd = [ "server" ];
+  };
+
+  services.nginx.virtualHosts.renard.locations = {
+    "/shiori" = {
+      return = "301 $scheme://$host$request_uri/";
+    };
+
+    "/shiori/" = {
+      proxyPass = "http://127.0.0.1:${toString shioriLocalPort}/";
+    };
+  };
+}