From 96d0947cd319f1e5efdbbfabde221a85683392f1 Mon Sep 17 00:00:00 2001 From: Jade Date: Thu, 16 Feb 2023 12:11:05 +0100 Subject: [PATCH] updates and microbin and stuff --- schrottserver/configuration.nix | 1 + schrottserver/microbin.nix | 38 ++++++++++++++++++++++++++++++++ schrottserver/proxy.nix | 11 +++++++++ secret-data/mb-pass | Bin 0 -> 28 bytes 4 files changed, 50 insertions(+) create mode 100644 schrottserver/microbin.nix create mode 100644 secret-data/mb-pass diff --git a/schrottserver/configuration.nix b/schrottserver/configuration.nix index 5c71158..3dc949e 100644 --- a/schrottserver/configuration.nix +++ b/schrottserver/configuration.nix @@ -13,6 +13,7 @@ ./vaultwarden.nix ./nextcloud.nix ./mumble.nix + ./microbin.nix ../modules/neovim.nix ../modules/zsh.nix ]; diff --git a/schrottserver/microbin.nix b/schrottserver/microbin.nix new file mode 100644 index 0000000..c212376 --- /dev/null +++ b/schrottserver/microbin.nix @@ -0,0 +1,38 @@ +{ inputs, config, pkgs, ... }: +let + microbin = pkgs.rustPlatform.buildRustPackage rec { + pname = "microbin"; + version = "1.2.0"; + + # GitHub sources do not have Cargo.lock + src = pkgs.fetchCrate { + inherit pname version; + sha256 = "sha256-dZClslUTUchx+sOJzFG8wiAgyW/0RcCKfKYklKfVrzM="; + }; + + cargoSha256 = "sha256-fBbChu5iy/2H/8IYCwd1OwxplGPZAmkd8z8xD7Uc0vo="; + }; +in { + environment.systemPackages = with pkgs; [ microbin ]; + systemd.services.microbin = { + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + environment = { + MICROBIN_AUTH_USERNAME = "jade"; + MICROBIN_AUTH_PASSWORD = builtins.readFile ../secret-data/mb-pass; + MICROBIN_HASH_IDS = ""; + MICROBIN_EDITABLE = ""; + MICROBIN_PRIVATE = ""; + MICROBIN_HIGHLIGHTSYNTAX = ""; + MICROBIN_PUBLIC_PATH = "https://s10e.de"; + MICROBIN_QR = ""; + }; + script = "${pkgs.microbin}/bin/microbin"; + #scriptArgs = "--auth-password ${builtins.readFile ../secret-data/mb-pass} --auth-username jade --editable --hash-ids --no-listing --highlightsyntax --public-path https://s10e.de --qr"; + serviceConfig = { + Type = "simple"; + RootDirectory="/"; + WorkingDirectory = "/microbin"; + }; + }; +} diff --git a/schrottserver/proxy.nix b/schrottserver/proxy.nix index 52c68be..77446e3 100644 --- a/schrottserver/proxy.nix +++ b/schrottserver/proxy.nix @@ -16,6 +16,10 @@ group = "nginx"; keyType = "rsa2048"; }; + "s10e.de" = { + group = "nginx"; + keyType = "rsa2048"; + }; }; }; @@ -55,6 +59,13 @@ forceSSL = true; enableACME = true; }; + "s10e.de" = { + forceSSL = true; + enableACME = true; + locations."/" = { + proxyPass = "http://127.0.0.1:8080$request_uri"; + }; + }; }; }; } diff --git a/secret-data/mb-pass b/secret-data/mb-pass new file mode 100644 index 0000000000000000000000000000000000000000..55d07c71a6148683e23154083976a28e334c6ea6 GIT binary patch literal 28 jcmZQ@_Y83kiVO&05ZS7{*uU%fw6GW+C)xKlU7mXZfny3Z literal 0 HcmV?d00001